{
createProgressBar();
+ String[][] chains = extractChains(seqs);
jmb = new JalviewChimeraBindingModel(this,
- ap.getStructureSelectionManager(), pdbentrys, seqs, null, null);
+ ap.getStructureSelectionManager(), pdbentrys, seqs, chains,
+ null);
addAlignmentPanel(ap);
useAlignmentPanelForColourbyseq(ap);
if (pdbentrys.length > 1)
}
/**
+ * Retrieve chains for sequences by inspecting their PDB refs. The hope is
+ * that the first will be to the sequence's own chain. Really need a more
+ * managed way of doing this.
+ *
+ * @param seqs
+ * @return
+ */
+ protected String[][] extractChains(SequenceI[][] seqs)
+ {
+ String[][] chains = new String[seqs.length][];
+ for (int i = 0; i < seqs.length; i++)
+ {
+ chains[i] = new String[seqs[i].length];
+ int seqno = 0;
+ for (SequenceI seq : seqs[i])
+ {
+ String chain = null;
+ if (seq.getDatasetSequence() != null)
+ {
+ Vector<PDBEntry> pdbrefs = seq.getDatasetSequence().getPDBId();
+ if (pdbrefs != null && pdbrefs.size() > 0)
+ {
+ chain = pdbrefs.get(0).getChainCode();
+ }
+ }
+ chains[i][seqno++] = chain;
+ }
+ }
+ return chains;
+ }
+
+ /**
* create a new viewer containing several structures superimposed using the
* given alignPanel.
*