can now do antialias on Mac OS.
[jalview.git] / forester / java / src / org / forester / go / TestGo.java
index 4fdcd29..593d06d 100644 (file)
@@ -5,7 +5,7 @@
 // Copyright (C) 2008-2009 Christian M. Zmasek
 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
 // All rights reserved
-// 
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 // Lesser General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 //
 // Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
 
 package org.forester.go;
 
@@ -31,7 +31,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.SortedSet;
 
-import org.forester.surfacing.DomainId;
 import org.forester.util.ForesterUtil;
 
 public class TestGo {
@@ -212,8 +211,7 @@ public class TestGo {
             if ( !g0.getComment().equals( "" ) ) {
                 return false;
             }
-            if ( !g0
-                    .getDefinition()
+            if ( !g0.getDefinition()
                     .equals( "\"The distribution of mitochondria, including the mitochondrial genome, into daughter cells after mitosis or meiosis, mediated by interactions between mitochondria and the cytoskeleton.\" [GOC:mcc, PMID:10873824, PMID:11389764]" ) ) {
                 return false;
             }
@@ -244,8 +242,7 @@ public class TestGo {
             if ( !g1.getComment().equals( "comment" ) ) {
                 return false;
             }
-            if ( !g1
-                    .getDefinition()
+            if ( !g1.getDefinition()
                     .equals( "\"The maintenance of the structure and integrity of the mitochondrial genome.\" [GOC:ai]" ) ) {
                 return false;
             }
@@ -358,11 +355,11 @@ public class TestGo {
 
     private static boolean testPfamToGoMapping() {
         try {
-            final PfamToGoMapping pg0 = new PfamToGoMapping( new DomainId( "A" ), new GoId( "GO:0000001" ) );
-            final PfamToGoMapping pg1 = new PfamToGoMapping( new DomainId( "A" ), new GoId( "GO:0000001" ) );
-            final PfamToGoMapping pg2 = new PfamToGoMapping( new DomainId( "B" ), new GoId( "GO:0000001" ) );
-            final PfamToGoMapping pg3 = new PfamToGoMapping( new DomainId( "A" ), new GoId( "GO:0000002" ) );
-            final PfamToGoMapping pg4 = new PfamToGoMapping( new DomainId( "B" ), new GoId( "GO:0000002" ) );
+            final PfamToGoMapping pg0 = new PfamToGoMapping( "A", new GoId( "GO:0000001" ) );
+            final PfamToGoMapping pg1 = new PfamToGoMapping( "A", new GoId( "GO:0000001" ) );
+            final PfamToGoMapping pg2 = new PfamToGoMapping( "B", new GoId( "GO:0000001" ) );
+            final PfamToGoMapping pg3 = new PfamToGoMapping( "A", new GoId( "GO:0000002" ) );
+            final PfamToGoMapping pg4 = new PfamToGoMapping( "B", new GoId( "GO:0000002" ) );
             if ( !pg0.equals( pg0 ) ) {
                 return false;
             }
@@ -398,7 +395,7 @@ public class TestGo {
     private static boolean testPfamToGoParser( final File test_dir ) {
         try {
             final PfamToGoParser parser = new PfamToGoParser( new File( test_dir + ForesterUtil.getFileSeparator()
-                    + "pfam_to_go_test" ) );
+                                                                        + "pfam_to_go_test" ) );
             final List<PfamToGoMapping> mappings = parser.parse();
             if ( parser.getMappingCount() != 426 ) {
                 return false;
@@ -414,55 +411,55 @@ public class TestGo {
             final PfamToGoMapping m5 = mappings.get( 5 );
             final PfamToGoMapping m424 = mappings.get( 424 );
             final PfamToGoMapping m425 = mappings.get( 425 );
-            if ( !m0.getKey().equals( new DomainId( "7tm_1" ) ) ) {
+            if ( !m0.getKey().equals( "7tm_1" ) ) {
                 return false;
             }
             if ( !m0.getValue().equals( new GoId( "GO:0001584" ) ) ) {
                 return false;
             }
-            if ( m0.getKey().equals( new DomainId( "7tm_x" ) ) ) {
+            if ( m0.getKey().equals( "7tm_x" ) ) {
                 return false;
             }
             if ( m0.getValue().equals( new GoId( "GO:0001585" ) ) ) {
                 return false;
             }
-            if ( !m1.getKey().equals( new DomainId( "7tm_1" ) ) ) {
+            if ( !m1.getKey().equals( "7tm_1" ) ) {
                 return false;
             }
             if ( !m1.getValue().equals( new GoId( "GO:0007186" ) ) ) {
                 return false;
             }
-            if ( !m2.getKey().equals( new DomainId( "7tm_1" ) ) ) {
+            if ( !m2.getKey().equals( "7tm_1" ) ) {
                 return false;
             }
             if ( !m2.getValue().equals( new GoId( "GO:0016021" ) ) ) {
                 return false;
             }
-            if ( !m3.getKey().equals( new DomainId( "7tm_2" ) ) ) {
+            if ( !m3.getKey().equals( "7tm_2" ) ) {
                 return false;
             }
             if ( !m3.getValue().equals( new GoId( "GO:0004930" ) ) ) {
                 return false;
             }
-            if ( !m4.getKey().equals( new DomainId( "7tm_2" ) ) ) {
+            if ( !m4.getKey().equals( "7tm_2" ) ) {
                 return false;
             }
             if ( !m4.getValue().equals( new GoId( "GO:0016020" ) ) ) {
                 return false;
             }
-            if ( !m5.getKey().equals( new DomainId( "7tm_3" ) ) ) {
+            if ( !m5.getKey().equals( "7tm_3" ) ) {
                 return false;
             }
             if ( !m5.getValue().equals( new GoId( "GO:0008067" ) ) ) {
                 return false;
             }
-            if ( !m424.getKey().equals( new DomainId( "OMPdecase" ) ) ) {
+            if ( !m424.getKey().equals( "OMPdecase" ) ) {
                 return false;
             }
             if ( !m424.getValue().equals( new GoId( "GO:0006207" ) ) ) {
                 return false;
             }
-            if ( !m425.getKey().equals( new DomainId( "Bac_DNA_binding" ) ) ) {
+            if ( !m425.getKey().equals( "Bac_DNA_binding" ) ) {
                 return false;
             }
             if ( !m425.getValue().equals( new GoId( "GO:0003677" ) ) ) {
@@ -479,7 +476,7 @@ public class TestGo {
     private static boolean testSuperTermCounting( final File test_dir ) {
         try {
             final OBOparser parser = new OBOparser( new File( test_dir + ForesterUtil.getFileSeparator()
-                    + "gene_ontology_edit.obo" ), OBOparser.ReturnType.BASIC_GO_TERM );
+                                                              + "gene_ontology_edit.obo" ), OBOparser.ReturnType.BASIC_GO_TERM );
             final List<GoTerm> all_go_terms = parser.parse();
             if ( parser.getGoTermCount() != 27748 ) {
                 return false;
@@ -488,23 +485,23 @@ public class TestGo {
             final List<GoTerm> categories = new ArrayList<GoTerm>();
             final List<GoTerm> experiment_set = new ArrayList<GoTerm>();
             experiment_set.add( new BasicGoTerm( new GoId( "GO:0005690" ), "snRNP U4atac", GoNameSpace
-                    .createUnassigned(), false ) );
+                                                 .createUnassigned(), false ) );
             experiment_set.add( new BasicGoTerm( new GoId( "GO:0009698" ),
                                                  "phenylpropanoid metabolic process",
                                                  GoNameSpace.createUnassigned(),
                                                  false ) );
             experiment_set.add( new BasicGoTerm( new GoId( "GO:0008150" ), "biological_process", GoNameSpace
-                    .createUnassigned(), false ) );
+                                                 .createUnassigned(), false ) );
             experiment_set.add( new BasicGoTerm( new GoId( "GO:0006915" ),
                                                  "apoptosis",
                                                  GoNameSpace.createUnassigned(),
                                                  false ) );
             experiment_set.add( new BasicGoTerm( new GoId( "GO:0001783" ), "B cell apoptosis", GoNameSpace
-                    .createUnassigned(), false ) );
+                                                 .createUnassigned(), false ) );
             experiment_set.add( new BasicGoTerm( new GoId( "GO:0010657" ), "muscle cell apoptosis", GoNameSpace
-                    .createUnassigned(), false ) );
+                                                 .createUnassigned(), false ) );
             experiment_set.add( new BasicGoTerm( new GoId( "GO:0010657" ), "muscle cell apoptosis", GoNameSpace
-                    .createUnassigned(), false ) );
+                                                 .createUnassigned(), false ) );
             experiment_set.add( new BasicGoTerm( new GoId( "GO:0010658" ),
                                                  "striated muscle cell apoptosis",
                                                  GoNameSpace.createUnassigned(),
@@ -514,25 +511,25 @@ public class TestGo {
                                                  GoNameSpace.createUnassigned(),
                                                  false ) );
             categories
-                    .add( new BasicGoTerm( new GoId( "GO:0016265" ), "death", GoNameSpace.createUnassigned(), false ) );
+            .add( new BasicGoTerm( new GoId( "GO:0016265" ), "death", GoNameSpace.createUnassigned(), false ) );
             categories.add( new BasicGoTerm( new GoId( "GO:0006915" ),
                                              "apoptosis",
                                              GoNameSpace.createUnassigned(),
                                              false ) );
             categories.add( new BasicGoTerm( new GoId( "GO:0008150" ), "biological_process", GoNameSpace
-                    .createUnassigned(), false ) );
+                                             .createUnassigned(), false ) );
             categories.add( new BasicGoTerm( new GoId( "GO:0010657" ), "muscle cell apoptosis", GoNameSpace
-                    .createUnassigned(), false ) );
+                                             .createUnassigned(), false ) );
             categories.add( new BasicGoTerm( new GoId( "GO:0010658" ), "striated muscle cell apoptosis", GoNameSpace
-                    .createUnassigned(), false ) );
+                                             .createUnassigned(), false ) );
             categories.add( new BasicGoTerm( new GoId( "GO:0046242" ), "o-xylene biosynthetic process", GoNameSpace
-                    .createUnassigned(), false ) );
+                                             .createUnassigned(), false ) );
             categories.add( new BasicGoTerm( new GoId( "GO:0016326" ), "kinesin motor activity", GoNameSpace
-                    .createUnassigned(), false ) );
+                                             .createUnassigned(), false ) );
             categories.add( new BasicGoTerm( new GoId( "GO:0005575" ), "cellular_component", GoNameSpace
-                    .createUnassigned(), false ) );
+                                             .createUnassigned(), false ) );
             categories.add( new BasicGoTerm( new GoId( "GO:0032502" ), "developmental process", GoNameSpace
-                    .createUnassigned(), false ) );
+                                             .createUnassigned(), false ) );
             categories.add( new BasicGoTerm( new GoId( "GO:0051094" ),
                                              "positive regulation of developmental process",
                                              GoNameSpace.createUnassigned(),
@@ -650,7 +647,7 @@ public class TestGo {
     private static boolean testSuperTermGetting( final File test_dir ) {
         try {
             final OBOparser parser = new OBOparser( new File( test_dir + ForesterUtil.getFileSeparator()
-                    + "gene_ontology_edit.obo" ), OBOparser.ReturnType.BASIC_GO_TERM );
+                                                              + "gene_ontology_edit.obo" ), OBOparser.ReturnType.BASIC_GO_TERM );
             final List<GoTerm> go_terms = parser.parse();
             if ( parser.getGoTermCount() != 27748 ) {
                 return false;