Skip to content

Commit fcf516a

Browse files
kimmanbomilot-mirdita
authored andcommitted
fix: Convert uppercase RNA U to T before ORF search
Orf::setSequence wrote sequence[i] twice from seq[i], so the 'u' check overwrote the 'U'->'T' conversion. Uppercase RNA input kept U, and forward-strand stop codons were never recognised (extractorfs, translated search). Read the input character once and map both cases.
1 parent 76de5d8 commit fcf516a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/commons/Orf.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ bool Orf::setSequence(const char* seq, size_t length) {
143143

144144
sequenceLength = length;
145145
for(size_t i = 0; i < sequenceLength; ++i) {
146-
sequence[i] = (seq[i] == 'U' ) ? 'T' : seq[i];
147-
sequence[i] = (seq[i] == 'u' ) ? 't' : seq[i];
146+
const char c = seq[i];
147+
sequence[i] = (c == 'U') ? 'T' : (c == 'u') ? 't' : c;
148148
}
149149

150150
for(size_t i = 0; i < sequenceLength; ++i) {

0 commit comments

Comments
 (0)