X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FPDBChain.java;h=43c8e9dab57e9f178ccc0772b2e4525f1c56d859;hb=ba495f1e787f07401e5e91ecbd6fc69c4b4810cf;hp=86755dd58598125a34b58fffd8fb7f112778ef9d;hpb=e12d7b37af23fcf0d84b6b970c2b3c651601a02d;p=jalview.git diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index 86755dd..43c8e9d 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -34,7 +34,7 @@ public class PDBChain { public Vector residues = new Vector(); public int offset; public Sequence sequence; - public boolean isVisible = false; + public boolean isVisible = true; public int pdbstart = 0; public int pdbend = 0; public int seqstart = 0; @@ -61,8 +61,8 @@ public class PDBChain { for (int i = 0; i < (residues.size() - 1); i++) { Residue tmpres = (Residue) residues.elementAt(i); Residue tmpres2 = (Residue) residues.elementAt(i + 1); - myAtom at1 = tmpres.findAtom("CA"); - myAtom at2 = tmpres2.findAtom("CA"); + Atom at1 = tmpres.findAtom("CA"); + Atom at2 = tmpres2.findAtom("CA"); if ((at1 != null) && (at2 != null)) { if (at1.chain.equals(at2.chain)) { @@ -72,7 +72,7 @@ public class PDBChain { } } - public void makeBond(myAtom at1, myAtom at2) { + public void makeBond(Atom at1, Atom at2) { float[] start = new float[3]; float[] end = new float[3]; @@ -92,7 +92,7 @@ public class PDBChain { String seq = ""; for (int i = 0; i < atoms.size(); i++) { - myAtom tmp = (myAtom) atoms.elementAt(i); + Atom tmp = (Atom) atoms.elementAt(i); //String resName = tmp.resName; int resNumber = tmp.resNumber; int res = resNumber; @@ -103,18 +103,18 @@ public class PDBChain { Vector resAtoms = new Vector(); - resAtoms.addElement((myAtom) atoms.elementAt(i)); + resAtoms.addElement((Atom) atoms.elementAt(i)); i++; - resNumber = ((myAtom) atoms.elementAt(i)).resNumber; + resNumber = ((Atom) atoms.elementAt(i)).resNumber; //Add atoms to a vector while the residue number //remains the same while ((resNumber == res) && (i < atoms.size())) { - resAtoms.addElement((myAtom) atoms.elementAt(i)); + resAtoms.addElement((Atom) atoms.elementAt(i)); i++; if (i < atoms.size()) { - resNumber = ((myAtom) atoms.elementAt(i)).resNumber; + resNumber = ((Atom) atoms.elementAt(i)).resNumber; } else { resNumber++; } @@ -128,7 +128,7 @@ public class PDBChain { count++; Residue tmpres = (Residue) residues.lastElement(); - myAtom tmpat = (myAtom) tmpres.atoms.elementAt(0); + Atom tmpat = (Atom) tmpres.atoms.elementAt(0); // Keep totting up the sequence if (ResidueProperties.getAA3Hash().get(tmpat.resName) == null) { @@ -139,13 +139,14 @@ public class PDBChain { .get(tmpat.resName)).intValue()]; seq = seq + tmpres2; } - - // System.out.println(tmpat.resName + " " + tmpres2); } - sequence = new Sequence("PDB_seq", seq, 1, seq.length()); - System.out.println("PDB Sequence is :\nSequence = " + seq); - System.out.println("No of residues = " + residues.size()); + if(id.length()<1 || id.equals(" ")) + id = "_"; + + sequence = new Sequence(id, seq, 1, seq.length()); + // System.out.println("PDB Sequence is :\nSequence = " + seq); + // System.out.println("No of residues = " + residues.size()); } public void setChargeColours() { @@ -230,59 +231,15 @@ public class PDBChain { } } - public void colourBySequence(jalview.gui.SequenceRenderer sr, - jalview.gui.FeatureRenderer fr) - { + + public void setChainColours(Color col) + { for (int i = 0; i < bonds.size(); i++) { Bond tmp = (Bond) bonds.elementAt(i); - - if ((tmp.at1.resNumber >= ((offset + pdbstart) - 1)) && - (tmp.at1.resNumber <= ((offset + pdbend) - 1))) - { - int pos = seqstart + - (tmp.at1.resNumber - pdbstart - offset); - - - int index = sequence.findIndex(pos); - - tmp.startCol = sr.findSequenceColour(Color.gray, sequence, index); - - tmp.startCol = fr.findFeatureColour(tmp.startCol, sequence, index); - - } else - { - tmp.startCol = Color.gray; - } - - if ((tmp.at2.resNumber >= ((offset + pdbstart) - 1)) && - (tmp.at2.resNumber <= ((pdbend + offset) - 1))) { - int pos = seqstart + - (tmp.at2.resNumber - pdbstart - offset); - int index = sequence.findIndex(pos); - - tmp.endCol = sr.findSequenceColour(Color.gray, sequence, index); - tmp.endCol = fr.findFeatureColour( tmp.endCol, sequence, index); - } - else - { - tmp.endCol = Color.gray; - } - } - } - - public void setChainColours() { - for (int i = 0; i < bonds.size(); i++) { - Bond tmp = (Bond) bonds.elementAt(i); - - try { - tmp.startCol = (Color) ResidueProperties.getChainColours().get(id); - tmp.endCol = (Color) ResidueProperties.getChainColours().get(id); - } catch (Exception e) { - tmp.startCol = Color.lightGray; - tmp.endCol = Color.lightGray; - } + tmp.startCol = col; + tmp.endCol = col; } } }