X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=alg%2Fseq_span.cpp;h=1eb5e9344982cce4cf04b1b6ce364a14149de3a9;hp=bf9a3dc3664bb72d40a613a28521795db1265402;hb=f9349a646de1ad1ad8f9334b5556c5ae3d50b666;hpb=75496e2c562d728af983c347527270eba360c6ee diff --git a/alg/seq_span.cpp b/alg/seq_span.cpp index bf9a3dc..1eb5e93 100644 --- a/alg/seq_span.cpp +++ b/alg/seq_span.cpp @@ -113,6 +113,14 @@ SeqSpan::SeqSpan(const SeqSpanRef parent_, throw sequence_invalid_strand("unrecognized strand identifier"); break; } + + // Ack the complexity increases! + // If our parent is on the minus strand, we need to adjust the start + // and count to look like we're selecting from the right side of the + // parent sequence (AKA the start of the minus strand) + if (parent and parent->strand() == MinusStrand) { + seq_start = parent->start() + parent->size() - (start_ + seq_count); + } } //////