JAL-1191 isolated SequenceOntology (BioJava wrapper) to /ext/so folder
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 22 Mar 2016 13:57:29 +0000 (13:57 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 22 Mar 2016 13:57:29 +0000 (13:57 +0000)
build.xml
src/jalview/ext/so/SequenceOntology.java [moved from src/jalview/io/gff/SequenceOntology.java with 98% similarity]
src/jalview/io/gff/Gff3Helper.java
test/jalview/ext/so/SequenceOntologyTest.java [moved from test/jalview/io/gff/SequenceOntologyTest.java with 94% similarity]

index 43bab6f..b23293f 100755 (executable)
--- a/build.xml
+++ b/build.xml
 
 <target name="compileApplet" depends="init,clean">
   <mkdir dir="${outputDir}" />
-  <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="jalviewlite.deps" includes="jalview/appletgui/**" excludes="ext/**,gui/**,jbgui/**,MCview/**,org/**,vamsas/**,jalview/ext/rbvi/**,jalview/ext/paradise/**" />
+  <javac source="${javac.source}" target="${javac.target}" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" classpathref="jalviewlite.deps" includes="jalview/appletgui/**" excludes="ext/**,gui/**,jbgui/**,MCview/**,org/**,vamsas/**,jalview/ext/rbvi/**,jalview/ext/paradise/**,jalview/ext/ensembl/**,jalview/ext/so" />
 </target>
 
 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
similarity index 98%
rename from src/jalview/io/gff/SequenceOntology.java
rename to src/jalview/ext/so/SequenceOntology.java
index b069eef..af80b7a 100644 (file)
@@ -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<String>();
     termsNotFound = new ArrayList<String>();
index bd34d3c..031900d 100644 (file)
@@ -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"), ",");
     }
@@ -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;