From d3d566fbf876a3511c06fecec695b2f59eb71169 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 22 Mar 2016 13:57:29 +0000 Subject: [PATCH] JAL-1191 isolated SequenceOntology (BioJava wrapper) to /ext/so folder --- build.xml | 2 +- src/jalview/{io/gff => ext/so}/SequenceOntology.java | 8 +++++--- src/jalview/io/gff/Gff3Helper.java | 6 +++--- test/jalview/{io/gff => ext/so}/SequenceOntologyTest.java | 6 +++++- 4 files changed, 14 insertions(+), 8 deletions(-) rename src/jalview/{io/gff => ext/so}/SequenceOntology.java (98%) rename test/jalview/{io/gff => ext/so}/SequenceOntologyTest.java (94%) diff --git a/build.xml b/build.xml index 43bab6f..b23293f 100755 --- a/build.xml +++ b/build.xml @@ -570,7 +570,7 @@ - + diff --git a/src/jalview/io/gff/SequenceOntology.java b/src/jalview/ext/so/SequenceOntology.java similarity index 98% rename from src/jalview/io/gff/SequenceOntology.java rename to src/jalview/ext/so/SequenceOntology.java index b069eef..af80b7a 100644 --- a/src/jalview/io/gff/SequenceOntology.java +++ b/src/jalview/ext/so/SequenceOntology.java @@ -1,4 +1,6 @@ -package jalview.io.gff; +package jalview.ext.so; + +import jalview.io.gff.SequenceOntologyI; import java.io.BufferedInputStream; import java.io.BufferedReader; @@ -26,7 +28,7 @@ import org.biojava.nbio.ontology.utils.Annotation; * A wrapper class that parses the Sequence Ontology and exposes useful access * methods. This version uses the BioJava parser. */ -class SequenceOntology implements SequenceOntologyI +public class SequenceOntology implements SequenceOntologyI { /* * the parsed Ontology data as modelled by BioJava @@ -58,7 +60,7 @@ class SequenceOntology implements SequenceOntologyI * Package private constructor to enforce use of singleton. Parses and caches * the SO OBO data file. */ - SequenceOntology() + public SequenceOntology() { termsFound = new ArrayList(); termsNotFound = new ArrayList(); diff --git a/src/jalview/io/gff/Gff3Helper.java b/src/jalview/io/gff/Gff3Helper.java index bd34d3c..031900d 100644 --- a/src/jalview/io/gff/Gff3Helper.java +++ b/src/jalview/io/gff/Gff3Helper.java @@ -5,7 +5,6 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.MappingType; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; -import jalview.ext.ensembl.EnsemblSeqProxy; import jalview.util.MapList; import jalview.util.StringUtils; @@ -388,8 +387,9 @@ public class Gff3Helper extends GffHelperBase * extract 'Name' for a transcript (to show gene name) * or an exon (so 'colour by label' shows exon boundaries) */ - if (EnsemblSeqProxy.isTranscript(type) - || so.isA(type, SequenceOntology.EXON)) + if (SequenceOntologyI.NMD_TRANSCRIPT_VARIANT.equals(type) + || so.isA(type, SequenceOntologyI.TRANSCRIPT) + || so.isA(type, SequenceOntologyI.EXON)) { desc = StringUtils.listToDelimitedString(attributes.get("Name"), ","); } diff --git a/test/jalview/io/gff/SequenceOntologyTest.java b/test/jalview/ext/so/SequenceOntologyTest.java similarity index 94% rename from test/jalview/io/gff/SequenceOntologyTest.java rename to test/jalview/ext/so/SequenceOntologyTest.java index 0b72515..be07485 100644 --- a/test/jalview/io/gff/SequenceOntologyTest.java +++ b/test/jalview/ext/so/SequenceOntologyTest.java @@ -1,8 +1,12 @@ -package jalview.io.gff; +package jalview.ext.so; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; +import jalview.ext.so.SequenceOntology; +import jalview.io.gff.SequenceOntologyFactory; +import jalview.io.gff.SequenceOntologyI; + import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -- 1.7.10.2