X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fapplication%2Fsurfacing_old.java;h=443191c11f37a82a4f37d0cafb9c9c29771294eb;hb=ebaa3f63d0dc201b9b5a5cd91e2cfa3c7157f143;hp=07711ee2c1d47aa81b7ae4eb36feadd80bb3e998;hpb=493e40b0c936b65da342134da37e8b856b9b80af;p=jalview.git diff --git a/forester/java/src/org/forester/application/surfacing_old.java b/forester/java/src/org/forester/application/surfacing_old.java index 07711ee..443191c 100644 --- a/forester/java/src/org/forester/application/surfacing_old.java +++ b/forester/java/src/org/forester/application/surfacing_old.java @@ -6,7 +6,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 @@ -16,7 +16,7 @@ // 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 @@ -68,21 +68,21 @@ import org.forester.surfacing.DomainId; import org.forester.surfacing.DomainLengthsTable; import org.forester.surfacing.DomainParsimonyCalculator; import org.forester.surfacing.DomainSimilarity; +import org.forester.surfacing.DomainSimilarity.DomainSimilarityScoring; +import org.forester.surfacing.DomainSimilarity.DomainSimilaritySortField; import org.forester.surfacing.DomainSimilarityCalculator; +import org.forester.surfacing.DomainSimilarityCalculator.Detailedness; import org.forester.surfacing.GenomeWideCombinableDomains; +import org.forester.surfacing.GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder; import org.forester.surfacing.MappingResults; import org.forester.surfacing.PairwiseDomainSimilarityCalculator; import org.forester.surfacing.PairwiseGenomeComparator; import org.forester.surfacing.PrintableDomainSimilarity; +import org.forester.surfacing.PrintableDomainSimilarity.PRINT_OPTION; import org.forester.surfacing.Protein; import org.forester.surfacing.ProteinCountsBasedPairwiseDomainSimilarityCalculator; import org.forester.surfacing.Species; import org.forester.surfacing.SurfacingUtil; -import org.forester.surfacing.DomainSimilarity.DomainSimilarityScoring; -import org.forester.surfacing.DomainSimilarity.DomainSimilaritySortField; -import org.forester.surfacing.DomainSimilarityCalculator.Detailedness; -import org.forester.surfacing.GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder; -import org.forester.surfacing.PrintableDomainSimilarity.PRINT_OPTION; import org.forester.util.BasicTable; import org.forester.util.BasicTableParser; import org.forester.util.CommandLineArguments; @@ -517,9 +517,11 @@ public class surfacing_old { ForesterUtil.fatalError( surfacing_old.PRG_NAME, "input tree [" + intree_file + "] is not rooted" ); } if ( intree.getNumberOfExternalNodes() < number_of_genomes ) { - ForesterUtil.fatalError( surfacing_old.PRG_NAME, "number of external nodes [" - + intree.getNumberOfExternalNodes() + "] of input tree [" + intree_file - + "] is smaller than the number of genomes the be analyzed [" + number_of_genomes + "]" ); + ForesterUtil.fatalError( surfacing_old.PRG_NAME, + "number of external nodes [" + intree.getNumberOfExternalNodes() + + "] of input tree [" + intree_file + + "] is smaller than the number of genomes the be analyzed [" + + number_of_genomes + "]" ); } final StringBuilder parent_names = new StringBuilder(); final int nodes_lacking_name = SurfacingUtil.getNumberOfNodesLackingName( intree, parent_names ); @@ -1113,8 +1115,8 @@ public class surfacing_old { } } catch ( final IOException e ) { - ForesterUtil.fatalError( surfacing_old.PRG_NAME, "cannot read from GO OBO file: " - + e.getLocalizedMessage() ); + ForesterUtil.fatalError( surfacing_old.PRG_NAME, + "cannot read from GO OBO file: " + e.getLocalizedMessage() ); } } Map go_id_to_term_map = null; @@ -1307,8 +1309,8 @@ public class surfacing_old { .createDomainIdToSecondaryFeaturesMap( secondary_features_map_files[ i ] ); } catch ( final IOException e ) { - ForesterUtil.fatalError( surfacing_old.PRG_NAME, "cannot read secondary features map file: " - + e.getMessage() ); + ForesterUtil.fatalError( surfacing_old.PRG_NAME, + "cannot read secondary features map file: " + e.getMessage() ); } catch ( final Exception e ) { ForesterUtil.fatalError( surfacing_old.PRG_NAME, "problem with contents of features map file [" @@ -2021,14 +2023,16 @@ public class surfacing_old { output_file = new File( out_dir + ForesterUtil.FILE_SEPARATOR + output_file ); } SurfacingUtil.writeMatrixToFile( new File( matrix_output_file - + surfacing_old.MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc - .getDomainDistanceScoresMeans() ); - SurfacingUtil.writeMatrixToFile( new File( matrix_output_file - + surfacing_old.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc - .getSharedBinaryCombinationsBasedDistances() ); - SurfacingUtil.writeMatrixToFile( new File( matrix_output_file - + surfacing_old.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc - .getSharedDomainsBasedDistances() ); + + surfacing_old.MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), + pwgc.getDomainDistanceScoresMeans() ); + SurfacingUtil + .writeMatrixToFile( new File( matrix_output_file + + surfacing_old.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), + pwgc.getSharedBinaryCombinationsBasedDistances() ); + SurfacingUtil + .writeMatrixToFile( new File( matrix_output_file + + surfacing_old.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), + pwgc.getSharedDomainsBasedDistances() ); final Phylogeny nj_gd = SurfacingUtil.createNjTreeBasedOnMatrixToFile( new File( matrix_output_file + surfacing_old.NJ_TREE_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc .getDomainDistanceScoresMeans().get( 0 ) ); @@ -2060,14 +2064,19 @@ public class surfacing_old { jacknife_resamplings, jacknife_ratio, random_seed ); - SurfacingUtil.writeMatrixToFile( new File( matrix_output_file + "_" - + ForesterUtil.round( jacknife_ratio, 2 ) + "_" + jacknife_resamplings - + surfacing_old.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc - .getSharedBinaryCombinationsBasedDistances() ); - SurfacingUtil.writeMatrixToFile( new File( matrix_output_file + "_" - + ForesterUtil.round( jacknife_ratio, 2 ) + "_" + jacknife_resamplings - + surfacing_old.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc - .getSharedDomainsBasedDistances() ); + SurfacingUtil + .writeMatrixToFile( new File( matrix_output_file + + "_" + + ForesterUtil.round( jacknife_ratio, 2 ) + + "_" + + jacknife_resamplings + + surfacing_old.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), + pwgc.getSharedBinaryCombinationsBasedDistances() ); + SurfacingUtil + .writeMatrixToFile( new File( matrix_output_file + "_" + ForesterUtil.round( jacknife_ratio, 2 ) + + "_" + jacknife_resamplings + + surfacing_old.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), + pwgc.getSharedDomainsBasedDistances() ); // if ( infer_species_trees ) { // inferSpeciesTrees( new File( output_file + "_" + jacknife_resamplings // + INFERRED_SBC_BASED_NJ_SPECIES_TREE_SUFFIX ), pwgc