+ if (id.length() < 1)
+ {
+ id = " ";
+ }
+ isNa = nucleotide;
+ sequence = new Sequence(id, seq.toString(), offset, resNumber - 1); // Note:
+ // resNumber-offset
+ // ~=
+ // seq.size()
+ // Add normalised feature scores to RESNUM indicating start/end of sequence
+ // sf.setScore(offset+count);
+
+ // System.out.println("PDB Sequence is :\nSequence = " + seq);
+ // System.out.println("No of residues = " + residues.size());
+ for (i = 0, iSize = resFeatures.size(); i < iSize; i++)
+ {
+ sequence.addSequenceFeature(resFeatures.elementAt(i));
+ resFeatures.setElementAt(null, i);
+ }
+ if (visibleChainAnnotation)
+ {
+ Annotation[] annots = new Annotation[resAnnotation.size()];
+ float max = 0;
+ for (i = 0, iSize = annots.length; i < iSize; i++)
+ {
+ annots[i] = resAnnotation.elementAt(i);
+ if (annots[i].value > max)
+ {
+ max = annots[i].value;
+ }
+ resAnnotation.setElementAt(null, i);
+ }
+
+ AlignmentAnnotation tfactorann = new AlignmentAnnotation(
+ "Temperature Factor", "Temperature Factor for " + pdbid + id,
+ annots, 0, max, AlignmentAnnotation.LINE_GRAPH);
+ tfactorann.setSequenceRef(sequence);
+ sequence.addAlignmentAnnotation(tfactorann);
+ }
+ }
+
+ /**
+ * Colour start/end of bonds by charge
+ * <ul>
+ * <li>ASP and GLU red</li>
+ * <li>LYS and ARG blue</li>
+ * <li>CYS yellow</li>
+ * <li>others light gray</li>
+ * </ul>
+ */
+ public void setChargeColours()
+ {
+ for (Bond b : bonds)
+ {
+ if (b.at1 != null && b.at2 != null)
+ {
+ b.startCol = getChargeColour(b.at1.resName);
+ b.endCol = getChargeColour(b.at2.resName);
+ }
+ else
+ {
+ b.startCol = Color.gray;
+ b.endCol = Color.gray;
+ }
+ }
+ }