}
/**
- * 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++;
- }
- return ml == null ? null : ml.locateInFrom(aaPos, aaPos);
- }
-
- /**
* Convenience method to return the first aligned sequence in the given
* alignment whose dataset has a mapping with the given (aligned or dataset)
* sequence.