From fe5f751c21190cad65c44f0ec892e99f8efcbb62 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 11 Jun 2010 09:40:43 +0000 Subject: [PATCH] patch for JAL-556 --- src/MCview/PDBChain.java | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index 2eaf8a3..bd1f640 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -46,7 +46,7 @@ public class PDBChain public int offset; public Sequence sequence; - + public boolean isNa=false; public boolean isVisible = true; public int pdbstart = 0; @@ -163,17 +163,29 @@ public class PDBChain public void makeCaBondList() { + boolean na=false; + int numNa=0; for (int i = 0; i < (residues.size() - 1); i++) { Residue tmpres = (Residue) residues.elementAt(i); Residue tmpres2 = (Residue) residues.elementAt(i + 1); Atom at1 = tmpres.findAtom("CA"); Atom at2 = tmpres2.findAtom("CA"); - - if ((at1 != null) && (at2 != null)) + na=false; + if ((at1 == null) && (at2 == null)) + { + na=true; + at1 = tmpres.findAtom("P"); + at1 = tmpres2.findAtom("P"); + } + if ((at1 == null) && (at2 == null)) { if (at1.chain.equals(at2.chain)) { + if (na) + { + numNa++; + } makeBond(at1, at2); } } @@ -182,6 +194,10 @@ public class PDBChain System.out.println("not found " + i); } } + if (numNa>0 && ((numNa/residues.size())>0.99)) + { + isNa=true; + } } public void makeBond(Atom at1, Atom at2) @@ -257,7 +273,8 @@ public class PDBChain // Keep totting up the sequence if ((symbol = ResidueProperties.getAA3Hash().get(tmpat.resName)) == null) { - if (ResidueProperties.nucleotideIndex[tmpat.resName.charAt(0)] == -1) + String nucname=tmpat.resName.trim(); + if (ResidueProperties.nucleotideIndex[nucname.charAt(0)] == -1) { seq.append("X"); // System.err.println("PDBReader:Null aa3Hash for " + @@ -267,7 +284,7 @@ public class PDBChain { // nucleotide flag nucleotide = true; - seq.append(tmpat.resName.charAt(0)); + seq.append(nucname.charAt(0)); } } else @@ -286,7 +303,7 @@ public class PDBChain { id = " "; } - + isNa=nucleotide; sequence = new Sequence(id, seq.toString(), offset, resNumber - 1); // Note: // resNumber-offset // ~= -- 1.7.10.2