X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignedCodonFrame.java;h=c5204eb416a4f43199d70e3269af760fbe1b16c0;hb=ee778ac34b35c8d8fef03f1f3a58efb7d5be650a;hp=18aaecf7b5a784aa40d2a092663ae1baa1f0fb2f;hpb=1488d223bc6be5b47695a8153205cc9ff8c8095d;p=jalview.git diff --git a/src/jalview/datamodel/AlignedCodonFrame.java b/src/jalview/datamodel/AlignedCodonFrame.java index 18aaecf..c5204eb 100644 --- a/src/jalview/datamodel/AlignedCodonFrame.java +++ b/src/jalview/datamodel/AlignedCodonFrame.java @@ -93,8 +93,8 @@ public class AlignedCodonFrame return (this.fromSeq == that.fromSeq || (this.fromSeq != null && that.fromSeq != null && this.fromSeq.getDatasetSequence() != null && this.fromSeq - .getDatasetSequence() == that.fromSeq - .getDatasetSequence())) && this.mapping.equals(that.mapping); + .getDatasetSequence() == that.fromSeq.getDatasetSequence())) + && this.mapping.equals(that.mapping); } public SequenceI getFromSeq() @@ -128,6 +128,21 @@ public class AlignedCodonFrame */ public void addMap(SequenceI dnaseq, SequenceI aaseq, MapList map) { + addMap(dnaseq, aaseq, map, null); + } + + /** + * Adds a mapping between the dataset sequences for the associated dna and + * protein sequence objects + * + * @param dnaseq + * @param aaseq + * @param map + * @param mapFromId + */ + public void addMap(SequenceI dnaseq, SequenceI aaseq, MapList map, + String mapFromId) + { // JBPNote DEBUG! THIS ! // dnaseq.transferAnnotation(aaseq, mp); // aaseq.transferAnnotation(dnaseq, new Mapping(map.getInverse())); @@ -155,6 +170,7 @@ public class AlignedCodonFrame * otherwise, add a new sequence mapping */ Mapping mp = new Mapping(toSeq, map); + mp.setMappedFromId(mapFromId); mappings.add(new SequenceToSequenceMapping(fromSeq, mp)); } @@ -472,7 +488,8 @@ public class AlignedCodonFrame for (SequenceToSequenceMapping ssm : mappings) { - if (ssm.mapping.to == protein) + if (ssm.mapping.to == protein + && ssm.mapping.getMap().getFromRatio() == 3) { ml = ssm.mapping.map; dnaSeq = ssm.fromSeq; @@ -702,8 +719,8 @@ public class AlignedCodonFrame } /** - * Returns the first mapping found that is between 'fromSeq' and 'toSeq', or null - * if none found + * Returns the first mapping found that is between 'fromSeq' and 'toSeq', or + * null if none found * * @param fromSeq * aligned or dataset sequence