X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignedCodonFrame.java;h=2f33e43ceb7ae9ceaa866fa728220fe868fcdd54;hb=36f083dc674297be2157d9f291a7cddba9d3250a;hp=5240f0cf7bb1bbdc035c3e8e46bfe3622ac7b75c;hpb=0a2ec403c08a1747b7e876f00f468867f8329d36;p=jalview.git diff --git a/src/jalview/datamodel/AlignedCodonFrame.java b/src/jalview/datamodel/AlignedCodonFrame.java index 5240f0c..2f33e43 100644 --- a/src/jalview/datamodel/AlignedCodonFrame.java +++ b/src/jalview/datamodel/AlignedCodonFrame.java @@ -383,7 +383,8 @@ public class AlignedCodonFrame /** * 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 @@ -395,44 +396,14 @@ public class AlignedCodonFrame 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); } /** @@ -872,9 +843,9 @@ public class AlignedCodonFrame } /** - * Returns the first mapping found which is between the given sequence and - * another, is a triplet mapping (3:1 or 1:3), and covers the full extent of - * both sequences involved. + * Returns the first mapping found which is between the given dataset sequence + * and another, is a triplet mapping (3:1 or 1:3), and covers the full extent + * of both sequences involved * * @param seq * @return