From 71a5df9830e7ea6a5092f1fe2162d93e6341e18c Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 12 Feb 2016 16:53:14 +0000 Subject: [PATCH] JAL-1191 additions to SOLite, tweak to test --- src/jalview/io/gff/SequenceOntologyLite.java | 20 +++++++++++++++----- test/jalview/io/gff/SequenceOntologyTest.java | 14 +++++++++++--- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/jalview/io/gff/SequenceOntologyLite.java b/src/jalview/io/gff/SequenceOntologyLite.java index c0ae971..d2e6654 100644 --- a/src/jalview/io/gff/SequenceOntologyLite.java +++ b/src/jalview/io/gff/SequenceOntologyLite.java @@ -22,6 +22,9 @@ public class SequenceOntologyLite implements SequenceOntologyI { /* * initial selection of types of interest when processing Ensembl features + * NB unlike the full SequenceOntology we don't traverse indirect + * child-parent relationships here so e.g. need to list every sub-type + * of gene (direct or indirect) that is of interest */ // @formatter:off private final String[][] TERMS = new String[][] { @@ -32,15 +35,21 @@ public class SequenceOntologyLite implements SequenceOntologyI { "gene", "gene" }, { "ncRNA_gene", "gene" }, { "snRNA_gene", "gene" }, + { "miRNA_gene", "gene" }, + { "lincRNA_gene", "gene" }, /* * transcript sub-types: */ { "transcript", "transcript" }, { "mature_transcript", "transcript" }, + { "processed_transcript", "transcript" }, + { "aberrant_processed_transcript", "transcript" }, { "ncRNA", "transcript" }, { "snRNA", "transcript" }, - { "aberrant_processed_transcript", "transcript" }, + { "miRNA", "transcript" }, + { "lincRNA", "transcript" }, + // there are many more sub-types of ncRNA... /* * sequence_variant sub-types: @@ -55,8 +64,8 @@ public class SequenceOntologyLite implements SequenceOntologyI { "structural_variant", "sequence_variant" }, /* - * no sub-types of exon or CDS encountered in Ensembl - * a few added here for testing purposes + * no sub-types of exon or CDS yet seen in Ensembl + * some added here for testing purposes */ { "exon", "exon" }, { "coding_exon", "exon" }, @@ -64,10 +73,11 @@ public class SequenceOntologyLite implements SequenceOntologyI { "CDS_predicted", "CDS" }, /* - * used in exonerate GFF + * terms used in exonerate or PASA GFF */ { "protein_match", "protein_match"}, { "nucleotide_match", "nucleotide_match"}, + { "cDNA_match", "nucleotide_match"}, /* * used in InterProScan GFF @@ -169,7 +179,7 @@ public class SequenceOntologyLite implements SequenceOntologyI if (!termsNotFound.contains(term)) { System.out.println("SO term " + term - + " not known - either invalid or needs modelled in " + + " not known - may be invalid, or model if needed in " + getClass().getName()); termsNotFound.add(term); } diff --git a/test/jalview/io/gff/SequenceOntologyTest.java b/test/jalview/io/gff/SequenceOntologyTest.java index f791a1e..0b72515 100644 --- a/test/jalview/io/gff/SequenceOntologyTest.java +++ b/test/jalview/io/gff/SequenceOntologyTest.java @@ -3,20 +3,28 @@ package jalview.io.gff; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; -import org.testng.annotations.BeforeMethod; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class SequenceOntologyTest { private SequenceOntologyI so; - @BeforeMethod + @BeforeClass public void setUp() { long now = System.currentTimeMillis(); - so = SequenceOntologyFactory.getInstance(); + SequenceOntologyFactory.setInstance(new SequenceOntology()); long elapsed = System.currentTimeMillis() - now; System.out.println("Load and cache of Sequence Ontology took " + elapsed + "ms"); + so = SequenceOntologyFactory.getInstance(); + } + + @AfterClass + public void tearDown() + { + SequenceOntologyFactory.setInstance(null); } @Test(groups = "Functional") -- 1.7.10.2