From e97cd6659f6bcac55dc030e770192b0044960dc5 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Mon, 10 Oct 2016 15:58:55 +0100 Subject: [PATCH] JAL-2262 JAL-2195 bug fix for mapping local structure files --- src/MCview/PDBChain.java | 3 ++- src/jalview/ext/jmol/JmolParser.java | 16 ++++++++++------ src/jalview/structure/StructureSelectionManager.java | 5 +++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index b74f101..7774dac 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -199,7 +199,8 @@ public class PDBChain } for (int i = 0; i < features.length; i++) { - if (features[i].getFeatureGroup().equals(pdbid)) + if (features[i].getFeatureGroup() != null + && features[i].getFeatureGroup().equals(pdbid)) { SequenceFeature tx = new SequenceFeature(features[i]); tx.setBegin(1 + residues.elementAt(tx.getBegin() - offset).atoms diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index 1800ef0..c73657f 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -151,7 +151,15 @@ public class JmolParser extends StructureFile implements JmolStatusListener List prot = new ArrayList(); PDBChain tmpchain; String pdbId = (String) ms.getInfo(0, "title"); - setId(pdbId); + + if (pdbId == null) + { + setId(safeName(getDataName())); + } + else + { + setId(pdbId); + } List significantAtoms = convertSignificantAtoms(ms); for (Atom tmpatom : significantAtoms) { @@ -166,7 +174,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener tmpchain.atoms.addElement(tmpatom); } catch (Exception e) { - tmpchain = new PDBChain(pdbId, tmpatom.chain); + tmpchain = new PDBChain(getId(), tmpatom.chain); getChains().add(tmpchain); tmpchain.atoms.addElement(tmpatom); } @@ -177,10 +185,6 @@ public class JmolParser extends StructureFile implements JmolStatusListener makeResidueList(); makeCaBondList(); - if (getId() == null) - { - setId(safeName(getDataName())); - } for (PDBChain chain : getChains()) { SequenceI chainseq = postProcessChain(chain); diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 612b168..2e0975d 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -390,6 +390,11 @@ public class StructureSelectionManager { registerPDBFile(pdb.getId().trim(), pdbFile); } + // if PDB/mmCIF file is local then don't perform SIFTS MAPPING + if (pdb.getId().contains(".")) + { + isMapUsingSIFTs = false; + } } catch (Exception ex) { ex.printStackTrace(); -- 1.7.10.2