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.
24 import java.awt.Color;
26 import java.util.Iterator;
28 import org.junit.Assert;
29 import org.testng.annotations.AfterMethod;
30 import org.testng.annotations.BeforeClass;
31 import org.testng.annotations.BeforeMethod;
32 import org.testng.annotations.Test;
34 import jalview.analysis.AlignmentAnnotationUtils;
35 import jalview.api.FeatureColourI;
36 import jalview.bin.Cache;
37 import jalview.bin.Jalview;
38 import jalview.datamodel.Alignment;
39 import jalview.datamodel.AlignmentI;
40 import jalview.datamodel.HiddenColumns;
41 import jalview.datamodel.PDBEntry;
42 import jalview.datamodel.Sequence;
43 import jalview.datamodel.SequenceFeature;
44 import jalview.datamodel.SequenceGroup;
45 import jalview.datamodel.SequenceI;
46 import jalview.io.DataSourceType;
47 import jalview.io.FileLoader;
48 import jalview.project.Jalview2xmlTests;
49 import jalview.renderer.ResidueShaderI;
50 import jalview.schemes.BuriedColourScheme;
51 import jalview.schemes.FeatureColour;
52 import jalview.schemes.HelixColourScheme;
53 import jalview.schemes.JalviewColourScheme;
54 import jalview.schemes.StrandColourScheme;
55 import jalview.schemes.TurnColourScheme;
56 import jalview.util.MessageManager;
58 public class AssociatePDBFileTest
62 @BeforeClass(alwaysRun = true)
63 public static void setUpBeforeClass() throws Exception
67 * use read-only test properties file
69 Cache.loadProperties("test/jalview/io/testProps.jvprops");
70 Jalview.main(new String[] { "--nonews" });
73 @AfterMethod(alwaysRun = true)
74 public void tearDown()
76 if (Desktop.instance != null)
77 Desktop.instance.closeAll_actionPerformed(null);
81 * configure (read-only) properties for test to ensure Consensus is computed
82 * for colour Above PID testing
84 @BeforeMethod(alwaysRun = true)
87 Cache.loadProperties("test/jalview/io/testProps.jvprops");
88 Cache.applicationProperties.setProperty("SHOW_IDENTITY",
89 Boolean.TRUE.toString());
90 af = new FileLoader().LoadFileWaitTillLoaded(">1GAQ|A/19-314\n"
91 + "ESKKQEEGVVTNLYKPKEPYVGRCLLNTKITGDDAPGETWHMVFSTEGKIPYREGQSIGVIADGVDKNGKPH\n"
92 + "KVRLYSIASSAIGDFGDSKTVSLCVKRLIYTNDAGEIVKGVCSNFLCDLQPGDNVQITGPVGKEMLMPKDPN\n"
93 + "ATIIMLATGTGIAPFRSFLWKMFFEKHDDYKFNGLGWLFLGVPTSSSLLYKEEFGKMKERAPENFRVDYAVS\n"
94 + "REQTNAAGERMYIQTRMAEYKEELWELLKKDNTYVYMCGLKGMEKGIDDIMVSLAEKDGIDWFDYKKQLKRG\n"
97 + "ATYNVKLITPEGEVELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADG\n"
98 + "WVLTCHAYPTSDVVIETHKEEELTGA\n"
100 + "ESKKQEEGVVTNLYKPKEPYVGRCLLNTKITGDDAPGETWHMVFSTEGKIPYREGQSIGVIADGVDKNGKPH\n"
101 + "KVRLYSIASSAIGDFGDSKTVSLCVKRLIYTNDAGEIVKGVCSNFLCDLQPGDNVQITGPVGKEMLMPKDPN\n"
102 + "ATIIMLATGTGIAPFRSFLWKMFFEKHDDYKFNGLGWLFLGVPTSSSLLYKEEFGKMKERAPENFRVDYAVS\n"
103 + "REQTNAAGERMYIQTRMAEYKEELWELLKKDNTYVYMCGLKGMEKGIDDIMVSLAEKDGIDWFDYKKQLKRG\n"
106 DataSourceType.PASTE);
109 * wait for Consensus thread to complete
116 } catch (InterruptedException x)
119 } while (af.getViewport().getCalcManager().isWorking());
122 public static void setUpJvOptionPane()
124 JvOptionPane.setInteractiveMode(false);
125 JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
128 @Test(groups = "Functional")
129 public void testAssociatePDBFile()
131 String assoc_file="examples/1gaq.txt";
132 for (SequenceI toassoc:af.getViewport().getAlignment().getSequences())
134 PDBEntry pe = new AssociatePdbFileWithSeq()
135 .associatePdbWithSeq(assoc_file,
136 DataSourceType.FILE, toassoc, false,
138 Assert.assertNotNull(pe);
139 Assert.assertNotEquals(toassoc.getDatasetSequence().getAnnotation().length,0);