JAL-1803 transfer mapped chain’s PDBEntry to the *dataset* SequenceI it was mapped to
authorJim Procter <jprocter@issues.jalview.org>
Wed, 7 Sep 2016 10:57:09 +0000 (11:57 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 7 Sep 2016 10:57:09 +0000 (11:57 +0100)
src/jalview/structure/StructureSelectionManager.java

index 182a48f..c27289c 100644 (file)
@@ -428,6 +428,12 @@ public class StructureSelectionManager
     {
       boolean infChain = true;
       final SequenceI seq = sequenceArray[s];
+      SequenceI ds = seq;
+      while (ds.getDatasetSequence() != null)
+      {
+        ds = ds.getDatasetSequence();
+      }
+
       if (targetChainIds != null && targetChainIds[s] != null)
       {
         infChain = false;
@@ -518,8 +524,11 @@ public class StructureSelectionManager
                     pdb, maxChain, sqmpping, maxAlignseq);
             seqToStrucMapping.add(siftsMapping);
             maxChain.makeExactMapping(maxAlignseq, seq);
-            maxChain.transferRESNUMFeatures(seq, null);
+            maxChain.transferRESNUMFeatures(seq, null);// FIXME: is this
+                                                       // "IEA:SIFTS" ?
             maxChain.transferResidueAnnotation(siftsMapping, sqmpping);
+            ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
+
           } catch (SiftsException e)
           {
             // fall back to NW alignment
@@ -527,6 +536,11 @@ public class StructureSelectionManager
             StructureMapping nwMapping = getNWMappings(seq, pdbFile,
                     targetChainId, maxChain, pdb, maxAlignseq);
             seqToStrucMapping.add(nwMapping);
+            maxChain.makeExactMapping(maxAlignseq, seq);
+            maxChain.transferRESNUMFeatures(seq, null); // FIXME: is this
+                                                        // "IEA:Jalview" ?
+            maxChain.transferResidueAnnotation(nwMapping, sqmpping);
+            ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
           }
         }
         else
@@ -549,15 +563,21 @@ public class StructureSelectionManager
           {
             seqToStrucMapping.addAll(foundSiftsMappings);
             maxChain.makeExactMapping(maxAlignseq, seq);
-            maxChain.transferRESNUMFeatures(seq, null);
+            maxChain.transferRESNUMFeatures(seq, null);// FIXME: is this
+                                                       // "IEA:SIFTS" ?
             maxChain.transferResidueAnnotation(foundSiftsMappings.get(0),
                     sqmpping);
+            ds.addPDBId(sqmpping.getTo().getAllPDBEntries().get(0));
           }
           else
           {
             StructureMapping nwMapping = getNWMappings(seq, pdbFile,
                     maxChainId, maxChain, pdb, maxAlignseq);
             seqToStrucMapping.add(nwMapping);
+            maxChain.transferRESNUMFeatures(seq, null); // FIXME: is this
+                                                        // "IEA:Jalview" ?
+            maxChain.transferResidueAnnotation(nwMapping, sqmpping);
+            ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
           }
         }
       }
@@ -566,8 +586,11 @@ public class StructureSelectionManager
         setProgressBar(null);
         setProgressBar(MessageManager
                 .getString("status.obtaining_mapping_with_nw_alignment"));
-        seqToStrucMapping.add(getNWMappings(seq, pdbFile, maxChainId,
-                maxChain, pdb, maxAlignseq));
+        StructureMapping nwMapping = getNWMappings(seq, pdbFile,
+                maxChainId, maxChain, pdb, maxAlignseq);
+        seqToStrucMapping.add(nwMapping);
+        ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
+
       }
 
       if (forStructureView)