1 package jalview.ext.ensembl;
3 import static org.testng.Assert.assertEquals;
5 import jalview.bin.Cache;
6 import jalview.ext.ensembl.EnsemblSpecies.EnsemblTaxon;
11 import org.apache.log4j.Logger;
12 import org.testng.annotations.Test;
14 import junit.extensions.PA;
16 public class EnsemblSpeciesTest
18 @Test(groups = "Network")
19 public void testGetSpecies_ensembl()
21 Cache.log = Logger.getRootLogger();
22 EnsemblSpecies species = EnsemblSpecies.getSpecies(true);
23 System.out.println("Ensembllookup map size = "
24 + ((Map) PA.getValue(species, "lookup")).size());
26 List<EnsemblTaxon> matches = species.getNameMatches("homo sapiens");
27 assertEquals(matches.size(), 1);
28 EnsemblTaxon match = matches.get(0);
29 assertEquals(match.ncbiId, "9606");
31 matches = species.getNameMatches("mus ");
32 assertEquals(matches.size(), 6);
33 match = matches.get(0);
34 assertEquals(match.ncbiId, "10089");
35 assertEquals(match.name, "mus_caroli");
36 match = matches.get(1);
37 assertEquals(match.ncbiId, "10090");
38 assertEquals(match.commonName, "house mouse");
39 match = matches.get(2);
40 assertEquals(match.ncbiId, "10091");
41 assertEquals(match.displayName, "Mouse CAST/EiJ");
42 assertEquals(match.commonName, "south eastern house mouse");
45 @Test(groups = "Network")
46 public void testGetSpecies_ensemblGenomes()
48 Cache.log = Logger.getRootLogger();
49 EnsemblSpecies species = EnsemblSpecies.getSpecies(false);
50 System.out.println("EnsemblGenomes lookup map size = "
51 + ((Map) PA.getValue(species, "lookup")).size());
53 List<EnsemblTaxon> matches = species.getNameMatches("streptomyces al");
54 assertEquals(matches.size(), 12);
55 assertEquals(matches.get(0).ncbiId, "132473");
56 assertEquals(matches.get(0).name, "streptomyces_alboniger");
57 assertEquals(matches.get(1).ncbiId, "68570");
58 assertEquals(matches.get(1).displayName, "Streptomyces albulus");
59 assertEquals(matches.get(2).ncbiId, "68570");
60 assertEquals(matches.get(2).name, "streptomyces_albulus_gca_001646665");