Use the “PDBe” or “PDB” numbering (starts from 1, corresponds with the PDB SEQRES...
authorJim Procter <jprocter@issues.jalview.org>
Fri, 9 Feb 2018 09:46:25 +0000 (09:46 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 9 Feb 2018 09:46:25 +0000 (09:46 +0000)
src/jalview/ws/sifts/SiftsClient.java

index d2db9cf..29f0ffe 100644 (file)
@@ -571,6 +571,8 @@ public class SiftsClient implements SiftsClientI
       List<Residue> residues = segment.getListResidue().getResidue();
       for (Residue residue : residues)
       {
+        int pdbeIndex = getLeadingIntegerValue(residue.getDbResNum(),
+                UNASSIGNED);
         int currSeqIndex = UNASSIGNED;
         List<CrossRefDb> cRefDbs = residue.getCrossRefDb();
         CrossRefDb pdbRefDb = null;
@@ -591,11 +593,35 @@ public class SiftsClient implements SiftsClientI
             }
           }
         }
+        if (seqCoordSys == seqCoordSys.PDB) // FIXME: is seqCoordSys ever PDBe
+                                            // ???
+        {
+          // if the sequence has a primary reference to the PDB, then we are
+          // dealing with a sequence extracted directly from the PDB. In that
+          // case, numbering is PDBe - non-observed residues
+          currSeqIndex = pdbeIndex;
+        }
         if (currSeqIndex == UNASSIGNED)
         {
           continue;
         }
-        if (currSeqIndex >= seq.getStart() && currSeqIndex <= seq.getEnd())
+        if (!isResidueObserved(residue)
+                && seqCoordSys != seqCoordSys.UNIPROT)
+        {
+          // mapping to PDB or PDBe so we need to bookkeep for the non-observed
+          // SEQRES positions
+          omitNonObserved.add(currSeqIndex);
+          ++nonObservedShiftIndex;
+        }
+
+        // if (currSeqIndex >= seq.getStart() && currSeqIndex <= seqlength) //
+        // true
+                                                                         // numbering
+                                                                         // is
+                                                                         // not
+                                                                         // up
+                                                                         // to
+                                                                         // seq.getEnd()
         {
 
           int resNum = (pdbRefDb == null)
@@ -612,11 +638,7 @@ public class SiftsClient implements SiftsClientI
                             .getCanonicalAminoAcid(residue.getDbResName()));
             resNumMap.put(currSeqIndex, String.valueOf(resCharCode));
           }
-          else
-          {
-            omitNonObserved.add(currSeqIndex);
-            ++nonObservedShiftIndex;
-          }
+
           mapping.put(currSeqIndex - nonObservedShiftIndex,
                   new int[]
                   { Integer.valueOf(resNum), UNASSIGNED });