ScriptWindow scriptWindow;
PDBEntry pdbentry;
SequenceI[] sequence;
+ String [] chains;
StructureSelectionManager ssm;
JSplitPane splitPane;
RenderPanel renderPanel;
pdbentry = new PDBEntry();
pdbentry.setFile(file);
pdbentry.setId(id);
+ this.chains = chains;
this.sequence = seq;
this.ap = ap;
this.setBounds(bounds);
sequence = tmp;
}
- public AppJMol(PDBEntry pdbentry, SequenceI[] seq, AlignmentPanel ap)
+ public AppJMol(PDBEntry pdbentry, SequenceI[] seq, String [] chains, AlignmentPanel ap)
{
//////////////////////////////////
//Is the pdb file already loaded?
if (option == JOptionPane.YES_OPTION)
{
StructureSelectionManager.getStructureSelectionManager()
- .setMapping(seq, alreadyMapped, AppletFormatAdapter.FILE);
- ap.seqPanel.seqCanvas.fr.featuresAdded();
- ap.paintAlignment(true);
+ .setMapping(seq, chains, alreadyMapped, AppletFormatAdapter.FILE);
+ if (ap.seqPanel.seqCanvas.fr!=null) {
+ ap.seqPanel.seqCanvas.fr.featuresAdded();
+ ap.paintAlignment(true);
+ }
return;
}
}
}
+ public Color getColour(int atomIndex, int pdbResNum, String chain, String pdbfile)
+ {
+ if (!pdbfile.equals(pdbentry.getFile()))
+ return null;
+
+ return new Color(viewer.getAtomArgb(atomIndex));
+ }
+
public void updateColours(Object source)
{
colourBySequence( (AlignmentPanel) source);
//End StructureListener
////////////////////////////
- FeatureRenderer fr;
+ FeatureRenderer fr=null;
public void colourBySequence(AlignmentPanel ap)
{
if(!colourBySequence)
SequenceRenderer sr = ap.seqPanel.seqCanvas.getSequenceRenderer();
boolean showFeatures = false;
+
if (ap.av.showSequenceFeatures)
{
showFeatures = true;
if (fr == null)
{
- fr = new jalview.gui.FeatureRenderer(ap.av);
+ fr = new jalview.gui.FeatureRenderer(ap);
}
fr.transferSettings(ap.seqPanel.seqCanvas.getFeatureRenderer());
{
for (int m = 0; m < mapping.length; m++)
{
- if (mapping[m].getSequence() == sequence[s])
+ if (mapping[m].getSequence() == sequence[s]
+ && ap.av.alignment.findIndex(sequence[s])>-1)
{
for (int r = 0; r < sequence[s].getLength(); r++)
{
//FILE LOADED OK
ssm = StructureSelectionManager.getStructureSelectionManager();
- MCview.PDBfile pdbFile = ssm.setMapping(sequence, pdbentry.getFile(), AppletFormatAdapter.FILE);
+ MCview.PDBfile pdbFile = ssm.setMapping(sequence,chains,pdbentry.getFile(), AppletFormatAdapter.FILE);
ssm.addStructureViewerListener(this);
-
Vector chains = new Vector();
for(int i=0; i<pdbFile.chains.size(); i++)
{
colourBySequence(ap);
}
+ if (fr!=null)
+ fr.featuresAdded();
loadingFromArchive = false;
}
if (!atomsPicked.contains(picked))
{
+ if(chainId!=null)
viewer.evalString("select "+picked+";label %n %r:%c");
+ else
+ viewer.evalString("select "+picked+";label %n %r");
atomsPicked.addElement(picked);
}
else