Skip to content

Fix reverse complement calculation in CDSSequence.getCodingSequence (#1016) - #1160

Open
nayanhasnolyf wants to merge 1 commit into
biojava:masterfrom
nayanhasnolyf:fix/cds-sequence-reverse-complement-1016
Open

nayanhasnolyf wants to merge 1 commit into
biojava:masterfrom
nayanhasnolyf:fix/cds-sequence-reverse-complement-1016

Conversation

@nayanhasnolyf

@nayanhasnolyf nayanhasnolyf commented Oct 27, 2026 •

Copy link
Copy Markdown

Fixes #1016

CDSSequence.getCodingSequence() was calling getSequenceAsString(getBioBegin(), getBioEnd(), getStrand()), which already returns the reverse complement for Strand.NEGATIVE via AbstractLocation.reverseSequence(). After that, getCodingSequence() had a second if (getStrand() == Strand.NEGATIVE) block that complemented the sequence again, cancelling out the complement and leaving the sequence only reversed.

Removed the redundant second complement block in CDSSequence.java and enabled the existing @Disabled test TranscriptSequenceTest.getCDNASeqNegativeStrand().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant