X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fstructure%2FMapping.java;h=85aea4000c0354d1c8ef2f0b4b32ff323be4026d;hb=40bd118644ec4fe8a11b8bee04e1e25ab8699bf8;hp=aae1f3dd29385842d1bfb21d7c6caf77ca795846;hpb=52288466dd1e71946a06fd1e6ea15fa8e652c693;p=jalview.git diff --git a/test/jalview/structure/Mapping.java b/test/jalview/structure/Mapping.java index aae1f3d..85aea40 100644 --- a/test/jalview/structure/Mapping.java +++ b/test/jalview/structure/Mapping.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.structure; import static org.testng.AssertJUnit.assertEquals; @@ -8,18 +28,27 @@ import jalview.datamodel.Annotation; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; +import jalview.gui.JvOptionPane; +import jalview.io.DataSourceType; +import jalview.io.FileFormat; import jalview.io.FileLoader; -import jalview.io.FormatAdapter; +import jalview.io.StructureFile; import org.testng.Assert; import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import MCview.PDBfile; - public class Mapping { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + /* * more test data * @@ -47,9 +76,9 @@ public class Mapping { 303, 315 }, sheets[] = new int[] { 267, 268, 269, 270 }; StructureSelectionManager ssm = new jalview.structure.StructureSelectionManager(); - PDBfile pmap = ssm.setMapping(true, new SequenceI[] { uprot }, + StructureFile pmap = ssm.setMapping(true, new SequenceI[] { uprot }, new String[] { "A" }, "test/jalview/ext/jmol/1QCF.pdb", - jalview.io.FormatAdapter.FILE); + DataSourceType.FILE); assertTrue(pmap != null); SequenceI protseq = pmap.getSeqsAsArray()[0]; AlignmentAnnotation pstra = protseq @@ -118,8 +147,9 @@ public class Mapping StructureSelectionManager ssm = new jalview.structure.StructureSelectionManager(); // Associate the 1GAQ pdb file with the subsequence 'imported' from another // source - PDBfile pde = ssm.setMapping(true, new SequenceI[] { sq }, new String[] - { "A" }, inFile = "examples/1gaq.txt", jalview.io.FormatAdapter.FILE); + StructureFile pde = ssm.setMapping(true, new SequenceI[] { sq }, + new String[] + { "A" }, inFile = "examples/1gaq.txt", DataSourceType.FILE); assertTrue("PDB File couldn't be found", pde != null); StructureMapping[] mp = ssm.getMapping(inFile); assertTrue("No mappings made.", mp != null && mp.length > 0); @@ -211,12 +241,12 @@ public class Mapping AlignFrame seqf = new FileLoader(false) .LoadFileWaitTillLoaded( ">FER1_MAIZE/1-150 Ferredoxin-1, chloroplast precursor\nMATVLGSPRAPAFFFSSSSLRAAPAPTAVALPAAKVGIMGRSASSRRRLRAQATYNVKLITPEGEVELQVPD\nDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDVVIETHKE\nEELTGA", - FormatAdapter.PASTE, "FASTA"); + DataSourceType.PASTE, FileFormat.Fasta); SequenceI newseq = seqf.getViewport().getAlignment().getSequenceAt(0); StructureSelectionManager ssm = new jalview.structure.StructureSelectionManager(); - PDBfile pmap = ssm.setMapping(true, new SequenceI[] { newseq }, + StructureFile pmap = ssm.setMapping(true, new SequenceI[] { newseq }, new String[] { null }, "examples/3W5V.pdb", - jalview.io.FormatAdapter.FILE); + DataSourceType.FILE); if (pmap == null) { AssertJUnit.fail("Couldn't make a mapping for 3W5V to FER1_MAIZE"); @@ -230,9 +260,10 @@ public class Mapping @Test(groups = { "Functional" }) public void compareTransferredToRefPDBAnnot() throws Exception { + StructureImportSettings.setShowSeqFeatures(true); AlignFrame ref = new FileLoader(false) .LoadFileWaitTillLoaded("test/jalview/ext/jmol/1QCF.pdb", - jalview.io.FormatAdapter.FILE); + DataSourceType.FILE); SequenceI refseq = ref.getViewport().getAlignment().getSequenceAt(0); SequenceI newseq = new Sequence(refseq.getName() + "Copy", refseq.getSequenceAsString()); @@ -242,9 +273,9 @@ public class Mapping StructureSelectionManager ssm = new jalview.structure.StructureSelectionManager(); ssm.setProcessSecondaryStructure(true); ssm.setAddTempFacAnnot(true); - PDBfile pmap = ssm.setMapping(true, new SequenceI[] { newseq }, + StructureFile pmap = ssm.setMapping(true, new SequenceI[] { newseq }, new String[] { null }, "test/jalview/ext/jmol/1QCF.pdb", - jalview.io.FormatAdapter.FILE); + DataSourceType.FILE); assertTrue(pmap != null); assertEquals("Original and copied sequence of different lengths.", refseq.getLength(), newseq.getLength());