inprogress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 27 Nov 2013 18:10:08 +0000 (18:10 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 27 Nov 2013 18:10:08 +0000 (18:10 +0000)
forester/java/src/org/forester/application/surfacing.java
forester/java/src/org/forester/surfacing/AdjactantDirectedBinaryDomainCombination.java
forester/java/src/org/forester/surfacing/BasicBinaryDomainCombination.java
forester/java/src/org/forester/surfacing/DirectedBinaryDomainCombination.java

index 40fc471..ebecc7a 100644 (file)
@@ -87,6 +87,7 @@ public class surfacing {
 
     private static final int                                        MINIMAL_NUMBER_OF_SIMILARITIES_FOR_SPLITTING                                  = 1000;
     public final static String                                      DOMAIN_COMBINITONS_OUTPUT_OPTION_FOR_GRAPH_ANALYSIS                           = "graph_analysis_out";
+    public final static String                                      DOMAIN_COMBINITONS_COUNTS_OUTPUT_OPTION                                       = "dcc";
     public final static String                                      DOMAIN_COMBINITONS_OUTPUTFILE_SUFFIX_FOR_GRAPH_ANALYSIS                       = "_dc.dot";
     public final static String                                      PARSIMONY_OUTPUT_FITCH_PRESENT_BC_OUTPUTFILE_SUFFIX_FOR_GRAPH_ANALYSIS        = "_fitch_present_dc.dot";
     public final static String                                      DOMAIN_COMBINITON_COUNTS_OUTPUTFILE_SUFFIX                                    = ".dcc";
@@ -336,6 +337,7 @@ public class surfacing {
         allowed_options.add( SECONDARY_FEATURES_PARSIMONY_MAP_FILE );
         allowed_options.add( PLUS_MINUS_ANALYSIS_OPTION );
         allowed_options.add( DOMAIN_COMBINITONS_OUTPUT_OPTION_FOR_GRAPH_ANALYSIS );
+        allowed_options.add( DOMAIN_COMBINITONS_COUNTS_OUTPUT_OPTION );
         allowed_options.add( OUTPUT_LIST_OF_ALL_PROTEINS_OPTIONS );
         allowed_options.add( CONSIDER_DOMAIN_COMBINATION_DIRECTEDNESS_AND_ADJACENCY );
         allowed_options.add( WRITE_TO_NEXUS_OPTION );
@@ -376,6 +378,10 @@ public class surfacing {
         if ( cla.isOptionSet( DOMAIN_COMBINITONS_OUTPUT_OPTION_FOR_GRAPH_ANALYSIS ) ) {
             output_binary_domain_combinationsfor_graph_analysis = true;
         }
+        final boolean output_binary_domain_combinationsfor_counts = false;
+        if ( cla.isOptionSet( DOMAIN_COMBINITONS_COUNTS_OUTPUT_OPTION ) ) {
+            output_binary_domain_combinationsfor_graph_analysis = true;
+        }
         if ( cla.isOptionSet( surfacing.MAX_FS_E_VALUE_OPTION ) ) {
             try {
                 fs_e_value_max = cla.getOptionValueAsDouble( surfacing.MAX_FS_E_VALUE_OPTION );
@@ -1653,12 +1659,15 @@ public class surfacing {
                                          protein_length_stats_by_dc,
                                          domain_number_stats_by_dc ) );
                 if ( gwcd_list.get( i ).getSize() > 0 ) {
-                    SurfacingUtil.writeDomainCombinationsCountsFile( input_file_properties,
-                                                                     out_dir,
-                                                                     per_genome_domain_promiscuity_statistics_writer,
-                                                                     gwcd_list.get( i ),
-                                                                     i,
-                                                                     dc_sort_order );
+                    if ( output_binary_domain_combinationsfor_counts ) {
+                        SurfacingUtil
+                                .writeDomainCombinationsCountsFile( input_file_properties,
+                                                                    out_dir,
+                                                                    per_genome_domain_promiscuity_statistics_writer,
+                                                                    gwcd_list.get( i ),
+                                                                    i,
+                                                                    dc_sort_order );
+                    }
                     if ( output_binary_domain_combinationsfor_graph_analysis ) {
                         SurfacingUtil.writeBinaryDomainCombinationsFileForGraphAnalysis( input_file_properties,
                                                                                          out_dir,
@@ -2157,6 +2166,8 @@ public class surfacing {
         System.out.println( surfacing.SECONDARY_FEATURES_PARSIMONY_MAP_FILE
                 + "=<file>: to perfom parsimony analysis on secondary features" );
         System.out.println( surfacing.PLUS_MINUS_ANALYSIS_OPTION + "=<file>: to presence/absence genome analysis" );
+        System.out.println( surfacing.DOMAIN_COMBINITONS_COUNTS_OUTPUT_OPTION
+                + ": to output binary domain counts (as individual files)" );
         System.out.println( surfacing.DOMAIN_COMBINITONS_OUTPUT_OPTION_FOR_GRAPH_ANALYSIS
                 + ": to output binary domain combinations for (downstream) graph analysis" );
         System.out.println( surfacing.OUTPUT_LIST_OF_ALL_PROTEINS_OPTIONS + ": to output all proteins per domain" );
index 9b5ae80..fabf400 100644 (file)
@@ -66,6 +66,9 @@ public class AdjactantDirectedBinaryDomainCombination extends BasicBinaryDomainC
             final AdjactantDirectedBinaryDomainCombination dc = new AdjactantDirectedBinaryDomainCombination( n_terminal,
                                                                                                               c_terminal );
             ADDC_POOL.put( code, dc );
+            if ( VERBOSE && ( ADDC_POOL.size() % 100 == 0 ) ) {
+                System.out.println( " addc pool size: " + ADDC_POOL.size() );
+            }
             return dc;
         }
     }
index 47b4024..3d41e51 100644 (file)
@@ -35,6 +35,7 @@ import org.forester.util.ForesterUtil;
 
 public class BasicBinaryDomainCombination implements BinaryDomainCombination {
 
+    final static boolean                                            VERBOSE = true;
     final private static Map<Integer, BasicBinaryDomainCombination> DC_POOL = new HashMap<Integer, BasicBinaryDomainCombination>();
     final private static Map<Integer, String>                       S_POOL  = new HashMap<Integer, String>();
     short                                                           _id0;
@@ -176,9 +177,6 @@ public class BasicBinaryDomainCombination implements BinaryDomainCombination {
         else {
             final String s = getId0() + SEPARATOR + getId1();
             S_POOL.put( code, s );
-            if ( S_POOL.size() % 100 == 0 ) {
-                System.out.println( "ss=" + S_POOL.size() );
-            }
             return s;
         }
     }
@@ -208,8 +206,8 @@ public class BasicBinaryDomainCombination implements BinaryDomainCombination {
         else {
             final BasicBinaryDomainCombination dc = new BasicBinaryDomainCombination( id0, id1 );
             DC_POOL.put( code, dc );
-            if ( DC_POOL.size() % 100 == 0 ) {
-                System.out.println( "s=" + DC_POOL.size() );
+            if ( VERBOSE && ( DC_POOL.size() % 100 == 0 ) ) {
+                System.out.println( " dc pool size: " + DC_POOL.size() );
             }
             return dc;
         }
index 75abce7..a309603 100644 (file)
@@ -64,6 +64,9 @@ public class DirectedBinaryDomainCombination extends BasicBinaryDomainCombinatio
         else {
             final DirectedBinaryDomainCombination dc = new DirectedBinaryDomainCombination( n_terminal, c_terminal );
             DDC_POOL.put( code, dc );
+            if ( VERBOSE && ( DDC_POOL.size() % 100 == 0 ) ) {
+                System.out.println( " ddc pool size: " + DDC_POOL.size() );
+            }
             return dc;
         }
     }