1 package jalview.ext.ensembl;
3 import static org.testng.AssertJUnit.assertEquals;
5 import org.testng.Assert;
6 import org.testng.annotations.Test;
8 public class EnsemblProteinTest
11 @Test(groups = "Functional")
12 public void testIsValidReference() throws Exception
14 EnsemblSequenceFetcher esq = new EnsemblProtein();
15 Assert.assertTrue(esq.isValidReference("CCDS5863.1"));
16 Assert.assertTrue(esq.isValidReference("ENSP00000288602"));
17 Assert.assertFalse(esq.isValidReference("ENST00000288602"));
18 Assert.assertFalse(esq.isValidReference("ENSG00000288602"));
19 // non-human species having a 3 character identifier included:
20 Assert.assertTrue(esq.isValidReference("ENSMUSP00000099398"));
23 @Test(groups = "Functional")
24 public void testGetAccesionIdFromQuery() throws Exception
26 EnsemblSequenceFetcher esq = new EnsemblProtein();
27 assertEquals("ENSP00000288602",
28 esq.getAccessionIdFromQuery("ENSP00000288602"));
29 assertEquals("ENSMUSP00000288602",
30 esq.getAccessionIdFromQuery("ENSMUSP00000288602"));
32 // ENST converted to ENSP
33 assertEquals("ENSP00000288602",
34 esq.getAccessionIdFromQuery("ENST00000288602"));
35 assertEquals("ENSMUSP00000288602",
36 esq.getAccessionIdFromQuery("ENSMUST00000288602"));
38 // with valid separator:
39 assertEquals("ENSP00000288604",
40 esq.getAccessionIdFromQuery("ENSP00000288604 ENSP00000288602"));
42 // with wrong separator:
43 assertEquals("ENSP00000288604,ENSP00000288602",
44 esq.getAccessionIdFromQuery("ENSP00000288604,ENSP00000288602"));