X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fjmol%2FJmolParser.java;h=0cbd620bf11a251593294095090106b475ce12f7;hb=902545551ef0f546be958444bed784dae65d69d2;hp=a339c6b159778124862fd497e31096e6c5a2e372;hpb=8a693367d8a0f6113d21248993ca4e0355b32659;p=jalview.git diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index a339c6b..0cbd620 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -22,10 +22,12 @@ package jalview.ext.jmol; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; +import jalview.datamodel.DBRefSource; import jalview.datamodel.SequenceI; import jalview.io.FileParse; import jalview.io.StructureFile; import jalview.schemes.ResidueProperties; +import jalview.structure.StructureViewSettings; import jalview.util.MessageManager; import java.io.IOException; @@ -57,36 +59,19 @@ public class JmolParser extends StructureFile implements JmolStatusListener { Viewer viewer = null; - public JmolParser(boolean addAlignmentAnnotations, - boolean predictSecondaryStructure, boolean externalSecStr, - String inFile, String type) throws IOException + public JmolParser(boolean addAlignmentAnnotations, boolean predictSecStr, + boolean externalSecStr, String inFile, String type) + throws IOException { super(inFile, type); - this.visibleChainAnnotation = addAlignmentAnnotations; - this.predictSecondaryStructure = predictSecondaryStructure; - this.externalSecondaryStructure = externalSecStr; - } - - public JmolParser(boolean addAlignmentAnnotations, - boolean predictSecondaryStructure, boolean externalSecStr, - FileParse fp) throws IOException - { - super(fp); - this.visibleChainAnnotation = addAlignmentAnnotations; - this.predictSecondaryStructure = predictSecondaryStructure; - this.externalSecondaryStructure = externalSecStr; } - public JmolParser(FileParse fp) throws IOException + public JmolParser(boolean addAlignmentAnnotations, boolean predictSecStr, + boolean externalSecStr, FileParse fp) throws IOException { super(fp); } - public JmolParser(String inFile, String type) throws IOException - { - super(inFile, type); - } - public JmolParser() { } @@ -102,7 +87,15 @@ public class JmolParser extends StructureFile implements JmolStatusListener @Override public void parse() throws IOException { - + String dataName = getDataName(); + if (dataName.endsWith(".cif")) + { + setDbRefType(DBRefSource.MMCIF); + } + else + { + setDbRefType(DBRefSource.PDB); + } setChains(new Vector()); Viewer jmolModel = getJmolData(); jmolModel.openReader(getDataName(), getDataName(), getReader()); @@ -172,6 +165,8 @@ public class JmolParser extends StructureFile implements JmolStatusListener } lastID = tmpatom.resNumIns.trim(); } + xferSettings(); + makeResidueList(); makeCaBondList(); @@ -182,7 +177,6 @@ public class JmolParser extends StructureFile implements JmolStatusListener for (PDBChain chain : getChains()) { SequenceI chainseq = postProcessChain(chain); - createAnnotation(chainseq, chain, ms.at); if (isRNA(chainseq)) { rna.add(chainseq); @@ -191,6 +185,11 @@ public class JmolParser extends StructureFile implements JmolStatusListener { prot.add(chainseq); } + + if (StructureViewSettings.isPredictSecondaryStructure()) + { + createAnnotation(chainseq, chain, ms.at); + } } } catch (OutOfMemoryError er) { @@ -221,7 +220,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener curAtom.occupancy = ms.occupancies != null ? ms.occupancies[atom .getIndex()] : Float.valueOf(atom.getOccupancy100()); curAtom.resNumIns = "" + curAtom.resNumber + curAtom.insCode; - // curAtom.tfactor = atom.group.; + curAtom.tfactor = atom.getBfactor100() / 100f; curAtom.type = 0; significantAtoms.add(curAtom); } @@ -278,9 +277,15 @@ public class JmolParser extends StructureFile implements JmolStatusListener { if (secstr[p] >= 'A' && secstr[p] <= 'z') { + try + { asecstr[p] = new Annotation(String.valueOf(secstr[p]), null, secstrcode[p], Float.NaN); ssFound = true; + } catch (Exception e) + { + // e.printStackTrace(); + } } } @@ -561,4 +566,14 @@ public class JmolParser extends StructureFile implements JmolStatusListener this.predictSecondaryStructure = predictSecondaryStructure; } + public boolean isVisibleChainAnnotation() + { + return visibleChainAnnotation; + } + + public void setVisibleChainAnnotation(boolean visibleChainAnnotation) + { + this.visibleChainAnnotation = visibleChainAnnotation; + } + }