- // add 1 to mapped length to allow for a mapped stop codon
- if (length + 1 < (seq.getEnd() - seq.getStart() + 1))
+ return length;
+ }
+
+ /**
+ * Adds any regions mapped to or from position {@code pos} in sequence
+ * {@code seq} to the given search results Note: recommend first using the
+ * .covers(,true,true) to ensure mapping covers both sequences
+ *
+ * @param seq
+ * @param pos
+ * @param sr
+ */
+ public void markMappedRegion(SequenceI seq, int pos, SearchResultsI sr)
+ {
+ int[] codon = null;
+ SequenceI mappedSeq = null;
+ SequenceI ds = seq.getDatasetSequence();
+ if (ds == null)
+ {
+ ds = seq;
+ }
+
+ if (this.fromSeq == seq || this.fromSeq == ds)
+ {
+ codon = this.mapping.map.locateInTo(pos, pos);
+ mappedSeq = this.mapping.to;
+ }
+ else if (this.mapping.to == seq || this.mapping.to == ds)