From 984b32fdd9ae57c1a03021d70556484215317bf2 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 9 Feb 2018 09:46:25 +0000 Subject: [PATCH] =?utf8?q?Use=20the=20=E2=80=9CPDBe=E2=80=9D=20or=20=E2=80=9C?= =?utf8?q?PDB=E2=80=9D=20numbering=20(starts=20from=201,=20corresponds=20wit?= =?utf8?q?h=20the=20PDB=20SEQRES=20record)=20to=20map=20to=20the=20dataset=20?= =?utf8?q?sequence=20if=20its=20primary=20coord=20system=20is=20PDB.=20(fixe?= =?utf8?q?s=20StructureSelectionManagerTest.testMapping=5FEqualsSeqFeatures=20?= =?utf8?q?with=204im2=5Fmissing.pdb).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/ws/sifts/SiftsClient.java | 34 +++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/jalview/ws/sifts/SiftsClient.java b/src/jalview/ws/sifts/SiftsClient.java index d2db9cf..29f0ffe 100644 --- a/src/jalview/ws/sifts/SiftsClient.java +++ b/src/jalview/ws/sifts/SiftsClient.java @@ -571,6 +571,8 @@ public class SiftsClient implements SiftsClientI List residues = segment.getListResidue().getResidue(); for (Residue residue : residues) { + int pdbeIndex = getLeadingIntegerValue(residue.getDbResNum(), + UNASSIGNED); int currSeqIndex = UNASSIGNED; List 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 }); -- 1.7.10.2