JAL-3929 don’t use the url encoded pdbId in feature group when transferring features...
authorJim Procter <j.procter@dundee.ac.uk>
Wed, 8 Dec 2021 18:52:45 +0000 (18:52 +0000)
committerJim Procter <j.procter@dundee.ac.uk>
Wed, 8 Dec 2021 18:52:45 +0000 (18:52 +0000)
src/jalview/structure/StructureSelectionManager.java
src/mc_view/PDBChain.java

index ad57831..0ab9baf 100644 (file)
@@ -548,7 +548,7 @@ public class StructureSelectionManager
                     pdb, maxChain, sqmpping, maxAlignseq, siftsClient);
             seqToStrucMapping.add(siftsMapping);
             maxChain.makeExactMapping(siftsMapping, seq);
-            maxChain.transferRESNUMFeatures(seq, "IEA: SIFTS");
+            maxChain.transferRESNUMFeatures(seq, "IEA: SIFTS",pdb.getId());
             maxChain.transferResidueAnnotation(siftsMapping, null);
             ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
 
@@ -560,7 +560,7 @@ public class StructureSelectionManager
                     targetChainId, maxChain, pdb, maxAlignseq);
             seqToStrucMapping.add(nwMapping);
             maxChain.makeExactMapping(maxAlignseq, seq);
-            maxChain.transferRESNUMFeatures(seq, "IEA:Jalview"); // FIXME: is
+            maxChain.transferRESNUMFeatures(seq, "IEA:Jalview",pdb.getId()); // FIXME: is
                                                                  // this
                                                         // "IEA:Jalview" ?
             maxChain.transferResidueAnnotation(nwMapping, sqmpping);
@@ -580,7 +580,7 @@ public class StructureSelectionManager
                       siftsClient);
               foundSiftsMappings.add(siftsMapping);
               chain.makeExactMapping(siftsMapping, seq);
-              chain.transferRESNUMFeatures(seq, "IEA: SIFTS");// FIXME: is this
+              chain.transferRESNUMFeatures(seq, "IEA: SIFTS",pdb.getId());// FIXME: is this
               // "IEA:SIFTS" ?
               chain.transferResidueAnnotation(siftsMapping, null);
             } catch (SiftsException e)
@@ -605,7 +605,7 @@ public class StructureSelectionManager
             StructureMapping nwMapping = getNWMappings(seq, pdbFile,
                     maxChainId, maxChain, pdb, maxAlignseq);
             seqToStrucMapping.add(nwMapping);
-            maxChain.transferRESNUMFeatures(seq, null); // FIXME: is this
+            maxChain.transferRESNUMFeatures(seq, null,pdb.getId()); // FIXME: is this
                                                         // "IEA:Jalview" ?
             maxChain.transferResidueAnnotation(nwMapping, sqmpping);
             ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
@@ -773,7 +773,7 @@ public class StructureSelectionManager
     maxChain.makeExactMapping(maxAlignseq, seq);
     jalview.datamodel.Mapping sqmpping = maxAlignseq
             .getMappingFromS1(false);
-    maxChain.transferRESNUMFeatures(seq, null);
+    maxChain.transferRESNUMFeatures(seq, null, pdb.getId());
 
     HashMap<Integer, int[]> mapping = new HashMap<>();
     int resNum = -10000;
index 70fda66..425bc18 100755 (executable)
@@ -229,11 +229,16 @@ public class PDBChain
    * @param seq
    * @param status
    *          The Status of the transferred annotation
-   * @param actualGroupId the group id for the features on the destination sequence (e.g. the official accession ID)
+   * 
+   * @param altPDBID the group id for the features on the destination sequence (e.g. the official accession ID)
    */
   public void transferRESNUMFeatures(SequenceI seq,
-          String status)
+          String status, String altPDBID)
   {
+    if (altPDBID==null)
+    {
+      altPDBID = pdbid;
+    }
     SequenceI sq = seq;
     while (sq != null && sq.getDatasetSequence() != null)
     {
@@ -266,7 +271,7 @@ public class PDBChain
         int newEnd = 1 + residues.elementAt(feature.getEnd() - offset).atoms
                 .elementAt(0).alignmentMapping;
         SequenceFeature tx = new SequenceFeature(feature, newBegin, newEnd,
-                pdbid, feature.getScore());
+                altPDBID, feature.getScore());
         tx.setStatus(status
                 + ((tx.getStatus() == null || tx.getStatus().length() == 0)
                         ? ""