From: tcofoegbu Date: Thu, 24 Mar 2016 15:55:28 +0000 (+0000) Subject: JAL-1919 Added ability to generate temprature factor annotation via JmolParser X-Git-Tag: Release_2_10_0~284 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c4ac1df8d2ee8e02ad8f571e250aa0f3e1d8dbed;p=jalview.git JAL-1919 Added ability to generate temprature factor annotation via JmolParser --- diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index c9243ed..3280471 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -64,14 +64,12 @@ public class JmolParser extends StructureFile implements JmolStatusListener throws IOException { super(inFile, type); - // addSettings(addAlignmentAnnotations, predictSecStr, externalSecStr); } public JmolParser(boolean addAlignmentAnnotations, boolean predictSecStr, boolean externalSecStr, FileParse fp) throws IOException { super(fp); - // addSettings(addAlignmentAnnotations, predictSecStr, externalSecStr); } public JmolParser() @@ -167,6 +165,8 @@ public class JmolParser extends StructureFile implements JmolStatusListener } lastID = tmpatom.resNumIns.trim(); } + xferSettings(); + makeResidueList(); makeCaBondList(); @@ -220,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); } @@ -560,4 +560,14 @@ public class JmolParser extends StructureFile implements JmolStatusListener this.predictSecondaryStructure = predictSecondaryStructure; } + public boolean isVisibleChainAnnotation() + { + return visibleChainAnnotation; + } + + public void setVisibleChainAnnotation(boolean visibleChainAnnotation) + { + this.visibleChainAnnotation = visibleChainAnnotation; + } + } diff --git a/src/jalview/io/StructureFile.java b/src/jalview/io/StructureFile.java index fd488f0..9efaaac 100644 --- a/src/jalview/io/StructureFile.java +++ b/src/jalview/io/StructureFile.java @@ -63,6 +63,18 @@ public abstract class StructureFile extends AlignFile this.predictSecondaryStructure = predictSecondaryStructure; this.externalSecondaryStructure = externalSecStr; } + + public void xferSettings() + { + this.visibleChainAnnotation = StructureViewSettings + .isVisibleChainAnnotation(); + this.predictSecondaryStructure = StructureViewSettings + .isPredictSecondaryStructure(); + this.externalSecondaryStructure = StructureViewSettings + .isExternalSecondaryStructure(); + + } + public StructureFile(boolean parseImmediately, String inFile, String type) throws IOException { @@ -259,12 +271,17 @@ public abstract class StructureFile extends AlignFile final Constructor constructor = cl .getConstructor(new Class[] { boolean.class, boolean.class, boolean.class, FileParse.class }); - final Object[] args = new Object[] { true, true, true, + final Object[] args = new Object[] { visibleChainAnnotation, + predictSecondaryStructure, externalSecondaryStructure, new FileParse(getDataName(), type) }; - StructureViewSettings.setShowSeqFeatures(false); - StructureViewSettings.setPredictSecondaryStructure(true); + StructureViewSettings.setShowSeqFeatures(true); + StructureViewSettings.setVisibleChainAnnotation(false); + StructureViewSettings + .setPredictSecondaryStructure(predictSecondaryStructure); + StructureViewSettings + .setExternalSecondaryStructure(externalSecondaryStructure); Object jmf = constructor.newInstance(args); AlignmentI al = new Alignment((SequenceI[]) cl.getMethod( "getSeqsAsArray", new Class[] {}).invoke(jmf));