Skip to content

Commit 1f3a6dc

Browse files
author
Yana Valasatava
committed
Fix for orientation value: compare to Character, not to String
Enhancement: return transcription as all upper case string
1 parent 79def6d commit 1f3a6dc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ public String getTranscriptSequence(GeneChromosomePosition gcp) throws IOExcepti
11451145
public String getTranscriptSequence(List<Integer> exonStarts, List<Integer> exonEnds, int codingStart, int codingEnd, Character orientation) throws IOException, CompoundNotFoundException {
11461146

11471147
List<Range<Integer>> cdsRegion;
1148-
if (orientation.equals("-")) {
1148+
if (orientation.equals('-')) {
11491149
cdsRegion = getCDSRegionsReverse(exonStarts, exonEnds, codingStart, codingEnd);
11501150
}
11511151
else {
@@ -1157,12 +1157,12 @@ public String getTranscriptSequence(List<Integer> exonStarts, List<Integer> exon
11571157
int length = range.upperEndpoint() - range.lowerEndpoint();
11581158
transcription += parser.loadFragment(range.lowerEndpoint(), length);
11591159
}
1160-
if (orientation.equals("-")) {
1160+
if (orientation.equals('-')) {
11611161
transcription = new StringBuilder(transcription).reverse().toString();
11621162
DNASequence dna = new DNASequence(transcription);
11631163
SequenceView<NucleotideCompound> compliment = dna.getComplement();
11641164
transcription = compliment.getSequenceAsString();
11651165
}
1166-
return transcription;
1166+
return transcription.toUpperCase();
11671167
}
11681168
}

0 commit comments

Comments
 (0)