◐ Shell
clean mode source ↗

o.b.n.core.sequence.CDSSequence doesn't reverse-complement correctly

Given a transcript sequence derived from a GeneSequence defined on reverse strand of a chromosomal sequence, the method getCodingSequence doesn't return the reverse complement, but just the reverse.

This seems to be due to the complement being made twice:

String sequence = this.getSequenceAsString(getBioBegin(), getBioEnd(), getStrand()); 

in CDSSequence# getCodingSequence()

generates the reverse complement, but subsequent code makes a complementary sequence again, so the end result is simply a reversed sequence.

A simple fix might be just to remove this second complementation, but possibly it might be needed in some circumstances.

The bug is exposed by test TranscriptSequenceTest#getCDNASeqNegativeStrand()