int l = 0, c = pdbfn.indexOf(".");
while (mtch == null && c != -1)
{
- while ((c = pdbfn.indexOf(".", l)) > l)
+ do
{
l = c;
- }
+ } while ((c = pdbfn.indexOf(".", l)) > l);
if (l > -1)
{
pdbfn = pdbfn.substring(0, l);
{
return StructureSelectionManager.getStructureSelectionManager(Desktop.instance);
}
+
+ /**
+ *
+ * @param pdbEntries
+ * @return a series of SequenceI arrays, one for each PDBEntry, listing which sequence in the alignment holds a reference to it
+ */
+ public SequenceI[][] collateForPDB(PDBEntry[] pdbEntries)
+ {
+ ArrayList<SequenceI[]> seqvectors = new ArrayList<SequenceI[]>();
+ for (PDBEntry pdb: pdbEntries) {
+ ArrayList<SequenceI> seqs = new ArrayList<SequenceI>();
+ for (int i = 0; i < alignment.getHeight(); i++)
+ {
+ Vector pdbs = alignment.getSequenceAt(i)
+ .getDatasetSequence().getPDBId();
+ if (pdbs == null)
+ continue;
+ SequenceI sq;
+ for (int p = 0; p < pdbs.size(); p++)
+ {
+ PDBEntry p1 = (PDBEntry) pdbs.elementAt(p);
+ if (p1.getId().equals(pdb.getId()))
+ {
+ if (!seqs.contains(sq=alignment.getSequenceAt(i)))
+ seqs.add(sq);
+
+ continue;
+ }
+ }
+ }
+ seqvectors.add(seqs.toArray(new SequenceI[seqs.size()]));
+ }
+ return seqvectors.toArray(new SequenceI[seqvectors.size()][]);
+ }
}