inprogress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Nov 2013 20:46:17 +0000 (20:46 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Nov 2013 20:46:17 +0000 (20:46 +0000)
forester/java/src/org/forester/application/dom_dup.java
forester/java/src/org/forester/application/subtree_feature_count.java
forester/java/src/org/forester/phylogeny/data/Sequence.java

index f1a0a8d..64b4640 100644 (file)
@@ -189,7 +189,7 @@ public class dom_dup {
         System.out.println();
         System.out.println( PRG_NAME + "" );
         System.out.println();
-        System.out.println( " exmple: " );
+        System.out.println( " example: " );
         System.out.println();
         System.out
                 .println( "dom_dup \"HUMAN~[12]-2\" groups.txt RRMa_ALL_plus_RRMa_ee3_50_hmmalign_05_40_fme_gsdi.phylo.xml" );
index cde4cbb..c5fe6f7 100644 (file)
@@ -32,7 +32,7 @@ public class subtree_feature_count {
     public static void main( final String args[] ) {
         try {
             final CommandLineArguments cla = new CommandLineArguments( args );
-            if ( cla.isOptionSet( HELP_OPTION_1 ) || cla.isOptionSet( HELP_OPTION_2 ) || ( cla.getNumberOfNames() != 3 ) ) {
+            if ( cla.isOptionSet( HELP_OPTION_1 ) || cla.isOptionSet( HELP_OPTION_2 ) || ( args.length < 2 ) ) {
                 printHelp();
                 System.exit( 0 );
             }
@@ -121,7 +121,7 @@ public class subtree_feature_count {
         }
     }
 
-    private static PhylogenyNode moveUp( final PhylogenyNode node, final double depth ) {
+    private static PhylogenyNode moveUpOLd( final PhylogenyNode node, final double depth ) {
         PhylogenyNode n = node;
         double current_depth = 0.0;
         while ( current_depth < depth ) {
@@ -134,6 +134,16 @@ public class subtree_feature_count {
         return n;
     }
 
+    private static PhylogenyNode moveUp( final PhylogenyNode node, final double depth ) {
+        PhylogenyNode n = node;
+        PhylogenyNode prev = node;
+        while ( depth > n.calculateDistanceToRoot() ) {
+            prev = n;
+            n = n.getParent();
+        }
+        return prev;
+    }
+
     private static void printHelp() {
         ForesterUtil.printProgramInformation( PRG_NAME,
                                               PRG_DESC,
@@ -146,10 +156,8 @@ public class subtree_feature_count {
         System.out.println();
         System.out.println( PRG_NAME + "" );
         System.out.println();
-        System.out.println( " exmple: " );
+        System.out.println( " example: " );
         System.out.println();
-        System.out
-                .println( "dom_dup \"HUMAN~[12]-2\" groups.txt RRMa_ALL_plus_RRMa_ee3_50_hmmalign_05_40_fme_gsdi.phylo.xml" );
         System.out.println();
         System.out.println();
     }
index afc342b..525bc1b 100644 (file)
@@ -455,9 +455,6 @@ public class Sequence implements PhylogenyData, MultipleUris, Comparable<Sequenc
                 annotation.toPhyloXML( writer, level, my_ind );
             }
         }
-        if ( getDomainArchitecture() != null ) {
-            getDomainArchitecture().toPhyloXML( writer, level, my_ind );
-        }
         if ( ( getCrossReferences() != null ) && !getCrossReferences().isEmpty() ) {
             writer.write( ForesterUtil.LINE_SEPARATOR );
             writer.write( my_ind );
@@ -469,6 +466,9 @@ public class Sequence implements PhylogenyData, MultipleUris, Comparable<Sequenc
             writer.write( my_ind );
             PhylogenyDataUtil.appendClose( writer, PhyloXmlMapping.SEQUENCE_X_REFS );
         }
+        if ( getDomainArchitecture() != null ) {
+            getDomainArchitecture().toPhyloXML( writer, level, my_ind );
+        }
         writer.write( ForesterUtil.LINE_SEPARATOR );
         writer.write( indentation );
         PhylogenyDataUtil.appendClose( writer, PhyloXmlMapping.SEQUENCE );