cleanup
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Mon, 23 Apr 2012 18:03:22 +0000 (18:03 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Mon, 23 Apr 2012 18:03:22 +0000 (18:03 +0000)
forester/java/src/org/forester/application/surfacing.java
forester/java/src/org/forester/surfacing/DomainParsimonyCalculator.java
forester/java/src/org/forester/surfacing/SurfacingUtil.java

index ed54586..c19902f 100644 (file)
@@ -99,192 +99,192 @@ import org.forester.util.ForesterUtil;
 
 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_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";
+    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_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";
     // gain/loss:
-    public final static String                                PARSIMONY_OUTPUT_GL_SUFFIX_DOLLO_DOMAINS                               = "_dollo_gl_d";
-    public final static String                                PARSIMONY_OUTPUT_GL_SUFFIX_DOLLO_BINARY_COMBINATIONS                   = "_dollo_gl_dc";
-    public final static String                                PARSIMONY_OUTPUT_GL_SUFFIX_FITCH_DOMAINS                               = "_fitch_gl_d";
-    public final static String                                PARSIMONY_OUTPUT_GL_SUFFIX_FITCH_BINARY_COMBINATIONS                   = "_fitch_gl_dc";
+    public final static String                                PARSIMONY_OUTPUT_GL_SUFFIX_DOLLO_DOMAINS                                      = "_dollo_gl_d";
+    public final static String                                PARSIMONY_OUTPUT_GL_SUFFIX_DOLLO_BINARY_COMBINATIONS                          = "_dollo_gl_dc";
+    public final static String                                PARSIMONY_OUTPUT_GL_SUFFIX_FITCH_DOMAINS                                      = "_fitch_gl_d";
+    public final static String                                PARSIMONY_OUTPUT_GL_SUFFIX_FITCH_BINARY_COMBINATIONS                          = "_fitch_gl_dc";
     // gain/loss counts:
-    public final static String                                PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_DOLLO_DOMAINS                        = "_dollo_glc_d";
-    public final static String                                PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_DOLLO_BINARY_COMBINATIONS            = "_dollo_glc_dc";
-    public final static String                                PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_FITCH_DOMAINS                        = "_fitch_glc_d";
-    public final static String                                PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_FITCH_BINARY_COMBINATIONS            = "_fitch_glc_dc";
+    public final static String                                PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_DOLLO_DOMAINS                               = "_dollo_glc_d";
+    public final static String                                PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_DOLLO_BINARY_COMBINATIONS                   = "_dollo_glc_dc";
+    public final static String                                PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_FITCH_DOMAINS                               = "_fitch_glc_d";
+    public final static String                                PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_FITCH_BINARY_COMBINATIONS                   = "_fitch_glc_dc";
     // tables:
-    public final static String                                PARSIMONY_OUTPUT_FITCH_GAINS_BC                                        = "_fitch_gains_dc";
-    public final static String                                PARSIMONY_OUTPUT_FITCH_GAINS_HTML_BC                                   = "_fitch_gains_dc.html";
-    public final static String                                PARSIMONY_OUTPUT_FITCH_LOSSES_BC                                       = "_fitch_losses_dc";
-    public final static String                                PARSIMONY_OUTPUT_FITCH_LOSSES_HTML_BC                                  = "_fitch_losses_dc.html";
-    public final static String                                PARSIMONY_OUTPUT_FITCH_PRESENT_BC                                      = "_fitch_present_dc";
-    public final static String                                PARSIMONY_OUTPUT_FITCH_PRESENT_HTML_BC                                 = "_fitch_present_dc.html";
-    public final static String                                PARSIMONY_OUTPUT_DOLLO_GAINS_D                                         = "_dollo_gains_d";
-    public final static String                                PARSIMONY_OUTPUT_DOLLO_GAINS_HTML_D                                    = "_dollo_gains_d.html";
-    public final static String                                PARSIMONY_OUTPUT_DOLLO_LOSSES_D                                        = "_dollo_losses_d";
-    public final static String                                PARSIMONY_OUTPUT_DOLLO_LOSSES_HTML_D                                   = "_dollo_losses_d.html";
-    public final static String                                PARSIMONY_OUTPUT_DOLLO_PRESENT_D                                       = "_dollo_present_d";
-    public final static String                                PARSIMONY_OUTPUT_DOLLO_PRESENT_HTML_D                                  = "_dollo_present_d.html";
-    public final static String                                DOMAINS_PRESENT_NEXUS                                                  = "_dom.nex";
-    public final static String                                BDC_PRESENT_NEXUS                                                      = "_dc.nex";
+    public final static String                                PARSIMONY_OUTPUT_FITCH_GAINS_BC                                               = "_fitch_gains_dc";
+    public final static String                                PARSIMONY_OUTPUT_FITCH_GAINS_HTML_BC                                          = "_fitch_gains_dc.html";
+    public final static String                                PARSIMONY_OUTPUT_FITCH_LOSSES_BC                                              = "_fitch_losses_dc";
+    public final static String                                PARSIMONY_OUTPUT_FITCH_LOSSES_HTML_BC                                         = "_fitch_losses_dc.html";
+    public final static String                                PARSIMONY_OUTPUT_FITCH_PRESENT_BC                                             = "_fitch_present_dc";
+    public final static String                                PARSIMONY_OUTPUT_FITCH_PRESENT_HTML_BC                                        = "_fitch_present_dc.html";
+    public final static String                                PARSIMONY_OUTPUT_DOLLO_GAINS_D                                                = "_dollo_gains_d";
+    public final static String                                PARSIMONY_OUTPUT_DOLLO_GAINS_HTML_D                                           = "_dollo_gains_d.html";
+    public final static String                                PARSIMONY_OUTPUT_DOLLO_LOSSES_D                                               = "_dollo_losses_d";
+    public final static String                                PARSIMONY_OUTPUT_DOLLO_LOSSES_HTML_D                                          = "_dollo_losses_d.html";
+    public final static String                                PARSIMONY_OUTPUT_DOLLO_PRESENT_D                                              = "_dollo_present_d";
+    public final static String                                PARSIMONY_OUTPUT_DOLLO_PRESENT_HTML_D                                         = "_dollo_present_d.html";
+    public final static String                                DOMAINS_PRESENT_NEXUS                                                         = "_dom.nex";
+    public final static String                                BDC_PRESENT_NEXUS                                                             = "_dc.nex";
     // ---
-    public final static String                                PRG_NAME                                                               = "surfacing";
-    public static final String                                DOMAINS_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO                             = "_d_dollo"
-                                                                                                                                             + ForesterConstants.PHYLO_XML_SUFFIX;
-    public static final String                                DOMAINS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH                             = "_d_fitch"
-                                                                                                                                             + ForesterConstants.PHYLO_XML_SUFFIX;
-    public static final String                                BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO          = "_dc_dollo"
-                                                                                                                                             + ForesterConstants.PHYLO_XML_SUFFIX;
-    public static final String                                BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH          = "_dc_fitch"
-                                                                                                                                             + ForesterConstants.PHYLO_XML_SUFFIX;
-    public static final String                                NEXUS_EXTERNAL_DOMAINS                                                 = "_dom.nex";
-    public static final String                                NEXUS_EXTERNAL_DOMAIN_COMBINATIONS                                     = "_dc.nex";
-    public static final String                                NEXUS_SECONDARY_FEATURES                                               = "_secondary_features.nex";
-    public static final String                                PARSIMONY_OUTPUT_GL_SUFFIX_DOLLO_SECONDARY_FEATURES                    = "_dollo_gl_secondary_features";
-    public static final String                                PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_DOLLO_SECONDARY_FEATURES             = "_dollo_glc_secondary_features";
-    public static final String                                PARSIMONY_OUTPUT_DOLLO_GAINS_SECONDARY_FEATURES                        = "_dollo_gains_secondary_features";
-    public static final String                                PARSIMONY_OUTPUT_DOLLO_LOSSES_SECONDARY_FEATURES                       = "_dollo_losses_secondary_features";
-    public static final String                                PARSIMONY_OUTPUT_DOLLO_PRESENT_SECONDARY_FEATURES                      = "_dollo_present_secondary_features";
-    public static final String                                SECONDARY_FEATURES_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO                  = "_secondary_features_dollo"
-                                                                                                                                             + ForesterConstants.PHYLO_XML_SUFFIX;
-    public static final String                                PARSIMONY_OUTPUT_DOLLO_ALL_GOID_D_ALL_NAMESPACES                       = "_dollo_goid_d";
-    public static final String                                PARSIMONY_OUTPUT_FITCH_ALL_GOID_BC_ALL_NAMESPACES                      = "_fitch_goid_dc";
-    final static private String                               HELP_OPTION_1                                                          = "help";
-    final static private String                               HELP_OPTION_2                                                          = "h";
-    final static private String                               OUTPUT_DIR_OPTION                                                      = "out_dir";
-    final static private String                               SCORING_OPTION                                                         = "scoring";
-    private static final DomainSimilarityScoring              SCORING_DEFAULT                                                        = DomainSimilarity.DomainSimilarityScoring.COMBINATIONS;
-    final static private String                               SCORING_DOMAIN_COUNT_BASED                                             = "domains";
-    final static private String                               SCORING_PROTEIN_COUNT_BASED                                            = "proteins";
-    final static private String                               SCORING_COMBINATION_BASED                                              = "combinations";
-    final static private String                               DETAILEDNESS_OPTION                                                    = "detail";
-    private final static Detailedness                         DETAILEDNESS_DEFAULT                                                   = DomainSimilarityCalculator.Detailedness.PUNCTILIOUS;
-    final static private String                               SPECIES_MATRIX_OPTION                                                  = "smatrix";
-    final static private String                               DETAILEDNESS_BASIC                                                     = "basic";
-    final static private String                               DETAILEDNESS_LIST_IDS                                                  = "list_ids";
-    final static private String                               DETAILEDNESS_PUNCTILIOUS                                               = "punctilious";
-    final static private String                               DOMAIN_SIMILARITY_SORT_OPTION                                          = "sort";
-    private static final DomainSimilaritySortField            DOMAIN_SORT_FILD_DEFAULT                                               = DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID;
-    final static private String                               DOMAIN_SIMILARITY_SORT_MIN                                             = "min";
-    final static private String                               DOMAIN_SIMILARITY_SORT_MAX                                             = "max";
-    final static private String                               DOMAIN_SIMILARITY_SORT_SD                                              = "sd";
-    final static private String                               DOMAIN_SIMILARITY_SORT_MEAN                                            = "mean";
-    final static private String                               DOMAIN_SIMILARITY_SORT_DIFF                                            = "diff";
-    final static private String                               DOMAIN_SIMILARITY_SORT_COUNTS_DIFF                                     = "count_diff";
-    final static private String                               DOMAIN_SIMILARITY_SORT_ABS_COUNTS_DIFF                                 = "abs_count_diff";
-    final static private String                               DOMAIN_SIMILARITY_SORT_SPECIES_COUNT                                   = "species";
-    final static private String                               DOMAIN_SIMILARITY_SORT_ALPHA                                           = "alpha";
-    final static private String                               DOMAIN_SIMILARITY_SORT_BY_SPECIES_COUNT_FIRST_OPTION                   = "species_first";
-    final static private String                               DOMAIN_COUNT_SORT_OPTION                                               = "dc_sort";
-    private static final GenomeWideCombinableDomainsSortOrder DOMAINS_SORT_ORDER_DEFAULT                                             = GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder.ALPHABETICAL_KEY_ID;
-    final static private String                               DOMAIN_COUNT_SORT_ALPHA                                                = "alpha";
-    final static private String                               DOMAIN_COUNT_SORT_KEY_DOMAIN_COUNT                                     = "dom";
-    final static private String                               DOMAIN_COUNT_SORT_KEY_DOMAIN_PROTEINS_COUNT                            = "prot";
-    final static private String                               DOMAIN_COUNT_SORT_COMBINATIONS_COUNT                                   = "comb";
-    final static private String                               CUTOFF_SCORE_FILE_OPTION                                               = "cos";
-    final static private String                               NOT_IGNORE_DUFS_OPTION                                                 = "dufs";
-    final static private String                               MAX_E_VALUE_OPTION                                                     = "e";
-    final static private String                               MAX_ALLOWED_OVERLAP_OPTION                                             = "mo";
-    final static private String                               NO_ENGULFING_OVERLAP_OPTION                                            = "no_eo";
-    final static private String                               IGNORE_COMBINATION_WITH_SAME_OPTION                                    = "ignore_self_comb";
-    final static private String                               PAIRWISE_DOMAIN_COMPARISONS_PREFIX                                     = "pwc_";
-    final static private String                               PAIRWISE_DOMAIN_COMPARISONS_OPTION                                     = "pwc";
-    final static private String                               OUTPUT_FILE_OPTION                                                     = "o";
-    final static private String                               PFAM_TO_GO_FILE_USE_OPTION                                             = "p2g";
-    final static private String                               GO_OBO_FILE_USE_OPTION                                                 = "obo";
-    final static private String                               GO_NAMESPACE_LIMIT_OPTION                                              = "go_namespace";
-    final static private String                               GO_NAMESPACE_LIMIT_OPTION_MOLECULAR_FUNCTION                           = "molecular_function";
-    final static private String                               GO_NAMESPACE_LIMIT_OPTION_BIOLOGICAL_PROCESS                           = "biological_process";
-    final static private String                               GO_NAMESPACE_LIMIT_OPTION_CELLULAR_COMPONENT                           = "cellular_component";
-    final static private String                               SECONDARY_FEATURES_PARSIMONY_MAP_FILE                                  = "secondary";
-    final static private String                               DOMAIN_SIMILARITY_PRINT_OPTION_SIMPLE_TAB_DELIMITED                    = "simple_tab";
-    final static private String                               DOMAIN_SIMILARITY_PRINT_OPTION_SIMPLE_HTML                             = "simple_html";
-    final static private String                               DOMAIN_SIMILARITY_PRINT_OPTION_DETAILED_HTML                           = "detailed_html";
-    final static private String                               DOMAIN_SIMILARITY_PRINT_OPTION                                         = "ds_output";
-    private static final PRINT_OPTION                         DOMAIN_SIMILARITY_PRINT_OPTION_DEFAULT                                 = PrintableDomainSimilarity.PRINT_OPTION.HTML;
-    final static private String                               IGNORE_DOMAINS_WITHOUT_COMBINATIONS_IN_ALL_SPECIES_OPTION              = "ignore_singlet_domains";
-    final static private String                               IGNORE_VIRAL_IDS                                                       = "ignore_viral_ids";
-    final static private boolean                              IGNORE_DOMAINS_WITHOUT_COMBINATIONS_IN_ALL_SPECIES_DEFAULT             = false;
-    final static private String                               IGNORE_DOMAINS_SPECIFIC_TO_ONE_SPECIES_OPTION                          = "ignore_species_specific_domains";
-    final static private boolean                              IGNORE_DOMAINS_SPECIFIC_TO_ONE_SPECIES_OPTION_DEFAULT                  = false;
-    final static private String                               MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX                         = "_mean_score.pwd";
-    final static private String                               MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX                     = "_domains.pwd";
-    final static private String                               MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX            = "_bin_combinations.pwd";
-    final static private String                               NJ_TREE_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX                        = "_mean_score_NJ"
-                                                                                                                                             + ForesterConstants.PHYLO_XML_SUFFIX;
-    final static private String                               NJ_TREE_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX                    = "_domains_NJ"
-                                                                                                                                             + ForesterConstants.PHYLO_XML_SUFFIX;
-    final static private String                               NJ_TREE_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX           = "_bin_combinations_NJ"
-                                                                                                                                             + ForesterConstants.PHYLO_XML_SUFFIX;
-    final static private String                               JACKNIFE_OPTION                                                        = "jack";
-    final static private String                               JACKNIFE_RANDOM_SEED_OPTION                                            = "seed";
-    final static private String                               JACKNIFE_RATIO_OPTION                                                  = "jack_ratio";
-    private static final int                                  JACKNIFE_NUMBER_OF_RESAMPLINGS_DEFAULT                                 = 100;
-    final static private long                                 JACKNIFE_RANDOM_SEED_DEFAULT                                           = 19;
-    final static private double                               JACKNIFE_RATIO_DEFAULT                                                 = 0.5;
+    public final static String                                PRG_NAME                                                                      = "surfacing";
+    public static final String                                DOMAINS_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO                                    = "_d_dollo"
+                                                                                                                                                    + ForesterConstants.PHYLO_XML_SUFFIX;
+    public static final String                                DOMAINS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH                                    = "_d_fitch"
+                                                                                                                                                    + ForesterConstants.PHYLO_XML_SUFFIX;
+    public static final String                                BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO                 = "_dc_dollo"
+                                                                                                                                                    + ForesterConstants.PHYLO_XML_SUFFIX;
+    public static final String                                BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH                 = "_dc_fitch"
+                                                                                                                                                    + ForesterConstants.PHYLO_XML_SUFFIX;
+    public static final String                                NEXUS_EXTERNAL_DOMAINS                                                        = "_dom.nex";
+    public static final String                                NEXUS_EXTERNAL_DOMAIN_COMBINATIONS                                            = "_dc.nex";
+    public static final String                                NEXUS_SECONDARY_FEATURES                                                      = "_secondary_features.nex";
+    public static final String                                PARSIMONY_OUTPUT_GL_SUFFIX_DOLLO_SECONDARY_FEATURES                           = "_dollo_gl_secondary_features";
+    public static final String                                PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_DOLLO_SECONDARY_FEATURES                    = "_dollo_glc_secondary_features";
+    public static final String                                PARSIMONY_OUTPUT_DOLLO_GAINS_SECONDARY_FEATURES                               = "_dollo_gains_secondary_features";
+    public static final String                                PARSIMONY_OUTPUT_DOLLO_LOSSES_SECONDARY_FEATURES                              = "_dollo_losses_secondary_features";
+    public static final String                                PARSIMONY_OUTPUT_DOLLO_PRESENT_SECONDARY_FEATURES                             = "_dollo_present_secondary_features";
+    public static final String                                SECONDARY_FEATURES_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO                         = "_secondary_features_dollo"
+                                                                                                                                                    + ForesterConstants.PHYLO_XML_SUFFIX;
+    public static final String                                PARSIMONY_OUTPUT_DOLLO_ALL_GOID_D_ALL_NAMESPACES                              = "_dollo_goid_d";
+    public static final String                                PARSIMONY_OUTPUT_FITCH_ALL_GOID_BC_ALL_NAMESPACES                             = "_fitch_goid_dc";
+    final static private String                               HELP_OPTION_1                                                                 = "help";
+    final static private String                               HELP_OPTION_2                                                                 = "h";
+    final static private String                               OUTPUT_DIR_OPTION                                                             = "out_dir";
+    final static private String                               SCORING_OPTION                                                                = "scoring";
+    private static final DomainSimilarityScoring              SCORING_DEFAULT                                                               = DomainSimilarity.DomainSimilarityScoring.COMBINATIONS;
+    final static private String                               SCORING_DOMAIN_COUNT_BASED                                                    = "domains";
+    final static private String                               SCORING_PROTEIN_COUNT_BASED                                                   = "proteins";
+    final static private String                               SCORING_COMBINATION_BASED                                                     = "combinations";
+    final static private String                               DETAILEDNESS_OPTION                                                           = "detail";
+    private final static Detailedness                         DETAILEDNESS_DEFAULT                                                          = DomainSimilarityCalculator.Detailedness.PUNCTILIOUS;
+    final static private String                               SPECIES_MATRIX_OPTION                                                         = "smatrix";
+    final static private String                               DETAILEDNESS_BASIC                                                            = "basic";
+    final static private String                               DETAILEDNESS_LIST_IDS                                                         = "list_ids";
+    final static private String                               DETAILEDNESS_PUNCTILIOUS                                                      = "punctilious";
+    final static private String                               DOMAIN_SIMILARITY_SORT_OPTION                                                 = "sort";
+    private static final DomainSimilaritySortField            DOMAIN_SORT_FILD_DEFAULT                                                      = DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID;
+    final static private String                               DOMAIN_SIMILARITY_SORT_MIN                                                    = "min";
+    final static private String                               DOMAIN_SIMILARITY_SORT_MAX                                                    = "max";
+    final static private String                               DOMAIN_SIMILARITY_SORT_SD                                                     = "sd";
+    final static private String                               DOMAIN_SIMILARITY_SORT_MEAN                                                   = "mean";
+    final static private String                               DOMAIN_SIMILARITY_SORT_DIFF                                                   = "diff";
+    final static private String                               DOMAIN_SIMILARITY_SORT_COUNTS_DIFF                                            = "count_diff";
+    final static private String                               DOMAIN_SIMILARITY_SORT_ABS_COUNTS_DIFF                                        = "abs_count_diff";
+    final static private String                               DOMAIN_SIMILARITY_SORT_SPECIES_COUNT                                          = "species";
+    final static private String                               DOMAIN_SIMILARITY_SORT_ALPHA                                                  = "alpha";
+    final static private String                               DOMAIN_SIMILARITY_SORT_BY_SPECIES_COUNT_FIRST_OPTION                          = "species_first";
+    final static private String                               DOMAIN_COUNT_SORT_OPTION                                                      = "dc_sort";
+    private static final GenomeWideCombinableDomainsSortOrder DOMAINS_SORT_ORDER_DEFAULT                                                    = GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder.ALPHABETICAL_KEY_ID;
+    final static private String                               DOMAIN_COUNT_SORT_ALPHA                                                       = "alpha";
+    final static private String                               DOMAIN_COUNT_SORT_KEY_DOMAIN_COUNT                                            = "dom";
+    final static private String                               DOMAIN_COUNT_SORT_KEY_DOMAIN_PROTEINS_COUNT                                   = "prot";
+    final static private String                               DOMAIN_COUNT_SORT_COMBINATIONS_COUNT                                          = "comb";
+    final static private String                               CUTOFF_SCORE_FILE_OPTION                                                      = "cos";
+    final static private String                               NOT_IGNORE_DUFS_OPTION                                                        = "dufs";
+    final static private String                               MAX_E_VALUE_OPTION                                                            = "e";
+    final static private String                               MAX_ALLOWED_OVERLAP_OPTION                                                    = "mo";
+    final static private String                               NO_ENGULFING_OVERLAP_OPTION                                                   = "no_eo";
+    final static private String                               IGNORE_COMBINATION_WITH_SAME_OPTION                                           = "ignore_self_comb";
+    final static private String                               PAIRWISE_DOMAIN_COMPARISONS_PREFIX                                            = "pwc_";
+    final static private String                               PAIRWISE_DOMAIN_COMPARISONS_OPTION                                            = "pwc";
+    final static private String                               OUTPUT_FILE_OPTION                                                            = "o";
+    final static private String                               PFAM_TO_GO_FILE_USE_OPTION                                                    = "p2g";
+    final static private String                               GO_OBO_FILE_USE_OPTION                                                        = "obo";
+    final static private String                               GO_NAMESPACE_LIMIT_OPTION                                                     = "go_namespace";
+    final static private String                               GO_NAMESPACE_LIMIT_OPTION_MOLECULAR_FUNCTION                                  = "molecular_function";
+    final static private String                               GO_NAMESPACE_LIMIT_OPTION_BIOLOGICAL_PROCESS                                  = "biological_process";
+    final static private String                               GO_NAMESPACE_LIMIT_OPTION_CELLULAR_COMPONENT                                  = "cellular_component";
+    final static private String                               SECONDARY_FEATURES_PARSIMONY_MAP_FILE                                         = "secondary";
+    final static private String                               DOMAIN_SIMILARITY_PRINT_OPTION_SIMPLE_TAB_DELIMITED                           = "simple_tab";
+    final static private String                               DOMAIN_SIMILARITY_PRINT_OPTION_SIMPLE_HTML                                    = "simple_html";
+    final static private String                               DOMAIN_SIMILARITY_PRINT_OPTION_DETAILED_HTML                                  = "detailed_html";
+    final static private String                               DOMAIN_SIMILARITY_PRINT_OPTION                                                = "ds_output";
+    private static final PRINT_OPTION                         DOMAIN_SIMILARITY_PRINT_OPTION_DEFAULT                                        = PrintableDomainSimilarity.PRINT_OPTION.HTML;
+    final static private String                               IGNORE_DOMAINS_WITHOUT_COMBINATIONS_IN_ALL_SPECIES_OPTION                     = "ignore_singlet_domains";
+    final static private String                               IGNORE_VIRAL_IDS                                                              = "ignore_viral_ids";
+    final static private boolean                              IGNORE_DOMAINS_WITHOUT_COMBINATIONS_IN_ALL_SPECIES_DEFAULT                    = false;
+    final static private String                               IGNORE_DOMAINS_SPECIFIC_TO_ONE_SPECIES_OPTION                                 = "ignore_species_specific_domains";
+    final static private boolean                              IGNORE_DOMAINS_SPECIFIC_TO_ONE_SPECIES_OPTION_DEFAULT                         = false;
+    final static private String                               MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX                                = "_mean_score.pwd";
+    final static private String                               MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX                            = "_domains.pwd";
+    final static private String                               MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX                   = "_bin_combinations.pwd";
+    final static private String                               NJ_TREE_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX                               = "_mean_score_NJ"
+                                                                                                                                                    + ForesterConstants.PHYLO_XML_SUFFIX;
+    final static private String                               NJ_TREE_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX                           = "_domains_NJ"
+                                                                                                                                                    + ForesterConstants.PHYLO_XML_SUFFIX;
+    final static private String                               NJ_TREE_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX                  = "_bin_combinations_NJ"
+                                                                                                                                                    + ForesterConstants.PHYLO_XML_SUFFIX;
+    final static private String                               JACKNIFE_OPTION                                                               = "jack";
+    final static private String                               JACKNIFE_RANDOM_SEED_OPTION                                                   = "seed";
+    final static private String                               JACKNIFE_RATIO_OPTION                                                         = "jack_ratio";
+    private static final int                                  JACKNIFE_NUMBER_OF_RESAMPLINGS_DEFAULT                                        = 100;
+    final static private long                                 JACKNIFE_RANDOM_SEED_DEFAULT                                                  = 19;
+    final static private double                               JACKNIFE_RATIO_DEFAULT                                                        = 0.5;
     //final static private String  INFER_SPECIES_TREES_OPTION                                             = "species_tree_inference";
-    final static private String                               INFERRED_SD_BASED_NJ_SPECIES_TREE_SUFFIX                               = "_sd_nj.nh";
-    final static private String                               INFERRED_SBC_BASED_NJ_SPECIES_TREE_SUFFIX                              = "_sbc_nj.nh";
-    final static private String                               FILTER_POSITIVE_OPTION                                                 = "pos_filter";
-    final static private String                               FILTER_NEGATIVE_OPTION                                                 = "neg_filter";
-    final static private String                               FILTER_NEGATIVE_DOMAINS_OPTION                                         = "neg_dom_filter";
-    final static private String                               INPUT_FILES_FROM_FILE_OPTION                                           = "input";
-    final static private String                               INPUT_SPECIES_TREE_OPTION                                              = "species_tree";
-    final static private String                               SEQ_EXTRACT_OPTION                                                     = "prot_extract";
-    final static private char                                 SEPARATOR_FOR_INPUT_VALUES                                             = '#';
-    final static private String                               PRG_VERSION                                                            = "2.230";
-    final static private String                               PRG_DATE                                                               = "2012.04.22";
-    final static private String                               E_MAIL                                                                 = "czmasek@burnham.org";
-    final static private String                               WWW                                                                    = "www.phylosoft.org/forester/applications/surfacing";
-    final static private boolean                              IGNORE_DUFS_DEFAULT                                                    = true;
-    final static private boolean                              IGNORE_COMBINATION_WITH_SAME_DEFAULLT                                  = false;
-    final static private double                               MAX_E_VALUE_DEFAULT                                                    = -1;
-    final static private int                                  MAX_ALLOWED_OVERLAP_DEFAULT                                            = -1;
-    private static final String                               RANDOM_SEED_FOR_FITCH_PARSIMONY_OPTION                                 = "random_seed";
-    private static final String                               CONSIDER_DOMAIN_COMBINATION_DIRECTEDNESS                               = "consider_bdc_direction";
-    private static final String                               CONSIDER_DOMAIN_COMBINATION_DIRECTEDNESS_AND_ADJACENCY                 = "consider_bdc_adj";
-    private static final String                               SEQ_EXTRACT_SUFFIX                                                     = ".prot";
-    private static final String                               PLUS_MINUS_ANALYSIS_OPTION                                             = "plus_minus";
-    private static final String                               PLUS_MINUS_DOM_SUFFIX                                                  = "_plus_minus_dom.txt";
-    private static final String                               PLUS_MINUS_DOM_SUFFIX_HTML                                             = "_plus_minus_dom.html";
-    private static final String                               PLUS_MINUS_DC_SUFFIX_HTML                                              = "_plus_minus_dc.html";
-    private static final int                                  PLUS_MINUS_ANALYSIS_MIN_DIFF_DEFAULT                                   = 0;
-    private static final double                               PLUS_MINUS_ANALYSIS_FACTOR_DEFAULT                                     = 1.0;
-    private static final String                               PLUS_MINUS_ALL_GO_IDS_DOM_SUFFIX                                       = "_plus_minus_go_ids_all.txt";
-    private static final String                               PLUS_MINUS_PASSING_GO_IDS_DOM_SUFFIX                                   = "_plus_minus_go_ids_passing.txt";
-    private static final String                               OUTPUT_LIST_OF_ALL_PROTEINS_OPTIONS                                    = "all_prot";
-    private static final boolean                              VERBOSE                                                                = false;
-    private static final String                               OUTPUT_DOMAIN_COMBINATIONS_GAINED_MORE_THAN_ONCE_ANALYSIS_SUFFIX       = "_fitch_dc_gains_counts";
-    private static final String                               OUTPUT_DOMAIN_COMBINATIONS_LOST_MORE_THAN_ONCE_ANALYSIS_SUFFIX         = "_fitch_dc_losses_counts";
-    private static final String                               DOMAIN_LENGTHS_ANALYSIS_SUFFIX                                         = "_domain_lengths_analysis";
-    private static final boolean                              PERFORM_DOMAIN_LENGTH_ANALYSIS                                         = true;
-    public static final String                                ALL_PFAMS_ENCOUNTERED_SUFFIX                                           = "_all_encountered_pfams";
-    public static final String                                ALL_PFAMS_ENCOUNTERED_WITH_GO_ANNOTATION_SUFFIX                        = "_all_encountered_pfams_with_go_annotation";
-    public static final String                                ENCOUNTERED_PFAMS_SUMMARY_SUFFIX                                       = "_encountered_pfams_summary";
-    public static final String                                ALL_PFAMS_GAINED_AS_DOMAINS_SUFFIX                                     = "_all_pfams_gained_as_domains";
-    public static final String                                ALL_PFAMS_LOST_AS_DOMAINS_SUFFIX                                       = "_all_pfams_lost_as_domains";
-    public static final String                                ALL_PFAMS_GAINED_AS_DC_SUFFIX                                          = "_all_pfams_gained_as_dc";
-    public static final String                                ALL_PFAMS_LOST_AS_DC_SUFFIX                                            = "_all_pfams_lost_as_dc";
-    public static final String                                BASE_DIRECTORY_PER_NODE_DOMAIN_GAIN_LOSS_FILES                         = "PER_NODE_EVENTS";
-    public static final String                                BASE_DIRECTORY_PER_SUBTREE_DOMAIN_GAIN_LOSS_FILES                      = "PER_SUBTREE_EVENTS";
-    public static final String                                D_PROMISCUITY_FILE_SUFFIX                                              = "_domain_promiscuities";
-    private static final String                               LOG_FILE_SUFFIX                                                        = "_log.txt";
-    private static final String                               DATA_FILE_SUFFIX                                                       = "_domain_combination_data.txt";
-    private static final String                               DATA_FILE_DESC                                                         = "#SPECIES\tPRTEIN_ID\tN_TERM_DOMAIN\tC_TERM_DOMAIN\tN_TERM_DOMAIN_PER_DOMAIN_E_VALUE\tC_TERM_DOMAIN_PER_DOMAIN_E_VALUE\tN_TERM_DOMAIN_COUNTS_PER_PROTEIN\tC_TERM_DOMAIN_COUNTS_PER_PROTEIN";
-    private static final INDIVIDUAL_SCORE_CUTOFF              INDIVIDUAL_SCORE_CUTOFF_DEFAULT                                        = INDIVIDUAL_SCORE_CUTOFF.FULL_SEQUENCE;
-    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_COUNTS_OUTPUT_SUFFIX                   = "_indep_dc_gains_fitch_counts.txt";
-    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_DC_OUTPUT_SUFFIX                       = "_indep_dc_gains_fitch_lists.txt";
-    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_OUTPUT_SUFFIX        = "_indep_dc_gains_fitch_lists_for_go_mapping.txt";
-    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_OUTPUT_UNIQUE_SUFFIX = "_indep_dc_gains_fitch_lists_for_go_mapping_unique.txt";
-    public static final String                                LIMIT_SPEC_FOR_PROT_EX                                                 = null;                                                                                                                                                                                       // e.g. "HUMAN"; set to null for not using this feature (default).
-    public static final String BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH_MAPPED  = "_dc_MAPPED_secondary_features_fitch"
-        + ForesterConstants.PHYLO_XML_SUFFIX;
-    public static final String INDEPENDENT_DC_GAINS_FITCH_PARS_COUNTS_MAPPED_OUTPUT_SUFFIX =  "_indep_dc_gains_fitch_counts_MAPPED.txt";
-    public static final String INDEPENDENT_DC_GAINS_FITCH_PARS_DC_MAPPED_OUTPUT_SUFFIX =  "_indep_dc_gains_fitch_lists_MAPPED.txt";
-    public static final String INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_MAPPED_OUTPUT_SUFFIX = "_indep_dc_gains_fitch_lists_for_go_mapping_MAPPED.txt";
-    public static final String INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_MAPPED_OUTPUT_UNIQUE_SUFFIX = "_indep_dc_gains_fitch_lists_for_go_mapping_unique_MAPPED.txt";
+    final static private String                               INFERRED_SD_BASED_NJ_SPECIES_TREE_SUFFIX                                      = "_sd_nj.nh";
+    final static private String                               INFERRED_SBC_BASED_NJ_SPECIES_TREE_SUFFIX                                     = "_sbc_nj.nh";
+    final static private String                               FILTER_POSITIVE_OPTION                                                        = "pos_filter";
+    final static private String                               FILTER_NEGATIVE_OPTION                                                        = "neg_filter";
+    final static private String                               FILTER_NEGATIVE_DOMAINS_OPTION                                                = "neg_dom_filter";
+    final static private String                               INPUT_FILES_FROM_FILE_OPTION                                                  = "input";
+    final static private String                               INPUT_SPECIES_TREE_OPTION                                                     = "species_tree";
+    final static private String                               SEQ_EXTRACT_OPTION                                                            = "prot_extract";
+    final static private char                                 SEPARATOR_FOR_INPUT_VALUES                                                    = '#';
+    final static private String                               PRG_VERSION                                                                   = "2.230";
+    final static private String                               PRG_DATE                                                                      = "2012.04.22";
+    final static private String                               E_MAIL                                                                        = "czmasek@burnham.org";
+    final static private String                               WWW                                                                           = "www.phylosoft.org/forester/applications/surfacing";
+    final static private boolean                              IGNORE_DUFS_DEFAULT                                                           = true;
+    final static private boolean                              IGNORE_COMBINATION_WITH_SAME_DEFAULLT                                         = false;
+    final static private double                               MAX_E_VALUE_DEFAULT                                                           = -1;
+    final static private int                                  MAX_ALLOWED_OVERLAP_DEFAULT                                                   = -1;
+    private static final String                               RANDOM_SEED_FOR_FITCH_PARSIMONY_OPTION                                        = "random_seed";
+    private static final String                               CONSIDER_DOMAIN_COMBINATION_DIRECTEDNESS                                      = "consider_bdc_direction";
+    private static final String                               CONSIDER_DOMAIN_COMBINATION_DIRECTEDNESS_AND_ADJACENCY                        = "consider_bdc_adj";
+    private static final String                               SEQ_EXTRACT_SUFFIX                                                            = ".prot";
+    private static final String                               PLUS_MINUS_ANALYSIS_OPTION                                                    = "plus_minus";
+    private static final String                               PLUS_MINUS_DOM_SUFFIX                                                         = "_plus_minus_dom.txt";
+    private static final String                               PLUS_MINUS_DOM_SUFFIX_HTML                                                    = "_plus_minus_dom.html";
+    private static final String                               PLUS_MINUS_DC_SUFFIX_HTML                                                     = "_plus_minus_dc.html";
+    private static final int                                  PLUS_MINUS_ANALYSIS_MIN_DIFF_DEFAULT                                          = 0;
+    private static final double                               PLUS_MINUS_ANALYSIS_FACTOR_DEFAULT                                            = 1.0;
+    private static final String                               PLUS_MINUS_ALL_GO_IDS_DOM_SUFFIX                                              = "_plus_minus_go_ids_all.txt";
+    private static final String                               PLUS_MINUS_PASSING_GO_IDS_DOM_SUFFIX                                          = "_plus_minus_go_ids_passing.txt";
+    private static final String                               OUTPUT_LIST_OF_ALL_PROTEINS_OPTIONS                                           = "all_prot";
+    private static final boolean                              VERBOSE                                                                       = false;
+    private static final String                               OUTPUT_DOMAIN_COMBINATIONS_GAINED_MORE_THAN_ONCE_ANALYSIS_SUFFIX              = "_fitch_dc_gains_counts";
+    private static final String                               OUTPUT_DOMAIN_COMBINATIONS_LOST_MORE_THAN_ONCE_ANALYSIS_SUFFIX                = "_fitch_dc_losses_counts";
+    private static final String                               DOMAIN_LENGTHS_ANALYSIS_SUFFIX                                                = "_domain_lengths_analysis";
+    private static final boolean                              PERFORM_DOMAIN_LENGTH_ANALYSIS                                                = true;
+    public static final String                                ALL_PFAMS_ENCOUNTERED_SUFFIX                                                  = "_all_encountered_pfams";
+    public static final String                                ALL_PFAMS_ENCOUNTERED_WITH_GO_ANNOTATION_SUFFIX                               = "_all_encountered_pfams_with_go_annotation";
+    public static final String                                ENCOUNTERED_PFAMS_SUMMARY_SUFFIX                                              = "_encountered_pfams_summary";
+    public static final String                                ALL_PFAMS_GAINED_AS_DOMAINS_SUFFIX                                            = "_all_pfams_gained_as_domains";
+    public static final String                                ALL_PFAMS_LOST_AS_DOMAINS_SUFFIX                                              = "_all_pfams_lost_as_domains";
+    public static final String                                ALL_PFAMS_GAINED_AS_DC_SUFFIX                                                 = "_all_pfams_gained_as_dc";
+    public static final String                                ALL_PFAMS_LOST_AS_DC_SUFFIX                                                   = "_all_pfams_lost_as_dc";
+    public static final String                                BASE_DIRECTORY_PER_NODE_DOMAIN_GAIN_LOSS_FILES                                = "PER_NODE_EVENTS";
+    public static final String                                BASE_DIRECTORY_PER_SUBTREE_DOMAIN_GAIN_LOSS_FILES                             = "PER_SUBTREE_EVENTS";
+    public static final String                                D_PROMISCUITY_FILE_SUFFIX                                                     = "_domain_promiscuities";
+    private static final String                               LOG_FILE_SUFFIX                                                               = "_log.txt";
+    private static final String                               DATA_FILE_SUFFIX                                                              = "_domain_combination_data.txt";
+    private static final String                               DATA_FILE_DESC                                                                = "#SPECIES\tPRTEIN_ID\tN_TERM_DOMAIN\tC_TERM_DOMAIN\tN_TERM_DOMAIN_PER_DOMAIN_E_VALUE\tC_TERM_DOMAIN_PER_DOMAIN_E_VALUE\tN_TERM_DOMAIN_COUNTS_PER_PROTEIN\tC_TERM_DOMAIN_COUNTS_PER_PROTEIN";
+    private static final INDIVIDUAL_SCORE_CUTOFF              INDIVIDUAL_SCORE_CUTOFF_DEFAULT                                               = INDIVIDUAL_SCORE_CUTOFF.FULL_SEQUENCE;
+    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_COUNTS_OUTPUT_SUFFIX                          = "_indep_dc_gains_fitch_counts.txt";
+    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_DC_OUTPUT_SUFFIX                              = "_indep_dc_gains_fitch_lists.txt";
+    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_OUTPUT_SUFFIX               = "_indep_dc_gains_fitch_lists_for_go_mapping.txt";
+    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_OUTPUT_UNIQUE_SUFFIX        = "_indep_dc_gains_fitch_lists_for_go_mapping_unique.txt";
+    public static final String                                LIMIT_SPEC_FOR_PROT_EX                                                        = null;                                                                                                                                                                                       // e.g. "HUMAN"; set to null for not using this feature (default).
+    public static final String                                BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH_MAPPED          = "_dc_MAPPED_secondary_features_fitch"
+                                                                                                                                                    + ForesterConstants.PHYLO_XML_SUFFIX;
+    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_COUNTS_MAPPED_OUTPUT_SUFFIX                   = "_indep_dc_gains_fitch_counts_MAPPED.txt";
+    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_DC_MAPPED_OUTPUT_SUFFIX                       = "_indep_dc_gains_fitch_lists_MAPPED.txt";
+    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_MAPPED_OUTPUT_SUFFIX        = "_indep_dc_gains_fitch_lists_for_go_mapping_MAPPED.txt";
+    public static final String                                INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_MAPPED_OUTPUT_UNIQUE_SUFFIX = "_indep_dc_gains_fitch_lists_for_go_mapping_unique_MAPPED.txt";
 
     private static void checkWriteabilityForPairwiseComparisons( final PrintableDomainSimilarity.PRINT_OPTION domain_similarity_print_option,
                                                                  final String[][] input_file_properties,
@@ -2370,14 +2370,13 @@ public class surfacing {
         final Runtime rt = java.lang.Runtime.getRuntime();
         final long free_memory = rt.freeMemory() / 1000000;
         final long total_memory = rt.totalMemory() / 1000000;
-       
-        ForesterUtil.programMessage( PRG_NAME,  "Time for analysis : " + ( new Date().getTime() - analysis_start_time ) + "ms" );
+        ForesterUtil.programMessage( PRG_NAME, "Time for analysis : " + ( new Date().getTime() - analysis_start_time )
+                + "ms" );
         ForesterUtil.programMessage( PRG_NAME, "Total running time: " + ( new Date().getTime() - start_time ) + "ms " );
-        ForesterUtil.programMessage( PRG_NAME,  "Free memory       : " + free_memory + "MB, total memory: " + total_memory + "MB" );
-       
-        ForesterUtil.programMessage( PRG_NAME,  "If this application is useful to you, please cite:" );
-        ForesterUtil.programMessage( PRG_NAME,  surfacing.WWW );
-       
+        ForesterUtil.programMessage( PRG_NAME, "Free memory       : " + free_memory + "MB, total memory: "
+                + total_memory + "MB" );
+        ForesterUtil.programMessage( PRG_NAME, "If this application is useful to you, please cite:" );
+        ForesterUtil.programMessage( PRG_NAME, surfacing.WWW );
         ForesterUtil.programMessage( PRG_NAME, "OK" );
         System.out.println();
     }
index 4658371..ee9524c 100644 (file)
@@ -212,11 +212,10 @@ public final class DomainParsimonyCalculator {
         setTotalLosses( fitch.getTotalLosses() );
         setTotalUnchanged( fitch.getTotalUnchanged() );
     }
-    
-    private void executeFitchParsimonyOnSecondaryFeatures( 
-                                        final boolean use_last,
-                                        final boolean randomize,
-                                        final long random_number_seed ) {
+
+    private void executeFitchParsimonyOnSecondaryFeatures( final boolean use_last,
+                                                           final boolean randomize,
+                                                           final long random_number_seed ) {
         reset();
         if ( use_last ) {
             System.out.println( "   Fitch parsimony: use_last = true" );
@@ -229,21 +228,19 @@ public final class DomainParsimonyCalculator {
         fitch.setUseLast( use_last );
         fitch.setReturnGainLossMatrix( true );
         fitch.setReturnInternalStates( true );
-        
         final Map<DomainId, Set<String>> map = getDomainIdToSecondaryFeaturesMap();
         final Map<DomainId, String> newmap = new HashMap<DomainId, String>();
         final Iterator<Entry<DomainId, Set<String>>> it = map.entrySet().iterator();
-        while (it.hasNext()) {
-            final Map.Entry<DomainId, Set<String>> pair =  (Map.Entry<DomainId, Set<String>>)it.next();
+        while ( it.hasNext() ) {
+            final Map.Entry<DomainId, Set<String>> pair = it.next();
             if ( pair.getValue().size() != 1 ) {
-                throw new IllegalArgumentException( pair.getKey().getId() + " mapps to " + pair.getValue().size() + " items" );
+                throw new IllegalArgumentException( pair.getKey().getId() + " mapps to " + pair.getValue().size()
+                        + " items" );
             }
             newmap.put( pair.getKey(), ( String ) pair.getValue().toArray()[ 0 ] );
         }
-        
-        CharacterStateMatrix<BinaryStates> states  =createMatrixOfSecondaryFeatureBinaryDomainCombinationPresenceOrAbsence( getGenomeWideCombinableDomainsList(),
-                                                                                newmap );
-       
+        final CharacterStateMatrix<BinaryStates> states = createMatrixOfSecondaryFeatureBinaryDomainCombinationPresenceOrAbsence( getGenomeWideCombinableDomainsList(),
+                                                                                                                                  newmap );
         fitch.execute( getPhylogeny(), states );
         setGainLossMatrix( fitch.getGainLossMatrix() );
         setBinaryInternalStatesMatrix( fitch.getInternalStatesMatrix() );
@@ -256,7 +253,7 @@ public final class DomainParsimonyCalculator {
     public void executeFitchParsimonyOnBinaryDomainCombintion( final boolean use_last ) {
         executeFitchParsimony( false, use_last, false, 0 );
     }
-    
+
     public void executeFitchParsimonyOnBinaryDomainCombintionOnSecondaryFeatures( final boolean use_last ) {
         executeFitchParsimonyOnSecondaryFeatures( use_last, false, 0 );
     }
@@ -546,7 +543,6 @@ public final class DomainParsimonyCalculator {
         return new DomainParsimonyCalculator( phylogeny, gwcd_list, domain_id_to_secondary_features_map );
     }
 
-    
     /**
      * For folds instead of Pfam-domains, for example
      * 
@@ -619,10 +615,9 @@ public final class DomainParsimonyCalculator {
         }
         return matrix;
     }
-    
-    
+
     public static CharacterStateMatrix<BinaryStates> createMatrixOfSecondaryFeatureBinaryDomainCombinationPresenceOrAbsence( final List<GenomeWideCombinableDomains> gwcd_list,
-                                                                                                                             final Map<DomainId, String> domain_id_to_second_features_map) {
+                                                                                                                             final Map<DomainId, String> domain_id_to_second_features_map ) {
         if ( gwcd_list.isEmpty() ) {
             throw new IllegalArgumentException( "genome wide combinable domains list is empty" );
         }
@@ -633,12 +628,10 @@ public final class DomainParsimonyCalculator {
         final SortedSet<BinaryDomainCombination> all_binary_combinations_mapped = new TreeSet<BinaryDomainCombination>();
         final Set<BinaryDomainCombination>[] binary_combinations_per_genome_mapped = new HashSet[ number_of_identifiers ];
         int identifier_index = 0;
-        
         final SortedSet<String> no_mappings = new TreeSet<String>();
         for( final GenomeWideCombinableDomains gwcd : gwcd_list ) {
             binary_combinations_per_genome_mapped[ identifier_index ] = new HashSet<BinaryDomainCombination>();
             for( final BinaryDomainCombination bc : gwcd.toBinaryDomainCombinations() ) {
-                
                 final BinaryDomainCombination mapped_bc = mapBinaryDomainCombination( domain_id_to_second_features_map,
                                                                                       bc,
                                                                                       no_mappings );
@@ -647,14 +640,13 @@ public final class DomainParsimonyCalculator {
             }
             ++identifier_index;
         }
-       
         if ( !no_mappings.isEmpty() ) {
-            ForesterUtil.programMessage( surfacing.PRG_NAME, "No mappings for the following (" + no_mappings.size()  + "):" );
+            ForesterUtil.programMessage( surfacing.PRG_NAME, "No mappings for the following (" + no_mappings.size()
+                    + "):" );
             for( final String id : no_mappings ) {
-                ForesterUtil.programMessage( surfacing.PRG_NAME, id);
+                ForesterUtil.programMessage( surfacing.PRG_NAME, id );
             }
         }
-        
         final int number_of_characters = all_binary_combinations_mapped.size();
         final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> matrix = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( number_of_identifiers,
                                                                                                                                                  number_of_characters );
@@ -699,30 +691,23 @@ public final class DomainParsimonyCalculator {
                                                                        final SortedSet<String> no_mappings ) {
         String id0 = "";
         String id1 = "";
-        
         if ( !domain_id_to_second_features_map.containsKey( bc.getId0() ) ) {
-           
-            no_mappings.add(bc.getId0().getId()  );
+            no_mappings.add( bc.getId0().getId() );
             id0 = bc.getId0().getId();
         }
         else {
-            id0 = domain_id_to_second_features_map.get(  bc.getId0());
+            id0 = domain_id_to_second_features_map.get( bc.getId0() );
         }
         if ( !domain_id_to_second_features_map.containsKey( bc.getId1() ) ) {
-           
-            no_mappings.add(bc.getId1().getId()  );
+            no_mappings.add( bc.getId1().getId() );
             id1 = bc.getId1().getId();
         }
         else {
-            id1 = domain_id_to_second_features_map.get(  bc.getId1());
+            id1 = domain_id_to_second_features_map.get( bc.getId1() );
         }
-        
         return new BasicBinaryDomainCombination( id0, id1 );
     }
-    
-    
-    
-    
+
     public static CharacterStateMatrix<BinaryStates> createMatrixOfBinaryDomainCombinationPresenceOrAbsence( final List<GenomeWideCombinableDomains> gwcd_list ) {
         if ( gwcd_list.isEmpty() ) {
             throw new IllegalArgumentException( "genome wide combinable domains list is empty" );
@@ -846,8 +831,6 @@ public final class DomainParsimonyCalculator {
         return matrix;
     }
 
-   
-
     private static int getStateSumDeltaOnNode( final String node_identifier,
                                                final CharacterStateMatrix<GainLossStates> gain_loss_matrix,
                                                final GainLossStates state ) {
index 24823a4..8f5bf5e 100644 (file)
@@ -105,12 +105,12 @@ public final class SurfacingUtil {
                                                                                  }
                                                                              };
     public final static Pattern             PATTERN_SP_STYLE_TAXONOMY        = Pattern.compile( "^[A-Z0-9]{3,5}$" );
-    private static final boolean USE_LAST = true;
+    private static final boolean            USE_LAST                         = true;
 
     private SurfacingUtil() {
         // Hidden constructor.
     }
+
     public static void addAllBinaryDomainCombinationToSet( final GenomeWideCombinableDomains genome,
                                                            final SortedSet<BinaryDomainCombination> binary_domain_combinations ) {
         final SortedMap<DomainId, CombinableDomains> all_cd = genome.getAllCombinableDomainsIds();
@@ -841,18 +841,11 @@ public final class SurfacingUtil {
                           parameters_str );
         SurfacingUtil.writePhylogenyToFile( local_phylogeny_copy, outfile_name
                 + surfacing.SECONDARY_FEATURES_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO );
-        
-        
         // FITCH DOMAIN COMBINATIONS
         // -------------------------
-         local_phylogeny_copy = phylogeny.copy();
-        String randomization = "no";
-       
+        local_phylogeny_copy = phylogeny.copy();
+        final String randomization = "no";
         secondary_features_parsimony.executeFitchParsimonyOnBinaryDomainCombintionOnSecondaryFeatures( USE_LAST );
-        
-      
-     
-      
         preparePhylogeny( local_phylogeny_copy,
                           secondary_features_parsimony,
                           date_time,
@@ -867,9 +860,8 @@ public final class SurfacingUtil {
                 + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_DC_MAPPED_OUTPUT_SUFFIX, outfile_name
                 + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_MAPPED_OUTPUT_SUFFIX, outfile_name
                 + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_MAPPED_OUTPUT_UNIQUE_SUFFIX, outfile_name
-                + "_MAPPED_indep_dc_gains_fitch_lca_ranks.txt", outfile_name + "_MAPPED_indep_dc_gains_fitch_lca_taxonomies.txt" );
-   
-        
+                + "_MAPPED_indep_dc_gains_fitch_lca_ranks.txt", outfile_name
+                + "_MAPPED_indep_dc_gains_fitch_lca_taxonomies.txt" );
     }
 
     public static void extractProteinNames( final List<Protein> proteins,