From: jprocter Date: Fri, 30 Oct 2009 10:22:45 +0000 (+0000) Subject: na pdb: recognise NA residue names X-Git-Tag: Release_2_5~170 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1e716949b95edeb0b47ef99e09ce3ee32d2fe511;p=jalview.git na pdb: recognise NA residue names --- diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index 61ad26a..a556137 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -204,6 +204,8 @@ public class PDBChain public void makeResidueList() { int count = 0; + Object symbol; + boolean nucleotide=false; StringBuffer seq = new StringBuffer(); Vector resFeatures = new Vector(); Vector resAnnotation = new Vector(); @@ -254,17 +256,26 @@ public class PDBChain resFeatures.addElement(sf); resAnnotation.addElement(new Annotation(tmpat.tfactor)); // Keep totting up the sequence - if (ResidueProperties.getAA3Hash().get(tmpat.resName) == null) + if ((symbol=ResidueProperties.getAA3Hash().get(tmpat.resName)) == null) { - seq.append("X"); + if (ResidueProperties.nucleotideIndex[tmpat.resName.charAt(0)]==-1) + { + seq.append("X"); // System.err.println("PDBReader:Null aa3Hash for " + // tmpat.resName); + } else { + // nucleotide flag + nucleotide=true; + seq.append(tmpat.resName.charAt(0)); + } } else { - - seq.append(ResidueProperties.aa[((Integer) ResidueProperties - .getAA3Hash().get(tmpat.resName)).intValue()]); + if (nucleotide) + { + System.err.println("Warning: mixed nucleotide and amino acid chain.. its gonna do bad things to you!"); + } + seq.append(ResidueProperties.aa[((Integer) symbol).intValue()]); } count++; } @@ -300,7 +311,7 @@ public class PDBChain resAnnotation.setElementAt(null, i); } AlignmentAnnotation tfactorann = new AlignmentAnnotation( - "PDB.CATempFactor", "CA Temperature Factor for " + "PDB.TempFactor", "Temperature Factor for " + sequence.getName(), annots, 0, max, AlignmentAnnotation.LINE_GRAPH); tfactorann.setSequenceRef(sequence);