1 package jalview.ext.rbvi.chimera;
3 import static org.junit.Assert.assertTrue;
4 import jalview.datamodel.PDBEntry;
5 import jalview.datamodel.SequenceI;
6 import jalview.gui.AlignFrame;
7 import jalview.gui.StructureViewer;
8 import jalview.gui.StructureViewer.ViewerType;
9 import jalview.io.FormatAdapter;
11 import org.junit.AfterClass;
12 import org.junit.BeforeClass;
13 import org.junit.Test;
15 public class JalviewChimeraView
19 * @throws java.lang.Exception
22 public static void setUpBeforeClass() throws Exception
24 jalview.bin.Jalview.main(new String[]
25 { "-noquestionnaire -nonews -props", "test/src/jalview/ext/rbvi/chimera/testProps.jvprops" });
29 * @throws java.lang.Exception
32 public static void tearDownAfterClass() throws Exception
34 jalview.gui.Desktop.instance.closeAll_actionPerformed(null);
40 public void testSingleSeqView()
42 String inFile = "examples/1gaq.txt";
43 AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
44 inFile, FormatAdapter.FILE);
45 assertTrue("Didn't read input file " + inFile, af != null);
46 for (SequenceI sq:af.getViewport().getAlignment().getSequences())
48 SequenceI dsq=sq.getDatasetSequence();
49 while (dsq.getDatasetSequence()!=null)
51 dsq=dsq.getDatasetSequence();
53 if (dsq.getPDBId()!=null && dsq.getPDBId().size()>0) {
54 for (int q=0;q<dsq.getPDBId().size();q++)
56 new StructureViewer(af.getViewport()
57 .getStructureSelectionManager()).viewStructures(
59 af.getCurrentView().getAlignPanel(),
60 new PDBEntry[] { (PDBEntry)dsq.getPDBId().elementAt(q) },
61 new SequenceI[][] { new SequenceI[] { sq } });
63 new StructureViewer(af.getViewport()
64 .getStructureSelectionManager()).viewStructures(
66 af.getCurrentView().getAlignPanel(),
67 new PDBEntry[] { (PDBEntry)dsq.getPDBId().elementAt(q) },
68 new SequenceI[][] { new SequenceI[] { sq } });
69 // todo: break here means only once through this loop?
77 // Thread.sleep(200000);
78 // } catch (InterruptedException q)