{
private static final int CODON_LENGTH = 3;
+
private static final String SEQUENCE_VARIANT = "sequence_variant:";
+
private static final String ID = "ID";
/**
*/
if (cdnaLength != mappedLength && cdnaLength > 2)
{
- String lastCodon = String.valueOf(cdnaSeqChars, cdnaLength - CODON_LENGTH, CODON_LENGTH)
- .toUpperCase();
+ String lastCodon = String.valueOf(cdnaSeqChars,
+ cdnaLength - CODON_LENGTH, CODON_LENGTH).toUpperCase();
for (String stop : ResidueProperties.STOP)
{
if (lastCodon.equals(stop))
int aaPos = 0;
int dnaPos = cdnaStart;
- for (; dnaPos < cdnaSeqChars.length - 2
- && aaPos < aaSeqChars.length; dnaPos += CODON_LENGTH, aaPos++)
+ for (; dnaPos < cdnaSeqChars.length - 2 && aaPos < aaSeqChars.length; dnaPos += CODON_LENGTH, aaPos++)
{
String codon = String.valueOf(cdnaSeqChars, dnaPos, CODON_LENGTH);
final String translated = ResidueProperties.codonTranslate(codon);
.println("alignCdsSequenceAsProtein needs aligned sequence!");
return false;
}
-
+
List<AlignedCodonFrame> dnaMappings = MappingUtils
.findMappingsForSequence(cdsSeq, mappings);
for (AlignedCodonFrame mapping : dnaMappings)
.getFromRanges());
int mappedToLength = MappingUtils
.getLength(mapList.getToRanges());
- boolean addStopCodon = (cdsLength == mappedFromLength * CODON_LENGTH + CODON_LENGTH)
+ boolean addStopCodon = (cdsLength == mappedFromLength
+ * CODON_LENGTH + CODON_LENGTH)
|| (peptide.getDatasetSequence().getLength() == mappedFromLength - 1);
if (cdsLength != mappedToLength && !addStopCodon)
{
// TODO resolve JAL-2022 so this fudge can be removed
int mappedSequenceCount = protein.getHeight() - unmappedProtein.size();
addUnmappedPeptideStarts(alignedCodons, mappedSequenceCount);
-
+
return alignedCodons;
}
*/
List<int[]> cdsRange = Collections.singletonList(new int[] { 1,
cdsSeq.getLength() });
- MapList cdsToProteinMap = new MapList(cdsRange, mapList.getToRanges(),
- mapList.getFromRatio(), mapList.getToRatio());
+ MapList cdsToProteinMap = new MapList(cdsRange,
+ mapList.getToRanges(), mapList.getFromRatio(),
+ mapList.getToRatio());
AlignedCodonFrame cdsToProteinMapping = new AlignedCodonFrame();
cdsToProteinMapping.addMap(cdsSeqDss, proteinProduct,
cdsToProteinMap);
* same source and accession, so need a different accession for
* the CDS from the dna sequence
*/
-
+
// specific use case:
// Genomic contig ENSCHR:1, contains coding regions for ENSG01,
// ENSG02, ENSG03, with transcripts and products similarly named.
// cannot add distinct dbrefs mapping location on ENSCHR:1 to ENSG01
-
+
// JBPNote: ?? can't actually create an example that demonstrates we
// need to
// synthesize an xref.
-
+
for (DBRefEntry primRef : dnaDss.getPrimaryDBRefs())
{
// creates a complementary cross-reference to the source sequence's
int mappedFromLength = MappingUtils.getLength(aMapping.getMap()
.getFromRanges());
int dnaLength = seqDss.getLength();
- if (mappedFromLength == dnaLength || mappedFromLength == dnaLength - CODON_LENGTH)
+ if (mappedFromLength == dnaLength
+ || mappedFromLength == dnaLength - CODON_LENGTH)
{
return seqDss;
}
for (SequenceToSequenceMapping map : acf.getMappings())
{
Mapping mapping = map.getMapping();
- if (mapping != aMapping && mapping.getMap().getFromRatio() == CODON_LENGTH
+ if (mapping != aMapping
+ && mapping.getMap().getFromRatio() == CODON_LENGTH
&& proteinProduct == mapping.getTo()
&& seqDss != map.getFromSeq())
{
}
}
}
-
+
/*
* assign 'from id' held in the mapping if set (e.g. EMBL protein_id),
* else generate a sequence name
StringBuilder link = new StringBuilder(32);
try
{
- link.append(desc).append(" ").append(id)
+ link.append(desc)
+ .append(" ")
+ .append(id)
.append("|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=")
.append(URLEncoder.encode(id, "UTF-8"));
sf.addLink(link.toString());
// as if
}
}
- String clinSig = (String) var.variant
- .getValue(CLINICAL_SIGNIFICANCE);
+ String clinSig = (String) var.variant.getValue(CLINICAL_SIGNIFICANCE);
if (clinSig != null)
{
sf.setValue(CLINICAL_SIGNIFICANCE, clinSig);
}
newCol++;
}
-
+
/*
* trim trailing gaps
*/