From: James Procter Date: Thu, 13 Jul 2023 15:05:45 +0000 (+0100) Subject: JAL-4229 beginnings of test to verify VARNA and Helices shading as correct X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f4865ea9ed6053ddd96a6157b124642488153a21;p=jalview.git JAL-4229 beginnings of test to verify VARNA and Helices shading as correct --- diff --git a/src/jalview/gui/AppVarna.java b/src/jalview/gui/AppVarna.java index 5273aaa..4231bf6 100644 --- a/src/jalview/gui/AppVarna.java +++ b/src/jalview/gui/AppVarna.java @@ -65,7 +65,7 @@ public class AppVarna extends JInternalFrame InterfaceVARNASelectionListener, VamsasSource { private static final byte[] PAIRS = new byte[] { '(', ')', '[', ']', '{', - '}', '<', '>' }; + '}', '<', '>', '_','-' }; private AppVarnaBinding vab; diff --git a/test/jalview/gui/AppVarnaTest.java b/test/jalview/gui/AppVarnaTest.java index 7936a4b..b648b4d 100644 --- a/test/jalview/gui/AppVarnaTest.java +++ b/test/jalview/gui/AppVarnaTest.java @@ -20,6 +20,7 @@ */ package jalview.gui; +import static org.testng.Assert.assertTrue; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertSame; @@ -27,6 +28,16 @@ import static org.testng.AssertJUnit.assertSame; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.Sequence; +import jalview.ext.varna.RnaModel; +import jalview.io.DataSourceType; +import jalview.io.FileFormat; +import jalview.io.FileLoader; +import jalview.io.FormatAdapter; +import jalview.io.StockholmFile; + + public class AppVarnaTest { @@ -53,4 +64,16 @@ public class AppVarnaTest assertEquals("..{B([.<.].}b>)", AppVarna.replaceOddGaps(" {B([*<-]?}b>)")); } + @Test(groups = "Functional") + public void testRnaModel() throws Exception + { + AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded("examples/rna_ss_test.stk", DataSourceType.FILE); + AlignmentI a = af.getViewport().getAlignment(); + assertTrue(a.getAlignmentAnnotation()[0].isRNA()); + AppVarna varnaView = new AppVarna(a.getSequenceAt(0),a.getAlignmentAnnotation()[0], af.alignPanel); + assertEquals(varnaView.getModels().size(),2); + for (RnaModel mdl: varnaView.getModels()) { + assertEquals(mdl.seq.getSequenceAsString(),mdl.rna.getSeq()); + } + } }