JAL-2262 JAL-2195 bug fix for mapping local structure files
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 10 Oct 2016 14:58:55 +0000 (15:58 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 10 Oct 2016 14:58:55 +0000 (15:58 +0100)
src/MCview/PDBChain.java
src/jalview/ext/jmol/JmolParser.java
src/jalview/structure/StructureSelectionManager.java

index b74f101..7774dac 100755 (executable)
@@ -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
index 1800ef0..c73657f 100644 (file)
@@ -151,7 +151,15 @@ public class JmolParser extends StructureFile implements JmolStatusListener
       List<SequenceI> prot = new ArrayList<SequenceI>();
       PDBChain tmpchain;
       String pdbId = (String) ms.getInfo(0, "title");
-      setId(pdbId);
+
+      if (pdbId == null)
+      {
+        setId(safeName(getDataName()));
+      }
+      else
+      {
+        setId(pdbId);
+      }
       List<Atom> 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);
index 612b168..2e0975d 100644 (file)
@@ -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();