int[] codon = null;
SequenceI mappedSeq = null;
SequenceI ds = seq.getDatasetSequence();
+ if (ds == null)
+ {
+ ds = seq;
+ }
if (this.fromSeq == seq || this.fromSeq == ds)
{
/**
* Add search results for regions in other sequences that translate or are
- * translated from a particular position in seq
+ * translated from a particular position in seq (which may be an aligned or
+ * dataset sequence)
*
* @param seq
* @param index
SearchResultsI results)
{
SequenceI ds = seq.getDatasetSequence();
- for (SequenceToSequenceMapping ssm : mappings)
+ if (ds == null)
{
- ssm.markMappedRegion(ds, index, results);
+ ds = seq;
}
- }
-
- /**
- * Returns the DNA codon positions (base 1) for the given position (base 1) in
- * a mapped protein sequence, or null if no mapping is found.
- *
- * Intended for use in aligning cDNA to match aligned protein. Only the first
- * mapping found is returned, so not suitable for use if multiple protein
- * sequences are mapped to the same cDNA (but aligning cDNA as protein is
- * ill-defined for this case anyway).
- *
- * @param seq
- * the DNA dataset sequence
- * @param aaPos
- * residue position (base 1) in a protein sequence
- * @return
- */
- public int[] getDnaPosition(SequenceI seq, int aaPos)
- {
- /*
- * Adapted from markMappedRegion().
- */
- MapList ml = null;
- int i = 0;
for (SequenceToSequenceMapping ssm : mappings)
{
- if (ssm.fromSeq == seq)
- {
- ml = getdnaToProt()[i];
- break;
- }
- i++;
+ ssm.markMappedRegion(ds, index, results);
}
- return ml == null ? null : ml.locateInFrom(aaPos, aaPos);
}
/**