There will be better ways of doing this in the future, for now we'll use
the tried and tested MCview pdb mapping
*/
- public MCview.PDBfile setMapping(SequenceI[] sequence,
+ synchronized public MCview.PDBfile setMapping(SequenceI[] sequence,
String pdbFile,
String protocol)
{
}
}
+ public Annotation[] colourSequenceFromStructure(SequenceI seq, String pdbid)
+ {
+ Annotation [] annotations = new Annotation[seq.getLength()];
+
+ StructureListener sl;
+ int atomNo = 0;
+ for (int i = 0; i < listeners.size(); i++)
+ {
+ if (listeners.elementAt(i) instanceof StructureListener)
+ {
+ sl = (StructureListener) listeners.elementAt(i);
+
+ for (int j = 0; j < mappings.length; j++)
+ {
+
+ if (mappings[j].sequence == seq
+ && mappings[j].getPdbId().equals(pdbid)
+ && mappings[j].pdbfile.equals(sl.getPdbFile()))
+ {
+ System.out.println(pdbid+" "+mappings[j].getPdbId()
+ +" "+mappings[j].pdbfile);
+
+ java.awt.Color col;
+ for(int index=0; index<seq.getLength(); index++)
+ {
+ if(jalview.util.Comparison.isGap(seq.getCharAt(index)))
+ continue;
+
+ atomNo = mappings[j].getAtomNum(seq.findPosition(index));
+ col = java.awt.Color.white;
+ if (atomNo > 0)
+ {
+ col = sl.getColour(atomNo,
+ mappings[j].getPDBResNum(index),
+ mappings[j].pdbchain,
+ mappings[j].pdbfile);
+
+ // System.out.println(atomNo+" "+mappings[j].getPDBResNum(index)
+ // +" "+index+" "+col);
+ }
+
+ annotations[index] = new Annotation("X",null,' ',0,col);
+ }
+ return annotations;
+ }
+ }
+ }
+ }
+
+ return annotations;
+ }
+
+
public void structureSelectionChanged()
{
StructureListener svl;