From: Jim Procter Date: Fri, 9 Feb 2018 09:46:25 +0000 (+0000) Subject: Use the “PDBe” or “PDB” numbering (starts from 1, corresponds with the PDB SEQRES... X-Git-Tag: Release_2_10_4~68^2~25 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=984b32fdd9ae57c1a03021d70556484215317bf2 Use the “PDBe” or “PDB” numbering (starts from 1, corresponds with the PDB SEQRES record) to map to the dataset sequence if its primary coord system is PDB. (fixes StructureSelectionManagerTest.testMapping_EqualsSeqFeatures with 4im2_missing.pdb). --- 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 });