From: Jim Procter Date: Fri, 8 Jan 2021 16:05:39 +0000 (+0000) Subject: JAL-3794 new test for recognition of protein or DNA with ambiguity characters, includ... X-Git-Tag: Release_2_11_2_0~34^2~15 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0bf5983f8a17fdfecb2cac649e3650763a8973ce;p=jalview.git JAL-3794 new test for recognition of protein or DNA with ambiguity characters, including the ‘all N’ case (that should be protein..). --- diff --git a/test/jalview/datamodel/SequenceTest.java b/test/jalview/datamodel/SequenceTest.java index e549978..6d07113 100644 --- a/test/jalview/datamodel/SequenceTest.java +++ b/test/jalview/datamodel/SequenceTest.java @@ -110,6 +110,23 @@ public class SequenceTest assertTrue(sq.isProtein()); } + @Test(groups = ("Functional")) + public void testIsProteinWithXorNAmbiguityCodes() + { + // test Protein with N - poly asparagine + assertTrue(new Sequence("prot", "ASDFASDFASDFNNNNNNNNN").isProtein()); + assertTrue(new Sequence("prot", "NNNNNNNNNNNNNNNNNNNNN").isProtein()); + // test Protein with X + assertTrue(new Sequence("prot", "ASDFASDFASDFXXXXXXXXX").isProtein()); + // test DNA with X + assertFalse(new Sequence("prot", "ACGTACGTACGTXXXXXXXX").isProtein()); + // test DNA with N + assertFalse(new Sequence("prot", "ACGTACGTACGTNNNNNNNN").isProtein()); + // test RNA with X + assertFalse(new Sequence("prot", "ACGUACGUACGUXXXXXXXXX").isProtein()); + assertFalse(new Sequence("prot", "ACGUACGUACGUNNNNNNNNN").isProtein()); + } + @Test(groups = { "Functional" }) public void testGetAnnotation() {