From: jprocter Date: Thu, 19 Apr 2007 16:17:39 +0000 (+0000) Subject: tfactor and occupancy extracted from PDB file, and tfactor added as sequence associat... X-Git-Tag: Release_2_3~205 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ff33b2ff68aed0d69ac1a4edf860141dc9402592;p=jalview.git tfactor and occupancy extracted from PDB file, and tfactor added as sequence associated alignment annotation. --- diff --git a/src/MCview/Atom.java b/src/MCview/Atom.java index f8fb9b4..e22b94e 100755 --- a/src/MCview/Atom.java +++ b/src/MCview/Atom.java @@ -36,7 +36,8 @@ public class Atom public String chain; public int alignmentMapping = -1; public int atomIndex; - + public float occupancy=0; + public float tfactor=0; public boolean isSelected = false; public Atom(String str) @@ -55,7 +56,8 @@ public class Atom this.x = (float) (new Float(str.substring(30, 38).trim()).floatValue()); this.y = (float) (new Float(str.substring(38, 46).trim()).floatValue()); this.z = (float) (new Float(str.substring(47, 55).trim()).floatValue()); - + occupancy = (float) (new Float(str.substring(54,60).trim()).floatValue()); + tfactor = (float) (new Float(str.substring(60,66).trim()).floatValue()); } public Atom(float x, float y, float z) diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index 76a0cde..8441a2d 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -189,6 +189,7 @@ public class PDBChain int count = 0; StringBuffer seq = new StringBuffer(); Vector resFeatures = new Vector(); + Vector resAnnotation = new Vector(); int i, iSize = atoms.size() - 1; int resNumber = -1; for (i = 0; i <= iSize; i++) @@ -236,6 +237,7 @@ public class PDBChain "", offset + count, offset + count, MCview.PDBChain.PDBFILEFEATURE); resFeatures.addElement(sf); + resAnnotation.addElement(new Annotation("","",'\0',tmpat.tfactor)); // Keep totting up the sequence if (ResidueProperties.getAA3Hash().get(tmpat.resName) == null) { @@ -266,6 +268,19 @@ public class PDBChain sequence.addSequenceFeature( (SequenceFeature) resFeatures.elementAt(i)); resFeatures.setElementAt(null, i); } + Annotation[] annots = new Annotation[resAnnotation.size()]; + float max=0; + for (i=0,iSize=annots.length; imax) + max = annots[i].value; + resAnnotation.setElementAt(null, i); + } + AlignmentAnnotation tfactorann = new AlignmentAnnotation("PDB.CATempFactor","CA Temperature Factor", + annots, 0, max, AlignmentAnnotation.LINE_GRAPH); + tfactorann.setSequenceRef(sequence); + sequence.addAlignmentAnnotation(tfactorann); } public void setChargeColours()