phylotastic hackathon at NESCENT 120606
authorcmzmasek <cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 6 Jun 2012 14:08:15 +0000 (14:08 +0000)
committercmzmasek <cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 6 Jun 2012 14:08:15 +0000 (14:08 +0000)
forester/java/src/org/forester/test/Test.java
forester/java/src/org/forester/util/SequenceIdParser.java

index adcbac9..9069693 100644 (file)
@@ -103,6 +103,7 @@ import org.forester.util.DescriptiveStatistics;
 import org.forester.util.ForesterConstants;
 import org.forester.util.ForesterUtil;
 import org.forester.util.GeneralTable;
+import org.forester.util.SequenceIdParser;
 import org.forester.ws.uniprot.DatabaseTools;
 import org.forester.ws.uniprot.SequenceDatabaseEntry;
 import org.forester.ws.uniprot.UniProtTaxonomy;
@@ -171,6 +172,19 @@ public final class Test {
             System.exit( -1 );
         }
         final long start_time = new Date().getTime();
+        
+        
+       
+        System.out.print( "Sequence id parsing: " );
+        if (  testSequenceIdParsing() ) {
+            System.out.println( "OK." );
+            succeeded++;
+        }
+        else {
+            System.out.println( "failed." );
+            System.exit( -1 ); //TODO FIXME remove me!! ~
+            failed++;
+        }
         System.out.print( "Hmmscan output parser: " );
         if ( testHmmscanOutputParser() ) {
             System.out.println( "OK." );
@@ -8907,4 +8921,18 @@ public final class Test {
         }
         return true;
     }
+    
+    private static boolean testSequenceIdParsing() {
+        try {
+            Identifier id = SequenceIdParser.parse( "mites|ref_XP_002434188_1" );
+            if ( id == null || ForesterUtil.isEmpty( id.getValue() ) || !id.getValue().equals( "002434188_1" ) ) {
+                return false;
+            }
+        }
+        catch ( final Exception e ) {
+            e.printStackTrace( System.out );
+            return false;
+        }
+        return true;
+    }
 }
index 09e208a..b8bebe1 100644 (file)
@@ -28,6 +28,8 @@
 \r
 package org.forester.util;\r
 \r
+import org.forester.phylogeny.data.Identifier;\r
+\r
 public final class SequenceIdParser {\r
 \r
     \r
@@ -41,8 +43,16 @@ public final class SequenceIdParser {
     // lcl_91970_unknown_\r
     \r
     \r
+    public final static Identifier parse( final String s ) {\r
+        \r
+        return null;\r
+    }\r
+    \r
     \r
     private SequenceIdParser() {\r
         // Hiding the constructor.\r
     }\r
+    \r
+    \r
+    \r
 }\r