X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fjmol%2FJmolParser.java;h=a9c5f5cb74e1d02cfbf98fc88df835c5bdd46479;hb=3ffda7877bae6500636fcccaf1a9eae8bff2f45c;hp=dc3d0eef52d3591a0bcdeafbf858ef2af27ec4ea;hpb=f4766a7bbcfae845fc95923b01fa14ff83d589ff;p=jalview.git diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index dc3d0ee..a9c5f5c 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -28,7 +28,6 @@ import jalview.io.DataSourceType; import jalview.io.FileParse; import jalview.io.StructureFile; import jalview.schemes.ResidueProperties; -import jalview.structure.StructureImportSettings; import jalview.util.Format; import jalview.util.MessageManager; @@ -46,9 +45,9 @@ import org.jmol.c.STR; import org.jmol.modelset.ModelSet; import org.jmol.viewer.Viewer; -import MCview.Atom; -import MCview.PDBChain; -import MCview.Residue; +import mc_view.Atom; +import mc_view.PDBChain; +import mc_view.Residue; /** * Import and process files with Jmol for file like PDB, mmCIF @@ -60,7 +59,14 @@ public class JmolParser extends StructureFile implements JmolStatusListener { Viewer viewer = null; - public JmolParser(String inFile, DataSourceType sourceType) + public JmolParser(boolean immediate, Object inFile, + DataSourceType sourceType) throws IOException + { + // BH 2018 File or String for filename + super(immediate, inFile, sourceType); + } + + public JmolParser(Object inFile, DataSourceType sourceType) throws IOException { super(inFile, sourceType); @@ -128,8 +134,8 @@ public class JmolParser extends StructureFile implements JmolStatusListener * params -o (output to sysout) -n (nodisplay) -x (exit when finished) * see http://wiki.jmol.org/index.php/Jmol_Application */ - viewer = (Viewer) JmolViewer.allocateViewer(null, null, null, null, - null, "-x -o -n", this); + + viewer = JalviewJmolBinding.getJmolData(this); // ensure the 'new' (DSSP) not 'old' (Ramachandran) SS method is used viewer.setBooleanProperty("defaultStructureDSSP", true); } catch (ClassCastException x) @@ -166,16 +172,16 @@ public class JmolParser extends StructureFile implements JmolStatusListener List significantAtoms = convertSignificantAtoms(ms); for (Atom tmpatom : significantAtoms) { - try + if (tmpatom.resNumIns.trim().equals(lastID)) + { + // phosphorylated protein - seen both CA and P.. + continue; + } + tmpchain = findChain(tmpatom.chain); + if (tmpchain != null) { - tmpchain = findChain(tmpatom.chain); - if (tmpatom.resNumIns.trim().equals(lastID)) - { - // phosphorylated protein - seen both CA and P.. - continue; - } tmpchain.atoms.addElement(tmpatom); - } catch (Exception e) + } else { tmpchain = new PDBChain(getId(), tmpatom.chain); getChains().add(tmpchain); @@ -183,7 +189,11 @@ public class JmolParser extends StructureFile implements JmolStatusListener } lastID = tmpatom.resNumIns.trim(); } - xferSettings(); + if (isParseImmediately()) + { + // configure parsing settings from the static singleton + xferSettings(); + } makeResidueList(); makeCaBondList(); @@ -200,7 +210,8 @@ public class JmolParser extends StructureFile implements JmolStatusListener prot.add(chainseq); } - if (StructureImportSettings.isProcessSecondaryStructure()) + // look at local setting for adding secondary tructure + if (predictSecondaryStructure) { createAnnotation(chainseq, chain, ms.at); }