JAL-4366 use dataset sequences for building the mapping
authorJames Procter <j.procter@dundee.ac.uk>
Thu, 11 Jan 2024 17:16:28 +0000 (17:16 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Thu, 11 Jan 2024 17:16:28 +0000 (17:16 +0000)
src/jalview/analysis/AlignmentUtils.java

index af3669f..9675232 100644 (file)
@@ -1479,19 +1479,23 @@ public class AlignmentUtils
     List<SequenceI> thisSeqs = proteinAlignment.getSequences();
     for (SequenceI aaSeq : thisSeqs)
     {
+      aaSeq = aaSeq.getDatasetSequence()!=null ? aaSeq.getDatasetSequence():null;
       boolean proteinMapped = false;
       AlignedCodonFrame acf = new AlignedCodonFrame();
 
       for (SequenceI cdnaSeq : tdiAlignment.getSequences())
       {
+        // resolve dataset sequences
+        cdnaSeq = cdnaSeq.getDatasetSequence()!=null ? cdnaSeq.getDatasetSequence():null;
         
         if (mappingExists(proteinAlignment.getCodonFrames(),
-                aaSeq.getDatasetSequence(), cdnaSeq.getDatasetSequence()))
+                aaSeq, cdnaSeq))
         {
           mappingExistsOrAdded = true;
         }
         else
         {
+          
           if (canBuild3diMapping(aaSeq, cdnaSeq))
           {
             MapList map = new MapList(new int[] { aaSeq.getStart(),aaSeq.getEnd()},new int[] { cdnaSeq.getStart(),cdnaSeq.getEnd()},1,1);