2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.bin.Cache;
24 import jalview.datamodel.AlignmentI;
25 import jalview.datamodel.PDBEntry;
26 import jalview.datamodel.SequenceI;
27 import jalview.gui.AlignFrame;
28 import jalview.gui.Desktop;
30 import org.junit.Assert;
31 import org.testng.annotations.AfterClass;
32 import org.testng.annotations.BeforeClass;
33 import org.testng.annotations.BeforeMethod;
34 import org.testng.annotations.Test;
36 public class ImportHomologyModelTest
39 public static String base = "examples/testdata/phyre2/";
41 public static String profile_msa = base + "query.jal",
42 profile_annot = base + "query.jal.ann";
44 public static String templaten[] = new String[] { "c1o1nA_", "c3pt8B_",
51 * Ensure 'process secondary structure from PDB and add annotations' are set
52 * in preferences, and load PDB example file 1gaq
56 @BeforeMethod(alwaysRun = true)
57 public void setup() throws Exception
59 Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
60 Boolean.TRUE.toString());
61 Cache.applicationProperties.setProperty("ADD_SS_ANN",
62 Boolean.TRUE.toString());
63 FileLoader loader = new FileLoader(false);
64 af = loader.LoadFileWaitTillLoaded(profile_msa,
65 jalview.io.DataSourceType.FILE);
66 Desktop.addInternalFrame(af, "homology models", 800, 500);
67 al = af.getViewport().getAlignment();
68 af.loadJalviewDataFile(profile_annot, jalview.io.DataSourceType.FILE,
70 // if file was loaded, the view should have a reference sequence set
71 Assert.assertTrue(al.hasSeqrep());
75 @Test(groups = { "Functional" })
76 public void testModelsAssociated()
78 for (String template : templaten)
80 SequenceI templseq = al.findName(template);
81 Assert.assertNotNull("Couldn't find template sequence for "
82 + template, templseq);
83 PDBEntry querymdl = al.getSeqrep().getPDBEntry(template);
84 PDBEntry templmdl = templseq.getPDBEntry(template);
85 Assert.assertEquals(querymdl.getFile(), templmdl.getFile());
90 * @throws java.lang.Exception
92 @BeforeClass(alwaysRun = true)
93 public static void setUpBeforeClass() throws Exception
95 jalview.bin.Jalview.main(new String[] { "-props",
96 "test/jalview/io/testProps.jvprops" });
100 * @throws java.lang.Exception
102 @AfterClass(alwaysRun = true)
103 public static void tearDownAfterClass() throws Exception
105 jalview.gui.Desktop.instance.closeAll_actionPerformed(null);