public final class AncestralTaxonomyInference {
public static void inferTaxonomyFromDescendents( final Phylogeny phy ) throws IOException,
- AncestralTaxonomyInferenceException {
+ AncestralTaxonomyInferenceException {
TaxonomyDataManager.clearCachesIfTooLarge();
for( final PhylogenyNodeIterator iter = phy.iteratorPostorder(); iter.hasNext(); ) {
final PhylogenyNode node = iter.next();
}
private static void inferTaxonomyFromDescendents( final PhylogenyNode n ) throws IOException,
- AncestralTaxonomyInferenceException {
+ AncestralTaxonomyInferenceException {
if ( n.isExternal() ) {
throw new IllegalArgumentException( "attempt to infer taxonomy from descendants of external node" );
}
|| !ForesterUtil.isEmpty( desc.getNodeData().getTaxonomy().getScientificName() )
|| !ForesterUtil.isEmpty( desc.getNodeData().getTaxonomy().getLineage() )
|| !ForesterUtil.isEmpty( desc.getNodeData().getTaxonomy().getTaxonomyCode() ) || !ForesterUtil
- .isEmpty( desc.getNodeData().getTaxonomy().getCommonName() ) ) ) {
+ .isEmpty( desc.getNodeData().getTaxonomy().getCommonName() ) ) ) {
final UniProtTaxonomy up_tax = TaxonomyDataManager.obtainUniProtTaxonomy( desc.getNodeData()
- .getTaxonomy(), null, null );
+ .getTaxonomy(), null, null );
if ( ( up_tax == null ) && ForesterUtil.isEmpty( desc.getNodeData().getTaxonomy().getLineage() ) ) {
String desc_str = "";
if ( !ForesterUtil.isEmpty( desc.getName() ) ) {
}
System.out.println( desc.getNodeData().getTaxonomy().toString() );
System.out.println( ForesterUtil.stringListToString( desc.getNodeData().getTaxonomy().getLineage(),
- " > " ) );
+ " > " ) );
throw new AncestralTaxonomyInferenceException( "a taxonomy for node " + desc_str
- + " could not be established from the database" );
+ + " could not be established from the database" );
}
String[] lineage = ForesterUtil.stringListToArray( desc.getNodeData().getTaxonomy().getLineage() );
if ( ( lineage == null ) || ( lineage.length < 1 ) ) {
node = "[" + desc.getId() + "]";
}
throw new AncestralTaxonomyInferenceException( "node " + node
- + " has no or inappropriate taxonomic information" );
+ + " has no or inappropriate taxonomic information" );
}
}
final List<String> last_common_lineage = new ArrayList<String>();
private final static UniProtTaxonomy obtainTaxonomy( final HashMap<String, UniProtTaxonomy> cache,
final Object query,
final QUERY_TYPE qt ) throws IOException,
- AncestralTaxonomyInferenceException {
+ AncestralTaxonomyInferenceException {
if ( cache.containsKey( query ) ) {
return cache.get( query ).copy();
}
//FIXME fix "SPHAR" issue
if ( ( ( query.indexOf( "XX" ) == 3 ) && TaxonomyUtil.isHasTaxIdFromFakeTaxCode( query ) )
|| query.equals( "SPHAR" ) /* TODO remove me, is same as Sphingomonas aromaticivorans */
- ) {
+ ) {
final int id = TaxonomyUtil.getTaxIdFromFakeTaxCode( query );
return SequenceDbWsTools.getTaxonomiesFromId( String.valueOf( id ), MAX_TAXONOMIES_TO_RETURN );
}
synchronized final private static SortedSet<String> obtainDetailedTaxonomicInformation( final Phylogeny phy,
final boolean delete,
final boolean allow_to_use_basic_node_names )
- throws IOException, AncestralTaxonomyInferenceException {
+ throws IOException, AncestralTaxonomyInferenceException {
clearCachesIfTooLarge();
final SortedSet<String> not_found = new TreeSet<String>();
List<PhylogenyNode> not_found_external_nodes = null;
if ( ( ( tax != null ) && ( isHasAppropriateId( tax )
|| !ForesterUtil.isEmpty( tax.getScientificName() )
|| !ForesterUtil.isEmpty( tax.getTaxonomyCode() ) || !ForesterUtil
- .isEmpty( tax.getCommonName() ) ) ) ) {
+ .isEmpty( tax.getCommonName() ) ) ) ) {
uniprot_tax = obtainUniProtTaxonomy( tax, null, qt );
}
else {
else {
final List<UniProtTaxonomy> matching_taxonomies = new ArrayList<UniProtTaxonomy>();
final List<UniProtTaxonomy> up_taxonomies = getTaxonomiesFromScientificName( lineage
- .get( lineage.size() - 1 ) );
+ .get( lineage.size() - 1 ) );
if ( ( up_taxonomies != null ) && ( up_taxonomies.size() > 0 ) ) {
for( final UniProtTaxonomy up_taxonomy : up_taxonomies ) {
boolean match = true;
}
else {
throw new AncestralTaxonomyInferenceException( "taxonomy \"" + ( lineage.get( lineage.size() - 1 ) )
- + "\" not found" );
+ + "\" not found" );
}
}
}
final PhylogenyNode node,
final Taxonomy tax,
final UniProtTaxonomy up_tax )
- throws PhyloXmlDataFormatException {
+ throws PhyloXmlDataFormatException {
if ( ( qt != QUERY_TYPE.SN ) && !ForesterUtil.isEmpty( up_tax.getScientificName() )
&& ForesterUtil.isEmpty( tax.getScientificName() ) ) {
tax.setScientificName( up_tax.getScientificName() );
JOptionPane.WARNING_MESSAGE );
}
catch ( final Exception e ) {
- // Not important if this fails, do nothing.
+ // Not important if this fails, do nothing.
}
return;
}
JOptionPane.WARNING_MESSAGE );
}
catch ( final Exception e ) {
- // Not important if this fails, do nothing.
+ // Not important if this fails, do nothing.
}
}
else {
}
catch ( final Exception e ) {
ForesterUtil
- .fatalError( PRG_NAME, "failed to read phylgenies from [" + infile + "] [" + e.getMessage()
- + "]" );
+ .fatalError( PRG_NAME, "failed to read phylgenies from [" + infile + "] [" + e.getMessage()
+ + "]" );
}
try {
obtainSeqInformation( phy );
}
private static void inferTaxonomyFromDescendents( final Phylogeny phy ) throws IOException,
- AncestralTaxonomyInferenceException {
+ AncestralTaxonomyInferenceException {
AncestralTaxonomyInference.inferTaxonomyFromDescendents( phy );
}
}
if ( ( first < 0 ) || ( last < 0 ) ) {
ForesterUtil
- .fatalError( PRG_NAME,
- "attempt to set first or last evaluator topology to use to a number less than zero" );
+ .fatalError( PRG_NAME,
+ "attempt to set first or last evaluator topology to use to a number less than zero" );
}
if ( norm < 0 ) {
ForesterUtil.fatalError( PRG_NAME, "illegal value for normalizer [" + norm + "]" );
}
if ( ( last >= evaluators.length ) || ( last <= first ) ) {
ForesterUtil.fatalError( PRG_NAME, "illegal value for first or last evaluator topology to use [" + first
- + ", " + last + "]" );
+ + ", " + last + "]" );
}
double value = 1;
if ( norm > 0 ) {
System.out.println( "Usage:" );
System.out.println();
System.out.println( PRG_NAME
- + " [options] <confidence type> <target tree file> <evaluators tree file> <outfile>" );
+ + " [options] <confidence type> <target tree file> <evaluators tree file> <outfile>" );
System.out.println();
System.out.println( "options:" );
System.out.println();
System.out.println( " -" + STRICT_OPTION
- + " : strict [default: non-strict]: all nodes between 'target' and 'evaluators' must match" );
+ + " : strict [default: non-strict]: all nodes between 'target' and 'evaluators' must match" );
System.out.println( " -" + NORMALIZE_OPTION
- + "=<d>: normalize to this value (e.g. 100 for most bootstrap analyses) [default: no normalization]" );
+ + "=<d>: normalize to this value (e.g. 100 for most bootstrap analyses) [default: no normalization]" );
System.out.println( " -" + FIRST_OPTION + "=<i>: first evaluator topology to use (0-based) [default: 0]" );
System.out.println( " -" + LAST_OPTION
- + "=<i>: last evaluator topology to use (0-based) [default: use all until final topology]" );
+ + "=<i>: last evaluator topology to use (0-based) [default: use all until final topology]" );
System.out.println();
}
final PhylogenyNode node = it.next();
if ( ext_nodes.contains( node ) ) {
throw new IllegalArgumentException( "external node [" + node.toString() + "] of " + msg
- + " is not unique" );
+ + " is not unique" );
}
ext_nodes.add( node );
}
System.out.println( count_support.PRG_NAME + ": wrong number of arguments" );
System.out.println();
System.out
- .println( "Usage: \"count_support [options] <file containing phylogeny to be evaluated> <file with phylogenies to be used for evaluation> <outfile> [outfile for evaluator phylogenies, "
- + "always unstripped if -t=<d> option is used, otherwise strippedness is dependent on -s option]\"\n" );
+ .println( "Usage: \"count_support [options] <file containing phylogeny to be evaluated> <file with phylogenies to be used for evaluation> <outfile> [outfile for evaluator phylogenies, "
+ + "always unstripped if -t=<d> option is used, otherwise strippedness is dependent on -s option]\"\n" );
System.out
- .println( " Options: -s strip external nodes from evaluator phylogenies not found in phylogeny to be evaluated" );
+ .println( " Options: -s strip external nodes from evaluator phylogenies not found in phylogeny to be evaluated" );
System.out.println( " : -t=<d> threshold for similarity (0.0 to 1.0)" );
System.out.println( " : -n no branch lengths in outfile for evaluator phylogenies" );
System.out.println();
else {
if ( !branch_lengths_in_ev_out ) {
ForesterUtil.fatalError( count_support.PRG_NAME,
- "Cannot use -n option if no outfile for evaluators specified" );
+ "Cannot use -n option if no outfile for evaluators specified" );
}
}
Phylogeny p = null;
}
if ( ( threshhold < 0 ) || ( threshhold > 1.0 ) ) {
ForesterUtil.fatalError( count_support.PRG_NAME,
- "support threshold has to be between 0.0 and 1.0 (inclusive)" );
+ "support threshold has to be between 0.0 and 1.0 (inclusive)" );
}
}
List<Phylogeny> evaluator_phylogenies_above_threshold = null;
if ( threshhold >= 0 ) {
count_support.normalizeSupport( p, 100, evaluator_phylogenies_above_threshold.size() );
System.out.println( evaluator_phylogenies_above_threshold.size() + " out of " + ev.length
- + " evaluator phylogenies are above threshold of " + threshhold );
+ + " evaluator phylogenies are above threshold of " + threshhold );
}
try {
final PhylogenyWriter w = new PhylogenyWriter();
final PhylogenyWriter w = new PhylogenyWriter();
if ( evaluator_phylogenies_above_threshold != null ) {
System.out.println( "Writing " + evaluator_phylogenies_above_threshold.size()
- + " evaluator phylogenies above threshold of " + threshhold + " to: " + evaluators_outfile );
+ + " evaluator phylogenies above threshold of " + threshhold + " to: " + evaluators_outfile );
if ( count_support.WRITE_EVALUATORS_AS_NHX ) {
w.toNewHampshireX( evaluator_phylogenies_above_threshold, evaluators_outfile, ";"
+ ForesterUtil.getLineSeparator() );
}
else {
ForesterUtil.fatalError( decorator.PRG_NAME, "unknown value for \"" + decorator.FIELD_OPTION
- + "\" option: \"" + field_str + "\"" );
+ + "\" option: \"" + field_str + "\"" );
}
}
}
}
catch ( final Exception e ) {
ForesterUtil.fatalError( decorator.PRG_NAME, "failed to read phylgenies from [" + phylogenies_infile
- + "] [" + e.getMessage() + "]" );
+ + "] [" + e.getMessage() + "]" );
}
Map<String, String> map = null;
if ( !advanced_table ) {
if ( ( phylogenies.length > 1 )
&& ( !ForesterUtil.isEmpty( tree_name ) || !ForesterUtil.isEmpty( tree_id ) ) ) {
ForesterUtil.fatalError( decorator.PRG_NAME,
- "attempt to set same name or id on more than one phylogeny" );
+ "attempt to set same name or id on more than one phylogeny" );
}
if ( !ForesterUtil.isEmpty( tree_name ) ) {
phylogenies[ 0 ].setName( tree_name );
}
if ( ForesterUtil.isEmpty( seqs ) ) {
ForesterUtil.fatalError( decorator.PRG_NAME, "fasta-file [" + mapping_infile
- + "] is devoid of fasta-formatted sequences" );
+ + "] is devoid of fasta-formatted sequences" );
}
final Map<String, String> map = new HashMap<String, String>();
for( final MolecularSequence seq : seqs ) {
if ( ForesterUtil.isEmpty( seq.getIdentifier() ) ) {
ForesterUtil.fatalError( decorator.PRG_NAME, "fasta-file [" + mapping_infile
- + "] contains sequence with empty identifier" );
+ + "] contains sequence with empty identifier" );
}
if ( map.containsKey( seq.getIdentifier() ) ) {
ForesterUtil.fatalError( decorator.PRG_NAME, "sequence identifier [" + seq.getIdentifier()
- + "] is not unique" );
+ + "] is not unique" );
}
if ( seq.getLength() < 1 ) {
ForesterUtil.fatalError( decorator.PRG_NAME, "sequence [" + seq.getIdentifier() + "] is empty" );
System.out.println();
System.out.println( " -f=<c> : field to be replaced: " + NODE_NAME_FIELD + " : node name" );
System.out.println( " " + SEQUENCE_ANNOTATION_DESC
- + " : sequence annotation description" );
+ + " : sequence annotation description" );
System.out.println( " " + DS_FILED + " : domain structure" );
System.out.println( " " + TAXONOMY_CODE_FIELD + " : taxonomy code" );
System.out.println( " " + TAXONOMY_SCIENTIFIC_NAME_FIELD
- + ": taxonomy scientific name" );
+ + ": taxonomy scientific name" );
System.out.println( " " + SEQUENCE_NAME_FIELD + " : sequence name" );
System.out.println( " " + MOL_SEQ + " : molecular sequence" );
System.out.println( " -k=<n> : key column in mapping table (0 based)," );
System.out.println( " -v=<n> : value column in mapping table (0 based)," );
System.out.println( " data which with to decorate - default is 1" );
System.out.println( " -" + EXTRACT_BRACKETED_SCIENTIC_NAME_OPTION
- + " : to extract bracketed scientific names, e.g. [Nematostella vectensis]" );
+ + " : to extract bracketed scientific names, e.g. [Nematostella vectensis]" );
System.out.println( " -" + EXTRACT_BRACKETED_TAXONOMIC_CODE_OPTION
- + " : to extract bracketed taxonomic codes, e.g. [NEMVE]" );
+ + " : to extract bracketed taxonomic codes, e.g. [NEMVE]" );
System.out.println( " -s=<c> : column separator in mapping file, default is tab" );
System.out.println( " -c : cut name after first space (only for -f=n)" );
System.out.println( " -" + decorator.TRIM_AFTER_TILDE_OPTION
- + " : trim node name to be replaced after tilde" );
+ + " : trim node name to be replaced after tilde" );
System.out.println( " -" + decorator.MIDPOINT_ROOT_OPTION + " : to midpoint-root the tree" );
System.out.println( " -" + decorator.ORDER_TREE_OPTION + " : to order tree branches" );
System.out.println( " -" + decorator.VERBOSE_OPTION + " : verbose" );
public class dom_dup {
// HUMAN MOUSE
- // ARATH SOYBN VOLCA CYAME PARTE THAPS EMIHU NAEGR
+ // ARATH SOYBN VOLCA CYAME PARTE THAPS EMIHU NAEGR
final static private String HELP_OPTION_1 = "help";
final static private String HELP_OPTION_2 = "h";
final static private String PRG_NAME = "dom_dup";
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" );
+ .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();
}
"failed to read phylogeny from [" + in + "]: " + e.getLocalizedMessage() );
}
final File outtree = new File( ForesterUtil.removeSuffix( in.toString() )
- + "_preprocessed_gene_tree.phylo.xml" );
+ + "_preprocessed_gene_tree.phylo.xml" );
final File removed_nodes = new File( ForesterUtil.removeSuffix( in.toString() ) + "_removed_nodes.txt" );
final File present_species = new File( ForesterUtil.removeSuffix( in.toString() ) + "_species_present.txt" );
checkForOutputFileWriteability( outtree );
checkForOutputFileWriteability( present_species );
if ( phy.getNumberOfExternalNodes() < 2 ) {
ForesterUtil.fatalError( PRG_NAME, "phylogeny has " + phy.getNumberOfExternalNodes()
- + " external node(s), aborting" );
+ + " external node(s), aborting" );
}
final SortedSet<String> not_found = SequenceDbWsTools.obtainSeqInformation( phy,
true,
System.out.println( "Usage:" );
System.out.println();
System.out
- .println( PRG_NAME
- + " <file with all GO terms, in 'obo' format> <file with ancestral term ids> <file with go ids to be analyzed>" );
+ .println( PRG_NAME
+ + " <file with all GO terms, in 'obo' format> <file with ancestral term ids> <file with go ids to be analyzed>" );
System.out.println();
System.out.println();
}
fatalError( "unexpected error", e.toString(), log_writer );
}
System.out.println( "Running time (excluding I/O) : " + ( new Date().getTime() - start_time )
- + "ms" );
+ + "ms" );
log_writer.println( "Running time (excluding I/O) : " + ( new Date().getTime() - start_time )
- + "ms" );
+ + "ms" );
System.out.println( "Mapping based on : " + gsdii.getTaxCompBase() );
log_writer.println( "Mapping based on : " + gsdii.getTaxCompBase() );
try {
System.out.println( "Wrote resulting gene tree to : " + out_file.getCanonicalPath() );
log_writer.println( "Wrote resulting gene tree to : " + out_file.getCanonicalPath() );
final File species_tree_used_file = new File( ForesterUtil.removeSuffix( out_file.toString() )
- + SUFFIX_FOR_SPECIES_TREE_USED );
+ + SUFFIX_FOR_SPECIES_TREE_USED );
try {
final PhylogenyWriter writer = new PhylogenyWriter();
writer.toPhyloXML( species_tree_used_file, species_tree, 0 );
}
catch ( final IOException e ) {
ForesterUtil.fatalError( PRG_NAME, "Failed to write to [" + species_tree_used_file.getCanonicalPath()
- + "]: " + e.getMessage() );
+ + "]: " + e.getMessage() );
}
System.out.println( "Wrote (stripped) species tree to : " + species_tree_used_file.getCanonicalPath() );
log_writer.println( "Wrote (stripped) species tree to : " + species_tree_used_file.getCanonicalPath() );
private static void print_help() {
System.out.println( "Usage: " + gsdi.PRG_NAME
- + " [-options] <gene tree in phyloXML format> <species tree> <outfile>" );
+ + " [-options] <gene tree in phyloXML format> <species tree> <outfile>" );
System.out.println();
System.out.println( "Options:" );
System.out.println( " -" + gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION
- + ": to allow stripping of gene tree nodes without a matching species" );
+ + ": to allow stripping of gene tree nodes without a matching species" );
System.out.println( " -" + gsdi.MOST_PARSIMONIOUS_OPTION
- + ": use most parimonious duplication model for GSDI: " );
+ + ": use most parimonious duplication model for GSDI: " );
System.out.println( " assign nodes as speciations which would otherwise be assiged" );
System.out.println( " as potential duplications due to polytomies in the species tree" );
System.out.println( " -" + gsdi.GUESS_FORMAT_OF_SPECIES_TREE
- + ": to allow species tree in other formats than phyloXML (i.e. Newick, NHX, Nexus)" );
+ + ": to allow species tree in other formats than phyloXML (i.e. Newick, NHX, Nexus)" );
System.out.println( " -" + gsdi.GSDIR_OPTION
- + ": to use GSDIR algorithm instead of GSDI algorithm (re-rooting)" );
+ + ": to use GSDIR algorithm instead of GSDI algorithm (re-rooting)" );
System.out.println( " -" + TRANSFER_TAXONOMY_OPTION
- + ": to transfer taxonomic data from species tree to gene tree\n" );
+ + ": to transfer taxonomic data from species tree to gene tree\n" );
System.out.println();
System.out.println( "Gene tree:" );
System.out.println( " in phyloXM format, with taxonomy and sequence data in appropriate fields" );
System.out.println( " in phyloXML format (unless option -" + gsdi.GUESS_FORMAT_OF_SPECIES_TREE + " is used)" );
System.out.println();
System.out.println( "Example: gsdi -" + ALLOW_STRIPPING_OF_GENE_TREE_OPTION
- + " gene_tree.xml tree_of_life.xml out.xml" );
+ + " gene_tree.xml tree_of_life.xml out.xml" );
System.out.println();
}
System.out.println( "Usage:" );
System.out.println();
System.out
- .println( PRG_NAME
- + " -p=<adj P value limit> <obo file> <pfam to go file> <ontologizer outdir> [domain gain loss file] <base for meta ontologizer outfile> <comment>" );
+ .println( PRG_NAME
+ + " -p=<adj P value limit> <obo file> <pfam to go file> <ontologizer outdir> [domain gain loss file] <base for meta ontologizer outfile> <comment>" );
System.out.println();
}
}
final static private String OUTPUT_REMOVED_SEQS_OPTION = "ro";
final static private String MAFFT_OPTIONS = "mo";
final static private String PERFORM_PHYLOGENETIC_INFERENCE = "t";
- //
+ //
final static private String PATH_TO_MAFFT_OPTION = "mafft";
final static private String DO_NOT_NORMALIZE_FOR_EFF_LENGTH_OPTION = "nn";
final static private String PRG_NAME = "msa_compactor";
if ( length >= msa.getLength() ) {
ForesterUtil.fatalError( PRG_NAME,
"target length is out of range [longer than MSA (" + msa.getLength()
- + ")]: " + length );
+ + ")]: " + length );
}
else if ( length < initial_msa_stats.getMin() ) {
ForesterUtil.fatalError( PRG_NAME,
if ( chart_only ) {
if ( ( out != null ) || ( removed_seqs_out_base != null ) ) {
ForesterUtil
- .fatalError( PRG_NAME,
- "chart only, no outfile(s) produced, thus no need to indicate output file(s)" );
+ .fatalError( PRG_NAME,
+ "chart only, no outfile(s) produced, thus no need to indicate output file(s)" );
}
if ( !realign && cla.isOptionSet( STEP_OPTION ) ) {
ForesterUtil.fatalError( PRG_NAME,
if ( perform_phylogenetic_inference ) {
if ( step_for_diagnostics != 1 ) {
ForesterUtil.fatalError( PRG_NAME,
- "step for diagnostics reports needs to be set to 1 for tree calculation" );
+ "step for diagnostics reports needs to be set to 1 for tree calculation" );
}
}
ForesterUtil.printProgramInformation( PRG_NAME,
else {
if ( ForesterUtil.isEmpty( path_to_mafft ) ) {
ForesterUtil.fatalError( PRG_NAME, "no MAFFT executable found, use -\"" + PATH_TO_MAFFT_OPTION
- + "=<path to MAFFT>\" option" );
+ + "=<path to MAFFT>\" option" );
}
else {
ForesterUtil.fatalError( PRG_NAME, "no MAFFT executable at \"" + path_to_mafft + "\"" );
System.out.println( " options: " );
System.out.println();
System.out.println( " -" + REMOVE_WORST_OFFENDERS_OPTION
- + "=<integer> number of worst offender sequences to remove" );
+ + "=<integer> number of worst offender sequences to remove" );
System.out.println( " -" + LENGTH_OPTION + "=<integer> target MSA length" );
System.out.println( " -" + AV_GAPINESS_OPTION + "=<decimal> target gap-ratio (0.0-1.0)" );
System.out.println( " -" + REALIGN_OPTION + " to realign using MAFFT" + mafft_comment );
System.out.println( " -" + MAFFT_OPTIONS + "=<string> options for MAFFT (default: --auto)" );
System.out.println( " -" + STEP_OPTION + "=<integer> step for output and re-aligning (default: 1)" );
System.out.println( " -" + STEP_FOR_DIAGNOSTICS_OPTION
- + "=<integer> step for diagnostics reports (default: 1)" );
+ + "=<integer> step for diagnostics reports (default: 1)" );
System.out.println( " -" + REPORT_ENTROPY
- + " to calculate normalized Shannon Entropy (not recommended for very large alignments)" );
+ + " to calculate normalized Shannon Entropy (not recommended for very large alignments)" );
System.out.println( " -" + OUTPUT_FORMAT_OPTION
- + "=<f|p|n> format for output alignments: f for fasta (default), p for phylip, or n for nexus" );
+ + "=<f|p|n> format for output alignments: f for fasta (default), p for phylip, or n for nexus" );
System.out.println( " -" + OUTPUT_REMOVED_SEQS_OPTION + "=<file> to output the removed sequences" );
System.out.println( " -" + MIN_LENGTH_OPTION
- + "=<integer> minimal effecive sequence length (for deleting of shorter sequences)" );
+ + "=<integer> minimal effecive sequence length (for deleting of shorter sequences)" );
System.out.println( " -" + GAP_RATIO_LENGTH_OPTION
- + "=<decimal> maximal allowed gap ratio per column (for deleting of columms) (0.0-1.0)" );
+ + "=<decimal> maximal allowed gap ratio per column (for deleting of columms) (0.0-1.0)" );
System.out.println( " -" + PERFORM_PHYLOGENETIC_INFERENCE
- + " to calculate a simple phylogenetic tree (Kimura distances, NJ)" );
+ + " to calculate a simple phylogenetic tree (Kimura distances, NJ)" );
System.out.println();
System.out.println();
System.out.println();
System.out.println( "Usage:" );
System.out.println();
System.out.println( "% java -cp forester.jar org.forester.applications." + PRG_NAME
- + " [options] <pairwise distances infile> <out file>" );
+ + " [options] <pairwise distances infile> <out file>" );
System.out.println();
System.out.println( " Options: " );
System.out.println( VERBOSE_OPTION + ": verbose on" );
ForesterUtil.fatalError( PRG_NAME, e.toString() );
}
ForesterUtil.programMessage( PRG_NAME, "successfully read in " + go_terms.size() + " GO terms from [" + infile
- + "]" );
+ + "]" );
if ( output_ids_to_names ) {
final File outfile_ids_to_names = new File( outfile + IDS_TO_NAMES_SUFFIX );
final String error = ForesterUtil.isWritableFile( outfile_ids_to_names );
}
catch ( final IOException e ) {
ForesterUtil.fatalError( pccx.PRG_NAME, "Failed to write to \"" + annotated_phylogenies_outfile
- + "\" [" + e.getMessage() + "]" );
+ + "\" [" + e.getMessage() + "]" );
}
}
}
System.out.println( "Usage:" );
System.out.println();
System.out.println( pccx.PRG_NAME
- + " [options] <phylogen(y|ies) infile> [external node name 1] [name 2] ... [name n]" );
+ + " [options] <phylogen(y|ies) infile> [external node name 1] [name 2] ... [name n]" );
System.out.println();
System.out.println( " Options: " );
System.out.println();
System.out.println( " -o=<file> : write output to <file>" );
System.out.println( " -i=<file> : read (new-line separated) external node names from <file>" );
System.out.println( " -" + pccx.OUTPUT_ANNOTATED_PHYLOGENIES_OPTION
- + "=<file> : write output as annotated phylogeny to <file> (only first" );
+ + "=<file> : write output as annotated phylogeny to <file> (only first" );
System.out.println( " phylogeny in phylogenies infile is used)" );
System.out.println();
}
private static void printHelp() {
System.out.println();
System.out.println( PRG_NAME
- + " <pfam2go mapping file> <file with all GO terms, in 'obo' format> <GO id> [more GO ids]" );
+ + " <pfam2go mapping file> <file with all GO terms, in 'obo' format> <GO id> [more GO ids]" );
System.out.println();
}
}
System.out.println( "Usage:" );
System.out.println();
System.out.println( PRG_NAME + " [-" + ALLOW_DUPLICATES_OPTION
- + " to allow duplicates] <pfam2go file> <file with pfams>" );
+ + " to allow duplicates] <pfam2go file> <file with pfams>" );
System.out.println();
System.out.println();
}
private static void printHelp() {
System.out.println();
System.out.println( PRG_NAME
- + " <pfam2go mapping file> <file with pfam accessors, newline and/or comma separated>" );
+ + " <pfam2go mapping file> <file with pfam accessors, newline and/or comma separated>" );
System.out.println();
}
}
if ( args.length < 4 ) {
System.out.println( "\nstrip: Wrong number of arguments.\n" );
System.out
- .println( "Usage: \"phylostrip <in-tree> <out-tree> <options> [name1] [name2] ... OR [ref-tree]\"\n" );
+ .println( "Usage: \"phylostrip <in-tree> <out-tree> <options> [name1] [name2] ... OR [ref-tree]\"\n" );
System.out.println( " Options: -knn to keep listed nodes" );
System.out.println( " -rnn to remove listed nodes" );
System.out.println( " -knnp to keep nodes found in [ref-tree]" );
&& ( field != PhylogenyMethods.PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME ) ) {
if ( extr_taxonomy_pf_only ) {
( ( NHXParser ) parser )
- .setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_STRICT );
+ .setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_STRICT );
replace_underscores = false;
}
else if ( extr_taxonomy ) {
( ( NHXParser ) parser )
- .setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_RELAXED );
+ .setTaxonomyExtraction( NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_RELAXED );
replace_underscores = false;
}
}
System.out.println( "Usage:" );
System.out.println();
System.out
- .println( PRG_NAME
- + " -"
- + FIELD_OPTION
- + "=<field option> [options] <infile in New Hamphshire, NHX, Nexus, ToL XML, or phyloXML format> <outfile>" );
+ .println( PRG_NAME
+ + " -"
+ + FIELD_OPTION
+ + "=<field option> [options] <infile in New Hamphshire, NHX, Nexus, ToL XML, or phyloXML format> <outfile>" );
System.out.println();
System.out.println( " field options: " );
System.out.println();
System.out.println( " " + FIELD_SEQUENCE_SYMBOL + ": transfer name to sequence symbol" );
System.out.println( " " + FIELD_DUMMY + ": to convert NHX formatted trees to phyloXML" );
System.out.println( " " + FIELD_UNIPROT_TAXONOMY_ID_SPLIT_1
- + ": transfer/split name to taxonomy uniprot identifier" );
+ + ": transfer/split name to taxonomy uniprot identifier" );
System.out.println( " (split at underscore if \"id_name\" pattern, e.g. \"817_SusD\")" );
System.out.println( " " + FIELD_UNIPROT_TAXONOMY_ID_SPLIT_2
- + ": transfer/split name to taxonomy uniprot identifier" );
+ + ": transfer/split name to taxonomy uniprot identifier" );
System.out.println( " (split at underscore if \"name_id\" pattern, e.g. \"SusD_817\")" );
System.out.println();
System.out.println( " options: " );
System.out.println( " -" + INTERNAL_NAMES_ARE_BOOT_SUPPPORT
- + " : internal names in NH or NHX tree are bootstrap support values" );
+ + " : internal names in NH or NHX tree are bootstrap support values" );
System.out.println( " -" + REPLACE_UNDER_SCORES + " : replace all underscores with spaces" );
System.out.println( " -" + MIDPOINT_REROOT + " : midpoint reroot" );
System.out.println( " -" + ORDER_SUBTREES + " : order subtrees" );
System.out
- .println( " -"
- + EXTRACT_TAXONOMY
- + " : extract taxonomy to taxonomy code from \"seqname_TAXON\"-style names (cannot be used with the following field options: "
- + FIELD_TAXONOMY_CODE + ", " + FIELD_TAXONOMY_COMM_NAME + ", " + FIELD_TAXONOMY_SCI_NAME + ")" );
+ .println( " -"
+ + EXTRACT_TAXONOMY
+ + " : extract taxonomy to taxonomy code from \"seqname_TAXON\"-style names (cannot be used with the following field options: "
+ + FIELD_TAXONOMY_CODE + ", " + FIELD_TAXONOMY_COMM_NAME + ", " + FIELD_TAXONOMY_SCI_NAME + ")" );
System.out
- .println( " -"
- + EXTRACT_TAXONOMY_PF
- + " : extract taxonomy to taxonomy code from Pfam (\"seqname_TAXON/x-y\") style names only (cannot be used with the following field options: "
- + FIELD_TAXONOMY_CODE + ", " + FIELD_TAXONOMY_COMM_NAME + ", " + FIELD_TAXONOMY_SCI_NAME + ")" );
+ .println( " -"
+ + EXTRACT_TAXONOMY_PF
+ + " : extract taxonomy to taxonomy code from Pfam (\"seqname_TAXON/x-y\") style names only (cannot be used with the following field options: "
+ + FIELD_TAXONOMY_CODE + ", " + FIELD_TAXONOMY_COMM_NAME + ", " + FIELD_TAXONOMY_SCI_NAME + ")" );
System.out.println( " -" + NO_TREE_LEVEL_INDENDATION + " : no tree level indendation in phyloXML output" );
System.out.println( " -" + IGNORE_QUOTES + ": ignore quotes and whitespace (e.g. \"a b\" becomes ab)" );
System.out.println();
}
else {
ForesterUtil
- .fatalError( "values for re-rooting are: 'none', 'midpoint', or 'outgroup' (minizming duplications is default)" );
+ .fatalError( "values for re-rooting are: 'none', 'midpoint', or 'outgroup' (minizming duplications is default)" );
}
}
if ( ForesterUtil.isEmpty( outgroup ) && ( rerooting == REROOTING.OUTGROUP ) ) {
System.out.println( "Usage" );
System.out.println();
System.out
- .println( PRG_NAME
- + " [options] <gene trees infile> <species tree infile> <all vs all orthology table outfile> [logfile]" );
+ .println( PRG_NAME
+ + " [options] <gene trees infile> <species tree infile> <all vs all orthology table outfile> [logfile]" );
System.out.println();
System.out.println( " Options" );
System.out.println( " -" + GT_FIRST + "=<first> : first gene tree to analyze (0-based index)" );
System.out.println( " -" + GT_LAST + "=<last> : last gene tree to analyze (0-based index)" );
System.out.println( " -" + REROOTING_OPT
- + "=<re-rooting>: re-rooting method for gene trees, possible values or 'none', 'midpoint'," );
+ + "=<re-rooting>: re-rooting method for gene trees, possible values or 'none', 'midpoint'," );
System.out.println( " or 'outgroup' (default: by minizming duplications)" );
System.out.println( " -" + OUTGROUP
- + "=<outgroup> : for rooting by outgroup, name of outgroup (external gene tree node)" );
+ + "=<outgroup> : for rooting by outgroup, name of outgroup (external gene tree node)" );
System.out
- .println( " -" + RETURN_SPECIES_TREE + "=<outfile> : to write the (stripped) species tree to file" );
+ .println( " -" + RETURN_SPECIES_TREE + "=<outfile> : to write the (stripped) species tree to file" );
System.out.println( " -" + RETURN_BEST_GENE_TREE
- + "=<outfile> : to write (one) minimal duplication gene tree to file" );
+ + "=<outfile> : to write (one) minimal duplication gene tree to file" );
System.out
- .println( " -"
- + TRANSFER_TAXONOMY_OPTION
- + " : to transfer taxonomic data from species tree to returned minimal duplication gene tree\n"
- + " (if -" + RETURN_BEST_GENE_TREE + " option is used)" );
+ .println( " -"
+ + TRANSFER_TAXONOMY_OPTION
+ + " : to transfer taxonomic data from species tree to returned minimal duplication gene tree\n"
+ + " (if -" + RETURN_BEST_GENE_TREE + " option is used)" );
System.out.println( " -" + USE_SDIR
- + " : to use SDIR instead of GSDIR (faster, but non-binary species trees are" );
+ + " : to use SDIR instead of GSDIR (faster, but non-binary species trees are" );
System.out.println( " disallowed, as are most options)" );
System.out.println();
System.out.println( " Formats" );
System.out
- .println( " The gene trees, as well as the species tree, ideally are in phyloXML (www.phyloxml.org) format," );
+ .println( " The gene trees, as well as the species tree, ideally are in phyloXML (www.phyloxml.org) format," );
System.out
- .println( " but can also be in New Hamphshire (Newick) or Nexus format as long as species information can be" );
+ .println( " but can also be in New Hamphshire (Newick) or Nexus format as long as species information can be" );
System.out
- .println( " extracted from the gene names (e.g. \"HUMAN\" from \"BCL2_HUMAN\") and matched to a single species" );
+ .println( " extracted from the gene names (e.g. \"HUMAN\" from \"BCL2_HUMAN\") and matched to a single species" );
System.out.println( " in the species tree." );
System.out.println();
System.out.println( " Examples" );
if ( dss_comp != null ) {
sb.append( ForesterUtil.getLineSeparator() );
sb.append( "\t" + ForesterUtil.normalizeString( "values for support means:", max_length, true, ' ' )
- + "\t\t" );
+ + "\t\t" );
sb.append( ForesterUtil.round( dss_comp.arithmeticMean(), support_statistics.PLACES ) + "\t" );
sb.append( ForesterUtil.round( dss_comp.sampleStandardDeviation(), support_statistics.PLACES ) + "\t" );
sb.append( ForesterUtil.round( dss_comp.getMin(), support_statistics.PLACES ) + "\t" );
* Transfers branch length values from one Phylogeny to another. It is
* mainly a "main method" for method "copyBranchLengthValuesFrom( Phylogeny )"
* of org.forester.phylogeny.Phylogeny, to be used in other (Perl) programs.
- *
+ *
* @param args[0]
* Filename (String) for Phylogeny which has correct branch
* length values
* @param args[2]
* String Filename (String) for outputfile
* @param args[3]
- * String [number of tree with correct bl to use in case treefile contains more than one, default 0]
-
+ * String [number of tree with correct bl to use in case treefile contains more than one, default 0]
+
*/
public static void main( final String args[] ) {
Phylogeny phylogeny_w_bl = null; // Has correct branch lengths
* Important (but obvious): The topology of both trees needs to be the same.
* The method is not robust, and might produce wrong results if the internal
* topology differs or if the external node names are not unique.
- *
+ *
* @param from
* the Phylogeny to copy the support values from
* @param to
// ---
public final static String PRG_NAME = "surfacing";
public static final String DOMAINS_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO = "_d_dollo"
- + ForesterConstants.PHYLO_XML_SUFFIX;
+ + ForesterConstants.PHYLO_XML_SUFFIX;
public static final String DOMAINS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH = "_d_fitch"
- + ForesterConstants.PHYLO_XML_SUFFIX;
+ + ForesterConstants.PHYLO_XML_SUFFIX;
public static final String BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO = "_dc_dollo"
- + ForesterConstants.PHYLO_XML_SUFFIX;
+ + ForesterConstants.PHYLO_XML_SUFFIX;
public static final String BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH = "_dc_fitch"
- + ForesterConstants.PHYLO_XML_SUFFIX;
+ + 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_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;
+ + 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 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;
+ + ForesterConstants.PHYLO_XML_SUFFIX;
final static private String NJ_TREE_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX = "_domains_NJ"
- + ForesterConstants.PHYLO_XML_SUFFIX;
+ + ForesterConstants.PHYLO_XML_SUFFIX;
final static private String NJ_TREE_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX = "_bin_combinations_NJ"
- + ForesterConstants.PHYLO_XML_SUFFIX;
+ + ForesterConstants.PHYLO_XML_SUFFIX;
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";
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;
+ + 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";
&& ( cla.isOptionSet( surfacing.FILTER_NEGATIVE_OPTION ) || cla
.isOptionSet( surfacing.FILTER_POSITIVE_OPTION ) ) ) {
ForesterUtil
- .fatalError( surfacing.PRG_NAME,
- "attempt to use both negative or positive protein filter together wirh a negative domains filter" );
+ .fatalError( surfacing.PRG_NAME,
+ "attempt to use both negative or positive protein filter together wirh a negative domains filter" );
}
if ( cla.isOptionSet( surfacing.FILTER_NEGATIVE_OPTION ) ) {
if ( !cla.isOptionValueSet( surfacing.FILTER_NEGATIVE_OPTION ) ) {
final String msg = ForesterUtil.isReadableFile( negative_domains_filter_file );
if ( !ForesterUtil.isEmpty( msg ) ) {
ForesterUtil.fatalError( surfacing.PRG_NAME, "can not read from \"" + negative_domains_filter_file
- + "\": " + msg );
+ + "\": " + msg );
}
}
final List<String> plus_minus_analysis_high_copy_base_species = new ArrayList<String>();
final String msg = ForesterUtil.isReadableFile( input_genomes_file );
if ( !ForesterUtil.isEmpty( msg ) ) {
ForesterUtil
- .fatalError( surfacing.PRG_NAME, "can not read from \"" + input_genomes_file + "\": " + msg );
+ .fatalError( surfacing.PRG_NAME, "can not read from \"" + input_genomes_file + "\": " + msg );
}
}
else {
}
else {
ForesterUtil.fatalError( surfacing.PRG_NAME, "unknown value \"" + scoring_str
- + "\" for scoring method for domain combinations similarity calculation: \"-"
- + surfacing.SCORING_OPTION + "=<" + surfacing.SCORING_DOMAIN_COUNT_BASED + "|"
- + surfacing.SCORING_PROTEIN_COUNT_BASED + "|" + surfacing.SCORING_COMBINATION_BASED + ">\"" );
+ + "\" for scoring method for domain combinations similarity calculation: \"-"
+ + surfacing.SCORING_OPTION + "=<" + surfacing.SCORING_DOMAIN_COUNT_BASED + "|"
+ + surfacing.SCORING_PROTEIN_COUNT_BASED + "|" + surfacing.SCORING_COMBINATION_BASED + ">\"" );
}
}
boolean sort_by_species_count_first = false;
if ( cla.isOptionSet( surfacing.SEQ_EXTRACT_OPTION ) ) {
if ( !cla.isOptionValueSet( surfacing.SEQ_EXTRACT_OPTION ) ) {
ForesterUtil
- .fatalError( surfacing.PRG_NAME,
- "no domain ids given for sequences with given domains to be extracted : -"
- + surfacing.SEQ_EXTRACT_OPTION
- + "=<ordered domain sequences, domain ids separated by '~', sequences separated by '#'>" );
+ .fatalError( surfacing.PRG_NAME,
+ "no domain ids given for sequences with given domains to be extracted : -"
+ + surfacing.SEQ_EXTRACT_OPTION
+ + "=<ordered domain sequences, domain ids separated by '~', sequences separated by '#'>" );
}
query_domain_ids = cla.getOptionValue( surfacing.SEQ_EXTRACT_OPTION );
}
}
else {
ForesterUtil.fatalError( surfacing.PRG_NAME, "unknown value \"" + sort_str
- + "\" for domain combinations similarities sorting: \"-"
- + surfacing.DOMAIN_SIMILARITY_SORT_OPTION + "=<" + surfacing.DOMAIN_SIMILARITY_SORT_ALPHA + "|"
- + surfacing.DOMAIN_SIMILARITY_SORT_MAX + "|" + surfacing.DOMAIN_SIMILARITY_SORT_MIN + "|"
- + surfacing.DOMAIN_SIMILARITY_SORT_MEAN + "|" + surfacing.DOMAIN_SIMILARITY_SORT_DIFF + "|"
- + surfacing.DOMAIN_SIMILARITY_SORT_ABS_COUNTS_DIFF + "|"
- + surfacing.DOMAIN_SIMILARITY_SORT_COUNTS_DIFF + "|" + "|"
- + surfacing.DOMAIN_SIMILARITY_SORT_SPECIES_COUNT + "|" + surfacing.DOMAIN_SIMILARITY_SORT_SD
- + ">\"" );
+ + "\" for domain combinations similarities sorting: \"-"
+ + surfacing.DOMAIN_SIMILARITY_SORT_OPTION + "=<" + surfacing.DOMAIN_SIMILARITY_SORT_ALPHA + "|"
+ + surfacing.DOMAIN_SIMILARITY_SORT_MAX + "|" + surfacing.DOMAIN_SIMILARITY_SORT_MIN + "|"
+ + surfacing.DOMAIN_SIMILARITY_SORT_MEAN + "|" + surfacing.DOMAIN_SIMILARITY_SORT_DIFF + "|"
+ + surfacing.DOMAIN_SIMILARITY_SORT_ABS_COUNTS_DIFF + "|"
+ + surfacing.DOMAIN_SIMILARITY_SORT_COUNTS_DIFF + "|" + "|"
+ + surfacing.DOMAIN_SIMILARITY_SORT_SPECIES_COUNT + "|" + surfacing.DOMAIN_SIMILARITY_SORT_SD
+ + ">\"" );
}
}
DomainSimilarity.PRINT_OPTION domain_similarity_print_option = DOMAIN_SIMILARITY_PRINT_OPTION_DEFAULT;
}
else {
ForesterUtil.fatalError( surfacing.PRG_NAME, "unknown value \"" + sort
- + "\" for sorting of domain counts: \"-" + surfacing.DOMAIN_COUNT_SORT_OPTION + "=<"
- + surfacing.DOMAIN_COUNT_SORT_ALPHA + "|" + surfacing.DOMAIN_COUNT_SORT_KEY_DOMAIN_COUNT + "|"
- + surfacing.DOMAIN_COUNT_SORT_KEY_DOMAIN_PROTEINS_COUNT + "|"
- + surfacing.DOMAIN_COUNT_SORT_COMBINATIONS_COUNT + ">\"" );
+ + "\" for sorting of domain counts: \"-" + surfacing.DOMAIN_COUNT_SORT_OPTION + "=<"
+ + surfacing.DOMAIN_COUNT_SORT_ALPHA + "|" + surfacing.DOMAIN_COUNT_SORT_KEY_DOMAIN_COUNT + "|"
+ + surfacing.DOMAIN_COUNT_SORT_KEY_DOMAIN_PROTEINS_COUNT + "|"
+ + surfacing.DOMAIN_COUNT_SORT_COMBINATIONS_COUNT + ">\"" );
}
}
final String[][] input_file_properties = SurfacingUtil.processInputGenomesFile( input_genomes_file );
domain_id_to_go_ids_map = SurfacingUtil.createDomainIdToGoIdMap( pfam_to_go_mappings );
if ( parser.getMappingCount() < domain_id_to_go_ids_map.size() ) {
ForesterUtil.unexpectedFatalError( surfacing.PRG_NAME,
- "parser.getMappingCount() < domain_id_to_go_ids_map.size()" );
+ "parser.getMappingCount() < domain_id_to_go_ids_map.size()" );
}
domain_id_to_go_ids_count = parser.getMappingCount();
}
}
else {
ForesterUtil.fatalError( surfacing.PRG_NAME, "unknown value \"" + go_namespace_limit_str
- + "\" for GO namespace limit: \"-" + surfacing.GO_NAMESPACE_LIMIT_OPTION + "=<"
- + surfacing.GO_NAMESPACE_LIMIT_OPTION_MOLECULAR_FUNCTION + "|"
- + surfacing.GO_NAMESPACE_LIMIT_OPTION_BIOLOGICAL_PROCESS + "|"
- + surfacing.GO_NAMESPACE_LIMIT_OPTION_CELLULAR_COMPONENT + ">\"" );
+ + "\" for GO namespace limit: \"-" + surfacing.GO_NAMESPACE_LIMIT_OPTION + "=<"
+ + surfacing.GO_NAMESPACE_LIMIT_OPTION_MOLECULAR_FUNCTION + "|"
+ + surfacing.GO_NAMESPACE_LIMIT_OPTION_BIOLOGICAL_PROCESS + "|"
+ + surfacing.GO_NAMESPACE_LIMIT_OPTION_CELLULAR_COMPONENT + ">\"" );
}
}
if ( ( domain_similarity_sort_field == DomainSimilarity.DomainSimilaritySortField.MAX_COUNTS_DIFFERENCE )
Map<String, Set<String>>[] domain_id_to_secondary_features_maps = null;
File[] secondary_features_map_files = null;
final File domain_lengths_analysis_outfile = new File( out_dir + ForesterUtil.FILE_SEPARATOR + output_file
- + DOMAIN_LENGTHS_ANALYSIS_SUFFIX );
+ + DOMAIN_LENGTHS_ANALYSIS_SUFFIX );
if ( domain_length_analysis ) {
SurfacingUtil.checkForOutputFileWriteability( domain_lengths_analysis_outfile );
}
if ( positive_filter_file != null ) {
final int filter_size = filter.size();
System.out.println( "Positive protein filter : " + positive_filter_file + " [" + filter_size
- + " domain ids]" );
+ + " domain ids]" );
html_desc.append( "<tr><td>Positive protein filter:</td><td>" + positive_filter_file + " [" + filter_size
- + " domain ids]</td></tr>" + nl );
+ + " domain ids]</td></tr>" + nl );
}
if ( negative_filter_file != null ) {
final int filter_size = filter.size();
System.out.println( "Negative protein filter : " + negative_filter_file + " [" + filter_size
- + " domain ids]" );
+ + " domain ids]" );
html_desc.append( "<tr><td>Negative protein filter:</td><td>" + negative_filter_file + " [" + filter_size
- + " domain ids]</td></tr>" + nl );
+ + " domain ids]</td></tr>" + nl );
}
if ( negative_domains_filter_file != null ) {
final int filter_size = filter.size();
System.out.println( "Negative domain filter : " + negative_domains_filter_file + " [" + filter_size
- + " domain ids]" );
+ + " domain ids]" );
html_desc.append( "<tr><td>Negative domain filter:</td><td>" + negative_domains_filter_file + " ["
+ filter_size + " domain ids]</td></tr>" + nl );
}
}
System.out.println( "Plus-minus analysis : " + plus1 + "&& " + plus0 + "&& " + minus );
html_desc.append( "<tr><td>Plus-minus analysis:</td><td>" + plus1 + "&& " + plus0 + "&& " + minus
- + "</td></tr>" + nl );
+ + "</td></tr>" + nl );
}
if ( cutoff_scores_file != null ) {
System.out.println( "Cutoff scores file : " + cutoff_scores_file );
if ( no_engulfing_overlaps ) {
System.out.println( "Ignore engulfed domains : " + no_engulfing_overlaps );
html_desc.append( "<tr><td>Ignore (lower confidence) engulfed domains:</td><td>" + no_engulfing_overlaps
- + "</td></tr>" + nl );
+ + "</td></tr>" + nl );
}
System.out.println( "Ignore singlet domains : " + ignore_domains_without_combs_in_all_spec );
html_desc
- .append( "<tr><td>Ignore singlet domains for domain combination similarity analyses (not for parsimony analyses):</td><td>"
- + ignore_domains_without_combs_in_all_spec + "</td></tr>" + nl );
+ .append( "<tr><td>Ignore singlet domains for domain combination similarity analyses (not for parsimony analyses):</td><td>"
+ + ignore_domains_without_combs_in_all_spec + "</td></tr>" + nl );
System.out.println( "Ignore species specific doms: " + ignore_species_specific_domains );
html_desc
- .append( "<tr><td>Ignore species specific domains for domain combination similarity analyses (not for parsimony analyses):</td><td>"
- + ignore_species_specific_domains + "</td></tr>" + nl );
+ .append( "<tr><td>Ignore species specific domains for domain combination similarity analyses (not for parsimony analyses):</td><td>"
+ + ignore_species_specific_domains + "</td></tr>" + nl );
System.out.println( "Ignore combination with self: " + ignore_combination_with_same );
html_desc.append( "<tr><td>Ignore combination with self for domain combination similarity analyses:</td><td>"
+ ignore_combination_with_same + "</td></tr>" + nl );
if ( perform_dc_fich ) {
System.out.println( "Use last in Fitch parsimony : " + use_last_in_fitch_parsimony );
html_desc.append( "<tr><td>Use last in Fitch parsimony:</td><td>" + use_last_in_fitch_parsimony
- + "</td></tr>" + nl );
+ + "</td></tr>" + nl );
}
System.out.println( "Write to Nexus files : " + write_to_nexus );
html_desc.append( "<tr><td>Write to Nexus files:</td><td>" + write_to_nexus + "</td></tr>" + nl );
if ( perform_dc_fich ) {
System.out.println( "DC regain prot stats : " + perform_dc_regain_proteins_stats );
html_desc.append( "<tr><td>DC regain prot stats:</td><td>" + perform_dc_regain_proteins_stats
- + "</td></tr>" + nl );
+ + "</td></tr>" + nl );
}
System.out.println( "DA analysis : " + da_analysis );
html_desc.append( "<tr><td>DA analysis :</td><td>" + da_analysis + "</td></tr>" + nl );
}
if ( domain_id_to_go_ids_map != null ) {
System.out.println( "Pfam to GO mappings from : " + pfam_to_go_file + " [" + domain_id_to_go_ids_count
- + " mappings]" );
+ + " mappings]" );
html_desc.append( "<tr><td>Pfam to GO mappings from:</td><td>" + pfam_to_go_file + " ["
+ domain_id_to_go_ids_count + " mappings]" + "</td></tr>" + nl );
}
if ( perform_pwc ) {
System.out.println( "Suffix for PWC files : " + automated_pairwise_comparison_suffix );
html_desc.append( "<tr><td>Suffix for PWC files</td><td>" + automated_pairwise_comparison_suffix
- + "</td></tr>" + nl );
+ + "</td></tr>" + nl );
}
if ( out_dir != null ) {
System.out.println( "Output directory : " + out_dir );
break;
default:
ForesterUtil
- .unexpectedFatalError( surfacing.PRG_NAME, "unknown value for sorting for similarities" );
+ .unexpectedFatalError( surfacing.PRG_NAME, "unknown value for sorting for similarities" );
}
System.out.println();
html_desc.append( "</td></tr>" + nl );
if ( ( intrees != null ) && ( intrees.length > 0 ) ) {
for( final File intree_file : intree_files ) {
html_desc.append( "<tr><td>Intree for gain/loss parsimony analysis:</td><td>" + intree_file
- + "</td></tr>" + nl );
+ + "</td></tr>" + nl );
System.out.println( " Intree for gain/loss pars.: " + intree_file );
}
}
} // if ( perform_pwc ) {
System.out.println();
html_desc.append( "<tr><td>Command line:</td><td>" + nl + nl + cla.getCommandLineArgsAsString() + nl + nl
- + "</td></tr>" + nl );
+ + "</td></tr>" + nl );
System.out.println( "Command line : " + cla.getCommandLineArgsAsString() );
BufferedWriter[] query_domains_writer_ary = null;
List<String>[] query_domain_ids_array = null;
all_bin_domain_combinations_lost_fitch = new ArrayList<BinaryDomainCombination>();
}
final File per_genome_domain_promiscuity_statistics_file = new File( out_dir + ForesterUtil.FILE_SEPARATOR
- + output_file + D_PROMISCUITY_FILE_SUFFIX );
+ + output_file + D_PROMISCUITY_FILE_SUFFIX );
BufferedWriter per_genome_domain_promiscuity_statistics_writer = null;
try {
per_genome_domain_promiscuity_statistics_writer = new BufferedWriter( new FileWriter( per_genome_domain_promiscuity_statistics_file ) );
BufferedWriter domains_per_potein_stats_writer = null;
try {
domains_per_potein_stats_writer = new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR
- + output_file + "_domains_per_potein_stats.txt" ) );
+ + output_file + "_domains_per_potein_stats.txt" ) );
domains_per_potein_stats_writer.write( "Genome" );
domains_per_potein_stats_writer.write( "\t" );
domains_per_potein_stats_writer.write( "Mean" );
System.out.println( "Coverage : "
+ ForesterUtil.roundToInt( 100.0 * coverage ) + "%" );
SurfacingUtil.log( "Coverage : "
- + ForesterUtil.roundToInt( 100.0 * coverage ) + "%",
- log_writer );
+ + ForesterUtil.roundToInt( 100.0 * coverage ) + "%",
+ log_writer );
System.out.println( "Domains encountered : " + parser.getDomainsEncountered() );
SurfacingUtil.log( "Domains encountered : " + parser.getDomainsEncountered(),
log_writer );
System.out.println( "Domains ignored due to individual score cutoffs: "
+ parser.getDomainsIgnoredDueToIndividualScoreCutoff() );
SurfacingUtil.log( "Domains ignored due to individual score cutoffs: "
- + parser.getDomainsIgnoredDueToIndividualScoreCutoff(),
- log_writer );
+ + parser.getDomainsIgnoredDueToIndividualScoreCutoff(),
+ log_writer );
System.out.println( "Domains ignored due to FS E-value : "
+ parser.getDomainsIgnoredDueToFsEval() );
SurfacingUtil.log( "Domains ignored due to FS E-value : "
- + parser.getDomainsIgnoredDueToFsEval(),
- log_writer );
+ + parser.getDomainsIgnoredDueToFsEval(),
+ log_writer );
System.out.println( "Domains ignored due to iE-value : "
+ parser.getDomainsIgnoredDueToIEval() );
SurfacingUtil.log( "Domains ignored due to iE-value : "
- + parser.getDomainsIgnoredDueToIEval(),
- log_writer );
+ + parser.getDomainsIgnoredDueToIEval(),
+ log_writer );
System.out.println( "Domains ignored due to DUF designation : "
+ parser.getDomainsIgnoredDueToDuf() );
SurfacingUtil
- .log( "Domains ignored due to DUF designation : " + parser.getDomainsIgnoredDueToDuf(),
- log_writer );
+ .log( "Domains ignored due to DUF designation : " + parser.getDomainsIgnoredDueToDuf(),
+ log_writer );
if ( ignore_virus_like_ids ) {
System.out.println( "Domains ignored due virus like ids : "
+ parser.getDomainsIgnoredDueToVirusLikeIds() );
SurfacingUtil.log( "Domains ignored due virus like ids : "
- + parser.getDomainsIgnoredDueToVirusLikeIds(),
- log_writer );
+ + parser.getDomainsIgnoredDueToVirusLikeIds(),
+ log_writer );
}
System.out.println( "Domains ignored due negative domain filter : "
+ parser.getDomainsIgnoredDueToNegativeDomainFilter() );
SurfacingUtil.log( "Domains ignored due negative domain filter : "
- + parser.getDomainsIgnoredDueToNegativeDomainFilter(),
- log_writer );
+ + parser.getDomainsIgnoredDueToNegativeDomainFilter(),
+ log_writer );
System.out.println( "Domains ignored due to overlap : "
+ parser.getDomainsIgnoredDueToOverlap() );
SurfacingUtil.log( "Domains ignored due to overlap : "
- + parser.getDomainsIgnoredDueToOverlap(),
- log_writer );
+ + parser.getDomainsIgnoredDueToOverlap(),
+ log_writer );
if ( negative_filter_file != null ) {
System.out.println( "Proteins ignored due to negative filter : "
+ parser.getProteinsIgnoredDueToFilter() );
SurfacingUtil.log( "Proteins ignored due to negative filter : "
- + parser.getProteinsIgnoredDueToFilter(),
- log_writer );
+ + parser.getProteinsIgnoredDueToFilter(),
+ log_writer );
}
if ( positive_filter_file != null ) {
System.out.println( "Proteins ignored due to positive filter : "
+ parser.getProteinsIgnoredDueToFilter() );
SurfacingUtil.log( "Proteins ignored due to positive filter : "
- + parser.getProteinsIgnoredDueToFilter(),
- log_writer );
+ + parser.getProteinsIgnoredDueToFilter(),
+ log_writer );
}
if ( da_analysis ) {
System.out.println( "Distinct domain architectures stored : " + distinct_das );
int count = 0;
for( final Protein protein : protein_list ) {
dc_data_writer.write( SurfacingUtil.proteinToDomainCombinations( protein, count + "", "\t" )
- .toString() );
+ .toString() );
++count;
for( final Domain d : protein.getProteinDomains() ) {
final String d_str = d.getDomainId().toString();
}
if ( !da_analysis ) {
gwcd_list.add( BasicGenomeWideCombinableDomains
- .createInstance( protein_list,
- ignore_combination_with_same,
- new BasicSpecies( input_file_properties[ i ][ 1 ] ),
- domain_id_to_go_ids_map,
- dc_type,
- protein_length_stats_by_dc,
- domain_number_stats_by_dc ) );
+ .createInstance( protein_list,
+ ignore_combination_with_same,
+ new BasicSpecies( input_file_properties[ i ][ 1 ] ),
+ domain_id_to_go_ids_map,
+ dc_type,
+ protein_length_stats_by_dc,
+ domain_number_stats_by_dc ) );
if ( gwcd_list.get( i ).getSize() > 0 ) {
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 );
+ .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,
distinct_domain_architecuture_counts,
10,
new File( out_dir.toString() + "/" + output_file
- + "_DA_counts.txt" ),
- new File( out_dir.toString() + "/" + output_file
- + "_unique_DAs.txt" ) );
+ + "_DA_counts.txt" ),
+ new File( out_dir.toString() + "/" + output_file
+ + "_unique_DAs.txt" ) );
distinct_domain_architecutures_per_genome.clear();
distinct_domain_architecuture_counts.clear();
System.gc();
all_genomes_domains_per_potein_stats = null;
SurfacingUtil.printOutPercentageOfMultidomainProteins( all_genomes_domains_per_potein_histo, log_writer );
ForesterUtil.map2file( new File( out_dir + ForesterUtil.FILE_SEPARATOR + output_file
- + "_all_genomes_domains_per_potein_histo.txt" ), all_genomes_domains_per_potein_histo, "\t", "\n" );
+ + "_all_genomes_domains_per_potein_histo.txt" ), all_genomes_domains_per_potein_histo, "\t", "\n" );
ForesterUtil.collection2file( new File( out_dir + ForesterUtil.FILE_SEPARATOR + output_file
- + "_domains_always_single_.txt" ), domains_which_are_always_single, "\n" );
+ + "_domains_always_single_.txt" ), domains_which_are_always_single, "\n" );
ForesterUtil.collection2file( new File( out_dir + ForesterUtil.FILE_SEPARATOR + output_file
- + "_domains_single_or_combined.txt" ), domains_which_are_sometimes_single_sometimes_not, "\n" );
+ + "_domains_single_or_combined.txt" ), domains_which_are_sometimes_single_sometimes_not, "\n" );
ForesterUtil.collection2file( new File( out_dir + ForesterUtil.FILE_SEPARATOR + output_file
- + "_domains_always_combined.txt" ), domains_which_never_single, "\n" );
+ + "_domains_always_combined.txt" ), domains_which_never_single, "\n" );
ForesterUtil.programMessage( PRG_NAME,
"Average of proteins with a least one domain assigned: "
+ ( 100 * protein_coverage_stats.arithmeticMean() ) + "% (+/-"
+ ( 100 * protein_coverage_stats.getMin() ) + "%-" + ( 100 * protein_coverage_stats.getMax() )
+ "%" );
SurfacingUtil.log( "Average of prot with a least one dom assigned : "
- + ( 100 * protein_coverage_stats.arithmeticMean() ) + "% (+/-"
- + ( 100 * protein_coverage_stats.sampleStandardDeviation() ) + "%)",
- log_writer );
+ + ( 100 * protein_coverage_stats.arithmeticMean() ) + "% (+/-"
+ + ( 100 * protein_coverage_stats.sampleStandardDeviation() ) + "%)",
+ log_writer );
SurfacingUtil.log( "Range of prot with a least one dom assigned : "
- + ( 100 * protein_coverage_stats.getMin() ) + "%-"
- + ( 100 * protein_coverage_stats.getMax() ) + "%",
- log_writer );
+ + ( 100 * protein_coverage_stats.getMin() ) + "%-"
+ + ( 100 * protein_coverage_stats.getMax() ) + "%",
+ log_writer );
protein_coverage_stats = null;
}
catch ( final IOException e2 ) {
html_desc.append( "<tr><td>Sum of all distinct binary combinations:</td><td>"
+ all_bin_domain_combinations_encountered.size() + "</td></tr>" + nl );
html_desc.append( "<tr><td>Sum of all distinct domains:</td><td>" + all_domains_encountered.size()
- + "</td></tr>" + nl );
+ + "</td></tr>" + nl );
html_desc.append( "<tr><td>Analysis date/time:</td><td>"
+ new java.text.SimpleDateFormat( "yyyy.MM.dd HH:mm:ss" ).format( new java.util.Date() )
+ "</td></tr>" + nl );
html_desc.append( "</table>" + nl );
final Writer simple_tab_writer = new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR
- + my_outfile + ".tsv" ) );
+ + my_outfile + ".tsv" ) );
SurfacingUtil.writeDomainSimilaritiesToFile( html_desc,
new StringBuilder( number_of_genomes + " genomes" ),
simple_tab_writer,
output_file = new File( out_dir + ForesterUtil.FILE_SEPARATOR + output_file );
}
SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
- + surfacing.MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc.getDomainDistanceScoresMeans() );
+ + surfacing.MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc.getDomainDistanceScoresMeans() );
SurfacingUtil
- .writeMatrixToFile( new File( matrix_output_file
- + surfacing.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ),
- pwgc.getSharedBinaryCombinationsBasedDistances() );
+ .writeMatrixToFile( new File( matrix_output_file
+ + surfacing.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedBinaryCombinationsBasedDistances() );
SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
- + surfacing.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ),
- pwgc.getSharedDomainsBasedDistances() );
+ + surfacing.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedDomainsBasedDistances() );
final Phylogeny nj_gd = SurfacingUtil.createNjTreeBasedOnMatrixToFile( new File( matrix_output_file
- + surfacing.NJ_TREE_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc.getDomainDistanceScoresMeans()
- .get( 0 ) );
+ + surfacing.NJ_TREE_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc.getDomainDistanceScoresMeans()
+ .get( 0 ) );
final Phylogeny nj_bc = SurfacingUtil.createNjTreeBasedOnMatrixToFile( new File( matrix_output_file
- + surfacing.NJ_TREE_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedBinaryCombinationsBasedDistances().get( 0 ) );
+ + surfacing.NJ_TREE_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
+ .getSharedBinaryCombinationsBasedDistances().get( 0 ) );
final Phylogeny nj_d = SurfacingUtil.createNjTreeBasedOnMatrixToFile( new File( matrix_output_file
- + surfacing.NJ_TREE_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedDomainsBasedDistances().get( 0 ) );
+ + surfacing.NJ_TREE_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
+ .getSharedDomainsBasedDistances().get( 0 ) );
inferred_trees = new ArrayList<Phylogeny>();
inferred_trees.add( nj_gd );
inferred_trees.add( nj_bc );
parameters_sb.toString(),
domain_id_to_secondary_features_maps,
positive_filter_file == null ? null : filter,
- output_binary_domain_combinationsfor_graph_analysis,
- all_bin_domain_combinations_gained_fitch,
- all_bin_domain_combinations_lost_fitch,
- dc_type,
- protein_length_stats_by_dc,
- domain_number_stats_by_dc,
- domain_length_stats_by_domain,
- tax_code_to_id_map,
- write_to_nexus,
- use_last_in_fitch_parsimony,
- perform_dc_fich );
- // Listing of all domain combinations gained is only done if only one input tree is used.
+ output_binary_domain_combinationsfor_graph_analysis,
+ all_bin_domain_combinations_gained_fitch,
+ all_bin_domain_combinations_lost_fitch,
+ dc_type,
+ protein_length_stats_by_dc,
+ domain_number_stats_by_dc,
+ domain_length_stats_by_domain,
+ tax_code_to_id_map,
+ write_to_nexus,
+ use_last_in_fitch_parsimony,
+ perform_dc_fich );
+ // Listing of all domain combinations gained is only done if only one input tree is used.
if ( ( domain_id_to_secondary_features_maps != null )
&& ( domain_id_to_secondary_features_maps.length > 0 ) ) {
int j = 0;
final DomainParsimonyCalculator secondary_features_parsimony = DomainParsimonyCalculator
.createInstance( intree, gwcd_list, domain_id_to_secondary_features_map );
SurfacingUtil
- .executeParsimonyAnalysisForSecondaryFeatures( outfile_name
- + "_"
- + secondary_features_map_files[ j++ ],
- secondary_features_parsimony,
- intree,
- parameters_sb.toString(),
- mapping_results_map,
- use_last_in_fitch_parsimony );
+ .executeParsimonyAnalysisForSecondaryFeatures( outfile_name
+ + "_"
+ + secondary_features_map_files[ j++ ],
+ secondary_features_parsimony,
+ intree,
+ parameters_sb.toString(),
+ mapping_results_map,
+ use_last_in_fitch_parsimony );
if ( i == 0 ) {
System.out.println();
System.out.println( "Mapping to secondary features:" );
if ( all_bin_domain_combinations_gained_fitch != null ) {
try {
SurfacingUtil
- .executeFitchGainsAnalysis( new File( output_file
- + surfacing.OUTPUT_DOMAIN_COMBINATIONS_GAINED_MORE_THAN_ONCE_ANALYSIS_SUFFIX ),
- all_bin_domain_combinations_gained_fitch,
- all_domains_encountered.size(),
- all_bin_domain_combinations_encountered,
- true );
+ .executeFitchGainsAnalysis( new File( output_file
+ + surfacing.OUTPUT_DOMAIN_COMBINATIONS_GAINED_MORE_THAN_ONCE_ANALYSIS_SUFFIX ),
+ all_bin_domain_combinations_gained_fitch,
+ all_domains_encountered.size(),
+ all_bin_domain_combinations_encountered,
+ true );
}
catch ( final IOException e ) {
ForesterUtil.fatalError( PRG_NAME, e.getLocalizedMessage() );
if ( all_bin_domain_combinations_lost_fitch != null ) {
try {
SurfacingUtil
- .executeFitchGainsAnalysis( new File( output_file
- + surfacing.OUTPUT_DOMAIN_COMBINATIONS_LOST_MORE_THAN_ONCE_ANALYSIS_SUFFIX ),
- all_bin_domain_combinations_lost_fitch,
- all_domains_encountered.size(),
- all_bin_domain_combinations_encountered,
- false );
+ .executeFitchGainsAnalysis( new File( output_file
+ + surfacing.OUTPUT_DOMAIN_COMBINATIONS_LOST_MORE_THAN_ONCE_ANALYSIS_SUFFIX ),
+ all_bin_domain_combinations_lost_fitch,
+ all_domains_encountered.size(),
+ all_bin_domain_combinations_encountered,
+ false );
}
catch ( final IOException e ) {
ForesterUtil.fatalError( PRG_NAME, e.getLocalizedMessage() );
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" );
+ + "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" );
System.out.println( "Usage:" );
System.out.println();
System.out.println( "% java -Xms256m -Xmx512m -cp forester.jar org.forester.applications." + surfacing.PRG_NAME
- + " [options] <phylogen(y|ies) infile> [external node name 1] [name 2] ... [name n]" );
+ + " [options] <phylogen(y|ies) infile> [external node name 1] [name 2] ... [name n]" );
System.out.println();
System.out.println( " Note: This software might need a significant amount of memory (heap space);" );
System.out
- .println( " hence use \"-Xms128m -Xmx512m\" (or more) to prevent a \"java.lang.OutOfMemoryError\"." );
+ .println( " hence use \"-Xms128m -Xmx512m\" (or more) to prevent a \"java.lang.OutOfMemoryError\"." );
System.out.println();
System.out.println( " Options: " );
System.out.println( surfacing.DETAILEDNESS_OPTION + ": level of detail for similarities output file (default:"
+ DETAILEDNESS_DEFAULT + ")" );
System.out.println( surfacing.IGNORE_COMBINATION_WITH_SAME_OPTION
- + ": to ignore combinations with self (default: not to ignore)" );
+ + ": to ignore combinations with self (default: not to ignore)" );
System.out
- .println( surfacing.IGNORE_DOMAINS_WITHOUT_COMBINATIONS_IN_ALL_SPECIES_OPTION
- + ": to ignore domains without combinations in any species (for similarity calc purposes, not for parsimony analyses) (default: not to ignore)" );
+ .println( surfacing.IGNORE_DOMAINS_WITHOUT_COMBINATIONS_IN_ALL_SPECIES_OPTION
+ + ": to ignore domains without combinations in any species (for similarity calc purposes, not for parsimony analyses) (default: not to ignore)" );
System.out
- .println( surfacing.IGNORE_DOMAINS_SPECIFIC_TO_ONE_SPECIES_OPTION
- + ": to ignore domains specific to one species (for similarity calc purposes, not for parsimony analyses) (default: not to ignore)" );
+ .println( surfacing.IGNORE_DOMAINS_SPECIFIC_TO_ONE_SPECIES_OPTION
+ + ": to ignore domains specific to one species (for similarity calc purposes, not for parsimony analyses) (default: not to ignore)" );
System.out.println( surfacing.NOT_IGNORE_DUFS_OPTION
- + ": to _not_ ignore DUFs (domains with unknown function) (default: ignore DUFs)" );
+ + ": to _not_ ignore DUFs (domains with unknown function) (default: ignore DUFs)" );
System.out
- .println( surfacing.IGNORE_VIRAL_IDS
- + ": to ignore domains with ids containing 'vir', 'retro', 'transpos', 'phage', or starting with 'rv' or 'gag_'" );
+ .println( surfacing.IGNORE_VIRAL_IDS
+ + ": to ignore domains with ids containing 'vir', 'retro', 'transpos', 'phage', or starting with 'rv' or 'gag_'" );
System.out.println( surfacing.DOMAIN_SIMILARITY_SORT_OPTION + ": sorting for similarities (default: "
+ DOMAIN_SORT_FILD_DEFAULT + ")" );
System.out.println( surfacing.OUTPUT_FILE_OPTION + ": name for (main) output file (mandatory)" );
+ DOMAIN_SIMILARITY_PRINT_OPTION_DEFAULT + ")" );
System.out.println( surfacing.CUTOFF_SCORE_FILE_OPTION + ": cutoff score file" );
System.out.println( surfacing.DOMAIN_SIMILARITY_SORT_BY_SPECIES_COUNT_FIRST_OPTION
- + ": sort by species count first" );
+ + ": sort by species count first" );
System.out.println( surfacing.OUTPUT_DIR_OPTION + ": output directory" );
System.out.println( surfacing.PFAM_TO_GO_FILE_USE_OPTION + ": Pfam to GO mapping file" );
System.out.println( surfacing.GO_OBO_FILE_USE_OPTION + ": GO terms file (OBO format)" );
System.out.println( surfacing.GO_NAMESPACE_LIMIT_OPTION + ": limit GO term to one GO namespace" );
System.out.println( surfacing.PAIRWISE_DOMAIN_COMPARISONS_OPTION
- + "[=<suffix for pairwise comparison output files>]: to perform pairwise comparison based analyses" );
+ + "[=<suffix for pairwise comparison output files>]: to perform pairwise comparison based analyses" );
System.out.println( surfacing.INPUT_SPECIES_TREE_OPTION
- + ": species tree, to perform (Dollo, Fitch) parismony analyses" );
+ + ": species tree, to perform (Dollo, Fitch) parismony analyses" );
System.out
- .println( surfacing.INPUT_SPECIES_TREE_OPTION
- + "=<treefiles in phyloXML format, separated by #>: to infer domain/binary domain combination gains/losses on given species trees" );
+ .println( surfacing.INPUT_SPECIES_TREE_OPTION
+ + "=<treefiles in phyloXML format, separated by #>: to infer domain/binary domain combination gains/losses on given species trees" );
System.out.println( surfacing.FILTER_POSITIVE_OPTION
- + "=<file>: to filter out proteins not containing at least one domain listed in <file>" );
+ + "=<file>: to filter out proteins not containing at least one domain listed in <file>" );
System.out.println( surfacing.FILTER_NEGATIVE_OPTION
- + "=<file>: to filter out proteins containing at least one domain listed in <file>" );
+ + "=<file>: to filter out proteins containing at least one domain listed in <file>" );
System.out.println( surfacing.FILTER_NEGATIVE_DOMAINS_OPTION
- + "=<file>: to filter out (ignore) domains listed in <file>" );
+ + "=<file>: to filter out (ignore) domains listed in <file>" );
System.out.println( surfacing.INPUT_GENOMES_FILE_OPTION + "=<file>: to read input files from <file>" );
System.out
- .println( surfacing.RANDOM_SEED_FOR_FITCH_PARSIMONY_OPTION
- + "=<seed>: seed for random number generator for Fitch Parsimony analysis (type: long, default: no randomization - given a choice, prefer absence" );
+ .println( surfacing.RANDOM_SEED_FOR_FITCH_PARSIMONY_OPTION
+ + "=<seed>: seed for random number generator for Fitch Parsimony analysis (type: long, default: no randomization - given a choice, prefer absence" );
System.out.println( surfacing.CONSIDER_DOMAIN_COMBINATION_DIRECTEDNESS
- + ": to consider directedness in binary combinations: e.g. A-B != B-A" );
+ + ": to consider directedness in binary combinations: e.g. A-B != B-A" );
System.out.println( surfacing.CONSIDER_DOMAIN_COMBINATION_DIRECTEDNESS_AND_ADJACENCY
- + ": to consider directedness and adjacency in binary combinations" );
+ + ": to consider directedness and adjacency in binary combinations" );
System.out
- .println( surfacing.SEQ_EXTRACT_OPTION
- + "=<domain ids (Pfam names)>: to extract sequence names of sequences containing matching domains and/or domain-sequences (order N to C) (domain separator: '~', domain sequences speparator: '#', e.g. 'NACHT#BIR~CARD')" );
+ .println( surfacing.SEQ_EXTRACT_OPTION
+ + "=<domain ids (Pfam names)>: to extract sequence names of sequences containing matching domains and/or domain-sequences (order N to C) (domain separator: '~', domain sequences speparator: '#', e.g. 'NACHT#BIR~CARD')" );
System.out.println( surfacing.SECONDARY_FEATURES_PARSIMONY_MAP_FILE
- + "=<file>: to perfom parsimony analysis on secondary features" );
+ + "=<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)" );
+ + ": 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" );
+ + ": 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" );
System.out.println( surfacing.OUTPUT_LIST_OF_ALL_PROTEINS_PER_DOMAIN_E_VALUE_OPTION
- + ": e value max per domain for output of all proteins per domain" );
+ + ": e value max per domain for output of all proteins per domain" );
System.out.println( surfacing.USE_LAST_IN_FITCH_OPTION + ": to use last in Fitch parsimony" );
System.out.println( surfacing.WRITE_TO_NEXUS_OPTION + ": to output in Nexus format" );
System.out.println( PERFORM_DC_FITCH + ": to perform DC Fitch parsimony" );
System.out.println();
System.out.println();
System.out
- .println( "Example 1: surfacing -p2g=pfam2go.txt -obo=go.obo -species_tree=tol_156.xml -no_eo -ie=0.01 -dufs -genomes=genomes_all.txt -pos_filter=tf_1.txt -out_dir=_tf1 -o=tf1" );
+ .println( "Example 1: surfacing -p2g=pfam2go.txt -obo=go.obo -species_tree=tol_156.xml -no_eo -ie=0.01 -dufs -genomes=genomes_all.txt -pos_filter=tf_1.txt -out_dir=_tf1 -o=tf1" );
System.out.println();
System.out
- .println( "Example 2: surfacing -p2g=pfam2go.txt -obo=go.obo -species_tree=tol_156.xml -last -ignore_viral_ids -no_eo -ie=0.1 -dufs -genomes=genomes_all.txt -pos_filter=tf_1.txt -all_prot -all_prot_e=0.1 -out_dir=_tf1_e01_ape01 -o=tf1_e01_ape01" );
+ .println( "Example 2: surfacing -p2g=pfam2go.txt -obo=go.obo -species_tree=tol_156.xml -last -ignore_viral_ids -no_eo -ie=0.1 -dufs -genomes=genomes_all.txt -pos_filter=tf_1.txt -all_prot -all_prot_e=0.1 -out_dir=_tf1_e01_ape01 -o=tf1_e01_ape01" );
System.out.println();
}
}
/**
* Returns true if at least one branch has a length larger than zero.
- *
- *
+ *
+ *
* @param phy
*/
final static public boolean isHasAtLeastOneBranchLengthLargerThanZero( final Phylogeny phy ) {
final ControlPanel ac,
final GraphicsExportType type,
final Options options ) throws IOException {
- tree_panel.calcParametersForPainting( width, height, true );
+ tree_panel.calcParametersForPainting( width, height );
tree_panel.resetPreferredSize();
tree_panel.repaint();
final RenderingHints rendering_hints = new RenderingHints( RenderingHints.KEY_RENDERING,
/**
* Exits with -1.
- *
- *
+ *
+ *
* @param message
* to message to be printed
*/
if ( options.isGraphicsExportVisibleOnly() ) {
throw new IllegalArgumentException( "cannot export visible rectangle only without exporting in actual size" );
}
- tree_panel.calcParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY(), true );
+ tree_panel.calcParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY() );
tree_panel.resetPreferredSize();
tree_panel.repaint();
}
if ( options.isGraphicsExportVisibleOnly() ) {
throw new IllegalArgumentException( "cannot export visible rectangle only without exporting in actual size" );
}
- tree_panel.calcParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY(), true );
+ tree_panel.calcParametersForPainting( options.getPrintSizeX(), options.getPrintSizeY() );
tree_panel.resetPreferredSize();
tree_panel.repaint();
}
* has been selected by the user by clicking the "Return ..."
* menu item. This method is expected to be called from Javascript or
* something like it.
- *
+ *
* @return current external node data as String
*/
public String getCurrentExternalNodesDataBuffer() {
/**
* Prints message when initialization is finished. Called automatically.
- *
+ *
* @param g
* Graphics
*/
* has been selected by the user by clicking the "Return ..."
* menu item. This method is expected to be called from Javascript or
* something like it.
- *
+ *
* @return current external node data as String
*/
public String getCurrentExternalNodesDataBuffer() {
/**
* This method returns the current phylogeny as a string in the chosen format
- *
+ *
* @param format must be NH, NHX, NEXUS or PHYLOXML
* @return the phylogeny string
* @author Herve Menager
}
/**
- * This method returns a view of the current phylogeny in a chosen
+ * This method returns a view of the current phylogeny in a chosen
* graphics format, base64-encoded in a string so that in can be used
* from javascript.
- *
+ *
* @param format must be GraphicsExportType (gif, jpg, pdf, png, tif, bmp)
* @return the phylogeny string
* @author Herve Menager
@Override
public void componentResized( final ComponentEvent e ) {
if ( getMainPanel().getCurrentTreePanel() != null ) {
- getMainPanel().getCurrentTreePanel()
- .calcParametersForPainting( getMainPanel().getCurrentTreePanel().getWidth(),
- getMainPanel().getCurrentTreePanel().getHeight(),
- getOptions().isAllowFontSizeChange() );
+ getMainPanel().getCurrentTreePanel().calcParametersForPainting( getMainPanel()
+ .getCurrentTreePanel()
+ .getWidth(),
+ getMainPanel()
+ .getCurrentTreePanel()
+ .getHeight() );
}
}
} );
/**
* Will attempt to use the phylogeny to determine whether to check
* this or not (e.g. phylogram)
- *
+ *
*/
boolean doGuessCheckOption( final int which ) {
return display_options[ which ][ 2 ].equals( "?" );
/**
* Convenience method.
- *
+ *
* @return true if value in configuration file was 'yes'
*/
boolean isDrawAsPhylogram() {
/**
* read each line of config file, process non-comment lines
- * @throws IOException
+ * @throws IOException
*/
private void readConfig( final BufferedReader conf_in ) throws IOException {
String line;
private int _paste_subtree_item;
private int _reroot_cb_item;
private JButton _return_to_super_tree;
- // Search
+ // Search
private JLabel _search_found_label_0;
private JLabel _search_found_label_1;
private JButton _search_reset_button_0;
/**
* Indicates what action should be execute when a node is clicked
- *
+ *
* @return the click-on action
*/
NodeClickAction getActionWhenNodeClicked() {
_mainpanel.getCurrentTreePanel().validate();
_mainpanel.validate();
_mainpanel.getCurrentTreePanel().calcParametersForPainting( _mainpanel.getSizeOfViewport().width,
- _mainpanel.getSizeOfViewport().height,
- true );
+ _mainpanel.getSizeOfViewport().height );
_mainpanel.getCurrentTreePanel().resetPreferredSize();
_mainpanel.adjustJScrollPane();
_mainpanel.getCurrentTreePanel().repaint();
_mainpanel.getCurrentTreePanel().validate();
_mainpanel.validate();
_mainpanel.getCurrentTreePanel().calcParametersForPainting( _mainpanel.getSizeOfViewport().width,
- _mainpanel.getSizeOfViewport().height,
- true );
+ _mainpanel.getSizeOfViewport().height );
_mainpanel.getCurrentTreePanel().resetPreferredSize();
_mainpanel.adjustJScrollPane();
_mainpanel.getCurrentTreePanel().repaint();
if ( tree_panel != null ) {
tree_panel.validate();
tree_panel.calcParametersForPainting( _mainpanel.getSizeOfViewport().width,
- _mainpanel.getSizeOfViewport().height,
- true );
+ _mainpanel.getSizeOfViewport().height );
tree_panel.resetPreferredSize();
tree_panel.repaint();
}
public abstract class MainFrame extends JFrame implements ActionListener {\r
\r
static final String USE_MOUSEWHEEL_SHIFT_TO_ROTATE = "In this display type, use mousewheel + Shift to rotate [or A and S]";\r
- static final String PHYLOXML_REF_TOOL_TIP = Constants.PHYLOXML_REFERENCE; //TODO //FIXME\r
+ static final String PHYLOXML_REF_TOOL_TIP = Constants.PHYLOXML_REFERENCE; //TODO //FIXME\r
static final String APTX_REF_TOOL_TIP = Constants.APTX_REFERENCE;\r
private static final long serialVersionUID = 3655000897845508358L;\r
final static Font menu_font = new Font( Configuration.getDefaultFontFamilyName(),\r
static final String TRIANGULAR_TYPE_CBMI_LABEL = "Triangular";\r
static final String CONVEX_TYPE_CBMI_LABEL = "Convex";\r
static final String ROUNDED_TYPE_CBMI_LABEL = "Rounded";\r
- static final String UNROOTED_TYPE_CBMI_LABEL = "Unrooted (alpha)"; //TODO\r
- static final String CIRCULAR_TYPE_CBMI_LABEL = "Circular (alpha)"; //TODO\r
+ static final String UNROOTED_TYPE_CBMI_LABEL = "Unrooted (alpha)"; //TODO\r
+ static final String CIRCULAR_TYPE_CBMI_LABEL = "Circular (alpha)"; //TODO\r
static final String OPTIONS_HEADER = "Options";\r
static final String SEARCH_SUBHEADER = "Search:";\r
static final String DISPLAY_SUBHEADER = "Display:";\r
JRadioButtonMenuItem _uniform_cladograms_rbmi;\r
JRadioButtonMenuItem _ext_node_dependent_cladogram_rbmi;\r
JCheckBoxMenuItem _color_by_taxonomic_group_cbmi;\r
- JCheckBoxMenuItem _show_scale_cbmi; //TODO fix me\r
+ JCheckBoxMenuItem _show_scale_cbmi; //TODO fix me\r
JCheckBoxMenuItem _show_overview_cbmi;\r
JCheckBoxMenuItem _show_domain_labels;\r
JCheckBoxMenuItem _show_annotation_ref_source;\r
// Handy pointers to child components:\r
MainPanel _mainpanel;\r
Container _contentpane;\r
- final LinkedList<TextFrame> _textframes = new LinkedList<TextFrame>(); ;\r
+ final LinkedList<TextFrame> _textframes = new LinkedList<TextFrame>(); ;\r
Configuration _configuration;\r
Options _options;\r
private Phylogeny _species_tree;\r
* has been selected by the user by clicking the "Return ..."\r
* menu item. This method is expected to be called from Javascript or\r
* something like it.\r
- * \r
+ *\r
* @return current external node data as String\r
*/\r
public String getCurrentExternalNodesDataBuffer() {\r
_mainpanel.getCurrentTreePanel().calcParametersForPainting( _mainpanel.getCurrentTreePanel()
.getWidth(),
_mainpanel.getCurrentTreePanel()
- .getHeight(),
- getOptions().isAllowFontSizeChange() );
+ .getHeight() );
}
}
} );
_mainpanel.getCurrentTreePanel().calcParametersForPainting( _mainpanel.getCurrentTreePanel()\r
.getWidth(),\r
_mainpanel.getCurrentTreePanel()\r
- .getHeight(),\r
- getOptions().isAllowFontSizeChange() );\r
+ .getHeight() );\r
}\r
}\r
} );\r
\r
void writePhylogenyToGraphicsFile( final String file_name, final GraphicsExportType type ) {\r
_mainpanel.getCurrentTreePanel().calcParametersForPainting( _mainpanel.getCurrentTreePanel().getWidth(),\r
- _mainpanel.getCurrentTreePanel().getHeight(),\r
- true );\r
+ _mainpanel.getCurrentTreePanel().getHeight() );\r
String file_written_to = "";\r
boolean error = false;\r
try {\r
}\r
if ( !getOptions().isPrintUsingActualSize() ) {\r
getCurrentTreePanel().calcParametersForPainting( getOptions().getPrintSizeX() - 80,\r
- getOptions().getPrintSizeY() - 140,\r
- true );\r
+ getOptions().getPrintSizeY() - 140 );\r
getCurrentTreePanel().resetPreferredSize();\r
getCurrentTreePanel().repaint();\r
}\r
\r
private void printPhylogenyToPdf( final String file_name ) {\r
if ( !getOptions().isPrintUsingActualSize() ) {\r
- getCurrentTreePanel().calcParametersForPainting( getOptions().getPrintSizeX(),\r
- getOptions().getPrintSizeY(),\r
- true );\r
+ getCurrentTreePanel()\r
+ .calcParametersForPainting( getOptions().getPrintSizeX(), getOptions().getPrintSizeY() );\r
getCurrentTreePanel().resetPreferredSize();\r
getCurrentTreePanel().repaint();\r
}\r
return _allow_errors_in_distance_to_parent;
}
- public boolean isAllowFontSizeChange() {
- return true;
- }
-
public final boolean isShowAnnotationRefSource() {
return _show_annotation_ref_source;
}
/**
* Returns null if printing has been aborted by the user,
- * a String otherwise -- if a printer name was obtained this String is
+ * a String otherwise -- if a printer name was obtained this String is
* the printer name, an empty String otherwise.
- *
+ *
* @param tree_panel
* @param job_name
* @return
final class TextFrame extends JFrame implements ActionListener, ClipboardOwner {
/**
- *
+ *
*/
private static final long serialVersionUID = -5012834229705518363L;
private static Color ta_text_color = new Color( 0, 0, 0 ),
new Color( 0, 100, 100 ), // background_color_gradient_bottom
new Color( 230, 230, 230 ), // sequence __ Default (same as Black)
new Color( 180, 180, 180 ), // taxonomy
- new Color( 180, 180, 180 ), // support
+ new Color( 180, 180, 180 ), // support
new Color( 140, 140, 140 ), // branch_length_color
new Color( 255, 255, 255 ), // branch_color
new Color( 255, 255, 255 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 230, 230, 230 ), // domain_label
- new Color( 100, 100, 100 ), // domains_base
- new Color( 65, 105, 255 ), // binary_domain_combinations_color
+ new Color( 230, 230, 230 ), // domain_label
+ new Color( 100, 100, 100 ), // domains_base
+ new Color( 65, 105, 255 ), // binary_domain_combinations_color
new Color( 173, 255, 47 ) // annotation
, new Color( 130, 130, 130 ) // overview
}, { new Color( 0, 0, 0 ), // background_color
- new Color( 0, 255, 255 ), // background_color_gradient_bottom
+ new Color( 0, 255, 255 ), // background_color_gradient_bottom
new Color( 230, 230, 230 ), // sequence __ Black
new Color( 180, 180, 180 ), // taxonomy
- new Color( 180, 180, 180 ), // support
+ new Color( 180, 180, 180 ), // support
new Color( 140, 140, 140 ), // branch_length_color
new Color( 255, 255, 255 ), // branch_color
new Color( 255, 255, 255 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 230, 230, 230 ), // domain_label
- new Color( 100, 100, 100 ), // domains_base
+ new Color( 230, 230, 230 ), // domain_label
+ new Color( 100, 100, 100 ), // domains_base
new Color( 65, 105, 255 ), // binary_domain_combinations_color
new Color( 173, 255, 47 ) // annotation
, new Color( 130, 130, 130 ) // ov
new Color( 0, 255, 255 ), // background_color_gradient_bottom
new Color( 0, 0, 0 ), // sequence __ Black & White
new Color( 0, 0, 0 ), // taxonomy
- new Color( 0, 0, 0 ), // support
+ new Color( 0, 0, 0 ), // support
new Color( 0, 0, 0 ), // branch_length_color
new Color( 0, 0, 0 ), // branch_color
new Color( 0, 0, 0 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 0, 0, 0 ), // domain_label
- new Color( 100, 100, 100 ), // domains_base
+ new Color( 0, 0, 0 ), // domain_label
+ new Color( 100, 100, 100 ), // domains_base
new Color( 0, 0, 0 ), // binary_domain_combinations_color
new Color( 0, 0, 0 ) // annotation
, new Color( 220, 220, 220 ) // ov
new Color( 0, 255, 255 ), // background_color_gradient_bottom
new Color( 220, 220, 220 ), // sequence __ Silver
new Color( 180, 180, 180 ), // taxonomy
- new Color( 140, 140, 140 ), // support
+ new Color( 140, 140, 140 ), // support
new Color( 140, 140, 140 ), // branch_length_color
new Color( 240, 240, 240 ), // branch_color
new Color( 140, 140, 140 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 230, 230, 230 ), // domain_label
- new Color( 100, 100, 100 ), // domains_base
+ new Color( 230, 230, 230 ), // domain_label
+ new Color( 100, 100, 100 ), // domains_base
new Color( 180, 180, 180 ), // binary_domain_combinations_color
new Color( 140, 140, 140 ) // annotation
, new Color( 40, 40, 40 ) // ov
new Color( 0, 255, 255 ), // background_color_gradient_bottom
new Color( 0, 255, 0 ), // sequence __ the Matrix
new Color( 30, 200, 30 ), // taxonomy
- new Color( 0, 155, 0 ), // support
+ new Color( 0, 155, 0 ), // support
new Color( 0, 100, 0 ), // branch_length_color
new Color( 0, 155, 0 ), // branch_color
new Color( 0, 255, 0 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 230, 230, 230 ), // domain_label
- new Color( 100, 100, 100 ), // domains_base
+ new Color( 230, 230, 230 ), // domain_label
+ new Color( 100, 100, 100 ), // domains_base
new Color( 0, 235, 0 ), // binary_domain_combinations_color
new Color( 0, 235, 0 ) // annotation
, new Color( 40, 40, 40 ) // ov
new Color( 0, 255, 255 ), // background_color_gradient_bottom
new Color( 0, 0, 0 ), //sequence __ White & Blue
new Color( 40, 40, 40 ), // taxonomy
- new Color( 0, 125, 0 ), // support
+ new Color( 0, 125, 0 ), // support
new Color( 70, 70, 0 ), // branch_length_color
new Color( 0, 20, 200 ), // branch_color
new Color( 0, 20, 200 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 0, 0, 0 ), // domain_label
- new Color( 50, 50, 50 ), // domains_base
+ new Color( 0, 0, 0 ), // domain_label
+ new Color( 50, 50, 50 ), // domains_base
new Color( 65, 105, 225 ), // binary_domain_combinations_color
new Color( 173, 255, 47 ) // annotation
, new Color( 220, 220, 220 ) // ov
new Color( 0, 255, 255 ), // background_color_gradient_bottom
new Color( 255, 255, 255 ), // sequence __ Cyan
new Color( 200, 200, 200 ), // taxonomy
- new Color( 255, 255, 255 ), // support
+ new Color( 255, 255, 255 ), // support
new Color( 200, 200, 200 ), // branch_length_color
new Color( 0, 255, 255 ), // branch_color
new Color( 0, 255, 255 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 230, 230, 230 ), // domain_label
- new Color( 100, 100, 100 ), // domains_base
+ new Color( 230, 230, 230 ), // domain_label
+ new Color( 100, 100, 100 ), // domains_base
new Color( 65, 105, 225 ), // binary_domain_combinations_color
new Color( 173, 255, 47 ) // annotation
, new Color( 0, 120, 120 ) // ov
new Color( 0, 255, 255 ), // background_color_gradient_bottom
new Color( 255, 200, 0 ), // sequence __ Clockwork
new Color( 255, 200, 0 ), // taxonomy
- new Color( 255, 200, 0 ), // support
+ new Color( 255, 200, 0 ), // support
new Color( 255, 200, 0 ), // branch_length_color
new Color( 255, 200, 0 ), // branch_color
new Color( 255, 200, 0 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 255, 200, 0 ), // domain_label
- new Color( 255, 200, 0 ), // domains_base
+ new Color( 255, 200, 0 ), // domain_label
+ new Color( 255, 200, 0 ), // domains_base
new Color( 150, 150, 150 ), // binary_domain_combinations_color
new Color( 150, 150, 150 ) // annotation
, new Color( 150, 150, 150 ) // ov
new Color( 0, 255, 255 ), // background_color_gradient_bottom
new Color( 255, 255, 255 ), // sequence __ Blue
new Color( 255, 255, 255 ), // taxonomy
- new Color( 255, 0, 0 ), // support
+ new Color( 255, 0, 0 ), // support
new Color( 255, 0, 0 ), // branch_length_color
new Color( 255, 0, 0 ), // branch_color
new Color( 255, 0, 0 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 255, 255, 255 ), // domain_label
- new Color( 100, 100, 100 ), // domains_base
+ new Color( 255, 255, 255 ), // domain_label
+ new Color( 100, 100, 100 ), // domains_base
new Color( 255, 255, 255 ), // binary_domain_combinations_color
new Color( 255, 255, 255 ) // annotation
, new Color( 77, 77, 255 ) // ov
new Color( 0, 255, 255 ), // background_color_gradient_bottom
new Color( 255, 255, 255 ), // sequence __ blue & white
new Color( 255, 255, 255 ), // taxonomy
- new Color( 255, 255, 255 ), // support
+ new Color( 255, 255, 255 ), // support
new Color( 0, 191, 255 ), // branch_length_color
new Color( 0, 191, 255 ), // branch_color
new Color( 0, 191, 255 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 255, 255, 255 ), // domain_label
- new Color( 150, 150, 150 ), // domains_base
+ new Color( 255, 255, 255 ), // domain_label
+ new Color( 150, 150, 150 ), // domains_base
new Color( 255, 255, 255 ), // binary_domain_combinations_color
new Color( 255, 255, 255 ) // annotation
, new Color( 170, 187, 204 ) // ov
new Color( 255, 255, 0 ), // background_color_gradient_bottom
new Color( 127, 255, 0 ), // sequence __ Neon
new Color( 255, 110, 199 ), // taxonomy
- new Color( 234, 173, 234 ), // support
+ new Color( 234, 173, 234 ), // support
new Color( 77, 77, 255 ), // branch_length_color
new Color( 234, 173, 234 ), // branch_color
new Color( 77, 77, 255 ), // box_color
new Color( 255, 0, 0 ), // duplication_box_color
new Color( 0, 255, 0 ), // speciation_box_color
new Color( 255, 255, 0 ), // duplication_speciation_color
- new Color( 127, 255, 0 ), // domain_label
- new Color( 234, 173, 234 ), // domains_base
+ new Color( 127, 255, 0 ), // domain_label
+ new Color( 234, 173, 234 ), // domains_base
new Color( 27, 255, 0 ), // binary_domain_combinations_color
new Color( 27, 255, 0 ) // annotation
, new Color( 77, 77, 255 ) // ov
calculateScaleDistance();
FORMATTER_CONFIDENCE.setMaximumFractionDigits( configuration.getNumberOfDigitsAfterCommaForConfidenceValues() );
FORMATTER_BRANCH_LENGTH.setMaximumFractionDigits( configuration
- .getNumberOfDigitsAfterCommaForBranchLengthValues() );
+ .getNumberOfDigitsAfterCommaForBranchLengthValues() );
}
@Override
}
/**
- * Get a pointer to the phylogeny
- *
+ * Get a pointer to the phylogeny
+ *
* @return a pointer to the phylogeny
*/
public final Phylogeny getPhylogeny() {
/**
* Set a phylogeny tree.
- *
+ *
* @param t
* an instance of a Phylogeny
*/
/**
* Set parameters for printing the displayed tree
- *
+ *
*/
- final void calcParametersForPainting( final int x, final int y, final boolean recalc_longest_ext_node_info ) {
+ final void calcParametersForPainting( final int x, final int y ) {
// updateStyle(); not needed?
if ( ( _phylogeny != null ) && !_phylogeny.isEmpty() ) {
initNodeData();
- if ( recalc_longest_ext_node_info ) {
- calculateLongestExtNodeInfo();
- if ( getOptions().isAllowFontSizeChange() ) {
- if ( ( getLongestExtNodeInfo() > ( x * 0.6 ) )
- && ( getTreeFontSet().getLargeFont().getSize() > ( 2 + TreeFontSet.FONT_SIZE_CHANGE_STEP ) ) ) {
- while ( ( getLongestExtNodeInfo() > ( x * 0.7 ) )
- && ( getTreeFontSet().getLargeFont().getSize() > 2 ) ) {
- getMainPanel().getTreeFontSet().decreaseFontSize( getConfiguration().getMinBaseFontSize(),
- true );
- calculateLongestExtNodeInfo();
- }
- }
- else {
- while ( ( getLongestExtNodeInfo() < ( x * 0.6 ) )
- && ( getTreeFontSet().getLargeFont().getSize() <= ( getTreeFontSet()
- .getLargeFontMemory().getSize() - TreeFontSet.FONT_SIZE_CHANGE_STEP ) ) ) {
- getMainPanel().getTreeFontSet().increaseFontSize();
- calculateLongestExtNodeInfo();
- }
- }
+ calculateLongestExtNodeInfo();
+ if ( ( getLongestExtNodeInfo() > ( x * 0.6 ) )
+ && ( getTreeFontSet().getLargeFont().getSize() > ( 2 + TreeFontSet.FONT_SIZE_CHANGE_STEP ) ) ) {
+ while ( ( getLongestExtNodeInfo() > ( x * 0.7 ) ) && ( getTreeFontSet().getLargeFont().getSize() > 2 ) ) {
+ getMainPanel().getTreeFontSet().decreaseFontSize( getConfiguration().getMinBaseFontSize(), true );
+ calculateLongestExtNodeInfo();
+ }
+ }
+ else {
+ while ( ( getLongestExtNodeInfo() < ( x * 0.6 ) )
+ && ( getTreeFontSet().getLargeFont().getSize() <= ( getTreeFontSet().getLargeFontMemory()
+ .getSize() - TreeFontSet.FONT_SIZE_CHANGE_STEP ) ) ) {
+ getMainPanel().getTreeFontSet().increaseFontSize();
+ calculateLongestExtNodeInfo();
}
- _length_of_longest_text = calcLengthOfLongestText();
}
+ _length_of_longest_text = calcLengthOfLongestText();
int ext_nodes = _phylogeny.getRoot().getNumberOfExternalNodes();
final int max_depth = PhylogenyMethods.calculateMaxDepth( _phylogeny );
if ( ext_nodes == 1 ) {
_circ_max_depth = max_depth;
setUpUrtFactor();
//
- if ( getOptions().isAllowFontSizeChange() ) {
- if ( ( getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.UNROOTED )
- && ( getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) ) {
- // int dynamic_hiding_factor = calcDynamicHidingFactor();
- // if ( dynamic_hiding_factor > 1 ) {
- // while ( dynamic_hiding_factor > 1
- // && getTreeFontSet()._fm_large.getHeight() > TreeFontSet.SMALL_FONTS_BASE ) {
- // getTreeFontSet().decreaseFontSize( 1, true );
- // dynamic_hiding_factor = calcDynamicHidingFactor();
- // }
- // }
- // else if ( getTreeFontSet().isDecreasedSizeBySystem() ) {
- // while ( dynamic_hiding_factor < 1 && getTreeFontSet()._fm_large.getHeight() < 12 ) {
- // getTreeFontSet().increaseFontSize();
- // dynamic_hiding_factor = calcDynamicHidingFactor();
- // }
- // }
- }
+ if ( ( getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.UNROOTED )
+ && ( getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) ) {
+ // int dynamic_hiding_factor = calcDynamicHidingFactor();
+ // if ( dynamic_hiding_factor > 1 ) {
+ // while ( dynamic_hiding_factor > 1
+ // && getTreeFontSet()._fm_large.getHeight() > TreeFontSet.SMALL_FONTS_BASE ) {
+ // getTreeFontSet().decreaseFontSize( 1, true );
+ // dynamic_hiding_factor = calcDynamicHidingFactor();
+ // }
+ // }
+ // else if ( getTreeFontSet().isDecreasedSizeBySystem() ) {
+ // while ( dynamic_hiding_factor < 1 && getTreeFontSet()._fm_large.getHeight() < 12 ) {
+ // getTreeFontSet().increaseFontSize();
+ // dynamic_hiding_factor = calcDynamicHidingFactor();
+ // }
+ // }
}
//
}
return;
}
int max_length = ForesterUtil.roundToInt( ( getSize().getWidth() - MOVE )
- * Constants.EXT_NODE_INFO_LENGTH_MAX_RATIO );
+ * Constants.EXT_NODE_INFO_LENGTH_MAX_RATIO );
if ( max_length < 40 ) {
max_length = 40;
}
}
if ( getControlPanel().isShowBinaryCharacters() && node.getNodeData().isHasBinaryCharacters() ) {
sum += getFontMetricsForLargeDefaultFont().stringWidth( node.getNodeData().getBinaryCharacters()
- .getGainedCharactersAsStringBuffer().toString() );
+ .getGainedCharactersAsStringBuffer().toString() );
}
if ( getControlPanel().isShowVectorData() && ( node.getNodeData().getVector() != null )
&& ( node.getNodeData().getVector().size() > 0 ) ) {
}
if ( getControlPanel().isShowDomainArchitectures() && node.getNodeData().isHasSequence()
&& ( node.getNodeData().getSequence().getDomainArchitecture() != null ) ) {
- // FIXME
+ // FIXME
// TODO this might need some clean up
final DomainArchitecture d = node.getNodeData().getSequence().getDomainArchitecture();
sum += ( ( _domain_structure_width / ( ( RenderableDomainArchitecture ) d ).getOriginalSize()
if ( getControlPanel().isShowMolSequences() && ( node.getNodeData().isHasSequence() )
&& ( node.getNodeData().getSequence().isMolecularSequenceAligned() )
&& ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getMolecularSequence() ) ) ) {
- // FIXME
+ // FIXME
sum += RenderableMsaSequence.DEFAULT_WIDTH + 30;
}
if ( sum >= max_length ) {
}
catch ( final NumberFormatException e ) {
JOptionPane.showMessageDialog( this, "Could not parse \"" + value_str
- + "\" into a decimal value", "Problem with Vector Data", JOptionPane.ERROR_MESSAGE );
+ + "\" into a decimal value", "Problem with Vector Data", JOptionPane.ERROR_MESSAGE );
return;
}
int i = -1;
catch ( final NumberFormatException e ) {
JOptionPane.showMessageDialog( this,
"Could not parse \"" + index_str
- + "\" into index for vector data",
+ + "\" into index for vector data",
"Problem with Vector Data",
JOptionPane.ERROR_MESSAGE );
return;
/**
* Collapse the tree from the given node
- *
+ *
* @param node
* a PhylogenyNode
*/
/**
* Find the node, if any, at the given location
- *
+ *
* @param x
* @param y
* @return pointer to the node at x,y, null if not found
if ( !( node.getNodeData().getSequence().getDomainArchitecture() instanceof RenderableDomainArchitecture ) ) {
if ( SPECIAL_DOMAIN_COLORING ) {
rds = new RenderableDomainArchitecture( node.getNodeData().getSequence()
- .getDomainArchitecture(), node.getName() );
+ .getDomainArchitecture(), node.getName() );
}
else {
rds = new RenderableDomainArchitecture( node.getNodeData().getSequence()
- .getDomainArchitecture() );
+ .getDomainArchitecture() );
}
node.getNodeData().getSequence().setDomainArchitecture( rds );
}
return ( ( e.getX() > ( getVisibleRect().x + getOvXPosition() + 1 ) )
&& ( e.getX() < ( ( getVisibleRect().x + getOvXPosition() + getOvMaxWidth() ) - 1 ) )
&& ( e.getY() > ( getVisibleRect().y + getOvYPosition() + 1 ) ) && ( e.getY() < ( ( getVisibleRect().y
- + getOvYPosition() + getOvMaxHeight() ) - 1 ) ) );
+ + getOvYPosition() + getOvMaxHeight() ) - 1 ) ) );
}
final boolean inOvRectangle( final MouseEvent e ) {
return ( ( e.getX() >= ( getOvRectangle().getX() - 1 ) )
&& ( e.getX() <= ( getOvRectangle().getX() + getOvRectangle().getWidth() + 1 ) )
&& ( e.getY() >= ( getOvRectangle().getY() - 1 ) ) && ( e.getY() <= ( getOvRectangle().getY()
- + getOvRectangle().getHeight() + 1 ) ) );
+ + getOvRectangle().getHeight() + 1 ) ) );
}
final boolean isApplet() {
y = max_y;
}
getMainPanel().getCurrentScrollPane().getViewport()
- .setViewPosition( new Point( ForesterUtil.roundToInt( x ), ForesterUtil.roundToInt( y ) ) );
+ .setViewPosition( new Point( ForesterUtil.roundToInt( x ), ForesterUtil.roundToInt( y ) ) );
setInOvRect( true );
repaint();
}
if ( isInFoundNodes( c ) || isInCurrentExternalNodes( c ) ) {
g.setColor( getColorForFoundNode( c ) );
drawRectFilled( c.getXSecondary() - OVERVIEW_FOUND_NODE_BOX_SIZE_HALF, c.getYSecondary()
- - OVERVIEW_FOUND_NODE_BOX_SIZE_HALF, OVERVIEW_FOUND_NODE_BOX_SIZE, OVERVIEW_FOUND_NODE_BOX_SIZE, g );
+ - OVERVIEW_FOUND_NODE_BOX_SIZE_HALF, OVERVIEW_FOUND_NODE_BOX_SIZE, OVERVIEW_FOUND_NODE_BOX_SIZE, g );
}
}
else {
if ( !to_graphics_file ) {
g.setPaint( new GradientPaint( r.x, r.y, getTreeColorSet().getBackgroundColor(), r.x, r.y
- + r.height, getTreeColorSet().getBackgroundColorGradientBottom() ) );
+ + r.height, getTreeColorSet().getBackgroundColorGradientBottom() ) );
g.fill( r );
}
else {
}
// Position starting Y of tree
_phylogeny.getRoot().setYcoord( ( getYdistance() * _phylogeny.getRoot().getNumberOfExternalNodes() )
- + ( TreePanel.MOVE / 2.0f ) );
+ + ( TreePanel.MOVE / 2.0f ) );
final int dynamic_hiding_factor = calcDynamicHidingFactor();
if ( getControlPanel().isDynamicallyHideData() ) {
if ( dynamic_hiding_factor > 1 ) {
y_pos + radius_ov,
( int ) ( radius_ov - ( getLongestExtNodeInfo() / ( getVisibleRect().width / getOvRectangle()
.getWidth() ) ) ),
- g );
+ g );
g.setTransform( _at );
paintOvRectangle( g );
}
x = TreePanel.MOVE
+ getLongestExtNodeInfo()
+ ForesterUtil
- .roundToInt( ( getXcorrectionFactor() * getPhylogeny().getHeight() ) + getXdistance() );
+ .roundToInt( ( getXcorrectionFactor() * getPhylogeny().getHeight() ) + getXdistance() );
}
else {
if ( !isNonLinedUpCladogram() && !isUniformBranchLengthsForCladogram() ) {
x = TreePanel.MOVE
+ getLongestExtNodeInfo()
+ ForesterUtil.roundToInt( getXdistance()
- * ( getPhylogeny().getRoot().getNumberOfExternalNodes() + 2 ) );
+ * ( getPhylogeny().getRoot().getNumberOfExternalNodes() + 2 ) );
}
else {
x = TreePanel.MOVE
+ getLongestExtNodeInfo()
+ ForesterUtil.roundToInt( getXdistance()
- * ( PhylogenyMethods.calculateMaxDepth( getPhylogeny() ) + 1 ) );
+ * ( PhylogenyMethods.calculateMaxDepth( getPhylogeny() ) + 1 ) );
}
}
setPreferredSize( new Dimension( x, y ) );
/**
* Calculate the length of the distance between the given node and its
* parent.
- *
+ *
* @param node
* @param ext_node_x
* @factor
return ( ( x >= ( getOvVirtualRectangle().x - 1 ) )
&& ( x <= ( getOvVirtualRectangle().x + getOvVirtualRectangle().width + 1 ) )
&& ( y >= ( getOvVirtualRectangle().y - 1 ) ) && ( y <= ( getOvVirtualRectangle().y
- + getOvVirtualRectangle().height + 1 ) ) );
+ + getOvVirtualRectangle().height + 1 ) ) );
}
final private boolean inOvVirtualRectangle( final MouseEvent e ) {
&& ( ( !ForesterUtil.isEmpty( node.getNodeData().getTaxonomy().getScientificName() ) )
|| ( !ForesterUtil.isEmpty( node.getNodeData().getTaxonomy().getTaxonomyCode() ) )
|| ( !ForesterUtil.isEmpty( node.getNodeData().getTaxonomy().getCommonName() ) ) || ( ( node
- .getNodeData().getTaxonomy().getIdentifier() != null ) && !ForesterUtil.isEmpty( node
- .getNodeData().getTaxonomy().getIdentifier().getValue() ) ) ) ) {
+ .getNodeData().getTaxonomy().getIdentifier() != null ) && !ForesterUtil.isEmpty( node
+ .getNodeData().getTaxonomy().getIdentifier().getValue() ) ) ) ) {
return true;
}
else {
}
return ( ( node.getYcoord() < ( getVisibleRect().getMinY() - y_dist ) )
|| ( node.getYcoord() > ( getVisibleRect().getMaxY() + y_dist ) ) || ( ( node.getParent() != null ) && ( node
- .getParent().getXcoord() > getVisibleRect().getMaxX() ) ) );
+ .getParent().getXcoord() > getVisibleRect().getMaxX() ) ) );
}
final private boolean isNodeDataInvisibleUnrootedCirc( final PhylogenyNode node ) {
return ( ( node.getYcoord() < ( getVisibleRect().getMinY() - 20 ) )
|| ( node.getYcoord() > ( getVisibleRect().getMaxY() + 20 ) )
|| ( node.getXcoord() < ( getVisibleRect().getMinX() - 20 ) ) || ( node.getXcoord() > ( getVisibleRect()
- .getMaxX() + 20 ) ) );
+ .getMaxX() + 20 ) ) );
}
final private boolean isNonLinedUpCladogram() {
AptxUtil.launchWebBrowser( new URI( uri_str ),
isApplet(),
isApplet() ? obtainApplet() : null,
- "_aptx_seq" );
+ "_aptx_seq" );
}
catch ( final IOException e ) {
AptxUtil.showErrorMessage( this, e.toString() );
AptxUtil.launchWebBrowser( new URI( uri_str ),
isApplet(),
isApplet() ? obtainApplet() : null,
- "_aptx_seq" );
+ "_aptx_seq" );
}
catch ( final IOException e ) {
AptxUtil.showErrorMessage( this, e.toString() );
AptxUtil.launchWebBrowser( new URI( uri_str ),
isApplet(),
isApplet() ? obtainApplet() : null,
- "_aptx_tax" );
+ "_aptx_tax" );
}
catch ( final IOException e ) {
AptxUtil.showErrorMessage( this, e.toString() );
if ( !node.isRoot() ) {
if ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) {
TreePanel.drawString( FORMATTER_BRANCH_LENGTH.format( node.getDistanceToParent() ), node.getParent()
- .getXcoord() + EURO_D, node.getYcoord() - getTreeFontSet().getSmallMaxDescent(), g );
+ .getXcoord() + EURO_D, node.getYcoord() - getTreeFontSet().getSmallMaxDescent(), g );
}
else if ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.ROUNDED ) {
TreePanel.drawString( FORMATTER_BRANCH_LENGTH.format( node.getDistanceToParent() ), node.getParent()
- .getXcoord() + ROUNDED_D, node.getYcoord() - getTreeFontSet().getSmallMaxDescent(), g );
+ .getXcoord() + ROUNDED_D, node.getYcoord() - getTreeFontSet().getSmallMaxDescent(), g );
}
else {
TreePanel.drawString( FORMATTER_BRANCH_LENGTH.format( node.getDistanceToParent() ), node.getParent()
- .getXcoord() + 3, node.getYcoord() - getTreeFontSet().getSmallMaxDescent(), g );
+ .getXcoord() + 3, node.getYcoord() - getTreeFontSet().getSmallMaxDescent(), g );
}
}
else {
TreePanel.drawString( FORMATTER_BRANCH_LENGTH.format( node.getDistanceToParent() ), 3, node.getYcoord()
- - getTreeFontSet().getSmallMaxDescent(), g );
+ - getTreeFontSet().getSmallMaxDescent(), g );
}
}
final float dx = x2 - x1;
final float dy = y2 - y1;
_cubic_curve.setCurve( x1, y1, x1 + ( dx * 0.4f ), y1 + ( dy * 0.2f ), x1 + ( dx * 0.6f ), y1
- + ( dy * 0.8f ), x2, y2 );
+ + ( dy * 0.8f ), x2, y2 );
( g ).draw( _cubic_curve );
}
else {
/**
* Paint a branch which consists of a vertical and a horizontal bar
- * @param is_ind_found_nodes
+ * @param is_ind_found_nodes
*/
final private void paintBranchRectangular( final Graphics2D g,
final float x1,
final float dx = x2 - x1;
final float dy = y2 - y1;
_cubic_curve.setCurve( x1, y1, x1 + ( dx * 0.4f ), y1 + ( dy * 0.2f ), x1 + ( dx * 0.6f ), y1
- + ( dy * 0.8f ), x2, y2 );
+ + ( dy * 0.8f ), x2, y2 );
g.draw( _cubic_curve );
}
else {
not_first = true;
}
sb.append( FORMATTER_CONFIDENCE.format( ForesterUtil.round( value, getOptions()
- .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
+ .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
if ( getOptions().isShowConfidenceStddev() ) {
if ( confidence.getStandardDeviation() != Confidence.CONFIDENCE_DEFAULT_VALUE ) {
sb.append( "(" );
sb.append( FORMATTER_CONFIDENCE.format( ForesterUtil.round( confidence
- .getStandardDeviation(), getOptions()
- .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
+ .getStandardDeviation(), getOptions()
+ .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
sb.append( ")" );
}
}
final String conf_str = sb.toString();
TreePanel.drawString( conf_str,
parent_x
- + ( ( x - parent_x - getTreeFontSet().getFontMetricsSmall()
- .stringWidth( conf_str ) ) / 2 ),
- ( node.getYcoord() + getTreeFontSet().getSmallMaxAscent() ) - 1,
- g );
+ + ( ( x - parent_x - getTreeFontSet().getFontMetricsSmall()
+ .stringWidth( conf_str ) ) / 2 ),
+ ( node.getYcoord() + getTreeFontSet().getSmallMaxAscent() ) - 1,
+ g );
}
}
g.setColor( Color.BLUE );
}
TreePanel
- .drawString( gained,
- parent_x
- + ( ( x - parent_x - getFontMetricsForLargeDefaultFont().stringWidth( gained ) ) / 2 ),
- ( node.getYcoord() - getFontMetricsForLargeDefaultFont().getMaxDescent() ),
- g );
+ .drawString( gained,
+ parent_x
+ + ( ( x - parent_x - getFontMetricsForLargeDefaultFont().stringWidth( gained ) ) / 2 ),
+ ( node.getYcoord() - getFontMetricsForLargeDefaultFont().getMaxDescent() ),
+ g );
g.setColor( getTreeColorSet().getLostCharactersColor() );
TreePanel
- .drawString( lost,
- parent_x
- + ( ( x - parent_x - getFontMetricsForLargeDefaultFont().stringWidth( lost ) ) / 2 ),
- ( node.getYcoord() + getFontMetricsForLargeDefaultFont().getMaxAscent() ),
- g );
+ .drawString( lost,
+ parent_x
+ + ( ( x - parent_x - getFontMetricsForLargeDefaultFont().stringWidth( lost ) ) / 2 ),
+ ( node.getYcoord() + getFontMetricsForLargeDefaultFont().getMaxAscent() ),
+ g );
}
}
/**
* Draw a box at the indicated node.
- *
+ *
* @param x
* @param y
* @param node
|| ( getOptions().isShowDefaultNodeShapesInternal() && node.isInternal() )
|| ( getOptions().isShowDefaultNodeShapesForMarkedNodes()
&& ( node.getNodeData().getNodeVisualData() != null ) && ( !node.getNodeData()
- .getNodeVisualData().isEmpty() ) )
- || ( getControlPanel().isUseVisualStyles() && ( ( node.getNodeData().getNodeVisualData() != null ) && ( ( node
- .getNodeData().getNodeVisualData().getNodeColor() != null )
- || ( node.getNodeData().getNodeVisualData().getSize() != NodeVisualData.DEFAULT_SIZE )
- || ( node.getNodeData().getNodeVisualData().getFillType() != NodeFill.DEFAULT ) || ( node
- .getNodeData().getNodeVisualData().getShape() != NodeShape.DEFAULT ) ) ) )
- || ( getControlPanel().isEvents() && node.isHasAssignedEvent() && ( node.getNodeData().getEvent()
- .isDuplication()
- || node.getNodeData().getEvent().isSpeciation() || node.getNodeData().getEvent()
- .isSpeciationOrDuplication() ) ) ) {
+ .getNodeVisualData().isEmpty() ) )
+ || ( getControlPanel().isUseVisualStyles() && ( ( node.getNodeData().getNodeVisualData() != null ) && ( ( node
+ .getNodeData().getNodeVisualData().getNodeColor() != null )
+ || ( node.getNodeData().getNodeVisualData().getSize() != NodeVisualData.DEFAULT_SIZE )
+ || ( node.getNodeData().getNodeVisualData().getFillType() != NodeFill.DEFAULT ) || ( node
+ .getNodeData().getNodeVisualData().getShape() != NodeShape.DEFAULT ) ) ) )
+ || ( getControlPanel().isEvents() && node.isHasAssignedEvent() && ( node.getNodeData().getEvent()
+ .isDuplication()
+ || node.getNodeData().getEvent().isSpeciation() || node.getNodeData().getEvent()
+ .isSpeciationOrDuplication() ) ) ) {
NodeVisualData vis = null;
if ( getControlPanel().isUseVisualStyles() && ( node.getNodeData().getNodeVisualData() != null )
&& ( !node.getNodeData().getNodeVisualData().isEmpty() ) ) {
if ( getControlPanel().isWriteBranchLengthValues()
&& ( ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR )
|| ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.ROUNDED ) || ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) )
- && ( !node.isRoot() ) && ( node.getDistanceToParent() != PhylogenyDataUtil.BRANCH_LENGTH_DEFAULT ) ) {
+ && ( !node.isRoot() ) && ( node.getDistanceToParent() != PhylogenyDataUtil.BRANCH_LENGTH_DEFAULT ) ) {
paintBranchLength( g, node, to_pdf, to_graphics_file );
}
if ( !getControlPanel().isShowInternalData() && !node.isExternal() && !node.isCollapse() ) {
final boolean fGotRelationWithQuery = ( seqRelation.getRef0().isEqual( _query_sequence ) || seqRelation
.getRef1().isEqual( _query_sequence ) )
&& seqRelation.getType().equals( getControlPanel().getSequenceRelationTypeBox()
- .getSelectedItem() );
+ .getSelectedItem() );
if ( fGotRelationWithQuery ) { // we will underline the text to show that this sequence is ortholog to the query
final double linePosX = node.getXcoord() + 2 + half_box_size;
final String sConfidence = ( !getControlPanel().isShowSequenceRelationConfidence() || ( seqRelation
.getConfidence() == null ) ) ? null : " (" + seqRelation.getConfidence().getValue()
- + ")";
+ + ")";
if ( sConfidence != null ) {
float confidenceX = pos_x;
if ( sb_str.length() > 0 ) {
confidenceX += new TextLayout( sb_str, g.getFont(), _frc ).getBounds().getWidth()
+ CONFIDENCE_LEFT_MARGIN;
}
- if ( confidenceX > linePosX ) { // let's only display confidence value if we are already displaying at least one of Prot/Gene Name and Taxonomy Code
+ if ( confidenceX > linePosX ) { // let's only display confidence value if we are already displaying at least one of Prot/Gene Name and Taxonomy Code
final int confidenceWidth = ( int ) new TextLayout( sConfidence, g.getFont(), _frc )
- .getBounds().getWidth();
+ .getBounds().getWidth();
TreePanel.drawString( sConfidence, confidenceX, pos_y, g );
x += CONFIDENCE_LEFT_MARGIN + confidenceWidth;
}
nodeTextBoundsWidth += 2;
}
g.drawLine( ( int ) linePosX + 1, 3 + ( int ) pos_y, ( int ) linePosX + x
- + nodeTextBoundsWidth, 3 + ( int ) pos_y );
+ + nodeTextBoundsWidth, 3 + ( int ) pos_y );
break;
}
}
}
final String ann_str = TreePanelUtil.createAnnotationString( ann, getOptions().isShowAnnotationRefSource() );
TreePanel.drawString( ann_str, node.getXcoord() + x + 3 + half_box_size, node.getYcoord()
- + ( getFontMetricsForLargeDefaultFont().getAscent() / down_shift_factor ), g );
+ + ( getFontMetricsForLargeDefaultFont().getAscent() / down_shift_factor ), g );
_sb.setLength( 0 );
_sb.append( ann_str );
if ( _sb.length() > 0 ) {
}
if ( getControlPanel().isShowBinaryCharacters() ) {
TreePanel.drawString( node.getNodeData().getBinaryCharacters().getPresentCharactersAsStringBuffer()
- .toString(), node.getXcoord() + x + 1 + half_box_size, node.getYcoord()
- + ( getFontMetricsForLargeDefaultFont().getAscent() / down_shift_factor ), g );
+ .toString(), node.getXcoord() + x + 1 + half_box_size, node.getYcoord()
+ + ( getFontMetricsForLargeDefaultFont().getAscent() / down_shift_factor ), g );
paintGainedAndLostCharacters( g, node, node.getNodeData().getBinaryCharacters()
- .getGainedCharactersAsStringBuffer().toString(), node.getNodeData().getBinaryCharacters()
- .getLostCharactersAsStringBuffer().toString() );
+ .getGainedCharactersAsStringBuffer().toString(), node.getNodeData().getBinaryCharacters()
+ .getLostCharactersAsStringBuffer().toString() );
}
else {
TreePanel
- .drawString( " " + node.getNodeData().getBinaryCharacters().getPresentCount(),
- node.getXcoord() + x + 4 + half_box_size,
- node.getYcoord()
- + ( getFontMetricsForLargeDefaultFont().getAscent() / down_shift_factor ),
- g );
+ .drawString( " " + node.getNodeData().getBinaryCharacters().getPresentCount(),
+ node.getXcoord() + x + 4 + half_box_size,
+ node.getYcoord()
+ + ( getFontMetricsForLargeDefaultFont().getAscent() / down_shift_factor ),
+ g );
paintGainedAndLostCharacters( g, node, "+"
+ node.getNodeData().getBinaryCharacters().getGainedCount(), "-"
- + node.getNodeData().getBinaryCharacters().getLostCount() );
+ + node.getNodeData().getBinaryCharacters().getLostCount() );
}
}
}
if ( isInFoundNodes( node ) || isInCurrentExternalNodes( node ) ) {
g.setColor( getColorForFoundNode( node ) );
drawRectFilled( node.getXSecondary() - OVERVIEW_FOUND_NODE_BOX_SIZE_HALF, node.getYSecondary()
- - OVERVIEW_FOUND_NODE_BOX_SIZE_HALF, OVERVIEW_FOUND_NODE_BOX_SIZE, OVERVIEW_FOUND_NODE_BOX_SIZE, g );
+ - OVERVIEW_FOUND_NODE_BOX_SIZE_HALF, OVERVIEW_FOUND_NODE_BOX_SIZE, OVERVIEW_FOUND_NODE_BOX_SIZE, g );
}
float new_x = 0;
if ( !node.isExternal() && !node.isCollapse() ) {
&& !node.isRoot()
&& ( ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.ROUNDED )
|| ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ) || ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) )
- && node.getBranchData().isHasConfidences() ) {
+ && node.getBranchData().isHasConfidences() ) {
paintConfidenceValues( g, node, to_pdf, to_graphics_file );
}
// Draw a line to root:
&& !is_in_found_nodes
&& ( ( node.isExternal() && ( ( _external_node_index % dynamic_hiding_factor ) != 1 ) ) || ( !node
.isExternal() && ( ( new_x_min < 20 ) || ( ( _y_distance * node.getNumberOfExternalNodes() ) < getFontMetricsForLargeDefaultFont()
- .getHeight() ) ) ) ) ) {
+ .getHeight() ) ) ) ) ) {
return;
}
final int x = paintNodeData( g, node, to_graphics_file, to_pdf, is_in_found_nodes );
if ( getOptions().isRightLineUpDomains() ) {
rds.render( ( float ) ( ( getMaxDistanceToRoot() * getXcorrectionFactor() )
+ _length_of_longest_text + ( ( _longest_domain - rds.getTotalLength() ) * rds
- .getRenderingFactorWidth() ) ), node.getYcoord() - ( h / 2.0f ), g, this, to_pdf );
+ .getRenderingFactorWidth() ) ), node.getYcoord() - ( h / 2.0f ), g, this, to_pdf );
}
else {
rds.render( ( float ) ( ( getMaxDistanceToRoot() * getXcorrectionFactor() ) + _length_of_longest_text ),
else {
if ( getOptions().isRightLineUpDomains() ) {
rds.render( ( ( getPhylogeny().getFirstExternalNode().getXcoord() + _length_of_longest_text ) - 20 )
- + ( ( _longest_domain - rds.getTotalLength() ) * rds
- .getRenderingFactorWidth() ),
- node.getYcoord() - ( h / 2.0f ),
- g,
- this,
- to_pdf );
+ + ( ( _longest_domain - rds.getTotalLength() ) * rds
+ .getRenderingFactorWidth() ),
+ node.getYcoord() - ( h / 2.0f ),
+ g,
+ this,
+ to_pdf );
}
else {
rds.render( getPhylogeny().getFirstExternalNode().getXcoord() + _length_of_longest_text,
&& ( node.getNodeData().getSequence().isMolecularSequenceAligned() )
&& ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getMolecularSequence() ) ) ) {
final RenderableMsaSequence rs = RenderableMsaSequence.createInstance( node.getNodeData().getSequence()
- .getMolecularSequence(), node.getNodeData().getSequence().getType(), getConfiguration() );
+ .getMolecularSequence(), node.getNodeData().getSequence().getType(), getConfiguration() );
if ( rs != null ) {
final int default_height = 7;
float y = getYdistance();
final private void paintPhylogenyLite( final Graphics2D g ) {
_phylogeny
- .getRoot()
- .setXSecondary( ( float ) ( getVisibleRect().x + getOvXPosition() + ( MOVE / ( getVisibleRect().width / getOvRectangle()
- .getWidth() ) ) ) );
+ .getRoot()
+ .setXSecondary( ( float ) ( getVisibleRect().x + getOvXPosition() + ( MOVE / ( getVisibleRect().width / getOvRectangle()
+ .getWidth() ) ) ) );
_phylogeny.getRoot().setYSecondary( ( getVisibleRect().y + getOvYStart() ) );
final Stroke s = g.getStroke();
g.setStroke( STROKE_05 );
/**
* Paint the root branch. (Differs from others because it will always be a
* single horizontal line).
- * @param to_graphics_file
- *
+ * @param to_graphics_file
+ *
* @return new x1 value
*/
final private void paintRootBranch( final Graphics2D g,
final Rectangle2D nodeTextBounds = new TextLayout( label, g.getFont(), new FontRenderContext( null,
false,
false ) )
- .getBounds();
+ .getBounds();
g.fillRect( ( int ) start_x - 1, ( int ) start_y - 8, ( int ) nodeTextBounds.getWidth() + 4, 11 );
g.setColor( getTreeColorSet().getBackgroundColor() );
}
ann_str = ann.toString();
}
sb.append( SequenceWriter.toFasta( ann_str, n.getNodeData().getSequence()
- .getMolecularSequence(), 60 ) );
+ .getMolecularSequence(), 60 ) );
data.add( sb.toString() );
}
break;
else if ( getConfiguration().getExtNodeDataReturnOn() == EXT_NODE_DATA_RETURN_ON.WINODW ) {
if ( sb.length() < 1 ) {
TreePanelUtil.showInformationMessage( this, "No Appropriate Data (" + obtainTitleForExtDescNodeData()
- + ")", "Descendants of selected node do not contain selected data" );
+ + ")", "Descendants of selected node do not contain selected data" );
clearCurrentExternalNodesDataBuffer();
}
else {
try {
if ( ( node.getName().length() > 0 )
|| ( node.getNodeData().isHasTaxonomy() && !TreePanelUtil.isTaxonomyEmpty( node.getNodeData()
- .getTaxonomy() ) )
- || ( node.getNodeData().isHasSequence() && !TreePanelUtil.isSequenceEmpty( node.getNodeData()
- .getSequence() ) ) || ( node.getNodeData().isHasDate() )
- || ( node.getNodeData().isHasDistribution() ) || node.getBranchData().isHasConfidences() ) {
+ .getTaxonomy() ) )
+ || ( node.getNodeData().isHasSequence() && !TreePanelUtil.isSequenceEmpty( node.getNodeData()
+ .getSequence() ) ) || ( node.getNodeData().isHasDate() )
+ || ( node.getNodeData().isHasDistribution() ) || node.getBranchData().isHasConfidences() ) {
_popup_buffer.setLength( 0 );
short lines = 0;
if ( node.getName().length() > 0 ) {
_popup_buffer.append( "] " );
}
_popup_buffer
- .append( FORMATTER_CONFIDENCE.format( ForesterUtil.round( confidence.getValue(),
- getOptions()
- .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
+ .append( FORMATTER_CONFIDENCE.format( ForesterUtil.round( confidence.getValue(),
+ getOptions()
+ .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
if ( confidence.getStandardDeviation() != Confidence.CONFIDENCE_DEFAULT_VALUE ) {
_popup_buffer.append( " (sd=" );
_popup_buffer.append( FORMATTER_CONFIDENCE.format( ForesterUtil.round( confidence
- .getStandardDeviation(), getOptions()
- .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
+ .getStandardDeviation(), getOptions()
+ .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
_popup_buffer.append( ")" );
}
}
if ( _popup_buffer.length() > 0 ) {
if ( !getConfiguration().isUseNativeUI() ) {
_rollover_popup
- .setBorder( BorderFactory.createLineBorder( getTreeColorSet().getBranchColor() ) );
+ .setBorder( BorderFactory.createLineBorder( getTreeColorSet().getBranchColor() ) );
_rollover_popup.setBackground( getTreeColorSet().getBackgroundColor() );
if ( isInFoundNodes0( node ) && !isInFoundNodes1( node ) ) {
_rollover_popup.setForeground( getTreeColorSet().getFoundColor0() );
_rollover_popup,
e.getLocationOnScreen().x + 10,
e.getLocationOnScreen().y
- - ( lines * 20 ) );
+ - ( lines * 20 ) );
_node_desc_popup.show();
}
}
if ( getMainPanel().getMainFrame() == null ) {
// Must be "E" applet version.
( ( ArchaeopteryxE ) ( ( MainPanelApplets ) getMainPanel() ).getApplet() )
- .setSelectedTypeInTypeMenu( getPhylogenyGraphicsType() );
+ .setSelectedTypeInTypeMenu( getPhylogenyGraphicsType() );
}
else {
getMainPanel().getMainFrame().setSelectedTypeInTypeMenu( getPhylogenyGraphicsType() );
* all external nodes of node.
* If at least one the external nodes has no taxonomy,
* null is returned.
- *
+ *
*/
public static Set<Taxonomy> obtainDistinctTaxonomies( final PhylogenyNode node ) {
final List<PhylogenyNode> descs = node.getAllExternalDescendants();
}
for( double i = 0; i < heigth; i += step ) {
g.setColor( org.forester.util.ForesterUtil
- .calcColor( i >= h2 ? heigth - i : i, 0, h2, color_one, color_two ) );
+ .calcColor( i >= h2 ? heigth - i : i, 0, h2, color_one, color_two ) );
_rectangle.setFrame( x, i + y, width, step );
g.fill( _rectangle );
}
}
for( double i = 0; i < heigth; i += step ) {
g.setColor( org.forester.util.ForesterUtil
- .calcColor( i >= h2 ? heigth - i : i, 0, h2, color_one, color_two ) );
+ .calcColor( i >= h2 ? heigth - i : i, 0, h2, color_one, color_two ) );
_rectangle.setFrame( x, i + y, width, step );
g.fill( _rectangle );
}
g.setColor( Constants.DOMAIN_LABEL_COLOR_FOR_PDF );
}
g.drawString( d.getName(), xa, y1
- + tree_panel.getMainPanel().getTreeFontSet().getFontMetricsSmall().getAscent()
- + _rendering_height );
+ + tree_panel.getMainPanel().getTreeFontSet().getFontMetricsSmall().getAscent()
+ + _rendering_height );
}
if ( TreePanel.SPECIAL_DOMAIN_COLORING && ( _node_name.indexOf( "~" ) > 1 )
&& ( d.getName().equals( SPECIAL_DOMAIN ) )
* This can be used to render phylogeny data as graphics (for example,
* display of the domain structure). In most Renderable implementations this
* will do nothing (i.e. just return).
- *
+ *
* @param g
* the Graphics to render to
*/
if ( ForesterUtil.isEmpty( query ) && ( node.getNodeData().getSequence().getAccession() != null )
&& !ForesterUtil.isEmpty( node.getNodeData().getSequence().getAccession().getValue() ) ) {
final Accession id = SequenceAccessionTools.parseAccessorFromString( node.getNodeData().getSequence()
- .getAccession().getValue() );
+ .getAccession().getValue() );
if ( id != null ) {
query = id.getValue();
}
}
if ( ForesterUtil.isEmpty( query ) && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getName() ) ) {
final Accession id = SequenceAccessionTools.parseAccessorFromString( node.getNodeData().getSequence()
- .getName() );
+ .getName() );
if ( id != null ) {
query = id.getValue();
}
}
if ( ForesterUtil.isEmpty( query ) && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getSymbol() ) ) {
final Accession id = SequenceAccessionTools.parseAccessorFromString( node.getNodeData().getSequence()
- .getSymbol() );
+ .getSymbol() );
if ( id != null ) {
query = id.getValue();
}
if ( ForesterUtil.isEmpty( query )
&& !ForesterUtil.isEmpty( node.getNodeData().getSequence().getGeneName() ) ) {
final Accession id = SequenceAccessionTools.parseAccessorFromString( node.getNodeData().getSequence()
- .getGeneName() );
+ .getGeneName() );
if ( id != null ) {
query = id.getValue();
}
catch ( final MalformedURLException e ) {
AptxUtil.printWarningMessage( Constants.PRG_NAME,
"could not load image from \"" + uri.getValue()
- + "\": Malformed URL Exception: "
- + e.getLocalizedMessage() );
+ + "\": Malformed URL Exception: "
+ + e.getLocalizedMessage() );
}
catch ( final IOException e ) {
AptxUtil.printWarningMessage( Constants.PRG_NAME,
"could not load image from \"" + uri.getValue()
- + "\": IO Exception: " + e.getLocalizedMessage() );
+ + "\": IO Exception: " + e.getLocalizedMessage() );
}
catch ( final CMMException e ) {
AptxUtil.printWarningMessage( Constants.PRG_NAME,
"could not load image from \"" + uri.getValue()
- + "\": CMMException: " + e.getLocalizedMessage() );
+ + "\": CMMException: " + e.getLocalizedMessage() );
}
if ( bi != null ) {
image_map.put( uri_str, bi );
public final class InferenceManager {
private final static String DEFAULT_PATHS[] = { "C:\\Program Files\\", "C:\\Program Files (x86)\\", "/bin/",
- "/usr/local/bin/", "/usr/bin/" };
+ "/usr/local/bin/", "/usr/bin/" };
private final File _path_to_local_mafft;
private final File _path_to_local_fastme;
private final File _path_to_local_raxml;
distance_calc_pnl_1.add( _distance_calc_kimura_rb = new JRadioButton( "Kimura correction" ) );
distance_calc_pnl_1.add( _distance_calc_poisson_rb = new JRadioButton( "Poisson" ) );
distance_calc_pnl_1
- .add( _distance_calc_fract_dissimilarity_rb = new JRadioButton( "Fractional dissimilarity" ) );
+ .add( _distance_calc_fract_dissimilarity_rb = new JRadioButton( "Fractional dissimilarity" ) );
final ButtonGroup distance_calc_group_1 = new ButtonGroup();
distance_calc_group_1.add( _distance_calc_kimura_rb );
distance_calc_group_1.add( _distance_calc_poisson_rb );
private void processMsaProcessing() {
getPhylogeneticInferenceOptions().setExecuteMsaProcessing( _execute_msa_processing_cb.isSelected() );
getPhylogeneticInferenceOptions()
- .setMsaProcessingRemoveAllGapColumns( _msa_processing_remove_all_gap_columns_cb.isSelected() );
+ .setMsaProcessingRemoveAllGapColumns( _msa_processing_remove_all_gap_columns_cb.isSelected() );
int min_length = -1;
try {
min_length = Integer.parseInt( _msa_processing_min_allowed_length_tf.getText().trim() );
double msa_processing_max_allowed_gap_ratio = -1.0;
try {
msa_processing_max_allowed_gap_ratio = Double.parseDouble( _msa_processing_max_allowed_gap_ratio_tf
- .getText().trim() );
+ .getText().trim() );
}
catch ( final NumberFormatException e ) {
msa_processing_max_allowed_gap_ratio = -1.0;
private void updateMsaProcessingItem() {
_execute_msa_processing_cb.setSelected( getPhylogeneticInferenceOptions().isExecuteMsaProcessing() );
_msa_processing_remove_all_gap_columns_cb.setSelected( getPhylogeneticInferenceOptions()
- .isMsaProcessingRemoveAllGapColumns() );
+ .isMsaProcessingRemoveAllGapColumns() );
if ( _opts.getMsaProcessingMaxAllowedGapRatio() > 0 ) {
_msa_processing_max_allowed_gap_ratio_tf.setText( _opts.getMsaProcessingMaxAllowedGapRatio() + "" );
}
+ _options.getMsaPrg() + "\" and the following parameters:\n\""
+ _options.getMsaPrgParameters() + "\"\nError: "
+ e.getLocalizedMessage(),
- "Failed to Calculate MSA",
- JOptionPane.ERROR_MESSAGE );
+ "Failed to Calculate MSA",
+ JOptionPane.ERROR_MESSAGE );
if ( DEBUG ) {
e.printStackTrace();
}
+ _options.getMsaPrg() + "\" and the following parameters:\n\""
+ _options.getMsaPrgParameters() + "\"\nError: "
+ e.getLocalizedMessage(),
- "Unexpected Exception During MSA Calculation",
- JOptionPane.ERROR_MESSAGE );
+ "Unexpected Exception During MSA Calculation",
+ JOptionPane.ERROR_MESSAGE );
if ( DEBUG ) {
e.printStackTrace();
}
"Could not create multiple sequence alignment with "
+ _options.getMsaPrg() + "\nand the following parameters:\n\""
+ _options.getMsaPrgParameters() + "\"",
- "Failed to Calculate MSA",
- JOptionPane.ERROR_MESSAGE );
+ "Failed to Calculate MSA",
+ JOptionPane.ERROR_MESSAGE );
return;
}
if ( DEBUG ) {
"Less than two sequences longer than "
+ _options.getMsaProcessingMinAllowedLength()
+ " residues left after MSA processing",
- "MSA Processing Settings Too Stringent",
- JOptionPane.ERROR_MESSAGE );
+ "MSA Processing Settings Too Stringent",
+ JOptionPane.ERROR_MESSAGE );
return;
}
}
if ( _options.isPerformBootstrapResampling() && ( n > 0 ) ) {
final ResampleableMsa resampleable_msa = new ResampleableMsa( ( BasicMsa ) _msa );
final int[][] resampled_column_positions = BootstrapResampler.createResampledColumnPositions( _msa
- .getLength(), n, seed );
+ .getLength(), n, seed );
final Phylogeny[] eval_phys = new Phylogeny[ n ];
for( int i = 0; i < n; ++i ) {
resampleable_msa.resample( resampled_column_positions[ i ] );
}
private Msa runMAFFT( final List<MolecularSequence> seqs, final List<String> opts ) throws IOException,
- InterruptedException {
+ InterruptedException {
Msa msa = null;
final MsaInferrer mafft = Mafft.createInstance( _mf.getInferenceManager().getPathToLocalMafft()
- .getCanonicalPath() );
+ .getCanonicalPath() );
try {
msa = mafft.infer( seqs, opts );
}
if ( !ForesterUtil.isEmpty( _options.getIntermediateFilesBase() ) ) {
try {
final BufferedWriter msa_writer = new BufferedWriter( new FileWriter( _options.getIntermediateFilesBase()
- + MSA_FILE_SUFFIX ) );
+ + MSA_FILE_SUFFIX ) );
_msa.write( msa_writer, MSA_FORMAT.PHYLIP );
msa_writer.close();
final BufferedWriter pwd_writer = new BufferedWriter( new FileWriter( _options.getIntermediateFilesBase()
- + PWD_FILE_SUFFIX ) );
+ + PWD_FILE_SUFFIX ) );
m.write( pwd_writer );
pwd_writer.close();
}
final boolean removed = mf.getProcessPool().removeProcess( getProcessId() );
if ( !removed ) {
ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not remove process " + getProcessId()
- + " from process pool" );
+ + " from process pool" );
}
mf.updateProcessMenu();
}
JOptionPane.WARNING_MESSAGE );
}
catch ( final Exception e ) {
- // Not important if this fails, do nothing.
+ // Not important if this fails, do nothing.
}
}
else {
/**
* A short description of the webservice (~20 characters).
- *
+ *
* @return a short description of the webservice (~20 characters)
*/
public String getDescription();
/**
* Instructions (and examples) on how to use the webservice.
- *
+ *
* @return instructions (and examples) on how to use the webservice
*/
public String getInstructions();
/**
* A name/description which can appear on a menu.
- *
+ *
* @return A name/description which can appear on a menu
*/
public String getMenuName();
/**
* The name of the webservice.
- *
- *
+ *
+ *
* @return the name of the webservice
*/
public String getName();
/**
* The node data field in which to place node names from simple unannotated formats
- * (such as Newick). Null means avoiding any such postprocessing.
- *
+ * (such as Newick). Null means avoiding any such postprocessing.
+ *
* @return the field code
*/
public PhylogenyMethods.PhylogenyNodeField getNodeField();
/**
* This is used to indicate any kind of special processing.
- *
- *
+ *
+ *
* @return a reference
*/
public Object getProcessingInstructions();
/**
* To get a type of reference for the webservice (an URL or citation, for example).
- *
- *
+ *
+ *
* @return a reference
*/
public String getReference();
/**
* The expected format of the response.
- *
+ *
* @return the expected format of the response
*/
public WsPhylogenyFormat getReturnFormat();
/**
* Use QUERY_PLACEHOLDER to indicate position of query variable.
- *
+ *
* @return the URL
*/
public String getUrl();
/**
* Is the query a number?
- *
- *
+ *
+ *
* @return
*/
public boolean isQueryInteger();
public static final String TOL_NAME = "Tree of Life (ToL)";
public static final String TOL_URL_BASE = "http://tolweb.org/onlinecontributors/app?service=external&page=xml/TreeStructureService&node_id=";
public static final String TOL_WEBSERVER = TOL_URL_BASE
- + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER;
+ + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER;
public static final String TREE_BASE_DESC = "This data set was downloaded from TreeBASE, a relational database of phylogenetic knowledge. TreeBASE has been supported by the NSF, Harvard University, Yale University, SDSC and UC Davis. Please do not remove this acknowledgment.";
public static final String TREE_BASE_INST = "treebase";
public static final String TREE_BASE_NAME = "TreeBASE";
WsPhylogenyFormat.TREEBASE_STUDY,
null,
TREEBASE_PHYLOWS_STUDY_URL_BASE
- + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
- + "?format=nexus",
+ + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
+ + "?format=nexus",
true,
"http://www.treebase.org",
TREE_BASE_INST ) );
WsPhylogenyFormat.TREEBASE_TREE,
null,
TREEBASE_PHYLOWS_TREE_URL_BASE
- + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
- + "?format=nexus",
+ + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
+ + "?format=nexus",
true,
"http://www.treebase.org",
TREE_BASE_INST ) );
PFAM_SERVER + "/family/PF"
+ PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
+ "/tree/download",
- false,
- PFAM_SERVER,
- PFAM_INST ) );
+ false,
+ PFAM_SERVER,
+ PFAM_INST ) );
clients.add( new BasicPhylogeniesWebserviceClient( TREE_FAM_NAME,
"Read Gene Tree from TreeFam...",
"Use TreeFam to obtain a gene tree",
WsPhylogenyFormat.NHX,
null,
TREE_FAM_URL_BASE
- + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
- + "/tree/newick",
+ + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
+ + "/tree/newick",
true,
"http://www.treefam.org",
TREE_FAM_INST ) );
"Use ToL webservice to obtain a evolutionary tree",
"Please enter a Tree of Life node identifier\n(Examples: "
+ "14923 for ray-finned fishes, 19386 for Cephalopoda, 2461 for Cnidaria)",
- WsPhylogenyFormat.TOL_XML_RESPONSE,
- PhylogenyMethods.PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME,
- WebserviceUtil.TOL_WEBSERVER,
- true,
- "http://tolweb.org",
- null ) );
+ WsPhylogenyFormat.TOL_XML_RESPONSE,
+ PhylogenyMethods.PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME,
+ WebserviceUtil.TOL_WEBSERVER,
+ true,
+ "http://tolweb.org",
+ null ) );
return clients;
}
}
if ( n.getNodeData().isHasTaxonomy() && ( n.getNodeData().getTaxonomy().getIdentifier() != null ) ) {
n.getNodeData()
- .getTaxonomy()
- .setIdentifier( new Identifier( n.getNodeData().getTaxonomy().getIdentifier().getValue(),
- "ncbi" ) );
+ .getTaxonomy()
+ .setIdentifier( new Identifier( n.getNodeData().getTaxonomy().getIdentifier().getValue(),
+ "ncbi" ) );
}
}
}
/*
* A simple Queue data structure. Created: 10/23/2005 by Christian M. Zmasek.
* Last modified: 10/23/2005 by Christian M. Zmasek.
- *
+ *
* @author Christian M. Zmasek
- *
+ *
* @version 1.000
*/
public class Queue {
/**
* Dequeues one element from this queue.
- *
+ *
* @return the dequeued object
* @throws NoSuchElementException
* if this queue is empty
// --------------
/**
* Adds Object element to thisqueue.
- *
+ *
* @param element
* the Object to be enqueued
*/
// ---------------
/**
* Returns the LinkedList upon which this queue is based.
- *
+ *
* @return the LinkedList upon which this queue is based
*/
private LinkedList<Object> getData() {
/**
* Returns whether or not this queue is empty.
- *
+ *
* @return true if this queue is empty, false otherwise
*/
public boolean isEmpty() {
public abstract class AbstractRenderer extends JComponent {
/**
- *
+ *
*/
private static final long serialVersionUID = 7236434322552764776L;
static final Color DEFAULT_COLOR = new Color( 0, 0, 0 );
/**
* Creates a completely unbalanced Phylogeny with i external nodes.
- *
+ *
* @return a newly created unbalanced Phylogeny
*/
// public static Phylogeny createUnbalancedTree( int i ) {
// try {
// PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
// t1 = factory.create( ":S=", new SimpleNHXParser() );
- //
+ //
// t1.setRooted( true );
//
// for ( int j = 1; j < i; ++j ) {
/**
* Creates a completely balanced rooted phylogeny with a given number of levels and
* children per node.
- *
+ *
* @param levels
* @param children_per_node
* @return a completely balanced rooted phylogeny
/**
* Sets the species names of the external Nodes of Phylogeny t to a random
* positive integer number between (and including) min and max.
- *
+ *
* @param t
* whose external species names are to be randomized
* @param min
static final int DISTANCE_OVAL_BORDER = 1;
static final int SIZE_LIMIT = 7;
/**
- *
+ *
*/
private static final long serialVersionUID = -2331160296913478874L;
private final char _value;
public class Test {
private final static String PATH_TO_TEST_DATA = System.getProperty( "user.dir" ) + ForesterUtil.getFileSeparator()
- + "test_data" + ForesterUtil.getFileSeparator();
+ + "test_data" + ForesterUtil.getFileSeparator();
public static void main( final String[] args ) {
System.out.println( "[Java version: " + ForesterUtil.JAVA_VERSION + " " + ForesterUtil.JAVA_VENDOR + "]" );
System.out.println( "[OS: " + ForesterUtil.OS_NAME + " " + ForesterUtil.OS_ARCH + " " + ForesterUtil.OS_VERSION
- + "]" );
+ + "]" );
Locale.setDefault( Locale.US );
System.out.println( "[Locale: " + Locale.getDefault() + "]" );
final int failed = 0;
// }
// }
// } /* tridiag */
- // Givens tridiagonalization
+ // Givens tridiagonalization
void tridiag( final double a[][], final int n, final double accuracy ) {
int i, j;
double s, c;
// }
// } /* shiftqr */
//
- // QR eigenvalue-finder
+ // QR eigenvalue-finder
void shiftqr( final double a[][], final int n, final double accuracy ) {
int i, j;
double approx;
//}
//} /* givens */
//
- // Givens transform at i,j for 1..n with angle theta
+ // Givens transform at i,j for 1..n with angle theta
void givens( final double a[][],
final int i,
final int j,
}
}
}
- // this jtt matrix decomposition due to Elisabeth Tillier
+ // this jtt matrix decomposition due to Elisabeth Tillier
final private static double jtteigs[] = { +0.00000000000000, -1.81721720738768, -1.87965834528616,
- -1.61403121885431, -1.53896608443751, -1.40486966367848, -1.30995061286931, -1.24668414819041,
- -1.17179756521289, -0.31033320987464, -0.34602837857034, -1.06031718484613, -0.99900602987105,
- -0.45576774888948, -0.86014403434677, -0.54569432735296, -0.76866956571861, -0.60593589295327,
- -0.65119724379348, -0.70249806480753 };
+ -1.61403121885431, -1.53896608443751, -1.40486966367848, -1.30995061286931, -1.24668414819041,
+ -1.17179756521289, -0.31033320987464, -0.34602837857034, -1.06031718484613, -0.99900602987105,
+ -0.45576774888948, -0.86014403434677, -0.54569432735296, -0.76866956571861, -0.60593589295327,
+ -0.65119724379348, -0.70249806480753 };
final private static double jttprobs[][] = {
- { +0.07686196156903, +0.05105697447152, +0.04254597872702, +0.05126897436552, +0.02027898986051,
+ { +0.07686196156903, +0.05105697447152, +0.04254597872702, +0.05126897436552, +0.02027898986051,
+0.04106097946952, +0.06181996909002, +0.07471396264303, +0.02298298850851, +0.05256897371552,
+0.09111095444453, +0.05949797025102, +0.02341398829301, +0.04052997973502, +0.05053197473402,
+0.06822496588753, +0.05851797074102, +0.01433599283201, +0.03230298384851, +0.06637396681302 },
{ -0.04445795120462, -0.01557336502860, -0.09314817363516, +0.04411372100382, -0.00511178725134,
- +0.00188472427522, -0.02176250428454, -0.01330231089224, +0.01004072641973, +0.02707838224285,
- -0.00785039050721, +0.02238829876349, +0.00257470703483, -0.00510311699563, -0.01727154263346,
- +0.20074235330882, -0.07236268502973, -0.00012690116016, -0.00215974664431, -0.01059243778174 },
- { +0.09480046389131, +0.00082658405814, +0.01530023104155, -0.00639909042723, +0.00160605602061,
- +0.00035896642912, +0.00199161318384, -0.00220482855717, -0.00112601328033, +0.14840201765438,
- -0.00344295714983, -0.00123976286718, -0.00439399942758, +0.00032478785709, -0.00104270266394,
- -0.02596605592109, -0.05645800566901, +0.00022319903170, -0.00022792271829, -0.16133258048606 },
- { -0.06924141195400, -0.01816245289173, -0.08104005811201, +0.08985697111009, +0.00279659017898,
- +0.01083740322821, -0.06449599336038, +0.01794514261221, +0.01036809141699, +0.04283504450449,
- +0.00634472273784, +0.02339134834111, -0.01748667848380, +0.00161859106290, +0.00622486432503,
- -0.05854130195643, +0.15083728660504, +0.00030733757661, -0.00143739522173, -0.05295810171941 },
- { -0.14637948915627, +0.02029296323583, +0.02615316895036, -0.10311538564943, -0.00183412744544,
- -0.02589124656591, +0.11073673851935, +0.00848581728407, +0.00106057791901, +0.05530240732939,
- -0.00031533506946, -0.03124002869407, -0.01533984125301, -0.00288717337278, +0.00272787410643,
- +0.06300929916280, +0.07920438311152, -0.00041335282410, -0.00011648873397, -0.03944076085434 },
- { -0.05558229086909, +0.08935293782491, +0.04869509588770, +0.04856877988810, -0.00253836047720,
- +0.07651693957635, -0.06342453535092, -0.00777376246014, -0.08570270266807, +0.01943016473512,
- -0.00599516526932, -0.09157595008575, -0.00397735155663, -0.00440093863690, -0.00232998056918,
- +0.02979967701162, -0.00477299485901, -0.00144011795333, +0.01795114942404, -0.00080059359232 },
- { +0.05807741644682, +0.14654292420341, -0.06724975334073, +0.02159062346633, -0.00339085518294,
- -0.06829036785575, +0.03520631903157, -0.02766062718318, +0.03485632707432, -0.02436836692465,
- -0.00397566003573, -0.10095488644404, +0.02456887654357, +0.00381764117077, -0.00906261340247,
- -0.01043058066362, +0.01651199513994, -0.00210417220821, -0.00872508520963, -0.01495915462580 },
- { +0.02564617106907, +0.02960554611436, -0.00052356748770, +0.00989267817318, -0.00044034172141,
- -0.02279910634723, -0.00363768356471, -0.01086345665971, +0.01229721799572, +0.02633650142592,
- +0.06282966783922, -0.00734486499924, -0.13863936313277, -0.00993891943390, -0.00655309682350,
- -0.00245191788287, -0.02431633805559, -0.00068554031525, -0.00121383858869, +0.06280025239509 },
- { +0.11362428251792, -0.02080375718488, -0.08802750967213, -0.06531316372189, -0.00166626058292,
- +0.06846081717224, +0.07007301248407, -0.01713112936632, -0.05900588794853, -0.04497159138485,
- +0.04222484636983, +0.00129043178508, -0.01550337251561, -0.01553102163852, -0.04363429852047,
- +0.01600063777880, +0.05787328925647, -0.00008265841118, +0.02870014572813, -0.02657681214523 },
- { +0.01840541226842, +0.00610159018805, +0.01368080422265, +0.02383751807012, -0.00923516894192,
- +0.01209943150832, +0.02906782189141, +0.01992384905334, +0.00197323568330, +0.00017531415423,
- -0.01796698381949, +0.01887083962858, -0.00063335886734, -0.02365277334702, +0.01209445088200,
- +0.01308086447947, +0.01286727242301, -0.11420358975688, -0.01886991700613, +0.00238338728588 },
- { -0.01100105031759, -0.04250695864938, -0.02554356700969, -0.05473632078607, +0.00725906469946,
- -0.03003724918191, -0.07051526125013, -0.06939439879112, -0.00285883056088, +0.05334304124753,
- +0.12839241846919, -0.05883473754222, +0.02424304967487, +0.09134510778469, -0.00226003347193,
- -0.01280041778462, -0.00207988305627, -0.02957493909199, +0.05290385686789, +0.05465710875015 },
- { -0.01421274522011, +0.02074863337778, -0.01006411985628, +0.03319995456446, -0.00005371699269,
- -0.12266046460835, +0.02419847062899, -0.00441168706583, -0.08299118738167, -0.00323230913482,
- +0.02954035119881, +0.09212856795583, +0.00718635627257, -0.02706936115539, +0.04473173279913,
- -0.01274357634785, -0.01395862740618, -0.00071538848681, +0.04767640012830, -0.00729728326990 },
- { -0.03797680968123, +0.01280286509478, -0.08614616553187, -0.01781049963160, +0.00674319990083,
- +0.04208667754694, +0.05991325707583, +0.03581015660092, -0.01529816709967, +0.06885987924922,
- -0.11719120476535, -0.00014333663810, +0.00074336784254, +0.02893416406249, +0.07466151360134,
- -0.08182016471377, -0.06581536577662, -0.00018195976501, +0.00167443595008, +0.09015415667825 },
- { +0.03577726799591, -0.02139253448219, -0.01137813538175, -0.01954939202830, -0.04028242801611,
- -0.01777500032351, -0.02106862264440, +0.00465199658293, -0.02824805812709, +0.06618860061778,
- +0.08437791757537, -0.02533125946051, +0.02806344654855, -0.06970805797879, +0.02328376968627,
- +0.00692992333282, +0.02751392122018, +0.01148722812804, -0.11130404325078, +0.07776346000559 },
- { -0.06014297925310, -0.00711674355952, -0.02424493472566, +0.00032464353156, +0.00321221847573,
- +0.03257969053884, +0.01072805771161, +0.06892027923996, +0.03326534127710, -0.01558838623875,
- +0.13794237677194, -0.04292623056646, +0.01375763233229, -0.11125153774789, +0.03510076081639,
- -0.04531670712549, -0.06170413486351, -0.00182023682123, +0.05979891871679, -0.02551802851059 },
- { -0.03515069991501, +0.02310847227710, +0.00474493548551, +0.02787717003457, -0.12038329679812,
- +0.03178473522077, +0.04445111601130, -0.05334957493090, +0.01290386678474, -0.00376064171612,
- +0.03996642737967, +0.04777677295520, +0.00233689200639, +0.03917715404594, -0.01755598277531,
- -0.03389088626433, -0.02180780263389, +0.00473402043911, +0.01964539477020, -0.01260807237680 },
- { -0.04120428254254, +0.00062717164978, -0.01688703578637, +0.01685776910152, +0.02102702093943,
- +0.01295781834163, +0.03541815979495, +0.03968150445315, -0.02073122710938, -0.06932247350110,
- +0.11696314241296, -0.00322523765776, -0.01280515661402, +0.08717664266126, +0.06297225078802,
- -0.01290501780488, -0.04693925076877, -0.00177653675449, -0.08407812137852, -0.08380714022487 },
- { +0.03138655228534, -0.09052573757196, +0.00874202219428, +0.06060593729292, -0.03426076652151,
- -0.04832468257386, +0.04735628794421, +0.14504653737383, -0.01709111334001, -0.00278794215381,
- -0.03513813820550, -0.11690294831883, -0.00836264902624, +0.03270980973180, -0.02587764129811,
- +0.01638786059073, +0.00485499822497, +0.00305477087025, +0.02295754527195, +0.00616929722958 },
- { -0.04898722042023, -0.01460879656586, +0.00508708857036, +0.07730497806331, +0.04252420017435,
- +0.00484232580349, +0.09861807969412, -0.05169447907187, -0.00917820907880, +0.03679081047330,
- +0.04998537112655, +0.00769330211980, +0.01805447683564, -0.00498723245027, -0.14148416183376,
- -0.05170281760262, -0.03230723310784, -0.00032890672639, -0.02363523071957, +0.03801365471627 },
- { -0.02047562162108, +0.06933781779590, -0.02101117884731, -0.06841945874842, -0.00860967572716,
- -0.00886650271590, -0.07185241332269, +0.16703684361030, -0.00635847581692, +0.00811478913823,
- +0.01847205842216, +0.06700967948643, +0.00596607376199, +0.02318239240593, -0.10552958537847,
- -0.01980199747773, -0.02003785382406, -0.00593392430159, -0.00965391033612, +0.00743094349652 } };
- // PMB matrix decomposition courtesy of Elisabeth Tillier
+ +0.00188472427522, -0.02176250428454, -0.01330231089224, +0.01004072641973, +0.02707838224285,
+ -0.00785039050721, +0.02238829876349, +0.00257470703483, -0.00510311699563, -0.01727154263346,
+ +0.20074235330882, -0.07236268502973, -0.00012690116016, -0.00215974664431, -0.01059243778174 },
+ { +0.09480046389131, +0.00082658405814, +0.01530023104155, -0.00639909042723, +0.00160605602061,
+ +0.00035896642912, +0.00199161318384, -0.00220482855717, -0.00112601328033, +0.14840201765438,
+ -0.00344295714983, -0.00123976286718, -0.00439399942758, +0.00032478785709, -0.00104270266394,
+ -0.02596605592109, -0.05645800566901, +0.00022319903170, -0.00022792271829, -0.16133258048606 },
+ { -0.06924141195400, -0.01816245289173, -0.08104005811201, +0.08985697111009, +0.00279659017898,
+ +0.01083740322821, -0.06449599336038, +0.01794514261221, +0.01036809141699, +0.04283504450449,
+ +0.00634472273784, +0.02339134834111, -0.01748667848380, +0.00161859106290, +0.00622486432503,
+ -0.05854130195643, +0.15083728660504, +0.00030733757661, -0.00143739522173, -0.05295810171941 },
+ { -0.14637948915627, +0.02029296323583, +0.02615316895036, -0.10311538564943, -0.00183412744544,
+ -0.02589124656591, +0.11073673851935, +0.00848581728407, +0.00106057791901, +0.05530240732939,
+ -0.00031533506946, -0.03124002869407, -0.01533984125301, -0.00288717337278, +0.00272787410643,
+ +0.06300929916280, +0.07920438311152, -0.00041335282410, -0.00011648873397, -0.03944076085434 },
+ { -0.05558229086909, +0.08935293782491, +0.04869509588770, +0.04856877988810, -0.00253836047720,
+ +0.07651693957635, -0.06342453535092, -0.00777376246014, -0.08570270266807, +0.01943016473512,
+ -0.00599516526932, -0.09157595008575, -0.00397735155663, -0.00440093863690, -0.00232998056918,
+ +0.02979967701162, -0.00477299485901, -0.00144011795333, +0.01795114942404, -0.00080059359232 },
+ { +0.05807741644682, +0.14654292420341, -0.06724975334073, +0.02159062346633, -0.00339085518294,
+ -0.06829036785575, +0.03520631903157, -0.02766062718318, +0.03485632707432, -0.02436836692465,
+ -0.00397566003573, -0.10095488644404, +0.02456887654357, +0.00381764117077, -0.00906261340247,
+ -0.01043058066362, +0.01651199513994, -0.00210417220821, -0.00872508520963, -0.01495915462580 },
+ { +0.02564617106907, +0.02960554611436, -0.00052356748770, +0.00989267817318, -0.00044034172141,
+ -0.02279910634723, -0.00363768356471, -0.01086345665971, +0.01229721799572, +0.02633650142592,
+ +0.06282966783922, -0.00734486499924, -0.13863936313277, -0.00993891943390, -0.00655309682350,
+ -0.00245191788287, -0.02431633805559, -0.00068554031525, -0.00121383858869, +0.06280025239509 },
+ { +0.11362428251792, -0.02080375718488, -0.08802750967213, -0.06531316372189, -0.00166626058292,
+ +0.06846081717224, +0.07007301248407, -0.01713112936632, -0.05900588794853, -0.04497159138485,
+ +0.04222484636983, +0.00129043178508, -0.01550337251561, -0.01553102163852, -0.04363429852047,
+ +0.01600063777880, +0.05787328925647, -0.00008265841118, +0.02870014572813, -0.02657681214523 },
+ { +0.01840541226842, +0.00610159018805, +0.01368080422265, +0.02383751807012, -0.00923516894192,
+ +0.01209943150832, +0.02906782189141, +0.01992384905334, +0.00197323568330, +0.00017531415423,
+ -0.01796698381949, +0.01887083962858, -0.00063335886734, -0.02365277334702, +0.01209445088200,
+ +0.01308086447947, +0.01286727242301, -0.11420358975688, -0.01886991700613, +0.00238338728588 },
+ { -0.01100105031759, -0.04250695864938, -0.02554356700969, -0.05473632078607, +0.00725906469946,
+ -0.03003724918191, -0.07051526125013, -0.06939439879112, -0.00285883056088, +0.05334304124753,
+ +0.12839241846919, -0.05883473754222, +0.02424304967487, +0.09134510778469, -0.00226003347193,
+ -0.01280041778462, -0.00207988305627, -0.02957493909199, +0.05290385686789, +0.05465710875015 },
+ { -0.01421274522011, +0.02074863337778, -0.01006411985628, +0.03319995456446, -0.00005371699269,
+ -0.12266046460835, +0.02419847062899, -0.00441168706583, -0.08299118738167, -0.00323230913482,
+ +0.02954035119881, +0.09212856795583, +0.00718635627257, -0.02706936115539, +0.04473173279913,
+ -0.01274357634785, -0.01395862740618, -0.00071538848681, +0.04767640012830, -0.00729728326990 },
+ { -0.03797680968123, +0.01280286509478, -0.08614616553187, -0.01781049963160, +0.00674319990083,
+ +0.04208667754694, +0.05991325707583, +0.03581015660092, -0.01529816709967, +0.06885987924922,
+ -0.11719120476535, -0.00014333663810, +0.00074336784254, +0.02893416406249, +0.07466151360134,
+ -0.08182016471377, -0.06581536577662, -0.00018195976501, +0.00167443595008, +0.09015415667825 },
+ { +0.03577726799591, -0.02139253448219, -0.01137813538175, -0.01954939202830, -0.04028242801611,
+ -0.01777500032351, -0.02106862264440, +0.00465199658293, -0.02824805812709, +0.06618860061778,
+ +0.08437791757537, -0.02533125946051, +0.02806344654855, -0.06970805797879, +0.02328376968627,
+ +0.00692992333282, +0.02751392122018, +0.01148722812804, -0.11130404325078, +0.07776346000559 },
+ { -0.06014297925310, -0.00711674355952, -0.02424493472566, +0.00032464353156, +0.00321221847573,
+ +0.03257969053884, +0.01072805771161, +0.06892027923996, +0.03326534127710, -0.01558838623875,
+ +0.13794237677194, -0.04292623056646, +0.01375763233229, -0.11125153774789, +0.03510076081639,
+ -0.04531670712549, -0.06170413486351, -0.00182023682123, +0.05979891871679, -0.02551802851059 },
+ { -0.03515069991501, +0.02310847227710, +0.00474493548551, +0.02787717003457, -0.12038329679812,
+ +0.03178473522077, +0.04445111601130, -0.05334957493090, +0.01290386678474, -0.00376064171612,
+ +0.03996642737967, +0.04777677295520, +0.00233689200639, +0.03917715404594, -0.01755598277531,
+ -0.03389088626433, -0.02180780263389, +0.00473402043911, +0.01964539477020, -0.01260807237680 },
+ { -0.04120428254254, +0.00062717164978, -0.01688703578637, +0.01685776910152, +0.02102702093943,
+ +0.01295781834163, +0.03541815979495, +0.03968150445315, -0.02073122710938, -0.06932247350110,
+ +0.11696314241296, -0.00322523765776, -0.01280515661402, +0.08717664266126, +0.06297225078802,
+ -0.01290501780488, -0.04693925076877, -0.00177653675449, -0.08407812137852, -0.08380714022487 },
+ { +0.03138655228534, -0.09052573757196, +0.00874202219428, +0.06060593729292, -0.03426076652151,
+ -0.04832468257386, +0.04735628794421, +0.14504653737383, -0.01709111334001, -0.00278794215381,
+ -0.03513813820550, -0.11690294831883, -0.00836264902624, +0.03270980973180, -0.02587764129811,
+ +0.01638786059073, +0.00485499822497, +0.00305477087025, +0.02295754527195, +0.00616929722958 },
+ { -0.04898722042023, -0.01460879656586, +0.00508708857036, +0.07730497806331, +0.04252420017435,
+ +0.00484232580349, +0.09861807969412, -0.05169447907187, -0.00917820907880, +0.03679081047330,
+ +0.04998537112655, +0.00769330211980, +0.01805447683564, -0.00498723245027, -0.14148416183376,
+ -0.05170281760262, -0.03230723310784, -0.00032890672639, -0.02363523071957, +0.03801365471627 },
+ { -0.02047562162108, +0.06933781779590, -0.02101117884731, -0.06841945874842, -0.00860967572716,
+ -0.00886650271590, -0.07185241332269, +0.16703684361030, -0.00635847581692, +0.00811478913823,
+ +0.01847205842216, +0.06700967948643, +0.00596607376199, +0.02318239240593, -0.10552958537847,
+ -0.01980199747773, -0.02003785382406, -0.00593392430159, -0.00965391033612, +0.00743094349652 } };
+ // PMB matrix decomposition courtesy of Elisabeth Tillier
final private static double pmbeigs[] = { 0.0000001586972220, -1.8416770496147100, -1.6025046986139100,
- -1.5801012515121300, -1.4987794099715900, -1.3520794233801900, -1.3003469390479700, -1.2439503327631300,
- -1.1962574080244200, -1.1383730501367500, -1.1153278910708000, -0.4934843510654760, -0.5419014550215590,
- -0.9657997830826700, -0.6276075673757390, -0.6675927795018510, -0.6932641383465870, -0.8897872681859630,
- -0.8382698977371710, -0.8074694642446040 };
+ -1.5801012515121300, -1.4987794099715900, -1.3520794233801900, -1.3003469390479700, -1.2439503327631300,
+ -1.1962574080244200, -1.1383730501367500, -1.1153278910708000, -0.4934843510654760, -0.5419014550215590,
+ -0.9657997830826700, -0.6276075673757390, -0.6675927795018510, -0.6932641383465870, -0.8897872681859630,
+ -0.8382698977371710, -0.8074694642446040 };
final private static double pmbprobs[][] = {
- { 0.0771762457248147, 0.0531913844998640, 0.0393445076407294, 0.0466756566755510, 0.0286348361997465,
+ { 0.0771762457248147, 0.0531913844998640, 0.0393445076407294, 0.0466756566755510, 0.0286348361997465,
0.0312327748383639, 0.0505410248721427, 0.0767106611472993, 0.0258916271688597, 0.0673140562194124,
0.0965705469252199, 0.0515979465932174, 0.0250628079438675, 0.0503492018628350, 0.0399908189418273,
0.0641898881894471, 0.0517539616710987, 0.0143507440546115, 0.0357994592438322, 0.0736218495862984 },
{ 0.0368263046116572, -0.0006728917107827, 0.0008590805287740, -0.0002764255356960, 0.0020152937187455,
- 0.0055743720652960, 0.0003213317669367, 0.0000449190281568, -0.0004226254397134, 0.1805040629634510,
- -0.0272246813586204, 0.0005904606533477, -0.0183743200073889, -0.0009194625608688, 0.0008173657533167,
- -0.0262629806302238, 0.0265738757209787, 0.0002176606241904, 0.0021315644838566, -0.1823229927207580 },
- { -0.0194800075560895, 0.0012068088610652, -0.0008803318319596, -0.0016044273960017, -0.0002938633803197,
- -0.0535796754602196, 0.0155163896648621, -0.0015006360762140, 0.0021601372013703, 0.0268513218744797,
- -0.1085292493742730, 0.0149753083138452, 0.1346457366717310, -0.0009371698759829, 0.0013501708044116,
- 0.0346352293103622, -0.0276963770242276, 0.0003643142783940, 0.0002074817333067, -0.0174108903914110 },
- { 0.0557839400850153, 0.0023271577185437, 0.0183481103396687, 0.0023339480096311, 0.0002013267015151,
- -0.0227406863569852, 0.0098644845475047, 0.0064721276774396, 0.0001389408104210, -0.0473713878768274,
- -0.0086984445005797, 0.0026913674934634, 0.0283724052562196, 0.0001063665179457, 0.0027442574779383,
- -0.1875312134708470, 0.1279864877057640, 0.0005103347834563, 0.0003155113168637, 0.0081451082759554 },
- { 0.0037510125027265, 0.0107095920636885, 0.0147305410328404, -0.0112351252180332, -0.0001500408626446,
- -0.1523450933729730, 0.0611532413339872, -0.0005496748939503, 0.0048714378736644, -0.0003826320053999,
- 0.0552010244407311, 0.0482555671001955, -0.0461664995115847, -0.0021165008617978, -0.0004574454232187,
- 0.0233755883688949, -0.0035484915422384, 0.0009090698422851, 0.0013840637687758, -0.0073895139302231 },
- { -0.0111512564930024, 0.1025460064723080, 0.0396772456883791, -0.0298408501361294, -0.0001656742634733,
- -0.0079876311843289, 0.0712644184507945, -0.0010780604625230, -0.0035880882043592, 0.0021070399334252,
- 0.0016716329894279, -0.1810123023850110, 0.0015141703608724, -0.0032700852781804, 0.0035503782441679,
- 0.0118634302028026, 0.0044561606458028, -0.0001576678495964, 0.0023470722225751, -0.0027457045397157 },
- { 0.1474525743949170, -0.0054432538500293, 0.0853848892349828, -0.0137787746207348, -0.0008274830358513,
- 0.0042248844582553, 0.0019556229305563, -0.0164191435175148, -0.0024501858854849, 0.0120908948084233,
- -0.0381456105972653, 0.0101271614855119, -0.0061945941321859, 0.0178841099895867, -0.0014577779202600,
- -0.0752120602555032, -0.1426985695849920, 0.0002862275078983, -0.0081191734261838, 0.0313401149422531 },
- { 0.0542034611735289, -0.0078763926211829, 0.0060433542506096, 0.0033396210615510, 0.0013965072374079,
- 0.0067798903832256, -0.0135291136622509, -0.0089982442731848, -0.0056744537593887, -0.0766524225176246,
- 0.1881210263933930, -0.0065875518675173, 0.0416627569300375, -0.0953804133524747, -0.0012559228448735,
- 0.0101622644292547, -0.0304742453119050, 0.0011702318499737, 0.0454733434783982, -0.1119239362388150 },
- { 0.1069409037912470, 0.0805064400880297, -0.1127352030714600, 0.1001181253523260, -0.0021480427488769,
- -0.0332884841459003, -0.0679837575848452, -0.0043812841356657, 0.0153418716846395, -0.0079441315103188,
- -0.0121766182046363, -0.0381127991037620, -0.0036338726532673, 0.0195324059593791, -0.0020165963699984,
- -0.0061222685010268, -0.0253761448771437, -0.0005246410999057, -0.0112205170502433, 0.0052248485517237 },
- { -0.0325247648326262, 0.0238753651653669, 0.0203684886605797, 0.0295666232678825, -0.0003946714764213,
- -0.0157242718469554, -0.0511737848084862, 0.0084725632040180, -0.0167068828528921, 0.0686962159427527,
- -0.0659702890616198, -0.0014289912494271, -0.0167000964093416, -0.1276689083678200, 0.0036575057830967,
- -0.0205958145531018, 0.0000368919612829, 0.0014413626622426, 0.1064360941926030, 0.0863372661517408 },
- { -0.0463777468104402, 0.0394712148670596, 0.1118686750747160, 0.0440711686389031, -0.0026076286506751,
- -0.0268454015202516, -0.1464943067133240, -0.0137514051835380, -0.0094395514284145, -0.0144124844774228,
- 0.0249103379323744, -0.0071832157138676, 0.0035592787728526, 0.0415627419826693, 0.0027040097365669,
- 0.0337523666612066, 0.0316121324137152, -0.0011350177559026, -0.0349998884574440, -0.0302651879823361 },
- { 0.0142360925194728, 0.0413145623127025, 0.0324976427846929, 0.0580930922002398, -0.0586974207121084,
- 0.0202001168873069, 0.0492204086749069, 0.1126593173463060, 0.0116620013776662, -0.0780333711712066,
- -0.1109786767320410, 0.0407775100936731, -0.0205013161312652, -0.0653458585025237, 0.0347351829703865,
- 0.0304448983224773, 0.0068813748197884, -0.0189002309261882, -0.0334507528405279, -0.0668143558699485 },
- { -0.0131548829657936, 0.0044244322828034, -0.0050639951827271, -0.0038668197633889, -0.1536822386530220,
- 0.0026336969165336, 0.0021585651200470, -0.0459233839062969, 0.0046854727140565, 0.0393815434593599,
- 0.0619554007991097, 0.0027456299925622, 0.0117574347936383, 0.0373018612990383, 0.0024818527553328,
- -0.0133956606027299, -0.0020457128424105, 0.0154178819990401, 0.0246524142683911, 0.0275363065682921 },
- { -0.1542307272455030, 0.0364861558267547, -0.0090880407008181, 0.0531673937889863, 0.0157585615170580,
- 0.0029986538457297, 0.0180194047699875, 0.0652152443589317, 0.0266842840376180, 0.0388457366405908,
- 0.0856237634510719, 0.0126955778952183, 0.0099593861698250, -0.0013941794862563, 0.0294065511237513,
- -0.1151906949298290, -0.0852991447389655, 0.0028699120202636, -0.0332087026659522, 0.0006811857297899 },
- { 0.0281300736924501, -0.0584072081898638, -0.0178386569847853, -0.0536470338171487, -0.0186881656029960,
- -0.0240008730656106, -0.0541064820498883, 0.2217137098936020, -0.0260500001542033, 0.0234505236798375,
- 0.0311127151218573, -0.0494139126682672, 0.0057093465049849, 0.0124937286655911, -0.0298322975915689,
- 0.0006520211333102, -0.0061018680727128, -0.0007081999479528, -0.0060523759094034, 0.0215845995364623 },
- { 0.0295321046399105, -0.0088296411830544, -0.0065057049917325, -0.0053478115612781, -0.0100646496794634,
- -0.0015473619084872, 0.0008539960632865, -0.0376381933046211, -0.0328135588935604, 0.0672161874239480,
- 0.0667626853916552, -0.0026511651464901, 0.0140451514222062, -0.0544836996133137, 0.0427485157912094,
- 0.0097455780205802, 0.0177309072915667, -0.0828759701187452, -0.0729504795471370, 0.0670731961252313 },
- { 0.0082646581043963, -0.0319918630534466, -0.0188454445200422, -0.0374976353856606, 0.0037131290686848,
- -0.0132507796987883, -0.0306958830735725, -0.0044119395527308, -0.0140786756619672, -0.0180512599925078,
- -0.0208243802903953, -0.0232202769398931, -0.0063135878270273, 0.0110442171178168, 0.1824538048228460,
- -0.0006644614422758, -0.0069909097436659, 0.0255407650654681, 0.0099119399501151, -0.0140911517070698 },
- { 0.0261344441524861, -0.0714454044548650, 0.0159436926233439, 0.0028462736216688, -0.0044572637889080,
- -0.0089474834434532, -0.0177570282144517, -0.0153693244094452, 0.1160919467206400, 0.0304911481385036,
- 0.0047047513411774, -0.0456535116423972, 0.0004491494948617, -0.0767108879444462, -0.0012688533741441,
- 0.0192445965934123, 0.0202321954782039, 0.0281039933233607, -0.0590403018490048, 0.0364080426546883 },
- { 0.0115826306265004, 0.1340228176509380, -0.0236200652949049, -0.1284484655137340, -0.0004742338006503,
- 0.0127617346949511, -0.0428560878860394, 0.0060030732454125, 0.0089182609926781, 0.0085353834972860,
- 0.0048464809638033, 0.0709740071429510, 0.0029940462557054, -0.0483434904493132, -0.0071713680727884,
- -0.0036840391887209, 0.0031454003250096, 0.0246243550241551, -0.0449551277644180, 0.0111449232769393 },
- { 0.0140356721886765, -0.0196518236826680, 0.0030517022326582, 0.0582672093364850, -0.0000973895685457,
- 0.0021704767224292, 0.0341806268602705, -0.0152035987563018, -0.0903198657739177, 0.0259623214586925,
- 0.0155832497882743, -0.0040543568451651, 0.0036477631918247, -0.0532892744763217, -0.0142569373662724,
- 0.0104500681408622, 0.0103483945857315, 0.0679534422398752, -0.0768068882938636, 0.0280289727046158 } };
- // dcmut version of PAM model from http://www.ebi.ac.uk/goldman-srv/dayhoff/
+ 0.0055743720652960, 0.0003213317669367, 0.0000449190281568, -0.0004226254397134, 0.1805040629634510,
+ -0.0272246813586204, 0.0005904606533477, -0.0183743200073889, -0.0009194625608688, 0.0008173657533167,
+ -0.0262629806302238, 0.0265738757209787, 0.0002176606241904, 0.0021315644838566, -0.1823229927207580 },
+ { -0.0194800075560895, 0.0012068088610652, -0.0008803318319596, -0.0016044273960017, -0.0002938633803197,
+ -0.0535796754602196, 0.0155163896648621, -0.0015006360762140, 0.0021601372013703, 0.0268513218744797,
+ -0.1085292493742730, 0.0149753083138452, 0.1346457366717310, -0.0009371698759829, 0.0013501708044116,
+ 0.0346352293103622, -0.0276963770242276, 0.0003643142783940, 0.0002074817333067, -0.0174108903914110 },
+ { 0.0557839400850153, 0.0023271577185437, 0.0183481103396687, 0.0023339480096311, 0.0002013267015151,
+ -0.0227406863569852, 0.0098644845475047, 0.0064721276774396, 0.0001389408104210, -0.0473713878768274,
+ -0.0086984445005797, 0.0026913674934634, 0.0283724052562196, 0.0001063665179457, 0.0027442574779383,
+ -0.1875312134708470, 0.1279864877057640, 0.0005103347834563, 0.0003155113168637, 0.0081451082759554 },
+ { 0.0037510125027265, 0.0107095920636885, 0.0147305410328404, -0.0112351252180332, -0.0001500408626446,
+ -0.1523450933729730, 0.0611532413339872, -0.0005496748939503, 0.0048714378736644, -0.0003826320053999,
+ 0.0552010244407311, 0.0482555671001955, -0.0461664995115847, -0.0021165008617978, -0.0004574454232187,
+ 0.0233755883688949, -0.0035484915422384, 0.0009090698422851, 0.0013840637687758, -0.0073895139302231 },
+ { -0.0111512564930024, 0.1025460064723080, 0.0396772456883791, -0.0298408501361294, -0.0001656742634733,
+ -0.0079876311843289, 0.0712644184507945, -0.0010780604625230, -0.0035880882043592, 0.0021070399334252,
+ 0.0016716329894279, -0.1810123023850110, 0.0015141703608724, -0.0032700852781804, 0.0035503782441679,
+ 0.0118634302028026, 0.0044561606458028, -0.0001576678495964, 0.0023470722225751, -0.0027457045397157 },
+ { 0.1474525743949170, -0.0054432538500293, 0.0853848892349828, -0.0137787746207348, -0.0008274830358513,
+ 0.0042248844582553, 0.0019556229305563, -0.0164191435175148, -0.0024501858854849, 0.0120908948084233,
+ -0.0381456105972653, 0.0101271614855119, -0.0061945941321859, 0.0178841099895867, -0.0014577779202600,
+ -0.0752120602555032, -0.1426985695849920, 0.0002862275078983, -0.0081191734261838, 0.0313401149422531 },
+ { 0.0542034611735289, -0.0078763926211829, 0.0060433542506096, 0.0033396210615510, 0.0013965072374079,
+ 0.0067798903832256, -0.0135291136622509, -0.0089982442731848, -0.0056744537593887, -0.0766524225176246,
+ 0.1881210263933930, -0.0065875518675173, 0.0416627569300375, -0.0953804133524747, -0.0012559228448735,
+ 0.0101622644292547, -0.0304742453119050, 0.0011702318499737, 0.0454733434783982, -0.1119239362388150 },
+ { 0.1069409037912470, 0.0805064400880297, -0.1127352030714600, 0.1001181253523260, -0.0021480427488769,
+ -0.0332884841459003, -0.0679837575848452, -0.0043812841356657, 0.0153418716846395, -0.0079441315103188,
+ -0.0121766182046363, -0.0381127991037620, -0.0036338726532673, 0.0195324059593791, -0.0020165963699984,
+ -0.0061222685010268, -0.0253761448771437, -0.0005246410999057, -0.0112205170502433, 0.0052248485517237 },
+ { -0.0325247648326262, 0.0238753651653669, 0.0203684886605797, 0.0295666232678825, -0.0003946714764213,
+ -0.0157242718469554, -0.0511737848084862, 0.0084725632040180, -0.0167068828528921, 0.0686962159427527,
+ -0.0659702890616198, -0.0014289912494271, -0.0167000964093416, -0.1276689083678200, 0.0036575057830967,
+ -0.0205958145531018, 0.0000368919612829, 0.0014413626622426, 0.1064360941926030, 0.0863372661517408 },
+ { -0.0463777468104402, 0.0394712148670596, 0.1118686750747160, 0.0440711686389031, -0.0026076286506751,
+ -0.0268454015202516, -0.1464943067133240, -0.0137514051835380, -0.0094395514284145, -0.0144124844774228,
+ 0.0249103379323744, -0.0071832157138676, 0.0035592787728526, 0.0415627419826693, 0.0027040097365669,
+ 0.0337523666612066, 0.0316121324137152, -0.0011350177559026, -0.0349998884574440, -0.0302651879823361 },
+ { 0.0142360925194728, 0.0413145623127025, 0.0324976427846929, 0.0580930922002398, -0.0586974207121084,
+ 0.0202001168873069, 0.0492204086749069, 0.1126593173463060, 0.0116620013776662, -0.0780333711712066,
+ -0.1109786767320410, 0.0407775100936731, -0.0205013161312652, -0.0653458585025237, 0.0347351829703865,
+ 0.0304448983224773, 0.0068813748197884, -0.0189002309261882, -0.0334507528405279, -0.0668143558699485 },
+ { -0.0131548829657936, 0.0044244322828034, -0.0050639951827271, -0.0038668197633889, -0.1536822386530220,
+ 0.0026336969165336, 0.0021585651200470, -0.0459233839062969, 0.0046854727140565, 0.0393815434593599,
+ 0.0619554007991097, 0.0027456299925622, 0.0117574347936383, 0.0373018612990383, 0.0024818527553328,
+ -0.0133956606027299, -0.0020457128424105, 0.0154178819990401, 0.0246524142683911, 0.0275363065682921 },
+ { -0.1542307272455030, 0.0364861558267547, -0.0090880407008181, 0.0531673937889863, 0.0157585615170580,
+ 0.0029986538457297, 0.0180194047699875, 0.0652152443589317, 0.0266842840376180, 0.0388457366405908,
+ 0.0856237634510719, 0.0126955778952183, 0.0099593861698250, -0.0013941794862563, 0.0294065511237513,
+ -0.1151906949298290, -0.0852991447389655, 0.0028699120202636, -0.0332087026659522, 0.0006811857297899 },
+ { 0.0281300736924501, -0.0584072081898638, -0.0178386569847853, -0.0536470338171487, -0.0186881656029960,
+ -0.0240008730656106, -0.0541064820498883, 0.2217137098936020, -0.0260500001542033, 0.0234505236798375,
+ 0.0311127151218573, -0.0494139126682672, 0.0057093465049849, 0.0124937286655911, -0.0298322975915689,
+ 0.0006520211333102, -0.0061018680727128, -0.0007081999479528, -0.0060523759094034, 0.0215845995364623 },
+ { 0.0295321046399105, -0.0088296411830544, -0.0065057049917325, -0.0053478115612781, -0.0100646496794634,
+ -0.0015473619084872, 0.0008539960632865, -0.0376381933046211, -0.0328135588935604, 0.0672161874239480,
+ 0.0667626853916552, -0.0026511651464901, 0.0140451514222062, -0.0544836996133137, 0.0427485157912094,
+ 0.0097455780205802, 0.0177309072915667, -0.0828759701187452, -0.0729504795471370, 0.0670731961252313 },
+ { 0.0082646581043963, -0.0319918630534466, -0.0188454445200422, -0.0374976353856606, 0.0037131290686848,
+ -0.0132507796987883, -0.0306958830735725, -0.0044119395527308, -0.0140786756619672, -0.0180512599925078,
+ -0.0208243802903953, -0.0232202769398931, -0.0063135878270273, 0.0110442171178168, 0.1824538048228460,
+ -0.0006644614422758, -0.0069909097436659, 0.0255407650654681, 0.0099119399501151, -0.0140911517070698 },
+ { 0.0261344441524861, -0.0714454044548650, 0.0159436926233439, 0.0028462736216688, -0.0044572637889080,
+ -0.0089474834434532, -0.0177570282144517, -0.0153693244094452, 0.1160919467206400, 0.0304911481385036,
+ 0.0047047513411774, -0.0456535116423972, 0.0004491494948617, -0.0767108879444462, -0.0012688533741441,
+ 0.0192445965934123, 0.0202321954782039, 0.0281039933233607, -0.0590403018490048, 0.0364080426546883 },
+ { 0.0115826306265004, 0.1340228176509380, -0.0236200652949049, -0.1284484655137340, -0.0004742338006503,
+ 0.0127617346949511, -0.0428560878860394, 0.0060030732454125, 0.0089182609926781, 0.0085353834972860,
+ 0.0048464809638033, 0.0709740071429510, 0.0029940462557054, -0.0483434904493132, -0.0071713680727884,
+ -0.0036840391887209, 0.0031454003250096, 0.0246243550241551, -0.0449551277644180, 0.0111449232769393 },
+ { 0.0140356721886765, -0.0196518236826680, 0.0030517022326582, 0.0582672093364850, -0.0000973895685457,
+ 0.0021704767224292, 0.0341806268602705, -0.0152035987563018, -0.0903198657739177, 0.0259623214586925,
+ 0.0155832497882743, -0.0040543568451651, 0.0036477631918247, -0.0532892744763217, -0.0142569373662724,
+ 0.0104500681408622, 0.0103483945857315, 0.0679534422398752, -0.0768068882938636, 0.0280289727046158 } };
+ // dcmut version of PAM model from http://www.ebi.ac.uk/goldman-srv/dayhoff/
final private static double pameigs[] = { 0, -1.93321786301018, -2.20904642493621, -1.74835983874903,
- -1.64854548332072, -1.54505559488222, -1.33859384676989, -1.29786201193594, -0.235548517495575,
- -0.266951066089808, -0.28965813670665, -1.10505826965282, -1.04323310568532, -0.430423720979904,
- -0.541719761016713, -0.879636093986914, -0.711249353378695, -0.725050487280602, -0.776855937389452,
- -0.808735559461343 };
+ -1.64854548332072, -1.54505559488222, -1.33859384676989, -1.29786201193594, -0.235548517495575,
+ -0.266951066089808, -0.28965813670665, -1.10505826965282, -1.04323310568532, -0.430423720979904,
+ -0.541719761016713, -0.879636093986914, -0.711249353378695, -0.725050487280602, -0.776855937389452,
+ -0.808735559461343 };
final private static double pamprobs[][] = {
- { 0.08712695644, 0.04090397955, 0.04043197978, 0.04687197656, 0.03347398326, 0.03825498087, 0.04952997524,
+ { 0.08712695644, 0.04090397955, 0.04043197978, 0.04687197656, 0.03347398326, 0.03825498087, 0.04952997524,
0.08861195569, 0.03361898319, 0.03688598156, 0.08535695732, 0.08048095976, 0.01475299262, 0.03977198011,
0.05067997466, 0.06957696521, 0.05854197073, 0.01049399475, 0.02991598504, 0.06471796764 },
{ 0.07991048383, 0.006888314018, 0.03857806206, 0.07947073194, 0.004895492884, 0.03815829405,
- -0.1087562465, 0.008691167141, -0.0140554828, 0.001306404001, -0.001888411299, -0.006921303342,
- 0.0007655604228, 0.001583298443, 0.006879590446, -0.171806883, 0.04890917949, 0.0006700432804,
- 0.0002276237277, -0.01350591875 },
- { -0.01641514483, -0.007233933239, -0.1377830621, 0.1163201333, -0.002305138017, 0.01557250366,
- -0.07455879489, -0.003225343503, 0.0140630487, 0.005112274204, 0.001405731862, 0.01975833782,
- -0.001348402973, -0.001085733262, -0.003880514478, 0.0851493313, -0.01163526615, -0.0001197903399,
- 0.002056153393, 0.0001536095643 },
- { 0.009669278686, -0.006905863869, 0.101083544, 0.01179903104, -0.003780967591, 0.05845105878,
- -0.09138357299, -0.02850503638, -0.03233951408, 0.008708065876, -0.004700705411, -0.02053221579,
- 0.001165851398, -0.001366585849, -0.01317695074, 0.1199985703, -0.1146346193, -0.0005953021314,
- -0.0004297615194, 0.007475695618 },
- { 0.1722243502, -0.003737582995, -0.02964873222, -0.02050116381, -0.0004530478465, -0.02460043205,
- 0.02280768412, -0.02127364909, 0.01570095258, 0.1027744285, -0.005330539586, 0.0179697651, -0.002904077286,
- -0.007068126663, -0.0142869583, -0.01444241844, -0.08218861544, 0.0002069181629, 0.001099671379,
- -0.1063484263 },
- { -0.1553433627, -0.001169168032, 0.02134785337, 0.0007602305436, 0.0001395330122, 0.03194992019,
- -0.01290252206, 0.03281720789, -0.01311103735, 0.1177254769, -0.008008783885, -0.02375317548,
- -0.002817809762, -0.008196682776, 0.01731267617, 0.01853526375, 0.08249908546, -2.788771776e-05,
- 0.001266182191, -0.09902299976 },
- { -0.03671080341, 0.0274168035, 0.04625877597, 0.07520706414, -0.0001833803619, -0.1207833161,
- -0.006415807779, -0.005465629648, 0.02778273972, 0.007589688485, -0.02945266034, -0.03797542064,
- 0.07044042052, -0.002018573865, 0.01845277071, 0.006901513991, -0.02430934639, -0.0005919635873,
- -0.001266962331, -0.01487591261 },
- { -0.03060317816, 0.01182361623, 0.04200270053, 0.05406235279, -0.0003920498815, -0.09159709348,
- -0.009602690652, -0.00382944418, 0.01761361993, 0.01605684317, 0.05198878008, 0.02198696949,
- -0.09308930025, -0.00102622863, 0.01477637127, 0.0009314065393, -0.01860959472, -0.0005964703968,
- -0.002694284083, 0.02079767439 },
- { 0.0195976494, -0.005104484936, 0.007406728707, 0.01236244954, 0.0201446796, 0.007039564785,
- 0.01276942134, 0.02641595685, 0.002764624354, 0.001273314658, -0.01335316035, 0.01105658671,
- 2.148773499e-05, -0.02692205639, 0.0118684991, 0.01212624708, 0.01127770094, -0.09842754796,
- -0.01942336432, 0.007105703151 },
- { -0.01819461888, -0.01509348507, -0.01297636935, -0.01996453439, 0.1715705905, -0.01601550692,
- -0.02122706144, -0.02854628494, -0.009351082371, -0.001527995472, -0.010198224, -0.03609537551,
- -0.003153182095, 0.02395980501, -0.01378664626, -0.005992611421, -0.01176810875, 0.003132361603,
- 0.03018439539, -0.004956065656 },
- { -0.02733614784, -0.02258066705, -0.0153112506, -0.02475728664, -0.04480525045, -0.01526640341,
- -0.02438517425, -0.04836914601, -0.00635964824, 0.02263169831, 0.09794101931, -0.04004304158,
- 0.008464393478, 0.1185443142, -0.02239294163, -0.0281550321, -0.01453581604, -0.0246742804, 0.0879619849,
- 0.02342867605 },
- { 0.06483718238, 0.1260012082, -0.006496013283, 0.009914915531, -0.004181603532, 0.0003493226286,
- 0.01408035752, -0.04881663016, -0.03431167356, -0.01768005602, 0.02362447761, -0.1482364784,
- -0.01289035619, -0.001778893279, -0.05240099752, 0.05536174567, 0.06782165352, -0.003548568717,
- 0.001125301173, -0.03277489363 },
- { 0.06520296909, -0.0754802543, 0.03139281903, -0.03266449554, -0.004485188002, -0.03389072036,
- -0.06163274338, -0.06484769882, 0.05722658289, -0.02824079619, 0.01544837349, 0.03909752708,
- 0.002029218884, 0.003151939572, -0.05471208363, 0.07962008342, 0.125916047, 0.0008696184937,
- -0.01086027514, -0.05314092355 },
- { 0.004543119081, 0.01935177735, 0.01905511007, 0.02682993409, -0.01199617967, 0.01426278655,
- 0.02472521255, 0.03864795501, 0.02166224804, -0.04754243479, -0.1921545477, 0.03621321546, -0.02120627881,
- 0.04928097895, 0.009396088815, 0.01748042052, -6.173742851e-05, -0.003168033098, 0.07723565812,
- -0.08255529309 },
- { 0.06710378668, -0.09441410284, -0.004801776989, 0.008830272165, -0.01021645042, -0.02764365608,
- 0.004250361851, 0.1648777542, -0.037446109, 0.004541057635, -0.0296980702, -0.1532325189, -0.008940580901,
- 0.006998050812, 0.02338809379, 0.03175059182, 0.02033965512, 0.006388075608, 0.001762762044, 0.02616280361 },
- { 0.01915943021, -0.05432967274, 0.01249342683, 0.06836622457, 0.002054462161, -0.01233535859,
- 0.07087282652, -0.08948637051, -0.1245896013, -0.02204522882, 0.03791481736, 0.06557467874, 0.005529294156,
- -0.006296644235, 0.02144530752, 0.01664230081, 0.02647078439, 0.001737725271, 0.01414149877, -0.05331990116 },
- { 0.0266659303, 0.0564142853, -0.0263767738, -0.08029726006, -0.006059357163, -0.06317558457,
- -0.0911894019, 0.05401487057, -0.08178072458, 0.01580699778, -0.05370550396, 0.09798653264, 0.003934944022,
- 0.01977291947, 0.0441198541, 0.02788220393, 0.03201877081, -0.00206161759, -0.005101423308, 0.03113033802 },
- { 0.02980360751, -0.009513246268, -0.009543527165, -0.02190644172, -0.006146440672, 0.01207009085,
- -0.0126989156, -0.1378266418, 0.0275235217, 0.00551720592, -0.03104791544, -0.07111701247, -0.006081754489,
- -0.01337494521, 0.1783961085, 0.01453225059, 0.01938736048, 0.0004488631071, 0.0110844398, 0.02049339243 },
- { -0.01433508581, 0.01258858175, -0.004294252236, -0.007146532854, 0.009541628809, 0.008040155729,
- -0.006857781832, 0.05584120066, 0.007749418365, -0.05867835844, 0.08008131283, -0.004877854222,
- -0.0007128540743, 0.09489058424, 0.06421121962, 0.00271493526, -0.03229944773, -0.001732026038,
- -0.08053448316, -0.1241903609 },
- { -0.009854113227, 0.01294129929, -0.00593064392, -0.03016833115, -0.002018439732, -0.00792418722,
- -0.03372768732, 0.07828561288, 0.007722254639, -0.05067377561, 0.1191848621, 0.005059475202,
- 0.004762387166, -0.1029870175, 0.03537190114, 0.001089956203, -0.02139157573, -0.001015245062,
- 0.08400521847, -0.08273195059 } };
+ -0.1087562465, 0.008691167141, -0.0140554828, 0.001306404001, -0.001888411299, -0.006921303342,
+ 0.0007655604228, 0.001583298443, 0.006879590446, -0.171806883, 0.04890917949, 0.0006700432804,
+ 0.0002276237277, -0.01350591875 },
+ { -0.01641514483, -0.007233933239, -0.1377830621, 0.1163201333, -0.002305138017, 0.01557250366,
+ -0.07455879489, -0.003225343503, 0.0140630487, 0.005112274204, 0.001405731862, 0.01975833782,
+ -0.001348402973, -0.001085733262, -0.003880514478, 0.0851493313, -0.01163526615, -0.0001197903399,
+ 0.002056153393, 0.0001536095643 },
+ { 0.009669278686, -0.006905863869, 0.101083544, 0.01179903104, -0.003780967591, 0.05845105878,
+ -0.09138357299, -0.02850503638, -0.03233951408, 0.008708065876, -0.004700705411, -0.02053221579,
+ 0.001165851398, -0.001366585849, -0.01317695074, 0.1199985703, -0.1146346193, -0.0005953021314,
+ -0.0004297615194, 0.007475695618 },
+ { 0.1722243502, -0.003737582995, -0.02964873222, -0.02050116381, -0.0004530478465, -0.02460043205,
+ 0.02280768412, -0.02127364909, 0.01570095258, 0.1027744285, -0.005330539586, 0.0179697651, -0.002904077286,
+ -0.007068126663, -0.0142869583, -0.01444241844, -0.08218861544, 0.0002069181629, 0.001099671379,
+ -0.1063484263 },
+ { -0.1553433627, -0.001169168032, 0.02134785337, 0.0007602305436, 0.0001395330122, 0.03194992019,
+ -0.01290252206, 0.03281720789, -0.01311103735, 0.1177254769, -0.008008783885, -0.02375317548,
+ -0.002817809762, -0.008196682776, 0.01731267617, 0.01853526375, 0.08249908546, -2.788771776e-05,
+ 0.001266182191, -0.09902299976 },
+ { -0.03671080341, 0.0274168035, 0.04625877597, 0.07520706414, -0.0001833803619, -0.1207833161,
+ -0.006415807779, -0.005465629648, 0.02778273972, 0.007589688485, -0.02945266034, -0.03797542064,
+ 0.07044042052, -0.002018573865, 0.01845277071, 0.006901513991, -0.02430934639, -0.0005919635873,
+ -0.001266962331, -0.01487591261 },
+ { -0.03060317816, 0.01182361623, 0.04200270053, 0.05406235279, -0.0003920498815, -0.09159709348,
+ -0.009602690652, -0.00382944418, 0.01761361993, 0.01605684317, 0.05198878008, 0.02198696949,
+ -0.09308930025, -0.00102622863, 0.01477637127, 0.0009314065393, -0.01860959472, -0.0005964703968,
+ -0.002694284083, 0.02079767439 },
+ { 0.0195976494, -0.005104484936, 0.007406728707, 0.01236244954, 0.0201446796, 0.007039564785,
+ 0.01276942134, 0.02641595685, 0.002764624354, 0.001273314658, -0.01335316035, 0.01105658671,
+ 2.148773499e-05, -0.02692205639, 0.0118684991, 0.01212624708, 0.01127770094, -0.09842754796,
+ -0.01942336432, 0.007105703151 },
+ { -0.01819461888, -0.01509348507, -0.01297636935, -0.01996453439, 0.1715705905, -0.01601550692,
+ -0.02122706144, -0.02854628494, -0.009351082371, -0.001527995472, -0.010198224, -0.03609537551,
+ -0.003153182095, 0.02395980501, -0.01378664626, -0.005992611421, -0.01176810875, 0.003132361603,
+ 0.03018439539, -0.004956065656 },
+ { -0.02733614784, -0.02258066705, -0.0153112506, -0.02475728664, -0.04480525045, -0.01526640341,
+ -0.02438517425, -0.04836914601, -0.00635964824, 0.02263169831, 0.09794101931, -0.04004304158,
+ 0.008464393478, 0.1185443142, -0.02239294163, -0.0281550321, -0.01453581604, -0.0246742804, 0.0879619849,
+ 0.02342867605 },
+ { 0.06483718238, 0.1260012082, -0.006496013283, 0.009914915531, -0.004181603532, 0.0003493226286,
+ 0.01408035752, -0.04881663016, -0.03431167356, -0.01768005602, 0.02362447761, -0.1482364784,
+ -0.01289035619, -0.001778893279, -0.05240099752, 0.05536174567, 0.06782165352, -0.003548568717,
+ 0.001125301173, -0.03277489363 },
+ { 0.06520296909, -0.0754802543, 0.03139281903, -0.03266449554, -0.004485188002, -0.03389072036,
+ -0.06163274338, -0.06484769882, 0.05722658289, -0.02824079619, 0.01544837349, 0.03909752708,
+ 0.002029218884, 0.003151939572, -0.05471208363, 0.07962008342, 0.125916047, 0.0008696184937,
+ -0.01086027514, -0.05314092355 },
+ { 0.004543119081, 0.01935177735, 0.01905511007, 0.02682993409, -0.01199617967, 0.01426278655,
+ 0.02472521255, 0.03864795501, 0.02166224804, -0.04754243479, -0.1921545477, 0.03621321546, -0.02120627881,
+ 0.04928097895, 0.009396088815, 0.01748042052, -6.173742851e-05, -0.003168033098, 0.07723565812,
+ -0.08255529309 },
+ { 0.06710378668, -0.09441410284, -0.004801776989, 0.008830272165, -0.01021645042, -0.02764365608,
+ 0.004250361851, 0.1648777542, -0.037446109, 0.004541057635, -0.0296980702, -0.1532325189, -0.008940580901,
+ 0.006998050812, 0.02338809379, 0.03175059182, 0.02033965512, 0.006388075608, 0.001762762044, 0.02616280361 },
+ { 0.01915943021, -0.05432967274, 0.01249342683, 0.06836622457, 0.002054462161, -0.01233535859,
+ 0.07087282652, -0.08948637051, -0.1245896013, -0.02204522882, 0.03791481736, 0.06557467874, 0.005529294156,
+ -0.006296644235, 0.02144530752, 0.01664230081, 0.02647078439, 0.001737725271, 0.01414149877, -0.05331990116 },
+ { 0.0266659303, 0.0564142853, -0.0263767738, -0.08029726006, -0.006059357163, -0.06317558457,
+ -0.0911894019, 0.05401487057, -0.08178072458, 0.01580699778, -0.05370550396, 0.09798653264, 0.003934944022,
+ 0.01977291947, 0.0441198541, 0.02788220393, 0.03201877081, -0.00206161759, -0.005101423308, 0.03113033802 },
+ { 0.02980360751, -0.009513246268, -0.009543527165, -0.02190644172, -0.006146440672, 0.01207009085,
+ -0.0126989156, -0.1378266418, 0.0275235217, 0.00551720592, -0.03104791544, -0.07111701247, -0.006081754489,
+ -0.01337494521, 0.1783961085, 0.01453225059, 0.01938736048, 0.0004488631071, 0.0110844398, 0.02049339243 },
+ { -0.01433508581, 0.01258858175, -0.004294252236, -0.007146532854, 0.009541628809, 0.008040155729,
+ -0.006857781832, 0.05584120066, 0.007749418365, -0.05867835844, 0.08008131283, -0.004877854222,
+ -0.0007128540743, 0.09489058424, 0.06421121962, 0.00271493526, -0.03229944773, -0.001732026038,
+ -0.08053448316, -0.1241903609 },
+ { -0.009854113227, 0.01294129929, -0.00593064392, -0.03016833115, -0.002018439732, -0.00792418722,
+ -0.03372768732, 0.07828561288, 0.007722254639, -0.05067377561, 0.1191848621, 0.005059475202,
+ 0.004762387166, -0.1029870175, 0.03537190114, 0.001089956203, -0.02139157573, -0.001015245062,
+ 0.08400521847, -0.08273195059 } };
}
private static boolean testDistanceCalculationMethods( final File test_dir ) {
try {
final Msa msa0 = GeneralMsaParser.parse( new FileInputStream( test_dir + ForesterUtil.FILE_SEPARATOR
- + "bcl.aln" ) );
+ + "bcl.aln" ) );
final BasicSymmetricalDistanceMatrix pwd0 = PairwiseDistanceCalculator.calcKimuraDistances( msa0 );
if ( pwd0.getSize() != 120 ) {
return false;
final String p1_str = "((((((a,b)ab,c)ac,d)ad,(e,f)ef)af,(g,h)gh)ah,i)r";
final Phylogeny p1 = factory1.create( p1_str, new NHXParser() )[ 0 ];
CharacterStateMatrix<CharacterStateMatrix.BinaryStates> m1 = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( 9,
- 1 );
+ 1 );
m1.setIdentifier( 0, "a" );
m1.setIdentifier( 1, "b" );
m1.setIdentifier( 2, "c" );
final String p2_str = "((((((a,b)ab,c)ac,d)ad,(e,f)ef)af,(g,h,i)gi)ai,((j,k,l)jl,(m,n,o)mo,(p,q,r)pr)jr)root";
final Phylogeny p2 = factory2.create( p2_str, new NHXParser() )[ 0 ];
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> m2 = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( 18,
- 4 );
+ 4 );
m2.setIdentifier( 0, "a" );
m2.setIdentifier( 1, "b" );
m2.setIdentifier( 2, "c" );
final String p10_str = "((((((a,b)ab,c)ac,d)ad,(e,f)ef)af,(g,h)gh)ah,i)r";
final Phylogeny p10 = factory10.create( p10_str, new NHXParser() )[ 0 ];
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> m10 = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( 9,
- 1 );
+ 1 );
m10.setIdentifier( 0, "a" );
m10.setIdentifier( 1, "b" );
m10.setIdentifier( 2, "c" );
final String p1_str = "((((((a,b,y)aby,c)ac,d)ad,(e,f)ef)af,(g,h)gh)ah,i)r";
final Phylogeny p1 = factory1.create( p1_str, new NHXParser() )[ 0 ];
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> m1 = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( 10,
- 1 );
+ 1 );
m1.setIdentifier( 0, "a" );
m1.setIdentifier( 1, "b" );
m1.setIdentifier( 2, "y" );
final String p2_str = "((((((a,b,y)aby,c,d)cad,e,f)af,(g,h)gh)ah,i))r";
final Phylogeny p2 = factory2.create( p2_str, new NHXParser() )[ 0 ];
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> m2 = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( 10,
- 1 );
+ 1 );
m2.setIdentifier( 0, "a" );
m2.setIdentifier( 1, "b" );
m2.setIdentifier( 2, "y" );
return false;
}
if ( isUnequal( p2.getNode( "Chimp" ).getParent().getParent().getParent().getParent().getParent()
- .getDistanceToParent(), 0.458845 ) ) {
+ .getDistanceToParent(), 0.458845 ) ) {
return false;
}
m = new BasicSymmetricalDistanceMatrix( 4 );
return false;
}
if ( isUnequal( p2f.getNode( "Chimp" ).getParent().getParent().getParent().getParent()
- .getDistanceToParent(), 0.42027 ) ) {
+ .getDistanceToParent(), 0.42027 ) ) {
return false;
}
if ( isUnequal( p2f.getNode( "Chimp" ).getParent().getParent().getParent().getParent().getParent()
- .getDistanceToParent(), 0.458845 ) ) {
+ .getDistanceToParent(), 0.458845 ) ) {
return false;
}
}
return false;
}
if ( isUnequal( p2.getNode( "Chimp" ).getParent().getParent().getParent().getParent().getParent()
- .getDistanceToParent(), 0.458845 ) ) {
+ .getDistanceToParent(), 0.458845 ) ) {
return false;
}
//
+ " ("
+ ( ForesterUtil.isEmpty( n.getChildNode1().getName() ) ? n.getChildNode1().getId() : n.getChildNode1()
.getName() )
- + "+"
- + ( ForesterUtil.isEmpty( n.getChildNode2().getName() ) ? n.getChildNode2().getId() : n.getChildNode2()
- .getName() ) + ")";
+ + "+"
+ + ( ForesterUtil.isEmpty( n.getChildNode2().getName() ) ? n.getChildNode2().getId() : n.getChildNode2()
+ .getName() ) + ")";
}
// only the values in the lower triangle are used.
+ " ("
+ ( ForesterUtil.isEmpty( n.getChildNode1().getName() ) ? n.getChildNode1().getId() : n.getChildNode1()
.getName() )
- + "+"
- + ( ForesterUtil.isEmpty( n.getChildNode2().getName() ) ? n.getChildNode2().getId() : n.getChildNode2()
- .getName() ) + ")";
+ + "+"
+ + ( ForesterUtil.isEmpty( n.getChildNode2().getName() ) ? n.getChildNode2().getId() : n.getChildNode2()
+ .getName() ) + ")";
}
// only the values in the lower triangle are used.
if ( _verbose ) {
System.out.println( "" );
System.out
- .println( "----------------------------------------------------------------------------------" );
+ .println( "----------------------------------------------------------------------------------" );
System.out.println( "" );
}
}
+ " ("
+ ( ForesterUtil.isEmpty( n.getChildNode1().getName() ) ? n.getChildNode1().getId() : n.getChildNode1()
.getName() )
- + "+"
- + ( ForesterUtil.isEmpty( n.getChildNode2().getName() ) ? n.getChildNode2().getId() : n.getChildNode2()
- .getName() ) + ")";
+ + "+"
+ + ( ForesterUtil.isEmpty( n.getChildNode2().getName() ) ? n.getChildNode2().getId() : n.getChildNode2()
+ .getName() ) + ")";
}
// only the values in the lower triangle are used.
/**
* "Kimura Distance"
* Kimura, 1983
- *
+ *
* @param row_1
* @param row_2
* @return
public static BasicSymmetricalDistanceMatrix calcFractionalDissimilarities( final Msa msa ) {
return new PairwiseDistanceCalculator( msa, DEFAULT_VALUE_FOR_TOO_LARGE_DISTANCE_FOR_KIMURA_FORMULA )
- .calcFractionalDissimilarities();
+ .calcFractionalDissimilarities();
}
public static BasicSymmetricalDistanceMatrix calcPoissonDistances( final Msa msa ) {
return new PairwiseDistanceCalculator( msa, DEFAULT_VALUE_FOR_TOO_LARGE_DISTANCE_FOR_KIMURA_FORMULA )
- .calcPoissonDistances();
+ .calcPoissonDistances();
}
public static BasicSymmetricalDistanceMatrix calcKimuraDistances( final Msa msa ) {
return new PairwiseDistanceCalculator( msa, DEFAULT_VALUE_FOR_TOO_LARGE_DISTANCE_FOR_KIMURA_FORMULA )
- .calcKimuraDistances();
+ .calcKimuraDistances();
}
public static BasicSymmetricalDistanceMatrix calcKimuraDistances( final Msa msa,
final double value_for_too_large_distance_for_kimura_formula ) {
return new PairwiseDistanceCalculator( msa, value_for_too_large_distance_for_kimura_formula )
- .calcKimuraDistances();
+ .calcKimuraDistances();
}
public enum PWD_DISTANCE_METHOD {
if ( x == null ) {
System.out.println();
System.out
- .println( "________________________________________________________________________________________" );
+ .println( "________________________________________________________________________________________" );
System.out.println( toString() );
throw new IllegalArgumentException( "key " + key + " (->" + value + ") does not exist for row " + j );
}
if ( x == null ) {
System.out.println();
System.out
- .println( "________________________________________________________________________________________" );
+ .println( "________________________________________________________________________________________" );
System.out.println( toString() );
throw new IllegalArgumentException( "key " + key + " (->" + value + ") does not exist for row " + j );
}
if ( !x.contains( value ) ) {
System.out.println();
System.out
- .println( "________________________________________________________________________________________" );
+ .println( "________________________________________________________________________________________" );
System.out.println( toString() );
throw new IllegalArgumentException( "pairing " + key + "->" + value + " does not exist for row "
+ j );
if ( DEBUG ) {
if ( !x.remove( value ) ) {
throw new IllegalArgumentException( "pairing " + key + "->" + value
- + " does not exist (could not be removed) for row " + j );
+ + " does not exist (could not be removed) for row " + j );
}
}
else {
@Override
public CharacterStateMatrix<S> copy() {
final CharacterStateMatrix<S> new_matrix = new BasicCharacterStateMatrix<S>( getNumberOfIdentifiers(),
- getNumberOfCharacters() );
+ getNumberOfCharacters() );
for( int character = 0; character < getNumberOfCharacters(); ++character ) {
if ( getCharacter( character ) != null ) {
new_matrix.setCharacter( character, getCharacter( character ) );
}
else if ( o.getClass() != this.getClass() ) {
throw new IllegalArgumentException( "attempt to check character state matrix to " + o + " [" + o.getClass()
- + "]" );
+ + "]" );
}
else {
final CharacterStateMatrix<S> other = ( CharacterStateMatrix<S> ) o;
@Override
public CharacterStateMatrix<S> pivot() {
final CharacterStateMatrix<S> new_matrix = new BasicCharacterStateMatrix<S>( getNumberOfCharacters(),
- getNumberOfIdentifiers() );
+ getNumberOfIdentifiers() );
for( int character = 0; character < getNumberOfCharacters(); ++character ) {
if ( getCharacter( character ) != null ) {
new_matrix.setIdentifier( character, getCharacter( character ) );
public void writeNexusBinaryChractersBlock( final Writer w ) throws IOException {
//BEGIN CHARACTERS;
// DIMENSIONS NCHAR=x;
- //BEGIN CHARSTATELABELS
+ //BEGIN CHARSTATELABELS
// 1 bcl,
// 2 tir,
//END;
final BinaryStates state = matrix.getState( indentifier_index, character_index );
if ( state == null ) {
throw new IllegalArgumentException( "value at [" + indentifier_index + ", " + character_index
- + "] is null" );
+ + "] is null" );
}
states.put( p.getNode( matrix.getIdentifier( indentifier_index ) ), state );
}
nodes.add( postorder.next() );
}
setGainLossMatrix( new BasicCharacterStateMatrix<CharacterStateMatrix.GainLossStates>( nodes.size(),
- external_node_states_matrix
- .getNumberOfCharacters() ) );
+ external_node_states_matrix
+ .getNumberOfCharacters() ) );
int identifier_index = 0;
for( final PhylogenyNode node : nodes ) {
getGainLossMatrix().setIdentifier( identifier_index++,
}
}
setInternalStatesMatrix( new BasicCharacterStateMatrix<BinaryStates>( internal_nodes.size(),
- external_node_states_matrix
- .getNumberOfCharacters() ) );
+ external_node_states_matrix
+ .getNumberOfCharacters() ) );
int identifier_index = 0;
for( final PhylogenyNode node : internal_nodes ) {
getInternalStatesMatrix().setIdentifier( identifier_index++,
final PhylogenyNode node,
final GainLossStates state ) {
getGainLossMatrix().setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(),
- character_state_column,
- state );
+ character_state_column,
+ state );
}
private void setInternalNodeState( final Map<PhylogenyNode, BinaryStates> states,
final int character_state_column,
final PhylogenyNode node ) {
getInternalStatesMatrix()
- .setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(),
- character_state_column,
- states.get( node ) );
+ .setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(),
+ character_state_column,
+ states.get( node ) );
}
private void setInternalStatesMatrix( final CharacterStateMatrix<BinaryStates> internal_states_matrix ) {
final PhylogenyNode node_child = node.getChildNode( i );
if ( !states.containsKey( node_child ) ) {
throw new RuntimeException( "this should not have happened: node [" + node_child.getName()
- + "] not found in node state map" );
+ + "] not found in node state map" );
}
if ( ( states.get( node_child ) == BinaryStates.PRESENT )
|| ( states.get( node_child ) == BinaryStates.UNKNOWN ) ) {
/**
* Returns a view of the internal states prior to trace-back.
- *
+ *
* @return
*/
public CharacterStateMatrix<List<STATE_TYPE>> getInternalStatesMatrixPriorToTraceback() {
* This sets whether to use the first or last state in the sorted
* states at the undecided internal nodes.
* For randomized choices set randomize to true (and this to false).
- *
+ *
* Note. It might be advisable to set this to false
* for BinaryStates if absence at the root is preferred
- * (given the enum BinaryStates sorts in the following order:
+ * (given the enum BinaryStates sorts in the following order:
* ABSENT, UNKNOWN, PRESENT).
- *
- *
+ *
+ *
* @param use_last
*/
public void setUseLast( final boolean use_last ) {
final PhylogenyNode node_child = node.getChildNode( i );
if ( !states.containsKey( node_child ) ) {
throw new AssertionError( "this should not have happened: node [" + node_child.getName()
- + "] not found in node state map" );
+ + "] not found in node state map" );
}
if ( i == 0 ) {
states_in_child_nodes.addAll( states.get( node_child ) );
final STATE_TYPE state = matrix.getState( indentifier_index, character_index );
if ( state == null ) {
throw new IllegalArgumentException( "value at [" + indentifier_index + ", " + character_index
- + "] is null" );
+ + "] is null" );
}
final SortedSet<STATE_TYPE> l = new TreeSet<STATE_TYPE>();
l.add( state );
final STATE_TYPE state = matrix.getState( indentifier_index, character_index );
if ( state == null ) {
throw new IllegalArgumentException( "value at [" + indentifier_index + ", " + character_index
- + "] is null" );
+ + "] is null" );
}
states.put( p.getNode( matrix.getIdentifier( indentifier_index ) ), state );
}
final PhylogenyNode node_child = node.getChildNode( i );
if ( !states.containsKey( node_child ) ) {
throw new AssertionError( "this should not have happened: node [" + node_child.getName()
- + "] not found in node state map" );
+ + "] not found in node state map" );
}
states_in_child_nodes.addAll( states.get( node_child ) );
}
nodes.add( postorder.next() );
}
setGainLossMatrix( new BasicCharacterStateMatrix<CharacterStateMatrix.GainLossStates>( nodes.size(),
- external_node_states_matrix
- .getNumberOfCharacters() ) );
+ external_node_states_matrix
+ .getNumberOfCharacters() ) );
int identifier_index = 0;
for( final PhylogenyNode node : nodes ) {
getGainLossMatrix().setIdentifier( identifier_index++,
}
}
setInternalStatesMatrixPriorToTraceback( new BasicCharacterStateMatrix<List<STATE_TYPE>>( internal_nodes.size(),
- external_node_states_matrix
- .getNumberOfCharacters() ) );
+ external_node_states_matrix
+ .getNumberOfCharacters() ) );
setInternalStatesMatrixTraceback( new BasicCharacterStateMatrix<STATE_TYPE>( internal_nodes.size(),
- external_node_states_matrix
- .getNumberOfCharacters() ) );
+ external_node_states_matrix
+ .getNumberOfCharacters() ) );
int identifier_index = 0;
for( final PhylogenyNode node : internal_nodes ) {
getInternalStatesMatrix().setIdentifier( identifier_index,
external_node_states_matrix.getCharacter( character_index ) );
getInternalStatesMatrixPriorToTraceback().setCharacter( character_index,
external_node_states_matrix
- .getCharacter( character_index ) );
+ .getCharacter( character_index ) );
}
}
else if ( current_binary_state == ABSENT ) {//new
setGainLossState( character_state_column, current_node, UNCHANGED_ABSENT );//new
}//new
- // setGainLossState( character_state_column, current_node, UNKNOWN_GAIN_LOSS );
+ // setGainLossState( character_state_column, current_node, UNKNOWN_GAIN_LOSS );
}
}
}
final PhylogenyNode node,
final GainLossStates state ) {
getGainLossMatrix().setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(),
- character_state_column,
- state );
+ character_state_column,
+ state );
}
private void setInternalNodeState( final Map<PhylogenyNode, STATE_TYPE> states,
final int character_state_column,
final PhylogenyNode node ) {
getInternalStatesMatrix()
- .setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(),
- character_state_column,
- states.get( node ) );
+ .setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(),
+ character_state_column,
+ states.get( node ) );
}
private void setInternalNodeStatePriorToTraceback( final Map<PhylogenyNode, SortedSet<STATE_TYPE>> states,
final int character_state_column,
final PhylogenyNode node ) {
getInternalStatesMatrixPriorToTraceback()
- .setState( ForesterUtil.isEmpty( node.getName() ) ? String.valueOf( node.getId() ) : node.getName(),
- character_state_column,
- toListSorted( states.get( node ) ) );
+ .setState( ForesterUtil.isEmpty( node.getName() ) ? String.valueOf( node.getId() ) : node.getName(),
+ character_state_column,
+ toListSorted( states.get( node ) ) );
}
private void setInternalStatesMatrixPriorToTraceback( final CharacterStateMatrix<List<STATE_TYPE>> internal_states_matrix_prior_to_traceback ) {
import org.forester.util.ForesterUtil;
/**
- *
+ *
* IN PROGRESS!
* DO NOT USE!
- *
- *
+ *
+ *
* @param <STATE_TYPE>
*/
public class SankoffParsimony<STATE_TYPE> {
/**
* Returns a view of the internal states prior to trace-back.
- *
+ *
* @return
*/
public CharacterStateMatrix<List<STATE_TYPE>> getInternalStatesMatrixPriorToTraceback() {
final PhylogenyNode node_child = node.getChildNode( i );
if ( !states.containsKey( node_child ) ) {
throw new AssertionError( "this should not have happened: node [" + node_child.getName()
- + "] not found in node state map" );
+ + "] not found in node state map" );
}
if ( i == 0 ) {
states_in_child_nodes.addAll( states.get( node_child ) );
final STATE_TYPE state = matrix.getState( indentifier_index, character_index );
if ( state == null ) {
throw new IllegalArgumentException( "value at [" + indentifier_index + ", " + character_index
- + "] is null" );
+ + "] is null" );
}
final SortedSet<STATE_TYPE> l = new TreeSet<STATE_TYPE>();
l.add( state );
final STATE_TYPE state = matrix.getState( indentifier_index, character_index );
if ( state == null ) {
throw new IllegalArgumentException( "value at [" + indentifier_index + ", " + character_index
- + "] is null" );
+ + "] is null" );
}
states.put( p.getNode( matrix.getIdentifier( indentifier_index ) ), state );
}
final PhylogenyNode node_child = node.getChildNode( i );
if ( !states.containsKey( node_child ) ) {
throw new AssertionError( "this should not have happened: node [" + node_child.getName()
- + "] not found in node state map" );
+ + "] not found in node state map" );
}
states_in_child_nodes.addAll( states.get( node_child ) );
}
nodes.add( postorder.next() );
}
setGainLossMatrix( new BasicCharacterStateMatrix<CharacterStateMatrix.GainLossStates>( nodes.size(),
- external_node_states_matrix
- .getNumberOfCharacters() ) );
+ external_node_states_matrix
+ .getNumberOfCharacters() ) );
int identifier_index = 0;
for( final PhylogenyNode node : nodes ) {
getGainLossMatrix().setIdentifier( identifier_index++,
}
}
setInternalStatesMatrixPriorToTraceback( new BasicCharacterStateMatrix<List<STATE_TYPE>>( internal_nodes.size(),
- external_node_states_matrix
- .getNumberOfCharacters() ) );
+ external_node_states_matrix
+ .getNumberOfCharacters() ) );
setInternalStatesMatrixTraceback( new BasicCharacterStateMatrix<STATE_TYPE>( internal_nodes.size(),
- external_node_states_matrix
- .getNumberOfCharacters() ) );
+ external_node_states_matrix
+ .getNumberOfCharacters() ) );
int identifier_index = 0;
for( final PhylogenyNode node : internal_nodes ) {
getInternalStatesMatrix().setIdentifier( identifier_index,
external_node_states_matrix.getCharacter( character_index ) );
getInternalStatesMatrixPriorToTraceback().setCharacter( character_index,
external_node_states_matrix
- .getCharacter( character_index ) );
+ .getCharacter( character_index ) );
}
}
else if ( current_binary_state == ABSENT ) {//new
setGainLossState( character_state_column, current_node, UNCHANGED_ABSENT );//new
}//new
- // setGainLossState( character_state_column, current_node, UNKNOWN_GAIN_LOSS );
+ // setGainLossState( character_state_column, current_node, UNKNOWN_GAIN_LOSS );
}
}
}
final PhylogenyNode node,
final GainLossStates state ) {
getGainLossMatrix().setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(),
- character_state_column,
- state );
+ character_state_column,
+ state );
}
private void setInternalNodeState( final Map<PhylogenyNode, STATE_TYPE> states,
final int character_state_column,
final PhylogenyNode node ) {
getInternalStatesMatrix()
- .setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(),
- character_state_column,
- states.get( node ) );
+ .setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(),
+ character_state_column,
+ states.get( node ) );
}
private void setInternalNodeStatePriorToTraceback( final Map<PhylogenyNode, SortedSet<STATE_TYPE>> states,
final int character_state_column,
final PhylogenyNode node ) {
getInternalStatesMatrixPriorToTraceback().setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + ""
- : node.getName(),
- character_state_column,
- toListSorted( states.get( node ) ) );
+ : node.getName(),
+ character_state_column,
+ toListSorted( states.get( node ) ) );
}
private void setInternalStatesMatrixPriorToTraceback( final CharacterStateMatrix<List<STATE_TYPE>> internal_states_matrix_prior_to_traceback ) {
* This sets whether to use the first or last state in the sorted
* states at the undecided internal nodes.
* For randomized choices set randomize to true (and this to false).
- *
+ *
* Note. It might be advisable to set this to false
* for BinaryStates if absence at the root is preferred
- * (given the enum BinaryStates sorts in the following order:
+ * (given the enum BinaryStates sorts in the following order:
* ABSENT, UNKNOWN, PRESENT).
- *
- *
+ *
+ *
* @param use_last
*/
public void setUseLast( final boolean use_last ) {
/**
* Based on value and type.
- *
- *
+ *
+ *
*/
@Override
public boolean equals( final Object o ) {
}
else if ( o.getClass() != this.getClass() ) {
throw new IllegalArgumentException( "attempt to check go subset equality to " + o + " [" + o.getClass()
- + "]" );
+ + "]" );
}
else {
return ( getType() == ( ( GoSubset ) o ).getType() );
/**
* Compares based on GO id.
- *
+ *
*/
@Override
public int compareTo( final GoTerm go_term ) {
/**
* Makes a shallow copy.
- *
- *
+ *
+ *
*/
@Override
public PhylogenyData copy() {
/**
* Return true if both GO id and namespace are equal.
- *
+ *
*/
@Override
public boolean equals( final Object o ) {
/**
* Hashcode is based on hashcode of GO id.
- *
- *
+ *
+ *
*/
@Override
public int hashCode() {
/**
* Based on value and type.
- *
- *
+ *
+ *
*/
@Override
public boolean equals( final Object o ) {
/**
* This is for counting the how many times each GO term in 'categories'
- * is a (direct or indirect) super term of the GO terms in 'experiment_set'.
- *
- *
+ * is a (direct or indirect) super term of the GO terms in 'experiment_set'.
+ *
+ *
* @param categories the set of super terms to be counted
* @param experiment_set the list of GO terms to be analyzed
* @param all_go_terms all terms in the ontology
penultimate = my_go_term;
if ( !map.containsKey( my_go_term.getSuperGoIds().get( 0 ) ) ) {
throw new IllegalArgumentException( "GO-id [" + my_go_term.getSuperGoIds().get( 0 )
- + "] not found in map" );
+ + "] not found in map" );
}
my_go_term = map.get( my_go_term.getSuperGoIds().get( 0 ) );
}
while ( ( my_go_term.getSuperGoIds() != null ) && ( my_go_term.getSuperGoIds().size() > 0 ) ) {
if ( !map.containsKey( my_go_term.getSuperGoIds().get( 0 ) ) ) {
throw new IllegalArgumentException( "GO-id [" + my_go_term.getSuperGoIds().get( 0 )
- + "] not found in map" );
+ + "] not found in map" );
}
my_go_term = map.get( my_go_term.getSuperGoIds().get( 0 ) );
}
/**
* Based on key and value.
- *
- *
+ *
+ *
*/
@Override
public boolean equals( final Object o ) {
private static boolean testPfamToGoParser( final File test_dir ) {
try {
final PfamToGoParser parser = new PfamToGoParser( new File( test_dir + ForesterUtil.getFileSeparator()
- + "pfam_to_go_test" ) );
+ + "pfam_to_go_test" ) );
final List<PfamToGoMapping> mappings = parser.parse();
if ( parser.getMappingCount() != 426 ) {
return false;
private static boolean testSuperTermCounting( final File test_dir ) {
try {
final OBOparser parser = new OBOparser( new File( test_dir + ForesterUtil.getFileSeparator()
- + "gene_ontology_edit.obo" ), OBOparser.ReturnType.BASIC_GO_TERM );
+ + "gene_ontology_edit.obo" ), OBOparser.ReturnType.BASIC_GO_TERM );
final List<GoTerm> all_go_terms = parser.parse();
if ( parser.getGoTermCount() != 27748 ) {
return false;
final List<GoTerm> categories = new ArrayList<GoTerm>();
final List<GoTerm> experiment_set = new ArrayList<GoTerm>();
experiment_set.add( new BasicGoTerm( new GoId( "GO:0005690" ), "snRNP U4atac", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
experiment_set.add( new BasicGoTerm( new GoId( "GO:0009698" ),
"phenylpropanoid metabolic process",
GoNameSpace.createUnassigned(),
false ) );
experiment_set.add( new BasicGoTerm( new GoId( "GO:0008150" ), "biological_process", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
experiment_set.add( new BasicGoTerm( new GoId( "GO:0006915" ),
"apoptosis",
GoNameSpace.createUnassigned(),
false ) );
experiment_set.add( new BasicGoTerm( new GoId( "GO:0001783" ), "B cell apoptosis", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
experiment_set.add( new BasicGoTerm( new GoId( "GO:0010657" ), "muscle cell apoptosis", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
experiment_set.add( new BasicGoTerm( new GoId( "GO:0010657" ), "muscle cell apoptosis", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
experiment_set.add( new BasicGoTerm( new GoId( "GO:0010658" ),
"striated muscle cell apoptosis",
GoNameSpace.createUnassigned(),
GoNameSpace.createUnassigned(),
false ) );
categories
- .add( new BasicGoTerm( new GoId( "GO:0016265" ), "death", GoNameSpace.createUnassigned(), false ) );
+ .add( new BasicGoTerm( new GoId( "GO:0016265" ), "death", GoNameSpace.createUnassigned(), false ) );
categories.add( new BasicGoTerm( new GoId( "GO:0006915" ),
"apoptosis",
GoNameSpace.createUnassigned(),
false ) );
categories.add( new BasicGoTerm( new GoId( "GO:0008150" ), "biological_process", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
categories.add( new BasicGoTerm( new GoId( "GO:0010657" ), "muscle cell apoptosis", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
categories.add( new BasicGoTerm( new GoId( "GO:0010658" ), "striated muscle cell apoptosis", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
categories.add( new BasicGoTerm( new GoId( "GO:0046242" ), "o-xylene biosynthetic process", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
categories.add( new BasicGoTerm( new GoId( "GO:0016326" ), "kinesin motor activity", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
categories.add( new BasicGoTerm( new GoId( "GO:0005575" ), "cellular_component", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
categories.add( new BasicGoTerm( new GoId( "GO:0032502" ), "developmental process", GoNameSpace
- .createUnassigned(), false ) );
+ .createUnassigned(), false ) );
categories.add( new BasicGoTerm( new GoId( "GO:0051094" ),
"positive regulation of developmental process",
GoNameSpace.createUnassigned(),
private static boolean testSuperTermGetting( final File test_dir ) {
try {
final OBOparser parser = new OBOparser( new File( test_dir + ForesterUtil.getFileSeparator()
- + "gene_ontology_edit.obo" ), OBOparser.ReturnType.BASIC_GO_TERM );
+ + "gene_ontology_edit.obo" ), OBOparser.ReturnType.BASIC_GO_TERM );
final List<GoTerm> go_terms = parser.parse();
if ( parser.getGoTermCount() != 27748 ) {
return false;
species = matcher.group( 1 );
if ( VERBOSE ) {
ForesterUtil
- .programMessage( PRG_NAME, "species for [" + ontologizer_outfile + "] is [" + species + "]" );
+ .programMessage( PRG_NAME, "species for [" + ontologizer_outfile + "] is [" + species + "]" );
}
}
else {
}
if ( ( p_adjusted_upper_limit < 0.0 ) || ( p_adjusted_upper_limit > 1.0 ) ) {
throw new IllegalArgumentException( "adjusted P values limit [" + p_adjusted_upper_limit
- + "] is out of range" );
+ + "] is out of range" );
}
SortedMap<Species, SortedSet<String>> speciesto_to_domain_id = null;
if ( domain_gain_loss_file != null ) {
speciesto_to_domain_id = parseDomainGainLossFile( domain_gain_loss_file );
if ( VERBOSE ) {
ForesterUtil.programMessage( PRG_NAME, "parsed gain/loss domains for " + speciesto_to_domain_id.size()
- + " species from [" + domain_gain_loss_file + "]" );
+ + " species from [" + domain_gain_loss_file + "]" );
}
}
final String[] children = ontologizer_outdir.list();
}
if ( VERBOSE ) {
ForesterUtil.programMessage( PRG_NAME, "need to analyze " + ontologizer_outfiles.size()
- + " Ontologizer outfiles from [" + ontologizer_outdir + "]" );
+ + " Ontologizer outfiles from [" + ontologizer_outdir + "]" );
}
final OBOparser parser = new OBOparser( obo_file, OBOparser.ReturnType.BASIC_GO_TERM );
final List<GoTerm> go_terms = parser.parse();
for( final File ontologizer_outfile : ontologizer_outfiles ) {
final String species = obtainSpecies( ontologizer_outfile );
final List<OntologizerResult> ontologizer_results = OntologizerResult.parse( new File( ontologizer_outdir
- + ForesterUtil.FILE_SEPARATOR + ontologizer_outfile ) );
+ + ForesterUtil.FILE_SEPARATOR + ontologizer_outfile ) );
final SortedSet<OntologizerResult> filtered_ontologizer_results = new TreeSet<OntologizerResult>();
for( final OntologizerResult ontologizer_result : ontologizer_results ) {
if ( ontologizer_result.getPAdjusted() <= p_adjusted_upper_limit ) {
writeHtmlHeader( b_html_writer,
GoNameSpace.GoNamespaceType.BIOLOGICAL_PROCESS.toString() + " | Pmax = "
+ p_adjusted_upper_limit + " | " + comment,
- ontologizer_outdir.getAbsolutePath(),
- domain_gain_loss_file_full_path_str );
+ ontologizer_outdir.getAbsolutePath(),
+ domain_gain_loss_file_full_path_str );
writeHtmlHeader( c_html_writer,
GoNameSpace.GoNamespaceType.CELLULAR_COMPONENT.toString() + " | Pmax = "
+ p_adjusted_upper_limit + " | " + comment,
- ontologizer_outdir.getAbsolutePath(),
- domain_gain_loss_file_full_path_str );
+ ontologizer_outdir.getAbsolutePath(),
+ domain_gain_loss_file_full_path_str );
writeHtmlHeader( m_html_writer,
GoNameSpace.GoNamespaceType.MOLECULAR_FUNCTION.toString() + " | Pmax = "
+ p_adjusted_upper_limit + " | " + comment,
- ontologizer_outdir.getAbsolutePath(),
- domain_gain_loss_file_full_path_str );
+ ontologizer_outdir.getAbsolutePath(),
+ domain_gain_loss_file_full_path_str );
for( final String species : species_to_results_map.keySet() ) {
if ( hasResultsForSpecies( go_id_to_terms,
species_to_results_map,
m_tab_writer.close();
if ( VERBOSE ) {
ForesterUtil.programMessage( PRG_NAME, "successfully wrote biological process summary to [" + b_file_html
- + "]" );
+ + "]" );
ForesterUtil.programMessage( PRG_NAME, "successfully wrote biological process summary to [" + b_file_txt
- + "]" );
+ + "]" );
ForesterUtil.programMessage( PRG_NAME, "successfully wrote molecular function summary to [" + m_file_html
- + "]" );
+ + "]" );
ForesterUtil.programMessage( PRG_NAME, "successfully wrote molecular function summary to [" + m_file_txt
- + "]" );
+ + "]" );
ForesterUtil.programMessage( PRG_NAME, "successfully wrote cellular component summary to [" + c_file_html
- + "]" );
+ + "]" );
ForesterUtil.programMessage( PRG_NAME, "successfully wrote cellular component summary to [" + c_file_txt
- + "]" );
+ + "]" );
}
}
for( final String domain : domains ) {
if ( !domain_ids_with_go_annot.contains( domain ) ) {
writer.write( "[<a class=\"new_type\" href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + domain
- + "\">" + domain + "</a>] " );
+ + "\">" + domain + "</a>] " );
}
}
}
writer.write( "</font>" );
writer.write( "</td><td>" );
writer.write( "<a href=\"" + SurfacingConstants.GO_LINK + ontologizer_result.getGoId().getId()
- + "\" target=\"amigo_window\">" + ontologizer_result.getGoId().getId() + "</a>" );
+ + "\" target=\"amigo_window\">" + ontologizer_result.getGoId().getId() + "</a>" );
writer.write( "</td><td>" );
writer.write( "<font color=\"#" + ForesterUtil.colorToHex( p_adj_color ) + "\">" );
writer.write( FORMATER.format( ontologizer_result.getPAdjusted() ) );
import org.forester.util.ForesterUtil;
/*
- *
+ *
* Note: this class has a natural ordering that is inconsistent with equals.
*/
public class OntologizerResult implements Comparable<OntologizerResult> {
private static final Pattern ANYTHING_REGEX = Pattern.compile( "[\\d\\s]+" );
//>gi|71834668|ref|NP_001025424.1| Bcl2 [Danio rerio]
public static final Pattern FASTA_DESC_LINE = Pattern
- .compile( ">?\\s*([^|]+)\\|([^|]+)\\S*\\s+(.+)\\s+\\[(.+)\\]" );
+ .compile( ">?\\s*([^|]+)\\|([^|]+)\\S*\\s+(.+)\\s+\\[(.+)\\]" );
public static void main( final String[] args ) {
final String a = ">gi|71834668|ref|NP_001025424.1| Bcl2 [Danio rerio]";
}
else {
throw new MsaFormatException( "illegal msa format (line: " + line_counter + "):\n\"" + trim( line )
- + "\"" );
+ + "\"" );
}
if ( is_first ) {
is_first = false;
final List<MolecularSequence> seqs = new ArrayList<MolecularSequence>();
for( int i = 0; i < names_in_order.size(); ++i ) {
seqs.add( BasicSequence.createAaSequence( names_in_order.get( i ), temp_msa.get( names_in_order.get( i ) )
- .toString() ) );
+ .toString() ) );
}
final Msa msa = BasicMsa.createInstance( seqs );
return msa;
}
else if ( isVerbose() ) {
ForesterUtil.printWarningMessage( getClass().getName(), "query \"" + query
- + "\" is not unique [line " + line_number + "] in ["
- + getInputFile().getCanonicalPath() + "]" );
+ + "\" is not unique [line " + line_number + "] in ["
+ + getInputFile().getCanonicalPath() + "]" );
}
}
else {
}
catch ( final NumberFormatException e ) {
throw new IOException( "could not parse seq-f from \"" + line + "\" [line " + line_number
- + "] in [" + getInputFile().getCanonicalPath() + "]" );
+ + "] in [" + getInputFile().getCanonicalPath() + "]" );
}
try {
to = Integer.valueOf( to_str ).intValue();
}
catch ( final NumberFormatException e ) {
throw new IOException( "could not parse seq-t from \"" + line + "\" [line " + line_number
- + "] in [" + getInputFile().getCanonicalPath() + "]" );
+ + "] in [" + getInputFile().getCanonicalPath() + "]" );
}
try {
score = Double.valueOf( score_str ).doubleValue();
}
catch ( final NumberFormatException e ) {
throw new IOException( "could not parse score from \"" + line + "\" [line " + line_number
- + "] in [" + getInputFile().getCanonicalPath() + "]" );
+ + "] in [" + getInputFile().getCanonicalPath() + "]" );
}
try {
e_value = Double.valueOf( e_value_str ).doubleValue();
}
catch ( final NumberFormatException e ) {
throw new IOException( "could not parse E-value from \"" + line + "\" [line " + line_number
- + "] in [" + getInputFile().getCanonicalPath() + "]" );
+ + "] in [" + getInputFile().getCanonicalPath() + "]" );
}
if ( hmm_match_str.equals( "[]" ) ) {
//is_complete_hmm_match = true;
}
catch ( final NumberFormatException e ) {
throw new IOException( "could not parse domain number from \"" + line + "\" [line " + line_number
- + "] in [" + getInputFile().getCanonicalPath() + "]" );
+ + "] in [" + getInputFile().getCanonicalPath() + "]" );
}
try {
total = Integer.valueOf( ( total_str ) ).intValue();
}
catch ( final NumberFormatException e ) {
throw new IOException( "could not parse domain count from \"" + line + "\" [line " + line_number
- + "] in [" + getInputFile().getCanonicalPath() + "]" );
+ + "] in [" + getInputFile().getCanonicalPath() + "]" );
}
++_domains_encountered;
boolean failed_cutoff = false;
}
else {
throw new IOException( "could not find a score cutoff value for domain id \"" + id
- + "\" [line " + line_number + "] in [" + getInputFile().getCanonicalPath() + "]" );
+ + "\" [line " + line_number + "] in [" + getInputFile().getCanonicalPath() + "]" );
}
}
final String uc_id = id.toUpperCase();
/**
* To ignore domains which are completely engulfed by domains (individual
* ones or stretches of overlapping ones) with better support values.
- *
- *
+ *
+ *
* @param ignored_engulfed_domains
*/
public void setIgnoreEngulfedDomains( final boolean ignore_engulfed_domains ) {
/**
* Sets the individual domain score cutoff values (for example, gathering
* thresholds from Pfam). Domain ids are the keys, cutoffs the values.
- *
+ *
* @param individual_domain_score_cutoffs
*/
public void setIndividualDomainScoreCutoffs( final Map<String, String> individual_domain_score_cutoffs ) {
if ( ForesterUtil.isEmpty( line ) || line.startsWith( "#" ) ) {
continue;
}
- // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
// # --- full sequence --- -------------- this domain ------------- hmm coord ali coord env coord
// # target name accession tlen query name accession qlen E-value score bias # of c-Evalue i-Evalue score bias from to from to from to acc description of target
// #------------------- ---------- ----- -------------------- ---------- ----- --------- ------ ----- --- --- --------- --------- ------ ----- ----- ----- ----- ----- ----- ----- ---- ---------------------
if ( !isAllowProteinsWithSameName() ) {
if ( query.equals( prev_query ) ) {
throw new IOException( "more than one protein named [" + query + "]" + " lengths: " + qlen
- + ", " + prev_qlen );
+ + ", " + prev_qlen );
}
if ( prev_queries.contains( query ) ) {
throw new IOException( "more than one protein named [" + query + "]" );
}
else {
throw new IOException( "could not find a score cutoff value for domain id \"" + target_id
- + "\" [line " + line_number + "] in [" + getInputFile().getCanonicalPath() + "]" );
+ + "\" [line " + line_number + "] in [" + getInputFile().getCanonicalPath() + "]" );
}
}
final String uc_id = target_id.toUpperCase();
}
catch ( final NumberFormatException e ) {
throw new IOException( "could not parse \" +label + \" from \"" + double_str + "\" [line " + line_number
- + "] in [" + getInputFile().getCanonicalPath() + "]" );
+ + "] in [" + getInputFile().getCanonicalPath() + "]" );
}
return d;
}
}
catch ( final NumberFormatException e ) {
throw new IOException( "could not parse \"" + label + "\" from \"" + double_str + "\" [line " + line_number
- + "] in [" + getInputFile().getCanonicalPath() + "]" );
+ + "] in [" + getInputFile().getCanonicalPath() + "]" );
}
return i;
}
/**
* To ignore domains which are completely engulfed by domains (individual
* ones or stretches of overlapping ones) with better support values.
- *
- *
+ *
+ *
* @param ignored_engulfed_domains
*/
public void setIgnoreEngulfedDomains( final boolean ignore_engulfed_domains ) {
/**
* Sets the individual score cutoff values (for example, gathering
* thresholds from Pfam). Domain ids are the keys, cutoffs the values.
- *
+ *
* @param individual_score_cutoffs
*/
public void setIndividualScoreCutoffs( final Map<String, Double> individual_score_cutoffs ) {
/*
* @author Christian Zmasek
- *
+ *
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
*/
* This can read full, lower triangular, and upper triangular distance matrices.
* In the case of a full matrix, the lower triangular values are used. Format
* (by example): id1 0 id2 0.3 0 id3 0.4 0.4 0
- *
+ *
* OR
- *
+ *
* id1 id2 0.3 id3 0.4 0.4
- *
+ *
* Numbers before are after the data are ignored.
- *
- *
- *
- *
+ *
+ *
+ *
+ *
* @author Christian M Zmasek
*/
public class SymmetricalDistanceMatrixParser {
}
catch ( final NumberFormatException e ) {
throw new IOException( "illegal format for distance [" + table_value + "] at [" + ( i - 1 ) + ", " + row
- + "]" );
+ + "]" );
}
if ( !ForesterUtil.isEqual( 0.0, d ) ) {
throw new IOException( "attempt to use non-zero diagonal value [" + table_value + "] at [" + ( i - 1 )
- + ", " + row + "]" );
+ + ", " + row + "]" );
}
}
}
catch ( final NumberFormatException e ) {
throw new IOException( "illegal format for distance [" + table_value + "] at [" + ( col - 1 ) + ", " + row
- + "]" );
+ + "]" );
}
distance_matrix.setValue( ( col - 1 ) + col_offset, row, d );
}
//int c = 0;
while ( hasNext() ) {
l.add( next() );
- // c++;
+ // c++;
}
final Phylogeny[] p = new Phylogeny[ l.size() ];
for( int i = 0; i < l.size(); ++i ) {
_input_type = NHXParser.BUFFERED_READER;
_source_length = 0;
if ( _my_source_br != null ) {
- // I am REALLY not sure if it a "good" NOT to close the stream...
-// try {
-// _my_source_br.close();
-// }
-// catch ( final IOException e ) {
-// }
+ //I am REALLY not sure if it is a "good" idea NOT to close the stream...
+ // try {
+ // _my_source_br.close();
+ // }
+ // catch ( final IOException e ) {
+ // }
}
final File f = ( File ) nhx_source;
final String error = ForesterUtil.isReadableFile( f );
_input_type = NHXParser.BUFFERED_READER;
_source_length = 0;
if ( _my_source_br != null ) {
-// I am REALLY not sure if it a "good" NOT to close the stream...
-// try {
-// _my_source_br.close();
-// }
-// catch ( final IOException e ) {
-// }
+ //I am REALLY not sure if it is a "good" idea NOT to close the stream...
+ // try {
+ // _my_source_br.close();
+ // }
+ // catch ( final IOException e ) {
+ // }
}
final InputStreamReader isr = new InputStreamReader( ( ( URL ) nhx_source ).openStream() );
_nhx_source = new BufferedReader( isr );
_input_type = NHXParser.BUFFERED_READER;
_source_length = 0;
if ( _my_source_br != null ) {
- // I am REALLY not sure if it a "good" NOT to close the stream...
-// try {
-// _my_source_br.close();
-// }
-// catch ( final IOException e ) {
-// }
+ //I am REALLY not sure if it is a "good" idea NOT to close the stream...
+ // try {
+ // _my_source_br.close();
+ // }
+ // catch ( final IOException e ) {
+ // }
}
final InputStreamReader isr = new InputStreamReader( ( InputStream ) nhx_source );
_nhx_source = new BufferedReader( isr );
}
private final Phylogeny finishPhylogeny() throws PhylogenyParserException, NHXFormatException,
- PhyloXmlDataFormatException {
+ PhyloXmlDataFormatException {
if ( _current_phylogeny != null ) {
parseNHX( _current_anotation != null ? _current_anotation.toString() : "",
- _current_phylogeny.getRoot(),
- getTaxonomyExtraction(),
- isReplaceUnderscores(),
- isAllowErrorsInDistanceToParent(),
- true );
+ _current_phylogeny.getRoot(),
+ getTaxonomyExtraction(),
+ isReplaceUnderscores(),
+ isAllowErrorsInDistanceToParent(),
+ true );
if ( GUESS_IF_SUPPORT_VALUES ) {
if ( isBranchLengthsLikeBootstrapValues( _current_phylogeny ) ) {
moveBranchLengthsToConfidenceValues( _current_phylogeny );
}
private final Phylogeny finishSingleNodePhylogeny() throws PhylogenyParserException, NHXFormatException,
- PhyloXmlDataFormatException {
+ PhyloXmlDataFormatException {
final PhylogenyNode new_node = new PhylogenyNode();
parseNHX( _current_anotation.toString(),
new_node,
_current_anotation.append( c );
}
++_i;
- } // while ( true )
+ } // while ( true )
if ( _clade_level != 0 ) {
throw new PhylogenyParserException( "error in NH (Newick) formatted data: most likely cause: number of open parens does not equal number of close parens" );
}
}
private final void processCloseParen() throws PhylogenyParserException, NHXFormatException,
- PhyloXmlDataFormatException {
+ PhyloXmlDataFormatException {
if ( _clade_level < 0 ) {
throw new PhylogenyParserException( "error in NH (Newick)/NHX formatted data: most likely cause: number of close parens is larger than number of open parens" );
}
}
private final Phylogeny processOpenParen() throws PhylogenyParserException, NHXFormatException,
- PhyloXmlDataFormatException {
+ PhyloXmlDataFormatException {
Phylogeny phy = null;
final PhylogenyNode new_node = new PhylogenyNode();
if ( _clade_level == 0 ) {
final boolean replace_underscores,
final boolean allow_errors_in_distance_to_parent,
final boolean replace_bell ) throws NHXFormatException,
- PhyloXmlDataFormatException {
+ PhyloXmlDataFormatException {
if ( ( taxonomy_extraction != TAXONOMY_EXTRACTION.NO ) && replace_underscores ) {
throw new IllegalArgumentException( "cannot extract taxonomies and replace under scores at the same time" );
}
node_to_annotate.getNodeData().setSequence( new Sequence() );
}
node_to_annotate.getNodeData().getSequence()
- .setAccession( new Accession( s.substring( 3 ), "?" ) );
+ .setAccession( new Accession( s.substring( 3 ), "?" ) );
}
else if ( s.startsWith( NHXtags.GENE_NAME ) ) {
if ( !node_to_annotate.getNodeData().isHasSequence() ) {
}
node_to_annotate.getNodeData().getSequence().setName( s.substring( 3 ) );
}
- } // while ( t.hasMoreTokens() )
+ } // while ( t.hasMoreTokens() )
}
}
}
if ( prob >= 0.0 ) {
if ( sd >= 0.0 ) {
node_to_annotate.getBranchData()
- .addConfidence( new Confidence( prob, "posterior probability", sd ) );
+ .addConfidence( new Confidence( prob, "posterior probability", sd ) );
}
else {
node_to_annotate.getBranchData().addConfidence( new Confidence( prob, "posterior probability" ) );
}
catch ( final NumberFormatException e ) {
throw new NHXFormatException( "failed to parse median branch length (Mr Bayes output) from \"" + s
- + "\"" );
+ + "\"" );
}
if ( bl >= 0.0 ) {
node_to_annotate.setDistanceToParent( bl );
}
else if ( qualified_name.equals( PhyloXmlMapping.BINARY_CHARACTERS ) ) {
node.getNodeData().setBinaryCharacters( ( BinaryCharacters ) BinaryCharactersParser.getInstance()
- .parse( element ) );
+ .parse( element ) );
}
else if ( qualified_name.equals( PhyloXmlMapping.COLOR ) ) {
node.getBranchData().setBranchColor( ( BranchColor ) ColorParser.getInstance().parse( element ) );
final XmlElement element = new XmlElement( namespace_uri, local_name, local_name, attributes );
if ( element.isHasAttribute( PhyloXmlMapping.PHYLOGENY_IS_REROOTABLE_ATTR ) ) {
getCurrentPhylogeny().setRerootable( Boolean.parseBoolean( element
- .getAttribute( PhyloXmlMapping.PHYLOGENY_IS_REROOTABLE_ATTR ) ) );
+ .getAttribute( PhyloXmlMapping.PHYLOGENY_IS_REROOTABLE_ATTR ) ) );
}
if ( element.isHasAttribute( PhyloXmlMapping.PHYLOGENY_BRANCHLENGTH_UNIT_ATTR ) ) {
getCurrentPhylogeny()
- .setDistanceUnit( element.getAttribute( PhyloXmlMapping.PHYLOGENY_BRANCHLENGTH_UNIT_ATTR ) );
+ .setDistanceUnit( element.getAttribute( PhyloXmlMapping.PHYLOGENY_BRANCHLENGTH_UNIT_ATTR ) );
}
if ( element.isHasAttribute( PhyloXmlMapping.PHYLOGENY_IS_ROOTED_ATTR ) ) {
getCurrentPhylogeny().setRooted( Boolean.parseBoolean( element
- .getAttribute( PhyloXmlMapping.PHYLOGENY_IS_ROOTED_ATTR ) ) );
+ .getAttribute( PhyloXmlMapping.PHYLOGENY_IS_ROOTED_ATTR ) ) );
}
if ( element.isHasAttribute( PhyloXmlMapping.PHYLOGENY_TYPE_ATTR ) ) {
getCurrentPhylogeny().setType( ( element.getAttribute( PhyloXmlMapping.PHYLOGENY_TYPE_ATTR ) ) );
final Reader reader = getReaderFromZipFile();
if ( reader == null ) {
throw new PhylogenyParserException( "zip file \"" + getSource()
- + "\" appears not to contain any entries" );
+ + "\" appears not to contain any entries" );
}
xml_reader.parse( new InputSource( reader ) );
}
}
catch ( final ParserConfigurationException parser_config_exception ) {
throw new PhylogenyParserException( "failed to parse [" + getSource()
- + "]. Problem with XML parser configuration: " + parser_config_exception.getLocalizedMessage() );
+ + "]. Problem with XML parser configuration: " + parser_config_exception.getLocalizedMessage() );
}
catch ( final IOException e ) {
throw new PhylogenyParserException( "problem with input source: " + e.getLocalizedMessage() );
public static final String UNKNOWN = "unknown";
public final static Pattern SEQUENCE_SYMBOL_PATTERN = Pattern.compile( "\\S{1,20}" );
public final static Pattern TAXOMONY_CODE_PATTERN = Pattern
- .compile( ParserUtils.TAX_CODE );
+ .compile( ParserUtils.TAX_CODE );
public final static Pattern LIT_REF_DOI_PATTERN = Pattern
- .compile( "[a-zA-Z0-9_\\.]+\\S+" );
+ .compile( "[a-zA-Z0-9_\\.]+\\S+" );
public final static Set<String> SEQUENCE_TYPES = new HashSet<String>();
public final static List<String> TAXONOMY_RANKS_LIST = new ArrayList<String>();
public final static Set<String> TAXONOMY_RANKS_SET = new HashSet<String>();
/**
* [Careful, this does not call "new String(...)"]
- *
+ *
* @param value
*/
public void setValue( final String value ) {
annotation.setProperties( new PropertiesMap() );
}
annotation.getProperties()
- .addProperty( ( Property ) PropertyParser.getInstance().parse( child_element ) );
+ .addProperty( ( Property ) PropertyParser.getInstance().parse( child_element ) );
}
}
return annotation;
try {
if ( element.isHasAttribute( PhyloXmlMapping.BINARY_CHARACTERS_PRESENT_COUNT_ATTR ) ) {
present_count = Integer.parseInt( element
- .getAttribute( PhyloXmlMapping.BINARY_CHARACTERS_PRESENT_COUNT_ATTR ) );
+ .getAttribute( PhyloXmlMapping.BINARY_CHARACTERS_PRESENT_COUNT_ATTR ) );
}
if ( element.isHasAttribute( PhyloXmlMapping.BINARY_CHARACTERS_GAINED_COUNT_ATTR ) ) {
gained_count = Integer.parseInt( element
- .getAttribute( PhyloXmlMapping.BINARY_CHARACTERS_GAINED_COUNT_ATTR ) );
+ .getAttribute( PhyloXmlMapping.BINARY_CHARACTERS_GAINED_COUNT_ATTR ) );
}
if ( element.isHasAttribute( PhyloXmlMapping.BINARY_CHARACTERS_LOST_COUNT_ATTR ) ) {
lost_count = Integer
if ( element.isHasAttribute( PhyloXmlMapping.CONFIDENCE_SD_ATTR ) ) {
try {
confidence.setStandardDeviation( Double.parseDouble( element
- .getAttribute( PhyloXmlMapping.CONFIDENCE_SD_ATTR ) ) );
+ .getAttribute( PhyloXmlMapping.CONFIDENCE_SD_ATTR ) ) );
}
catch ( final NumberFormatException ex ) {
throw new PhyloXmlDataFormatException( "attempt to parse ["
final DomainArchitecture architecure = new DomainArchitecture();
if ( !element.isHasAttribute( PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECTURE_LENGTH ) ) {
throw new PhyloXmlDataFormatException( PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECTURE_LENGTH
- + " attribute is required for domain architecture" );
+ + " attribute is required for domain architecture" );
}
final String lenght_str = element.getAttribute( PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECTURE_LENGTH );
try {
}
catch ( final NumberFormatException e ) {
throw new PhyloXmlDataFormatException( "could not extract domain architecture length from [" + lenght_str
- + "]: " + e.getMessage() );
+ + "]: " + e.getMessage() );
}
for( int i = 0; i < element.getNumberOfChildElements(); ++i ) {
final XmlElement child_element = element.getChildElement( i );
.parseInt( element.getAttribute( PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECTURE_PROT_DOMAIN_FROM ) );
t = Integer.parseInt( element.getAttribute( PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECTURE_PROT_DOMAIN_TO ) );
conf = Double.parseDouble( element
- .getAttribute( PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECTURE_PROT_DOMAIN_CONFIDENCE ) );
+ .getAttribute( PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECTURE_PROT_DOMAIN_CONFIDENCE ) );
if ( element.isHasAttribute( PhyloXmlMapping.IDENTIFIER ) ) {
id = element.getAttribute( PhyloXmlMapping.IDENTIFIER );
}
else if ( child_element.getQualifiedName().equals( PhyloXmlMapping.SEQUENCE_MOL_SEQ ) ) {
if ( child_element.isHasAttribute( PhyloXmlMapping.SEQUENCE_MOL_SEQ_ALIGNED_ATTR ) ) {
sequence.setMolecularSequenceAligned( Boolean.parseBoolean( child_element
- .getAttribute( PhyloXmlMapping.SEQUENCE_MOL_SEQ_ALIGNED_ATTR ) ) );
+ .getAttribute( PhyloXmlMapping.SEQUENCE_MOL_SEQ_ALIGNED_ATTR ) ) );
}
sequence.setMolecularSequence( child_element.getValueAsString() );
}
}
else if ( child_element.getQualifiedName().equals( PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECURE ) ) {
sequence.setDomainArchitecture( ( DomainArchitecture ) DomainArchitectureParser.getInstance()
- .parse( child_element ) );
+ .parse( child_element ) );
}
else if ( child_element.getQualifiedName().equals( PhyloXmlMapping.URI ) ) {
sequence.addUri( ( Uri ) UriParser.getInstance().parse( child_element ) );
for( int j = 0; j < child_element.getNumberOfChildElements(); ++j ) {
// final XmlElement c = child_element.getChildElement( j );
sequence.addCrossReference( ( Accession ) AccessionParser.getInstance().parse( child_element
- .getChildElement( j ) ) );
+ .getChildElement( j ) ) );
}
//sequence.addUri( ( Uri ) UriParser.getInstance().parse( child_element ) );
}
}
if ( element.isHasAttribute( PhyloXmlMapping.SEQUENCE_RELATION_DISTANCE ) ) {
seqRelation
- .setDistance( Double.valueOf( element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_DISTANCE ) ) );
+ .setDistance( Double.valueOf( element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_DISTANCE ) ) );
}
for( int i = 0; i < element.getNumberOfChildElements(); ++i ) {
final XmlElement child_element = element.getChildElement( i );
final Reader reader = getReaderFromZipFile();
if ( reader == null ) {
throw new PhylogenyParserException( "Zip file \"" + getSource()
- + "\" appears not to contain any entries" );
+ + "\" appears not to contain any entries" );
}
xml_reader.parse( new InputSource( reader ) );
}
final Reader reader = new InputStreamReader( zip_is );
if ( reader == null ) {
throw new PhylogenyParserException( "Zip input stream \"" + getSource()
- + "\" appears not to contain any data" );
+ + "\" appears not to contain any data" );
}
xml_reader.parse( new InputSource( reader ) );
}
}
catch ( final ParserConfigurationException parser_config_exception ) {
throw new PhylogenyParserException( "Failed to parse [" + getSource()
- + "] Problem with xml parser _configuration: " + parser_config_exception.getMessage() );
+ + "] Problem with xml parser _configuration: " + parser_config_exception.getMessage() );
}
catch ( final IOException e ) {
throw new PhylogenyParserException( "Problem with input source [" + getSource() + "]: \n" + e.getMessage() );
node.getNodeData().setTaxonomy( new Taxonomy() );
}
node.getNodeData().getTaxonomy()
- .setIdentifier( new Identifier( id, TolXmlMapping.TOL_TAXONOMY_ID_TYPE ) );
+ .setIdentifier( new Identifier( id, TolXmlMapping.TOL_TAXONOMY_ID_TYPE ) );
}
}
final boolean put_into_scientific_name = true; // Allways put into scientific name.
final public static String TAX_CODE = "(?:[A-Z9][A-Z]{2}[A-Z0-9]{2})|RAT|PIG|PEA";
final public static String TAX_CODE_LO = "(?:[A-Z]{5})|RAT|PIG|PEA";
final public static Pattern TAXOMONY_CODE_PATTERN_A = Pattern.compile( "(?:\\b|_)(" + TAX_CODE
- + ")(?:\\b|_)" );
+ + ")(?:\\b|_)" );
final public static Pattern TAXOMONY_CODE_PATTERN_A_LO = Pattern.compile( "_(" + TAX_CODE_LO
- + ")(?:\\b|_)" );
+ + ")(?:\\b|_)" );
final public static Pattern TAXOMONY_CODE_PATTERN_BRACKETED = Pattern.compile( "\\[(" + TAX_CODE + ")\\]" );
final public static Pattern TAXOMONY_CODE_PATTERN_PFR = Pattern.compile( "(?:\\b|_)[a-zA-Z0-9]{3,}_("
- + TAX_CODE + ")\\b" );
+ + TAX_CODE + ")\\b" );
final public static Pattern TAXOMONY_SN_PATTERN_GENUS = Pattern.compile( "([A-Z][a-z]{2,30})" );
final public static Pattern TAXOMONY_SN_PATTERN_SN = Pattern.compile( "(?:\\b|_)(" + SN_BN
- + ")(?:(\\s*$)|([_ ][a-z]*[A-Z0-9]))" );
+ + ")(?:(\\s*$)|([_ ][a-z]*[A-Z0-9]))" );
final public static Pattern TAXOMONY_SN_PATTERN_SNS = Pattern.compile( "(?:\\b|_)(" + SN_BN
- + "[_ ][a-z]{3,30}"
- + ")[_ ][a-z]*[A-Z0-9]" );
+ + "[_ ][a-z]{3,30}"
+ + ")[_ ][a-z]*[A-Z0-9]" );
final public static Pattern TAXOMONY_SN_PATTERN_SNS2 = Pattern.compile( "[A-Z0-9][a-z]*[_ ](" + SN_BN
- + "[_ ][a-z]{3,30}" + ")\\s*$" );
+ + "[_ ][a-z]{3,30}" + ")\\s*$" );
final public static Pattern TAXOMONY_SN_PATTERN_SP = Pattern
- .compile( "(?:\\b|_)([A-Z][a-z]{2,30}[_ ]sp\\.?)(?:\\b|_)?" );
+ .compile( "(?:\\b|_)([A-Z][a-z]{2,30}[_ ]sp\\.?)(?:\\b|_)?" );
final public static Pattern TAXOMONY_SN_PATTERN_STRAIN_1 = Pattern
- .compile( "(?:\\b|_)("
- + SN_BN
- + "[_ ](?:str|subsp|ssp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60})(?:\\b|_)" );
+ .compile( "(?:\\b|_)("
+ + SN_BN
+ + "[_ ](?:str|subsp|ssp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60})(?:\\b|_)" );
final public static Pattern TAXOMONY_SN_PATTERN_STRAIN_2 = Pattern
- .compile( "(?:\\b|_)("
- + SN_BN
- + "[_ ]\\((?:str|subsp|ssp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60}\\))" );
+ .compile( "(?:\\b|_)("
+ + SN_BN
+ + "[_ ]\\((?:str|subsp|ssp|var)[a-z]{0,5}\\.?[_ ]\\S{1,60}\\))" );
final public static Pattern TAXOMONY_SN_PATTERN_STRAIN_SUBSTRAIN = Pattern
- .compile( "(?:\\b|_)("
- + SN_BN
- + "[_ ]str[a-z]{0,3}\\.?[_ ]\\S{1,60}[_ ]substr[a-z]{0,3}\\.?[_ ]\\S{1,60})(?:\\b|_)" );
+ .compile( "(?:\\b|_)("
+ + SN_BN
+ + "[_ ]str[a-z]{0,3}\\.?[_ ]\\S{1,60}[_ ]substr[a-z]{0,3}\\.?[_ ]\\S{1,60})(?:\\b|_)" );
final private static Pattern TAXOMONY_CODE_PATTERN_PFS = Pattern.compile( "(?:\\b|_)[A-Z0-9]{4,}_("
- + TAX_CODE + ")/\\d+-\\d+\\b" );
+ + TAX_CODE + ")/\\d+-\\d+\\b" );
final private static Pattern TAXOMONY_UNIPROT_ID_PATTERN_PFR = Pattern
- .compile( "(?:\\b|_)[A-Z0-9]{1,}_(\\d{1,7})\\b" );
+ .compile( "(?:\\b|_)[A-Z0-9]{1,}_(\\d{1,7})\\b" );
final private static Pattern TAXOMONY_UNIPROT_ID_PATTERN_PFS = Pattern
- .compile( "(?:\\b|_)[A-Z0-9]{4,}_(\\d{1,7})/\\d+-\\d+\\b" );
+ .compile( "(?:\\b|_)[A-Z0-9]{4,}_(\\d{1,7})/\\d+-\\d+\\b" );
final public static PhylogenyParser createParserDependingFileContents( final File file,
final boolean phyloxml_validate_against_xsd )
- throws FileNotFoundException, IOException {
+ throws FileNotFoundException, IOException {
PhylogenyParser parser = null;
final String first_line = ForesterUtil.getFirstLine( file ).trim().toLowerCase();
if ( first_line.startsWith( "<" ) ) {
final public static PhylogenyParser createParserDependingOnFileType( final File file,
final boolean phyloxml_validate_against_xsd )
- throws FileNotFoundException, IOException {
+ throws FileNotFoundException, IOException {
PhylogenyParser parser = null;
parser = ParserUtils.createParserDependingOnSuffix( file.getName(), phyloxml_validate_against_xsd );
if ( parser == null ) {
final public static PhylogenyParser createParserDependingOnUrlContents( final URL url,
final boolean phyloxml_validate_against_xsd )
- throws FileNotFoundException, IOException {
+ throws FileNotFoundException, IOException {
final String lc_filename = url.getFile().toString().toLowerCase();
PhylogenyParser parser = createParserDependingOnSuffix( lc_filename, phyloxml_validate_against_xsd );
if ( parser == null ) {
}
else {
throw new IllegalArgumentException( "attempt to parse object of type [" + source.getClass()
- + "] (can only parse objects of type File/String, InputStream, StringBuffer, or StringBuilder)" );
+ + "] (can only parse objects of type File/String, InputStream, StringBuffer, or StringBuilder)" );
}
return reader;
}
public final static String extractTaxonomyDataFromNodeName( final PhylogenyNode node,
final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction )
- throws PhyloXmlDataFormatException {
+ throws PhyloXmlDataFormatException {
if ( taxonomy_extraction == TAXONOMY_EXTRACTION.NO ) {
throw new IllegalArgumentException();
}
/**
* Return null if it can not guess the parser to use based on name suffix.
- *
+ *
* @param filename
* @return
*/
public class PhylogenyParserException extends IOException {
/**
- *
+ *
*/
private static final long serialVersionUID = -4810333295377881086L;
/**
- *
+ *
*/
public PhylogenyParserException() {
super();
}
if ( node.getDistanceToParent() != PhylogenyDataUtil.BRANCH_LENGTH_DEFAULT ) {
PhylogenyDataUtil.appendElement( w, PhyloXmlMapping.BRANCH_LENGTH, String.valueOf( ForesterUtil.round( node
- .getDistanceToParent(), PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) ), indentation );
+ .getDistanceToParent(), PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) ), indentation );
}
if ( node.getBranchData() != null ) {
node.getBranchData().toPhyloXML( w, level, ind );
public final static String PHYLO_XML_INTENDATION_BASE = " ";
public final static String PHYLO_XML_VERSION_ENCODING_LINE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
public final static String PHYLO_XML_NAMESPACE_LINE = "<phyloxml xmlns:xsi=\""
- + ForesterConstants.XML_SCHEMA_INSTANCE
- + "\" xsi:schemaLocation=\""
- + ForesterConstants.PHYLO_XML_LOCATION
- + " "
- + ForesterConstants.PHYLO_XML_LOCATION
- + "/"
- + ForesterConstants.PHYLO_XML_VERSION
- + "/" + ForesterConstants.PHYLO_XML_XSD
- + "\" " + "xmlns=\""
- + ForesterConstants.PHYLO_XML_LOCATION
- + "\">";
+ + ForesterConstants.XML_SCHEMA_INSTANCE
+ + "\" xsi:schemaLocation=\""
+ + ForesterConstants.PHYLO_XML_LOCATION
+ + " "
+ + ForesterConstants.PHYLO_XML_LOCATION
+ + "/"
+ + ForesterConstants.PHYLO_XML_VERSION
+ + "/" + ForesterConstants.PHYLO_XML_XSD
+ + "\" " + "xmlns=\""
+ + ForesterConstants.PHYLO_XML_LOCATION
+ + "\">";
public final static String PHYLO_XML_END = "</phyloxml>";
private boolean _saw_comma;
private StringBuffer _buffer;
if ( tree.getConfidence() != null ) {
if ( ForesterUtil.isEmpty( tree.getConfidence().getType() ) ) {
PhylogenyDataUtil.appendElement( writer, PhyloXmlMapping.CONFIDENCE, tree.getConfidence().getValue()
- + "", indentation );
+ + "", indentation );
}
PhylogenyDataUtil.appendElement( writer,
PhyloXmlMapping.CONFIDENCE,
PhylogenyDataUtil.appendOpen( getWriter(),
PhyloXmlMapping.CLADE,
PhyloXmlMapping.NODE_COLLAPSE,
- "true" );
+ "true" );
}
else {
PhylogenyDataUtil.appendOpen( getWriter(), PhyloXmlMapping.CLADE );
}
if ( _identifiers_set.contains( id ) ) {
throw new IllegalArgumentException( "illegal attempt to create msa with non-unique identifiers [" + id
- + "]" );
+ + "]" );
}
_identifiers_set.add( id );
_identifiers[ row ] = id;
@Override
public Msa infer( final List<MolecularSequence> seqs, final List<String> opts ) throws IOException,
- InterruptedException {
+ InterruptedException {
final File file = File.createTempFile( "__clustalo_input_", ".fasta" );
file.deleteOnExit();
final BufferedWriter writer = new BufferedWriter( new FileWriter( file ) );
_error = stderr.toString();
if ( _exit_code != 0 ) {
throw new IOException( "Clustal Omega program failed, exit code: " + _exit_code + "\nCommand:\n" + my_opts
- + "\nError:\n" + stderr );
+ + "\nError:\n" + stderr );
}
final StringBuilder stdout = command_executor.getStandardOutputFromCommand();
if ( ( stdout == null ) || ( stdout.length() < 2 ) ) {
throw new IOException( "Clustal Omega program did not produce any output\nCommand:\n" + my_opts
- + "\nError:\n" + stderr );
+ + "\nError:\n" + stderr );
}
final Msa msa = FastaParser.parseMsa( stdout.toString() );
return msa;
@Override
public Msa infer( final List<MolecularSequence> seqs, final List<String> opts ) throws IOException,
- InterruptedException {
+ InterruptedException {
final File file = File.createTempFile( "__mafft_input_", ".fasta" );
file.deleteOnExit();
final BufferedWriter writer = new BufferedWriter( new FileWriter( file ) );
_error = stderr.toString();
if ( _exit_code != 0 ) {
throw new IOException( "MAFFT program failed, exit code: " + _exit_code + "\nCommand:\n" + my_opts
- + "\nError:\n" + stderr );
+ + "\nError:\n" + stderr );
}
final StringBuilder stdout = command_executor.getStandardOutputFromCommand();
if ( ( stdout == null ) || ( stdout.length() < 2 ) ) {
public abstract Msa infer( File path_to_input_seqs, List<String> opts ) throws IOException, InterruptedException;
public abstract Msa infer( final List<MolecularSequence> seqs, final List<String> opts ) throws IOException,
- InterruptedException;
+ InterruptedException;
}
final private static HashMap<Character, Integer> calcResidueDistribution6( final Msa msa, final int col ) {
// Residues are classified into one of tex2html_wrap199 types:
- // aliphatic [AVLIMC], aromatic [FWYH], polar [STNQ], positive [KR], negative [DE],
- // special conformations [GP] and gaps. This convention follows that
+ // aliphatic [AVLIMC], aromatic [FWYH], polar [STNQ], positive [KR], negative [DE],
+ // special conformations [GP] and gaps. This convention follows that
// of Mirny & Shakhnovich (1999, J Mol Biol 291:177-196).
final HashMap<Character, Integer> counts = new HashMap<Character, Integer>();
for( int row = 0; row < msa.getNumberOfSequences(); ++row ) {
final private static HashMap<Character, Integer> calcResidueDistribution7( final Msa msa, final int col ) {
// Residues are classified into one of tex2html_wrap199 types:
- // aliphatic [AVLIMC], aromatic [FWYH], polar [STNQ], positive [KR], negative [DE],
- // special conformations [GP] and gaps. This convention follows that
+ // aliphatic [AVLIMC], aromatic [FWYH], polar [STNQ], positive [KR], negative [DE],
+ // special conformations [GP] and gaps. This convention follows that
// of Mirny & Shakhnovich (1999, J Mol Biol 291:177-196).
final HashMap<Character, Integer> counts = new HashMap<Character, Integer>();
for( int row = 0; row < msa.getNumberOfSequences(); ++row ) {
final public void resample( final int[] resampled_column_positions ) {
if ( resampled_column_positions.length != getLength() ) {
throw new IllegalArgumentException( "illegal attempt to use " + resampled_column_positions.length
- + " resampled column positions on msa of length " + getLength() );
+ + " resampled column positions on msa of length " + getLength() );
}
_resampled_column_positions = resampled_column_positions;
}
}
else {
n.getNodeData()
- .getNodeVisualData()
- .setNodeColor( ForesterUtil.calcColor( msa_prop.getLength(),
- min,
- max,
- mean,
- min_color,
- max_color,
- mean_color ) );
+ .getNodeVisualData()
+ .setNodeColor( ForesterUtil.calcColor( msa_prop.getLength(),
+ min,
+ max,
+ mean,
+ min_color,
+ max_color,
+ mean_color ) );
}
}
}
}
public final List<MsaProperties> removeViaGapAverage( final double mean_gapiness ) throws IOException,
- InterruptedException {
+ InterruptedException {
final GapContribution stats[] = calcGapContribtionsStats( _norm );
final List<String> to_remove_ids = new ArrayList<String>();
final List<MsaProperties> msa_props = new ArrayList<MsaProperties>();
}
public final List<MsaProperties> removeWorstOffenders( final int to_remove ) throws IOException,
- InterruptedException {
+ InterruptedException {
final GapContribution stats[] = calcGapContribtionsStats( _norm );
final List<String> to_remove_ids = new ArrayList<String>();
final List<MsaProperties> msa_props = new ArrayList<MsaProperties>();
/*
* (non-Javadoc)
- *
+ *
* @see org.forester.tools.modeling.CoverageExtender#find(java.util.List,
* java.util.List, int,
* org.forester.tools.modeling.CoverageCalculationMethod,
/*
* Scoring method according to an idea by Adam Godzik, PhD.
- *
+ *
* @author Christian M. Zmasek
*/
public class BranchCountingBasedScoringMethod implements ScoringMethodForExternalNode {
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
/*
- *
+ *
* @author Christian M. Zmasek
*/
public class BranchLengthBasedScoringMethod extends BranchCountingBasedScoringMethod {
final PhylogenyNode node = ( PhylogenyNode ) element.getKey();
final double normalized_value = ( Double ) element.getValue() * normalization_factor;
PhylogenyMethods.setBranchColorValue( node, ForesterUtil
- .calcColor( normalized_value,
- min,
- max,
- median,
- ExternalNodeBasedCoverageMethod.MINIMAL_COV_COLOR,
- ExternalNodeBasedCoverageMethod.MAXIMAL_COV_COLOR,
- ExternalNodeBasedCoverageMethod.MEAN_COVERAGE_COLOR ) );
+ .calcColor( normalized_value,
+ min,
+ max,
+ median,
+ ExternalNodeBasedCoverageMethod.MINIMAL_COV_COLOR,
+ ExternalNodeBasedCoverageMethod.MAXIMAL_COV_COLOR,
+ ExternalNodeBasedCoverageMethod.MEAN_COVERAGE_COLOR ) );
}
PhylogenyMethods.postorderBranchColorAveragingExternalNodeBased( phylogeny );
}
/**
* This constructor sets the class name for the scoring method e.g.
* "org.forester.tools.modeling.BranchCountingBasedScoringMethod"
- *
+ *
* @param scoring_method
* class name for the scoring method
*/
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
/*
- *
+ *
* @author Christian M. Zmasek
*/
public class LogBranchLengthBasedScoringMethod extends BranchCountingBasedScoringMethod {
/*
* Interface providing implementations of scoring methods used by
* ExternalNodeBasedCoverageMethod.
- *
+ *
* @author Christian M. Zmasek
*/
public interface ScoringMethodForExternalNode {
/**
* This calculates the coverage score for one external node.
- *
- *
+ *
+ *
* @param external_node_scores
* SortedMap<PhylogenyNode, Double> in which the external node
* scores are stored (node->score)
* PhylogenyNod for which to calculate the score
* @param options
* CoverageCalculationOptions
- * @param annotate_phylogeny
- *
+ * @param annotate_phylogeny
+ *
*/
public void calculateScoreForExternalNode( final SortedMap<PhylogenyNode, Double> external_node_scores,
final Phylogeny phylogeny,
/**
* This returns a short description of this scoring method
- *
+ *
* @return short description of this scoring method
*/
public String getDesciption();
/**
* This calculates a normalization factor, so that a normalized score of 1.0
* means complete coverage.
- *
- *
+ *
+ *
* @param phylogeny
* Phylogeny containing the external nodes to score
* @return normalization factor
/**
* Adds this Phylogeny to the list of child nodes of PhylogenyNode parent
* and sets the parent of this to parent.
- *
+ *
* @param n
* the PhylogenyNode to add
*/
/**
* This calculates the height of the subtree emanating at n for rooted,
* tree-shaped phylogenies
- *
+ *
* @param n
* the root-node of a subtree
* @return the height of the subtree emanating at n
/**
* Need to call clearHashIdToNodeMap() afterwards (not done automatically
* to allow client multiple deletions in linear time).
- * Need to call 'recalculateNumberOfExternalDescendants(boolean)' after this
+ * Need to call 'recalculateNumberOfExternalDescendants(boolean)' after this
* if tree is to be displayed.
- *
+ *
* @param remove_us the parent node of the subtree to be deleted
*/
public void deleteSubtree( final PhylogenyNode remove_us, final boolean collapse_resulting_node_with_one_desc ) {
final int pi = p.getChildNodeIndex();
if ( removed_node.isFirstChildNode() ) {
p.getChildNode( 1 ).setDistanceToParent( PhylogenyMethods.addPhylogenyDistances( p
- .getDistanceToParent(), p.getChildNode( 1 ).getDistanceToParent() ) );
+ .getDistanceToParent(), p.getChildNode( 1 ).getDistanceToParent() ) );
pp.setChildNode( pi, p.getChildNode( 1 ) );
}
else {
p.getChildNode( 0 ).setDistanceToParent( PhylogenyMethods.addPhylogenyDistances( p
- .getDistanceToParent(), p.getChildNode( 0 ).getDistanceToParent() ) );
+ .getDistanceToParent(), p.getChildNode( 0 ).getDistanceToParent() ) );
pp.setChildNode( pi, p.getChildNode( 0 ) );
}
}
}
/**
- *
+ *
* Warning. The order of the returned nodes is random
* -- and hence cannot be relied on.
- *
+ *
* @return Unordered set of PhylogenyNode
*/
public List<PhylogenyNode> getExternalNodes() {
/**
* Sets the number of duplications of this Phylogeny (int). A value of -1
* indicates that the number of duplications is unknown.
- *
+ *
* @param clean_nh
* set to true for clean NH format
*/
* height is the longest distance from the root to an external node. Please
* note. Child nodes of collapsed nodes are ignored -- which is useful for
* display purposes but might be misleading for other applications.
- *
+ *
* @return the height for rooted, tree-shaped phylogenies
*/
public double getHeight() {
/**
* Returns a PhylogenyNode of this Phylogeny which has a matching name.
* Throws an Exception if seqname is not present in this or not unique.
- *
+ *
* @param name
* name (String) of PhylogenyNode to find
* @return PhylogenyNode with matchin name
/**
* This is time-inefficient since it runs a iterator each time it is called.
- *
+ *
*/
public int getNodeCount() {
if ( isEmpty() ) {
/**
* Returns a List with references to all Nodes of this Phylogeny which have
* a matching name.
- *
+ *
* @param name
* name (String) of Nodes to find
* @return Vector of references to Nodes of this Phylogeny with matching
/**
* Returns a Vector with references to all Nodes of this Phylogeny which
* have a matching species name.
- *
+ *
* @param specname
* species name (String) of Nodes to find
* @return Vector of references to Nodes of this Phylogeny with matching
* <p>
* (Last modified: 11/22/00) Olivier CHABROL :
* olivier.chabrol@univ-provence.fr
- *
+ *
* @param n
* external PhylogenyNode whose orthologs are to be returned
* @return Vector of references to all orthologous Nodes of PhylogenyNode n
if ( node.isDuplication() && isContains( taxIdList, taxonomyCodeRangeList ) ) {
if ( node.getChildNode1() == prev ) {
v.addAll( getNodeByTaxonomyID( searchNodeSpeciesId, node.getChildNode2()
- .getAllExternalDescendants() ) );
+ .getAllExternalDescendants() ) );
}
else {
v.addAll( getNodeByTaxonomyID( searchNodeSpeciesId, node.getChildNode1()
- .getAllExternalDescendants() ) );
+ .getAllExternalDescendants() ) );
}
}
}
/**
* Returns whether this is a completely binary tree (i.e. all internal nodes
* are bifurcations).
- *
+ *
*/
public boolean isCompletelyBinary() {
if ( isEmpty() ) {
/**
* Checks whether a Phylogeny object is deleted (or empty).
- *
+ *
* @return true if the tree is deleted (or empty), false otherwise
*/
public boolean isEmpty() {
* Resets the ID numbers of the nodes of this Phylogeny in level order,
* starting with start_label (for the root). <br>
* WARNING. After this method has been called, node IDs are no longer
- * unique.
+ * unique.
*/
public void levelOrderReID() {
if ( isEmpty() ) {
* (Re)counts the number of children for each PhylogenyNode of this
* Phylogeny. As an example, this method needs to be called after a
* Phylogeny has been reRooted and it is to be displayed.
- *
+ *
* @param consider_collapsed_nodes
* set to true to take into account collapsed nodes (collapsed
* nodes have 1 child).
* <p>
* <li>recalculateNumberOfExternalDescendants(boolean)
* <li>recalculateAndReset()
- *
+ *
* @param id
* ID (int) of PhylogenyNode of this Phylogeny
*/
* </ul>
* <p>
* (Last modified: 10/01/01)
- *
+ *
* @param n
* PhylogenyNode of this Phylogeny\
*/
}
else {
node.setDistanceToParent( ( c.getDistanceToParent() >= 0.0 ? c.getDistanceToParent() : 0.0 )
- + ( node.getDistanceToParent() >= 0.0 ? node.getDistanceToParent() : 0.0 ) );
+ + ( node.getDistanceToParent() >= 0.0 ? node.getDistanceToParent() : 0.0 ) );
}
if ( c.getBranchDataDirectly() != null ) {
node.setBranchData( ( BranchData ) c.getBranchDataDirectly().copy() );
// ---------------------------------------------------------
/**
* Converts this Phylogeny to a New Hampshire X (String) representation.
- *
+ *
* @return New Hampshire X (String) representation of this
* @see #toNewHampshireX()
*/
/**
* Return Node by TaxonomyId Olivier CHABROL :
* olivier.chabrol@univ-provence.fr
- *
+ *
* @param taxonomyID
* search taxonomy identifier
* @param nodes
/**
* List all species contains in all leaf under a node Olivier CHABROL :
* olivier.chabrol@univ-provence.fr
- *
+ *
* @param node
* PhylogenyNode whose sub node species are returned
* @return species contains in all leaf under the param node
* Create a map [<PhylogenyNode, List<String>], the list contains the
* species contains in all leaf under phylogeny node Olivier CHABROL :
* olivier.chabrol@univ-provence.fr
- *
+ *
* @param node
* the tree root node
* @param map
/**
* Util method to check if all element of a list is contains in the
* rangeList. Olivier CHABROL : olivier.chabrol@univ-provence.fr
- *
+ *
* @param list
* list to be check
* @param rangeList
if ( !ForesterUtil.isEmpty( stats.get( i ).getDescription() ) ) {\r
if ( !stats.get( i ).getDescription().equalsIgnoreCase( c.getType() ) ) {\r
throw new IllegalArgumentException( "support values in node [" + n.toString()\r
- + "] appear inconsistently ordered" );\r
+ + "] appear inconsistently ordered" );\r
}\r
}\r
stats.get( i ).setDescription( c.getType() );\r
\r
/**\r
* Calculates the distance between PhylogenyNodes node1 and node2.\r
- * \r
- * \r
+ *\r
+ *\r
* @param node1\r
* @param node2\r
* @return distance between node1 and node2\r
\r
/**\r
* Returns the LCA of PhylogenyNodes node1 and node2.\r
- * \r
- * \r
+ *\r
+ *\r
* @param node1\r
* @param node2\r
* @return LCA of node1 and node2\r
/**\r
* Returns the LCA of PhylogenyNodes node1 and node2.\r
* Precondition: ids are in pre-order (or level-order).\r
- * \r
- * \r
+ *\r
+ *\r
* @param node1\r
* @param node2\r
* @return LCA of node1 and node2\r
}\r
\r
/**\r
- * \r
+ *\r
* Convenience method\r
- * \r
+ *\r
* @param node\r
* @return\r
*/\r
}\r
\r
/**\r
- * Returns taxonomy t if all external descendants have \r
+ * Returns taxonomy t if all external descendants have\r
* the same taxonomy t, null otherwise.\r
- * \r
+ *\r
*/\r
public static Taxonomy getExternalDescendantsTaxonomy( final PhylogenyNode node ) {\r
final List<PhylogenyNode> descs = node.getAllExternalDescendants();\r
\r
/*\r
* This is case insensitive.\r
- * \r
+ *\r
*/\r
public synchronized static boolean isTaxonomyHasIdentifierOfGivenProvider( final Taxonomy tax,\r
final String[] providers ) {\r
* all external nodes of node.\r
* If at least one of the external nodes has no taxonomy,\r
* null is returned.\r
- * \r
+ *\r
*/\r
public static Map<Taxonomy, Integer> obtainDistinctTaxonomyCounts( final PhylogenyNode node ) {\r
final List<PhylogenyNode> descs = node.getAllExternalDescendants();\r
* Arranges the order of childern for each node of this Phylogeny in such a\r
* way that either the branch with more children is on top (right) or on\r
* bottom (left), dependent on the value of boolean order.\r
- * \r
+ *\r
* @param order\r
* decides in which direction to order\r
- * @param pri \r
+ * @param pri\r
*/\r
public static void orderAppearance( final PhylogenyNode n,\r
final boolean order,\r
\r
/**\r
* Convenience method.\r
- * Sets value for the first confidence value (created if not present, values overwritten otherwise). \r
+ * Sets value for the first confidence value (created if not present, values overwritten otherwise).\r
*/\r
public static void setBootstrapConfidence( final PhylogenyNode node, final double bootstrap_confidence_value ) {\r
setConfidence( node, bootstrap_confidence_value, "bootstrap" );\r
\r
/**\r
* Convenience method.\r
- * Sets value for the first confidence value (created if not present, values overwritten otherwise). \r
+ * Sets value for the first confidence value (created if not present, values overwritten otherwise).\r
*/\r
public static void setConfidence( final PhylogenyNode node, final double confidence_value ) {\r
setConfidence( node, confidence_value, "" );\r
\r
/**\r
* Convenience method.\r
- * Sets value for the first confidence value (created if not present, values overwritten otherwise). \r
+ * Sets value for the first confidence value (created if not present, values overwritten otherwise).\r
*/\r
public static void setConfidence( final PhylogenyNode node, final double confidence_value, final String type ) {\r
Confidence c = null;\r
\r
/**\r
* Convenience method to set the taxonomy code of a phylogeny node.\r
- * \r
- * \r
+ *\r
+ *\r
* @param node\r
* @param taxonomy_code\r
- * @throws PhyloXmlDataFormatException \r
+ * @throws PhyloXmlDataFormatException\r
*/\r
public static void setTaxonomyCode( final PhylogenyNode node, final String taxonomy_code )\r
throws PhyloXmlDataFormatException {\r
/**\r
* Removes from Phylogeny to_be_stripped all external Nodes which are\r
* associated with a species NOT found in Phylogeny reference.\r
- * \r
+ *\r
* @param reference\r
* a reference Phylogeny\r
* @param to_be_stripped\r
else if ( !( ref_ext_taxo.contains( n.getNodeData().getTaxonomy().getScientificName() ) )\r
&& !( ref_ext_taxo.contains( n.getNodeData().getTaxonomy().getTaxonomyCode() ) )\r
&& !( ( n.getNodeData().getTaxonomy().getIdentifier() != null ) && ref_ext_taxo.contains( n\r
- .getNodeData().getTaxonomy().getIdentifier().getValuePlusProvider() ) ) ) {\r
+ .getNodeData().getTaxonomy().getIdentifier().getValuePlusProvider() ) ) ) {\r
nodes_to_delete.add( n );\r
}\r
}\r
n.setName( "" );\r
}\r
n.getNodeData().getTaxonomy()\r
- .setIdentifier( new Identifier( id, PhyloXmlUtil.UNIPROT_TAX_PROVIDER ) );\r
+ .setIdentifier( new Identifier( id, PhyloXmlUtil.UNIPROT_TAX_PROVIDER ) );\r
break;\r
}\r
case TAXONOMY_ID_UNIPROT_2: {\r
n.setName( "" );\r
}\r
n.getNodeData().getTaxonomy()\r
- .setIdentifier( new Identifier( id, PhyloXmlUtil.UNIPROT_TAX_PROVIDER ) );\r
+ .setIdentifier( new Identifier( id, PhyloXmlUtil.UNIPROT_TAX_PROVIDER ) );\r
break;\r
}\r
case TAXONOMY_ID: {\r
/**\r
* Calculates the distance between PhylogenyNodes n1 and n2.\r
* PRECONDITION: n1 is a descendant of n2.\r
- * \r
+ *\r
* @param n1\r
* a descendant of n2\r
* @param n2\r
import org.forester.util.ForesterUtil;
/**
- * Warning. Implementation of method 'compareTo' only looks at
+ * Warning. Implementation of method 'compareTo' only looks at
* node name. Thus, use of this class in SortedSets might lead
* to unexpected behavior.
*
/**
* Adds PhylogenyNode n to the list of child nodes and sets the _parent of n
* to this.
- *
+ *
* @param n
* the PhylogenyNode to add
*/
* Returns a new PhylogenyNode which has its data copied from this
* PhylogenyNode. Links to the other Nodes in the same Phylogeny are NOT
* copied (e.g. _link to _parent). Field "_link" IS copied.
- *
- * @see #getLink()
+ *
+ * @see #getLink()
*/
final public PhylogenyNode copyNodeData() {
final PhylogenyNode node = new PhylogenyNode();
* Returns a new PhylogenyNode which has the same data as this
* PhylogenyNode. Links to the other Nodes in the same Phylogeny are NOT
* copied (e.g. _link to _parent). Field "_link" IS copied.
- *
- * @see #getLink()
+ *
+ * @see #getLink()
*/
final public PhylogenyNode copyNodeDataShallow() {
final PhylogenyNode node = new PhylogenyNode();
@Override
/**
* Based on node name, sequence, and taxonomy.
- *
- *
+ *
+ *
*/
final public boolean equals( final Object o ) {
if ( this == o ) {
/**
* Returns a List containing references to all external children of this
* PhylogenyNode.
- *
+ *
* @return List of references to external Nodes
*/
final public List<PhylogenyNode> getAllExternalDescendants() {
/**
* Returns a List containing references to all names of the external
* children of this PhylogenyNode.
- *
+ *
* @return List of references to names of external Nodes
*/
final public List<String> getAllExternalDescendantsNames() {
/**
* This return child node n of this node.
- *
+ *
* @param n
* the index of the child to get
* @return the child node with index n
/**
* This gets the child node index of this node.
* <p>
- *
+ *
* @return the child node index of this node
* @throws UnsupportedOperationException
* if this node is a root node
* parent
* <p>
* [last modified Aug 14, 2006 by CMZ]
- *
+ *
* @return the child node index of this node
* @throws UnsupportedOperationException
* if this node is a root node
* Convenience method. Returns the first child node of this node.
* <p>
* [last modified May 18, 2005 by CMZ]
- *
+ *
* @return the first child node of this node
*/
public final PhylogenyNode getFirstChildNode() {
* Convenience method. Returns the last child node of this node.
* <p>
* [last modified May 18, 2005 by CMZ]
- *
+ *
* @return the last child node of this node
*/
public final PhylogenyNode getLastChildNode() {
/**
* Checks whether this PhylogenyNode is external (tip).
- *
+ *
* @return true if this PhylogenyNode is external, false otherwise
*/
final public boolean isExternal() {
/**
* Checks whether this PhylogenyNode is internal (tip).
- *
+ *
* @return true if this PhylogenyNode is external, false otherwise
*/
final public boolean isInternal() {
* Returns true if this node is the last child node of its _parent.
* <p>
* [last modified June 01, 2005 by CMZ]
- *
+ *
* @return true if this node is the last child node of its _parent, false
* otherwise
*/
/**
* Checks whether this PhylogenyNode is a root.
- *
+ *
* @return true if this PhylogenyNode is the root, false otherwise
*/
final public boolean isRoot() {
* child nodes. This does not allow null slots in the list of child nodes:
* If i is larger than the number of child nodes, n is just added to the
* list, not place at index i.
- *
+ *
* @param i
* the index of position where to add the child
* @param n
}
if ( getNumberOfDescendants() != 2 ) {
throw new RuntimeException( "attempt to swap descendants of node with " + getNumberOfDescendants()
- + " descendants" );
+ + " descendants" );
}
final PhylogenyNode a = getChildNode( 0 );
final PhylogenyNode b = getChildNode( 1 );
if ( getBranchData().isHasConfidences()
&& ( getBranchData().getConfidence( 0 ).getValue() != Confidence.CONFIDENCE_DEFAULT_VALUE ) ) {
data = Confidence.FORMATTER.format( ForesterUtil
- .round( getBranchData().getConfidence( 0 ).getValue(),
- PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) );
+ .round( getBranchData().getConfidence( 0 ).getValue(),
+ PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) );
}
}
else if ( !ForesterUtil.isEmpty( getName() ) ) {
&& ( getBranchData().getConfidence( 0 ).getValue() != Confidence.CONFIDENCE_DEFAULT_VALUE ) ) {
sb.append( "[" );
sb.append( Confidence.FORMATTER.format( ForesterUtil
- .round( getBranchData().getConfidence( 0 ).getValue(),
- PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) ) );
+ .round( getBranchData().getConfidence( 0 ).getValue(),
+ PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) ) );
sb.append( "]" );
}
return sb.toString();
/**
* Adds PhylogenyNode n to the list of child nodes. But does NOT set the
* _parent of n to this.
- *
+ *
* @see addAsChild( PhylogenyNode n )
* @param n
* the PhylogenyNode to add
}
public static PhylogenyNode createInstanceFromNhxString( final String nhx ) throws NHXFormatException,
- PhyloXmlDataFormatException {
+ PhyloXmlDataFormatException {
return new PhylogenyNode( nhx, NHXParser.TAXONOMY_EXTRACTION.NO, false );
}
public static PhylogenyNode createInstanceFromNhxString( final String nhx,
final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction )
- throws NHXFormatException, PhyloXmlDataFormatException {
+ throws NHXFormatException, PhyloXmlDataFormatException {
return new PhylogenyNode( nhx, taxonomy_extraction, false );
}
public static PhylogenyNode createInstanceFromNhxString( final String nhx,
final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction,
final boolean replace_underscores )
- throws NHXFormatException, PhyloXmlDataFormatException {
+ throws NHXFormatException, PhyloXmlDataFormatException {
return new PhylogenyNode( nhx, taxonomy_extraction, replace_underscores );
}
/**
* Returns the total number of all Nodes created so far.
- *
+ *
* @return total number of Nodes (long)
*/
synchronized final public static long getNodeCount() {
public void addGainedCharacter( final String binary_character ) {
if ( getLostCharacters().contains( binary_character ) ) {
throw new IllegalArgumentException( "attempt to add binary character [" + binary_character
- + "] to gained characters but is already listed as lost" );
+ + "] to gained characters but is already listed as lost" );
}
getGainedCharacters().add( binary_character );
}
public void addLostCharacter( final String binary_character ) {
if ( getPresentCharacters().contains( binary_character ) ) {
throw new IllegalArgumentException( "attempt to add binary character [" + binary_character
- + "] to lost characters but is already listed as present" );
+ + "] to lost characters but is already listed as present" );
}
if ( getGainedCharacters().contains( binary_character ) ) {
throw new IllegalArgumentException( "attempt to add binary character [" + binary_character
- + "] to lost characters but is already listed as gained" );
+ + "] to lost characters but is already listed as gained" );
}
getLostCharacters().add( binary_character );
}
public void addPresentCharacter( final String binary_character ) {
if ( getLostCharacters().contains( binary_character ) ) {
throw new IllegalArgumentException( "attempt to add binary character [" + binary_character
- + "] to present characters but is already listed as lost" );
+ + "] to present characters but is already listed as lost" );
}
getPresentCharacters().add( binary_character );
}
@Override
/**
* Not a deep copy.
- *
+ *
*/
public PhylogenyData copy() {
validate();
getType(),
PhyloXmlMapping.BINARY_CHARACTERS_GAINED_COUNT_ATTR,
getGainedCount() != COUNT_DEFAULT ? String.valueOf( getGainedCount() ) : "",
- PhyloXmlMapping.BINARY_CHARACTERS_LOST_COUNT_ATTR,
- getLostCount() != COUNT_DEFAULT ? String.valueOf( getLostCount() ) : "",
- PhyloXmlMapping.BINARY_CHARACTERS_PRESENT_COUNT_ATTR,
- getPresentCount() != COUNT_DEFAULT ? String.valueOf( getPresentCount() ) : "" );
+ PhyloXmlMapping.BINARY_CHARACTERS_LOST_COUNT_ATTR,
+ getLostCount() != COUNT_DEFAULT ? String.valueOf( getLostCount() ) : "",
+ PhyloXmlMapping.BINARY_CHARACTERS_PRESENT_COUNT_ATTR,
+ getPresentCount() != COUNT_DEFAULT ? String.valueOf( getPresentCount() ) : "" );
final String my_ind = indentation + PhylogenyWriter.PHYLO_XML_INTENDATION_BASE;
if ( getGainedCharacters().size() > 0 ) {
writer.write( ForesterUtil.LINE_SEPARATOR );
@Override
/**
* Not a deep copy.
- *
+ *
*/
public PhylogenyData copy() {
final BranchColor bc = new BranchColor();
private BranchWidth _branch_width;
public BranchData() {
- // Doing nothing.
+ // Doing nothing.
}
public void addConfidence( final Confidence confidence ) {
writer.write( indentation );
if ( getStandardDeviation() != CONFIDENCE_DEFAULT_VALUE ) {
PhylogenyDataUtil
- .appendElement( writer,
- PhyloXmlMapping.CONFIDENCE,
- FORMATTER.format( ForesterUtil
- .round( getValue(), PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) ),
- PhyloXmlMapping.CONFIDENCE_TYPE_ATTR,
- ForesterUtil.isEmpty( getType() ) ? "unknown" : getType(),
- PhyloXmlMapping.CONFIDENCE_SD_ATTR,
- String.valueOf( ForesterUtil
- .round( getStandardDeviation(),
- PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) ) );
+ .appendElement( writer,
+ PhyloXmlMapping.CONFIDENCE,
+ FORMATTER.format( ForesterUtil
+ .round( getValue(), PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) ),
+ PhyloXmlMapping.CONFIDENCE_TYPE_ATTR,
+ ForesterUtil.isEmpty( getType() ) ? "unknown" : getType(),
+ PhyloXmlMapping.CONFIDENCE_SD_ATTR,
+ String.valueOf( ForesterUtil
+ .round( getStandardDeviation(),
+ PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) ) );
}
else {
PhylogenyDataUtil
- .appendElement( writer,
- PhyloXmlMapping.CONFIDENCE,
- FORMATTER.format( ForesterUtil
- .round( getValue(), PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) ),
- PhyloXmlMapping.CONFIDENCE_TYPE_ATTR,
- ForesterUtil.isEmpty( getType() ) ? "unknown" : getType() );
+ .appendElement( writer,
+ PhyloXmlMapping.CONFIDENCE,
+ FORMATTER.format( ForesterUtil
+ .round( getValue(), PhyloXmlUtil.ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT ) ),
+ PhyloXmlMapping.CONFIDENCE_TYPE_ATTR,
+ ForesterUtil.isEmpty( getType() ) ? "unknown" : getType() );
}
}
public PhylogenyData copy() {
return new Date( getDesc(),
getValue() == null ? null : new BigDecimal( getValue().toPlainString() ),
- getMin() == null ? null : new BigDecimal( getMin().toPlainString() ),
- getMax() == null ? null : new BigDecimal( getMax().toPlainString() ),
- getUnit() );
+ getMin() == null ? null : new BigDecimal( getMin().toPlainString() ),
+ getMax() == null ? null : new BigDecimal( getMax().toPlainString() ),
+ getUnit() );
}
public String getDesc() {
/**
* Returns true if the names and the order of the domains match (domain and
* linker lengths are ignored).
- *
- *
+ *
+ *
*/
@Override
public boolean isEqual( final PhylogenyData domain_architecture ) {
/**
* Returns true if this event contains one or more duplications events only
- *
+ *
* @return true if this event contains one or more duplications events only
*/
public boolean isDuplication() {
/**
* Returns true if this event contains one or more gene loss events only
- *
+ *
* @return true if this event contains one or more gene loss events only
*/
public boolean isGeneLoss() {
/**
* Returns true if this event contains one or more speciation events only
- *
+ *
* @return true if this event contains one or more speciation events only
*/
public boolean isSpeciation() {
PhylogenyDataUtil.appendOpen( writer, PhyloXmlMapping.EVENTS );
if ( ( getEventType() != EventType.unassigned ) && ( getEventType() != EventType.mixed ) ) {
PhylogenyDataUtil
- .appendElement( writer, PhyloXmlMapping.EVENT_TYPE, getEventType().toString(), indentation );
+ .appendElement( writer, PhyloXmlMapping.EVENT_TYPE, getEventType().toString(), indentation );
}
if ( getNumberOfDuplications() > 0 ) {
PhylogenyDataUtil.appendElement( writer,
/**
* Convenience method -- always returns the first Distribution.
- *
+ *
* @return Distribution
*/
public Distribution getDistribution() {
/**
* Convenience method -- always returns the first Reference.
- *
+ *
* @return Reference
- *
+ *
*/
public Reference getReference() {
return getReference( 0 );
/**
* Convenience method -- always returns the first Sequence.
- *
+ *
* @return Sequence
*/
public Sequence getSequence() {
/**
* Convenience method -- always returns the first Taxonomy.
- *
+ *
* @return Taxonomy
- *
+ *
*/
public Taxonomy getTaxonomy() {
return getTaxonomy( 0 );
public boolean isEmpty() {
return ( ForesterUtil.isEmpty( _node_name ) && !isHasSequence() && !isHasTaxonomy() && !isHasBinaryCharacters()
&& !isHasDate() && !isHasDistribution() && !isHasEvent() && !isHasProperties() && !isHasReference() && ( ( _vector == null ) || _vector
- .isEmpty() ) );
+ .isEmpty() ) );
}
public boolean isHasDate() {
return ( getDate() != null )
&& ( !ForesterUtil.isEmpty( getDate().getDesc() ) || !ForesterUtil.isNull( getDate().getMax() )
|| !ForesterUtil.isNull( getDate().getMin() ) || !ForesterUtil.isNull( getDate().getValue() ) || !ForesterUtil
- .isEmpty( getDate().getUnit() ) );
+ .isEmpty( getDate().getUnit() ) );
}
public boolean isHasDistribution() {
return ( ( ( getDistributions() != null ) && ( getDistributions().size() > 0 ) ) && ( ( !ForesterUtil
.isEmpty( getDistribution().getDesc() ) )
|| ( ( getDistribution().getPoints() != null ) && ( getDistribution().getPoints().size() > 0 ) ) || ( ( getDistribution()
- .getPolygons() != null ) && ( getDistribution().getPolygons().size() > 0 ) ) ) );
+ .getPolygons() != null ) && ( getDistribution().getPolygons().size() > 0 ) ) ) );
}
public boolean isHasEvent() {
public boolean isHasReference() {
return ( ( getReferences() != null ) && ( getReferences().size() > 0 ) )
&& ( !ForesterUtil.isEmpty( getReference().getDoi() ) || !ForesterUtil.isEmpty( getReference()
- .getDescription() ) );
+ .getDescription() ) );
}
public boolean isHasSequence() {
/**
* Convenience method -- always sets the first Distribution.
- *
+ *
*/
public void setDistribution( final Distribution distribution ) {
if ( _distributions == null ) {
/**
* Convenience method -- always sets the first Reference.
- *
+ *
*/
public void setReference( final Reference reference ) {
if ( _references == null ) {
/**
* Convenience method -- always sets the first Sequence.
- *
+ *
*/
public void setSequence( final Sequence sequence ) {
if ( _sequences == null ) {
/**
* Convenience method -- always sets the first Taxonomy.
- *
+ *
*/
public void setTaxonomy( final Taxonomy taxonomy ) {
if ( _taxonomies == null ) {
@Override\r
public final PhylogenyData copy() {\r
return new NodeVisualData( !ForesterUtil.isEmpty( getFontName() ) ? new String( getFontName() ) : null,\r
- getFontStyle(),\r
- getFontSize(),\r
- getFontColor() != null ? new Color( getFontColor().getRed(), getFontColor()\r
- .getGreen(), getFontColor().getBlue() ) : null,\r
- getShape(),\r
- getFillType(),\r
- getNodeColor() != null ? new Color( getNodeColor().getRed(), getNodeColor()\r
- .getGreen(), getNodeColor().getBlue() ) : null,\r
- getSize(),\r
- getTransparency() );\r
+ getFontStyle(),\r
+ getFontSize(),\r
+ getFontColor() != null ? new Color( getFontColor().getRed(), getFontColor()\r
+ .getGreen(), getFontColor().getBlue() ) : null,\r
+ getShape(),\r
+ getFillType(),\r
+ getNodeColor() != null ? new Color( getNodeColor().getRed(), getNodeColor()\r
+ .getGreen(), getNodeColor().getBlue() ) : null,\r
+ getSize(),\r
+ getTransparency() );\r
}\r
\r
public final NodeFill getFillType() {\r
* Creates a new PhylogenyData object with identical values as this
* PhylogenyData.
* This ~should~ return a deep copy, but not there yet.
- *
- *
+ *
+ *
* @return a ~deep~ copy of this PhylogenyData
*/
public PhylogenyData copy();
/**
* Compares this PhylogenyData to PhylogenyData data. In general, this
* should return true if and only if all fiels are exactly identical.
- *
+ *
* @param PhylogenyData
* the PhylogenyData to compare to
* @return in general, true if and only if all fiels are exactly identical,
/**
* Writes a phyloXML representation of this phylogeny data.
- *
+ *
* @param writer
* @param level
* @param indentation
- * @throws IOException
+ * @throws IOException
*/
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException;
}
\ No newline at end of file
/**
* Creates a deep copy of ArrayList of PhylogenyData objects.
- *
+ *
* @param list
* an ArrayList of PhylogenyData objects
* @return a deep copy of ArrayList list
}
else {
return new StringBuffer( "[" + getLatitude().toPlainString() + ", " + getLongitude() + ", " + getAltitude()
- + getAltiudeUnit() + "]" );
+ + getAltiudeUnit() + "]" );
}
}
public PhylogenyData copy() {
return new Point( getGeodeticDatum(),
getLatitude() == null ? null : new BigDecimal( getLatitude().toPlainString() ),
- getLongitude() == null ? null : new BigDecimal( getLongitude().toPlainString() ),
- getAltitude() == null ? null : new BigDecimal( getAltitude().toPlainString() ),
- getAltiudeUnit() );
+ getLongitude() == null ? null : new BigDecimal( getLongitude().toPlainString() ),
+ getAltitude() == null ? null : new BigDecimal( getAltitude().toPlainString() ),
+ getAltiudeUnit() );
}
public BigDecimal getAltitude() {
&& ( ( p.getLatitude() == null ) || ( p.getLatitude().compareTo( BigDecimal.ZERO ) <= 0 ) )
&& ( ForesterUtil.isEmpty( p.getGeodeticDatum() ) || p.getGeodeticDatum()
.equalsIgnoreCase( UNKNOWN_GEODETIC_DATUM ) ) && ( ForesterUtil.isEmpty( p.getAltiudeUnit() ) || p
- .getAltiudeUnit().equalsIgnoreCase( "?" ) ) );
+ .getAltiudeUnit().equalsIgnoreCase( "?" ) ) );
}
}
final String id_ref ) {
if ( !ForesterUtil.isEmpty( ref ) && ( ref.indexOf( ":" ) < 1 ) ) {
throw new IllegalArgumentException( "property reference [" + ref
- + "] is not in the expected format (missing a \":\")" );
+ + "] is not in the expected format (missing a \":\")" );
}
if ( !ForesterUtil.isEmpty( unit ) && ( unit.indexOf( ":" ) < 1 ) ) {
throw new IllegalArgumentException( "property unit [" + unit
- + "] is not in the expected format (missing a \":\")" );
+ + "] is not in the expected format (missing a \":\")" );
}
if ( !ForesterUtil.isEmpty( datatype ) && ( datatype.indexOf( ":" ) < 1 ) ) {
throw new IllegalArgumentException( "property datatype [" + unit
- + "] is not in the expected format (missing a \":\")" );
+ + "] is not in the expected format (missing a \":\")" );
}
_ref = ref;
_unit = unit;
/**
* Not a deep copy.
- *
+ *
*/
@Override
public PhylogenyData copy() {
public boolean isEmpty() {
return ( ( getIdentifier() == null ) && ForesterUtil.isEmpty( getTaxonomyCode() )
&& ForesterUtil.isEmpty( getCommonName() ) && ForesterUtil.isEmpty( getScientificName() ) && ForesterUtil
- .isEmpty( _lineage ) );
+ .isEmpty( _lineage ) );
}
/**
- *
+ *
* If this and taxonomy 'data' has an identifier, comparison will be based on that.
* Otherwise, if this and taxonomy 'data' has a code, comparison will be based on that.
* Otherwise, if Taxonomy 'data' has a scientific name, comparison will be
* Otherwise, if Taxonomy 'data' has a common name, comparison will be
* based on that (case insensitive!).
* (Note. This is important and should not be change without a very good reason.)
- *
+ *
*/
@Override
public boolean isEqual( final PhylogenyData data ) {
}
if ( !ForesterUtil.isEmpty( getCommonName() ) ) {
PhylogenyDataUtil
- .appendElement( writer, PhyloXmlMapping.TAXONOMY_COMMON_NAME, getCommonName(), indentation );
+ .appendElement( writer, PhyloXmlMapping.TAXONOMY_COMMON_NAME, getCommonName(), indentation );
}
if ( _synonyms != null ) {
for( final String syn : getSynonyms() ) {
/*
* Interface for Phylogeny factories.
- *
+ *
* @author Christian M. Zmasek
*/
public interface PhylogenyFactory {
* This must create a Phylogeny from source (e.g. an XML file, an alignment,
* pairwise distances) by using creator (e.g. an XML file parser, an
* algorithm implementation).
- *
+ *
* @param source
* a source to create a Phylogeny from
* @param creator
/**
* Constructor for ExternalForwardIterator.
- *
+ *
* @param tree
* the tree on which to iterate over all external nodes.
*/
/*
* (non-Javadoc)
- *
+ *
* @see java.util.Iterator#hasNext()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see java.util.Iterator#next()
*/
@Override
/**
* Not supported.
- *
+ *
*/
@Override
public void remove() {
/*
* An iterator to iterate a Phylogeny in level order.
- *
+ *
* Created: 10/23/2005 by Christian M. Zmasek. Last modified: 10/23/2005 by
* Christian M. Zmasek.
- *
+ *
* @author Christian M. Zmasek
- *
+ *
* @version 1.000
*/
public class LevelOrderTreeIterator implements PhylogenyNodeIterator {
/**
* Creates a new LevelOrderTreeIterator for iterating over all the nodes of
* Phylogeny phylogeny
- *
+ *
* @param phylogeny
* the Phylogeny to iterate over
* @throws IllegalArgumentException
/**
* Creates a new LevelOrderTreeIterator for iterating over all the child
* nodes of PhylogenyNode node (including node itself).
- *
+ *
* @param node
* the parent of the nodes to iterate over
*/
// ---------------
/**
* Returns the queue upon which this iterator is based.
- *
+ *
*/
private Queue getQueue() {
return _queue;
/**
* Returns the root of the phylogeny this iterators parses over.
- *
+ *
* @return the root of the phylogeny this iterators parses over.
*/
private PhylogenyNode getRoot() {
/**
* Returns true is this iterator has at least one more element, false
* otherwise.
- *
+ *
* @return true is this iterator has at least one more element, false
* otherwise
*/
/**
* Returns the next PhylogenyNode.
- *
+ *
* @return the next PhylogenyNode
* @throws NoSuchElementException
* if iteration is complete
/**
* Not supported.
- *
+ *
*/
@Override
public void remove() {
/*
* @author Christian Zmasek
- *
+ *
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
*/
/*
* @author Christian M. Zmasek
- *
+ *
* @version 1.00 -- last modified: 06/15/00
*/
public final class PostOrderStackObject {
/*
* (non-Javadoc)
- *
+ *
* @see java.util.Iterator#hasNext()
*/
@Override
/**
* Not supported.
- *
+ *
*/
@Override
public final void remove() {
/**
* Basic domains are compared/sorted based upon their identifiers (case
* insensitive) and their numbers.
- *
+ *
*/
@Override
public int compareTo( final Domain domain ) {
/**
* Basic domains are considered equal if they have the same identifier (case
* sensitive).
- *
+ *
*/
@Override
public boolean equals( final Object o ) {
private final List<Domain> _protein_domains;
public static Comparator<Domain> DomainMidPositionComparator = new Comparator<Domain>() {
- @Override
- public int compare( final Domain d1,
- final Domain d2 ) {
- final int m1 = ( d1.getTo() + d1.getFrom() );
- final int m2 = ( d2.getTo() + d2.getFrom() );
- return m1 < m2 ? -1 : m1 > m2 ? 1 : d1
- .getDomainId()
- .compareTo( d2.getDomainId() );
- }
- };
+ @Override
+ public int compare( final Domain d1,
+ final Domain d2 ) {
+ final int m1 = ( d1.getTo() + d1.getFrom() );
+ final int m2 = ( d2.getTo() + d2.getFrom() );
+ return m1 < m2 ? -1 : m1 > m2 ? 1 : d1
+ .getDomainId()
+ .compareTo( d2.getDomainId() );
+ }
+ };
public BasicProtein( final String id_str, final String species_str, final int length ) {
if ( length < 0 ) {
* If in_nc_order is set to true, this returns true only and only if
* the order in List 'domains' and this protein (as determined by the start positions
* of the domains of this proteins, _not_ by their index) are the same
- * (interspersing, 'other', domains in this are ignored).
+ * (interspersing, 'other', domains in this are ignored).
* If in_nc_order is set to false, this returns true only and only if
* this contains all domains listed in 'domains' (order and count do not matter).
- *
+ *
* @param domains a list of domain ids in a certain order.
* @param in_nc_order to consider order
* @return
* If in_nc_order is set to true, this should return true only and only if
* the order in List 'domains' and this protein (as determined by the start positions
* of the domains of this proteins, _not_ by their index) are the same
- * (interspersing, 'other', domains in this are ignored).
+ * (interspersing, 'other', domains in this are ignored).
* If in_nc_order is set to false, this should return true only and only if
* this contains all domains listed in 'domains' (order and count do not matter).
- *
+ *
* @param domains a list of domain ids in a certain order.
* @param in_nc_order to consider order
* @return
}
else if ( o.getClass() != this.getClass() ) {
throw new IllegalArgumentException( "attempt to check protein id equality to " + o + " [" + o.getClass()
- + "]" );
+ + "]" );
}
else {
return getId().equals( ( ( ProteinId ) o ).getId() );
/**
* Returns the numbers of number of ext nodes in gene trees analyzed (after
* stripping).
- *
+ *
* @return number of ext nodes in gene trees analyzed (after stripping)
*/
public final int getExtNodesOfAnalyzedGeneTrees() {
/**
* Returns the numbers of number of int nodes in gene trees analyzed (after
* stripping).
- *
+ *
* @return number of int nodes in gene trees analyzed (after stripping)
*/
public final int getIntNodesOfAnalyzedGeneTrees() {
int first,
final int last,
final boolean transfer_taxonomy ) throws SDIException, RIOException,
- FileNotFoundException, IOException {
+ FileNotFoundException, IOException {
if ( !parser.hasNext() ) {
throw new RIOException( "no gene trees to analyze" );
}
final int first,
final int last,
final boolean transfer_taxonomy ) throws SDIException, RIOException,
- FileNotFoundException, IOException {
+ FileNotFoundException, IOException {
if ( algorithm == ALGORITHM.SDIR ) {
// Removes from species_tree all species not found in gene_tree.
PhylogenyMethods.taxonomyBasedDeletionOfExternalNodes( gene_trees[ 0 ], species_tree );
final String outgroup,
final int i,
final boolean transfer_taxonomy ) throws SDIException,
- RIOException {
+ RIOException {
final Phylogeny assigned_tree;
switch ( algorithm ) {
case SDIR: {
final String outgroup,
final int i,
final boolean transfer_taxonomy ) throws SDIException,
- RIOException {
+ RIOException {
final Phylogeny assigned_tree;
final int dups;
if ( _rerooting == REROOTING.BY_ALGORITHM ) {
for( final PhylogenyNode r : _removed_gene_tree_nodes ) {
if ( !r.getNodeData().isHasTaxonomy() ) {
throw new RIOException( "node with no (appropriate) taxonomic information found in gene tree #" + i
- + ": " + r.toString() );
+ + ": " + r.toString() );
}
}
assigned_tree = gene_tree;
}
log( "Gene trees analyzed : " + _duplications_stats.getN() );
log( "Mean number of duplications : " + df.format( _duplications_stats.arithmeticMean() )
- + " (sd: " + df.format( _duplications_stats.sampleStandardDeviation() ) + ")" + " ("
- + df.format( ( 100.0 * _duplications_stats.arithmeticMean() ) / getIntNodesOfAnalyzedGeneTrees() )
- + "%)" );
+ + " (sd: " + df.format( _duplications_stats.sampleStandardDeviation() ) + ")" + " ("
+ + df.format( ( 100.0 * _duplications_stats.arithmeticMean() ) / getIntNodesOfAnalyzedGeneTrees() )
+ + "%)" );
if ( _duplications_stats.getN() > 3 ) {
log( "Median number of duplications : " + df.format( _duplications_stats.median() )
- + " (" + df.format( ( 100.0 * _duplications_stats.median() ) / getIntNodesOfAnalyzedGeneTrees() )
- + "%)" );
+ + " (" + df.format( ( 100.0 * _duplications_stats.median() ) / getIntNodesOfAnalyzedGeneTrees() )
+ + "%)" );
}
log( "Minimum duplications : " + ( int ) _duplications_stats.getMin() + " ("
+ df.format( ( 100.0 * _duplications_stats.getMin() ) / getIntNodesOfAnalyzedGeneTrees() ) + "%)" );
final boolean produce_log,
final boolean verbose,
final boolean transfer_taxonomy ) throws IOException, SDIException,
- RIOException {
+ RIOException {
final Phylogeny[] gene_trees = parseGeneTrees( gene_trees_file );
if ( gene_trees.length < 1 ) {
throw new RIOException( "\"" + gene_trees_file + "\" is devoid of appropriate gene trees" );
final boolean produce_log,
final boolean verbose,
final boolean transfer_taxonomy ) throws IOException, SDIException,
- RIOException {
+ RIOException {
return new RIO( parseGeneTrees( gene_trees_file ),
species_tree,
algorithm,
final boolean produce_log,
final boolean verbose,
final boolean transfer_taxonomy ) throws IOException, SDIException,
- RIOException {
+ RIOException {
return new RIO( parseGeneTrees( gene_trees_file ),
species_tree,
algorithm,
final boolean produce_log,
final boolean verbose,
final boolean transfer_taxonomy ) throws IOException, SDIException,
- RIOException {
+ RIOException {
final Phylogeny g0 = p.next();
if ( ( g0 == null ) || g0.isEmpty() || ( g0.getNumberOfExternalNodes() < 2 ) ) {
throw new RIOException( "input file does not seem to contain any gene trees" );
final boolean produce_log,
final boolean verbose,
final boolean transfer_taxonomy ) throws IOException, SDIException,
- RIOException {
+ RIOException {
return new RIO( p,
species_tree,
algorithm,
final boolean produce_log,
final boolean verbose,
final boolean transfer_taxonomy ) throws IOException, SDIException,
- RIOException {
+ RIOException {
return new RIO( p,
species_tree,
algorithm,
final boolean produce_log,
final boolean verbose,
final boolean transfer_taxonomy ) throws IOException, SDIException,
- RIOException {
+ RIOException {
return new RIO( gene_trees,
species_tree,
algorithm,
final boolean produce_log,
final boolean verbose,
final boolean transfer_taxonomy ) throws IOException, SDIException,
- RIOException {
+ RIOException {
return new RIO( gene_trees,
species_tree,
algorithm,
}
private final static Phylogeny[] parseGeneTrees( final File gene_trees_file ) throws FileNotFoundException,
- IOException {
+ IOException {
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
final PhylogenyParser p = ParserUtils.createParserDependingOnFileType( gene_trees_file, true );
if ( p instanceof NHXParser ) {
if ( o > 0 ) {
if ( verbose ) {
System.out.println( "warning: species tree has " + o
- + " internal nodes with only one descendent which are therefore going to be removed" );
+ + " internal nodes with only one descendent which are therefore going to be removed" );
}
PhylogenyMethods.deleteInternalNodesWithOnlyOneDescendent( species_tree );
}
public class RIOException extends Exception {
/**
- *
+ *
*/
private static final long serialVersionUID = 4691098852783522097L;
public final class TestRIO {
private final static String PATH_TO_TEST_DATA = System.getProperty( "user.dir" ) + ForesterUtil.getFileSeparator()
- + "test_data" + ForesterUtil.getFileSeparator();
+ + "test_data" + ForesterUtil.getFileSeparator();
public static void main( final String[] args ) {
if ( !testRIO_GSDIR() ) {
* Preconditions: Mapping M for external nodes must have been calculated and
* the species tree must be labeled in preorder.
* <p>
- * @param transfer_taxonomy
- * @return
- * @throws SDIException
- *
+ * @param transfer_taxonomy
+ * @return
+ * @throws SDIException
+ *
*/
final static GSDIsummaryResult geneTreePostOrderTraversal( final Phylogeny gene_tree,
final boolean most_parsimonious_duplication_model,
if ( g.isInternal() ) {
if ( g.getNumberOfDescendants() != 2 ) {
throw new SDIException( "gene tree contains internal node with " + g.getNumberOfDescendants()
- + " descendents" );
+ + " descendents" );
}
PhylogenyNode s1 = g.getChildNode1().getLink();
PhylogenyNode s2 = g.getChildNode2().getLink();
if ( g.isInternal() ) {
if ( g.getNumberOfDescendants() != 2 ) {
throw new SDIException( "gene tree contains internal node with " + g.getNumberOfDescendants()
- + " descendents" );
+ + " descendents" );
}
PhylogenyNode s1 = g.getChildNode1().getLink();
PhylogenyNode s2 = g.getChildNode2().getLink();
* This allows for linking of internal nodes of the species tree (as opposed
* to just external nodes, as in the method it overrides.
* If TaxonomyComparisonBase is null, it will try to determine it.
- * @throws SDIException
- *
+ * @throws SDIException
+ *
*/
final static NodesLinkingResult linkNodesOfG( final Phylogeny gene_tree,
final Phylogeny species_tree,
}
else {
throw new SDIException( "taxonomy \"" + g.getNodeData().getTaxonomy()
- + "\" not present in species tree" );
+ + "\" not present in species tree" );
}
}
else {
}\r
if ( gene_tree.getRoot().getNumberOfDescendants() == 2 ) {\r
gene_tree_branches_post_order.add( new PhylogenyBranch( gene_tree.getRoot().getChildNode1(), gene_tree\r
- .getRoot().getChildNode2() ) );\r
+ .getRoot().getChildNode2() ) );\r
}\r
int min_duplications_sum = Integer.MAX_VALUE;\r
int speciations_sum = 0;\r
/**\r
* Places the root of this Phylogeny on Branch b. The new root is always\r
* placed on the middle of the branch b.\r
- * \r
+ *\r
*/\r
static final void reRoot( final PhylogenyBranch b, final Phylogeny phy ) {\r
final PhylogenyNode n1 = b.getFirstNode();\r
// else if ( ( n1.getParent() != null ) && n1.getParent().isRoot()\r
// && ( ( n1.getParent().getChildNode1() == n2 ) || ( n1.getParent().getChildNode2() == n2 ) ) ) {\r
// phy.reRoot( n1 );\r
- // \r
+ //\r
// }\r
else {\r
throw new IllegalArgumentException( "reRoot( Branch b ): b is not a branch." );\r
* "stripTree(Phylogeny,Phylogeny)" of class Phylogeny </ul> <p> The recursion
* part is accomplished by this class' method
* "geneTreePostOrderTraversal(PhylogenyNode)". <p> Requires JDK 1.2 or greater.
- *
+ *
* @see SDI#linkNodesOfG()
- *
+ *
* @see Phylogeny#preorderReID(int)
- *
+ *
* @see
* PhylogenyMethods#taxonomyBasedDeletionOfExternalNodes(Phylogeny,Phylogeny)
- *
+ *
* @see #geneTreePostOrderTraversal(PhylogenyNode)
- *
+ *
* @author Christian M. Zmasek
- *
+ *
* @version 1.102 -- last modified: 10/02/01
*/
public class SDI {
* "computeMappingCost()".
* <p>
* (Last modified: 01/11/01)
- *
+ *
* @see #infer(boolean)
* @see SDI#computeMappingCostL()
* @param gene_tree
* reference to a rooted binary species Phylogeny which might get
* stripped in the process, must have species names in the
* species name fields for all external nodes
- * @throws SDIException
+ * @throws SDIException
*/
public SDI( final Phylogeny gene_tree, final Phylogeny species_tree ) throws SDIException {
if ( species_tree.isEmpty() || gene_tree.isEmpty() ) {
* Reference. Zhang, L. (1997) On a Mirkin-Muchnik-Smith Conjecture for
* Comparing Molecular Phylogenies. Journal of Computational Biology 4
* 177-187.
- *
+ *
* @return the mapping cost "L"
*/
public int computeMappingCostL() {
/**
* Returns the number of duplications.
- *
+ *
* @return number of duplications
*/
public int getDuplicationsSum() {
/**
* Returns the gene tree.
- *
+ *
* @return gene tree
*/
public Phylogeny getGeneTree() {
/**
* Returns the species tree.
- *
+ *
* @return species tree
*/
public Phylogeny getSpeciesTree() {
* the species tree must be labelled in preorder.
* <p>
* (Last modified: 01/11/01)
- *
+ *
* @param g
* starting node of a gene tree - normally the root
*/
* links (sets the field "link" of PhylogenyNode) each external
* PhylogenyNode of gene_tree to the external PhylogenyNode of species_tree
* which has the same species name.
- * @throws SDIException
+ * @throws SDIException
*/
final void linkNodesOfG() throws SDIException {
final Map<String, PhylogenyNode> speciestree_ext_nodes = new HashMap<String, PhylogenyNode>();
final String tax_str = SDIutil.taxonomyToString( s, tax_comp_base );
if ( speciestree_ext_nodes.containsKey( tax_str ) ) {
throw new IllegalArgumentException( "taxonomy [" + s.getNodeData().getTaxonomy()
- + "] is not unique in species phylogeny" );
+ + "] is not unique in species phylogeny" );
}
speciestree_ext_nodes.put( tax_str, s );
}
final PhylogenyNode s = speciestree_ext_nodes.get( tax_str );
if ( s == null ) {
throw new IllegalArgumentException( "taxonomy [" + g.getNodeData().getTaxonomy()
- + "] not present in species tree" );
+ + "] not present in species tree" );
}
g.setLink( s );
}
* To be used ONLY by method "SDIunrooted.fastInfer(Phylogeny,Phylogeny)".
* <p>
* (Last modfied: 10/02/01)
- *
+ *
* @param prev_root_was_dup
* true if the previous root was a duplication, false otherwise
* @param prev_root_c1
final HashMap<String, PhylogenyNode> speciestree_ext_nodes = new HashMap<String, PhylogenyNode>();
if ( _species_tree.getFirstExternalNode().isRoot() ) {
speciestree_ext_nodes.put( _species_tree.getFirstExternalNode().getNodeData().getTaxonomy().getIdentifier()
- .getValue(), _species_tree.getFirstExternalNode() );
+ .getValue(), _species_tree.getFirstExternalNode() );
}
else {
for( final PhylogenyNodeIterator iter = _species_tree.iteratorExternalForward(); iter.hasNext(); ) {
public class SDIException extends Exception {
/**
- *
+ *
*/
private static final long serialVersionUID = 5154733429066500435L;
* <li>Mapping cost L <li>Phylogeny height - which is the largest distance from
* root to external node (minimizing of which is the same as "midpoint rooting")
* </ul>
- *
+ *
* @see SDIse
- *
+ *
* @see SDI
- *
+ *
* @author Christian M. Zmasek
*/
public class SDIR {
/**
* Returns the number of differently rooted trees which minimize the
* (rooting) "criterion" - as determined by method "infer".
- *
+ *
* @see #infer(Phylogeny,Phylogeny,boolean,boolean,boolean,boolean,int,boolean)
* @return number of differently rooted trees which minimized the criterion
*/
* not necessarily zero.
* <p>
* (Last modified: 01/22/00)
- *
+ *
* @see #infer(Phylogeny,Phylogeny,boolean,boolean,boolean,boolean,int,boolean)
* @return the minimal difference in tree heights -- IF calculated by
* "infer"
* <B>IMPORTANT </B>: If the tree is not rooted by minimizing the sum of
* duplications or the mapping cost L, then this number is NOT NECESSARILY
* the MINIMAL number of duplications.
- *
+ *
* @see #infer(Phylogeny,Phylogeny,boolean,boolean,boolean,boolean,int,boolean)
* @return (minimal) number of duplications
*/
* minimize_mapping_cost is set to true.
* <p>
* (Last modified: 11/07/00)
- *
+ *
* @see #infer(Phylogeny,Phylogeny,boolean,boolean,boolean,boolean,int,boolean)
* @return the minimal mapping cost "L" -- IF calculated by "infer"
*/
* first criterion.
* <p>
* (Last modified: 01/12/00)
- *
+ *
* @see #infer(Phylogeny,Phylogeny,boolean,boolean,boolean,boolean,int,boolean)
* @return the minimal tree height -- IF calculated by "infer"
*/
/**
* Returns the sum of times (in ms) needed to run method infer of class SDI.
* Final variable TIME needs to be set to true.
- *
+ *
* @return sum of times (in ms) needed to run method infer of class SDI
*/
public long getTimeSumSDI() {
* </ul>
* <p>
* (Last modified: 10/01/01)
- *
+ *
* @param gene_tree
* a binary (except deepest node) gene Phylogeny
* @param species_tree
* Array) must be no lower than 1
* @return array of rooted Trees with duplication vs. speciation assigned if
* return_trees is set to true, null otherwise
- * @throws SDIException
+ * @throws SDIException
*/
public Phylogeny[] infer( final Phylogeny gene_tree,
final Phylogeny species_tree,
final boolean replace_undescores_in_nhx_trees,
final boolean ignore_quotes_in_nhx_trees,
final TAXONOMY_EXTRACTION taxonomy_extraction_in_nhx_trees )
- throws FileNotFoundException, PhyloXmlDataFormatException, IOException, SDIException {
+ throws FileNotFoundException, PhyloXmlDataFormatException, IOException, SDIException {
Phylogeny species_tree;
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
final PhylogenyParser p = ParserUtils.createParserDependingOnFileType( species_tree_file, true );
switch ( comp_base ) {
case SCIENTIFIC_NAME:
PhylogenyMethods
- .transferNodeNameToField( species_tree,
- PhylogenyMethods.PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME,
- true );
+ .transferNodeNameToField( species_tree,
+ PhylogenyMethods.PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME,
+ true );
break;
case CODE:
PhylogenyMethods.transferNodeNameToField( species_tree,
public final class TestGSDI {
private final static String PATH_TO_TEST_DATA = System.getProperty( "user.dir" ) + ForesterUtil.getFileSeparator()
- + "test_data" + ForesterUtil.getFileSeparator();
+ + "test_data" + ForesterUtil.getFileSeparator();
public static void main( final String[] args ) {
if ( !TestGSDI.testGSDI_against_binary_gene_tree() ) {
//--
final Phylogeny tol_143_ = ParserUtils.readPhylogenies( PATH_TO_TEST_DATA + "tol_143.xml" )[ 0 ];
final Phylogeny gene_tree_tax_code_4_ = ParserUtils.readPhylogenies( PATH_TO_TEST_DATA
- + "gene_tree_tax_code_4.xml" )[ 0 ];
+ + "gene_tree_tax_code_4.xml" )[ 0 ];
final GSDI gsdi_143_4_1 = new GSDI( gene_tree_tax_code_4_.copy(), tol_143_.copy(), false, true, true );
if ( gsdi_143_4_1.getDuplicationsSum() != 21 ) {
return false;
}
//--
final Phylogeny gsdi_test_gene_tree_sn_wnt = ParserUtils.readPhylogenies( PATH_TO_TEST_DATA
- + "gsdi_test_gene_tree_sn_wnt.xml" )[ 0 ];
+ + "gsdi_test_gene_tree_sn_wnt.xml" )[ 0 ];
gsdi_test_gene_tree_sn_wnt.setRooted( true );
final GSDI a = new GSDI( gsdi_test_gene_tree_sn_wnt.copy(), tol_143_.copy(), false, true, true );
if ( a.getDuplicationsSum() != 33 ) {
}
//--
final Phylogeny gsdi_test_species_tree_sn_xml = ParserUtils.readPhylogenies( PATH_TO_TEST_DATA
- + "gsdi_test_species_tree_sn.xml" )[ 0 ];
+ + "gsdi_test_species_tree_sn.xml" )[ 0 ];
final GSDI b = new GSDI( gsdi_test_gene_tree_sn_wnt.copy(),
gsdi_test_species_tree_sn_xml.copy(),
false,
}
//--
final Phylogeny gsdi_test_gene_tree_codes_xml = ParserUtils.readPhylogenies( PATH_TO_TEST_DATA
- + "gsdi_test_gene_tree_codes.xml" )[ 0 ];
+ + "gsdi_test_gene_tree_codes.xml" )[ 0 ];
final Phylogeny gsdi_test_species_tree_codes_xml = ParserUtils.readPhylogenies( PATH_TO_TEST_DATA
- + "gsdi_test_species_tree_codes.xml" )[ 0 ];
+ + "gsdi_test_species_tree_codes.xml" )[ 0 ];
final GSDI d = new GSDI( gsdi_test_gene_tree_codes_xml.copy(),
gsdi_test_species_tree_codes_xml.copy(),
false,
}
//--
final Phylogeny gsdi_test_gene_tree_sn_xml = ParserUtils.readPhylogenies( PATH_TO_TEST_DATA
- + "gsdi_test_gene_tree_sn.xml" )[ 0 ];
+ + "gsdi_test_gene_tree_sn.xml" )[ 0 ];
final GSDI e = new GSDI( gsdi_test_gene_tree_sn_xml.copy(),
gsdi_test_species_tree_sn_xml.copy(),
false,
/**
* Only use if you know what you are doing!
- *
+ *
*/
public BasicSequence( final String identifier, final String mol_sequence, final TYPE type ) {
if ( ForesterUtil.isEmpty( identifier ) ) {
/**
* Only use if you know what you are doing!
- *
+ *
*/
public BasicSequence( final String identifier, final char[] mol_sequence, final TYPE type ) {
if ( ForesterUtil.isEmpty( identifier ) ) {
public static MolecularSequence createAaSequence( final String identifier, final String mol_sequence ) {
return new BasicSequence( identifier, mol_sequence.toUpperCase().replaceAll( "\\.", GAP_STR )
- .replaceAll( AA_REGEXP, Character.toString( UNSPECIFIED_AA ) ), TYPE.AA );
+ .replaceAll( AA_REGEXP, Character.toString( UNSPECIFIED_AA ) ), TYPE.AA );
}
public static MolecularSequence createDnaSequence( final String identifier, final String mol_sequence ) {
return new BasicSequence( identifier, mol_sequence.toUpperCase().replaceAll( "\\.", GAP_STR )
- .replaceAll( DNA_REGEXP, Character.toString( UNSPECIFIED_NUC ) ), TYPE.DNA );
+ .replaceAll( DNA_REGEXP, Character.toString( UNSPECIFIED_NUC ) ), TYPE.DNA );
}
public static MolecularSequence createRnaSequence( final String identifier, final String mol_sequence ) {
return new BasicSequence( identifier, mol_sequence.toUpperCase().replaceAll( "\\.", GAP_STR )
- .replaceAll( RNA_REGEXP, Character.toString( UNSPECIFIED_NUC ) ), TYPE.RNA );
+ .replaceAll( RNA_REGEXP, Character.toString( UNSPECIFIED_NUC ) ), TYPE.RNA );
}
@Override
private static final Comparator<CombinableDomains> DESCENDING_COMBINATIONS_COUNT_ORDER = new Comparator<CombinableDomains>() {
- @Override
- public int compare( final CombinableDomains d1,
- final CombinableDomains d2 ) {
- if ( d1.getNumberOfCombinableDomains() < d2
- .getNumberOfCombinableDomains() ) {
- return 1;
- }
- else if ( d1
- .getNumberOfCombinableDomains() > d2
- .getNumberOfCombinableDomains() ) {
- return -1;
- }
- else {
- return d1
- .getKeyDomain()
- .compareTo( d2
- .getKeyDomain() );
- }
- }
- };
+ @Override
+ public int compare( final CombinableDomains d1,
+ final CombinableDomains d2 ) {
+ if ( d1.getNumberOfCombinableDomains() < d2
+ .getNumberOfCombinableDomains() ) {
+ return 1;
+ }
+ else if ( d1
+ .getNumberOfCombinableDomains() > d2
+ .getNumberOfCombinableDomains() ) {
+ return -1;
+ }
+ else {
+ return d1
+ .getKeyDomain()
+ .compareTo( d2
+ .getKeyDomain() );
+ }
+ }
+ };
private static final Comparator<CombinableDomains> DESCENDING_KEY_DOMAIN_COUNT_ORDER = new Comparator<CombinableDomains>() {
- @Override
- public int compare( final CombinableDomains d1,
- final CombinableDomains d2 ) {
- if ( d1.getKeyDomainCount() < d2
- .getKeyDomainCount() ) {
- return 1;
- }
- else if ( d1
- .getKeyDomainCount() > d2
- .getKeyDomainCount() ) {
- return -1;
- }
- else {
- return d1
- .getKeyDomain()
- .compareTo( d2
- .getKeyDomain() );
- }
- }
- };
+ @Override
+ public int compare( final CombinableDomains d1,
+ final CombinableDomains d2 ) {
+ if ( d1.getKeyDomainCount() < d2
+ .getKeyDomainCount() ) {
+ return 1;
+ }
+ else if ( d1
+ .getKeyDomainCount() > d2
+ .getKeyDomainCount() ) {
+ return -1;
+ }
+ else {
+ return d1
+ .getKeyDomain()
+ .compareTo( d2
+ .getKeyDomain() );
+ }
+ }
+ };
private static final Comparator<CombinableDomains> DESCENDING_KEY_DOMAIN_PROTEINS_COUNT_ORDER = new Comparator<CombinableDomains>() {
- @Override
- public int compare( final CombinableDomains d1,
- final CombinableDomains d2 ) {
- if ( d1.getKeyDomainProteinsCount() < d2
- .getKeyDomainProteinsCount() ) {
- return 1;
- }
- else if ( d1
- .getKeyDomainProteinsCount() > d2
- .getKeyDomainProteinsCount() ) {
- return -1;
- }
- else {
- return d1
- .getKeyDomain()
- .compareTo( d2
- .getKeyDomain() );
- }
- }
- };
+ @Override
+ public int compare( final CombinableDomains d1,
+ final CombinableDomains d2 ) {
+ if ( d1.getKeyDomainProteinsCount() < d2
+ .getKeyDomainProteinsCount() ) {
+ return 1;
+ }
+ else if ( d1
+ .getKeyDomainProteinsCount() > d2
+ .getKeyDomainProteinsCount() ) {
+ return -1;
+ }
+ else {
+ return d1
+ .getKeyDomain()
+ .compareTo( d2
+ .getKeyDomain() );
+ }
+ }
+ };
final private SortedMap<String, CombinableDomains> _combinable_domains_map;
final private DomainCombinationType _dc_type;
final private Species _species;
return toStringBuilder( GenomeWideCombinableDomainsSortOrder.ALPHABETICAL_KEY_ID ).toString();
}
- // Produces something like:
- // 2-oxoacid_dh 5 5 2 Biotin_lipoyl [4], E3_binding [3]
- @Override
- public StringBuilder toStringBuilder( final GenomeWideCombinableDomainsSortOrder sort_order ) {
+ // Produces something like:
+ // 2-oxoacid_dh 5 5 2 Biotin_lipoyl [4], E3_binding [3]
+ @Override
+ public StringBuilder toStringBuilder( final GenomeWideCombinableDomainsSortOrder sort_order ) {
final StringBuilder sb = new StringBuilder();
final List<CombinableDomains> combinable_domains = new ArrayList<CombinableDomains>();
for( final String key : getAllCombinableDomainsIds().keySet() ) {
for( final Protein protein : protein_list ) {
if ( !protein.getSpecies().equals( species ) ) {
throw new IllegalArgumentException( "species (" + protein.getSpecies()
- + ") does not match species of combinable domains collection (" + species + ")" );
+ + ") does not match species of combinable domains collection (" + species + ")" );
}
final Set<String> saw_i = new HashSet<String>();
final Set<String> saw_c = new HashSet<String>();
saw_j.add( id );
if ( dc_type != DomainCombinationType.DIRECTED_ADJACTANT ) {
domain_combination
- .addCombinableDomain( protein.getProteinDomain( j ).getDomainId() );
+ .addCombinableDomain( protein.getProteinDomain( j ).getDomainId() );
}
else {
if ( closest == null ) {
/**
* To add a new combinable domain.
- *
+ *
* @param protein_domain
*/
public void addCombinableDomain( final String protein_domain );
* Returns the combinable domain identifiers sorted in alphabetical manner: -
* keys are the combinable domain identifiers - values are the counts of
* proteins exhibiting a particular combination
- *
+ *
* @return combining domain identifiers sorted in alphabetical manner
*/
public SortedMap<String, Integer> getCombinableDomainsIds();
/**
* Returns the domain whose combinable domains are in stored in this
* combinable domains.
- *
+ *
* @return the domain identifier
*/
public String getKeyDomain();
/**
* Returns how many times the key domain is present in a given species
* genome.
- *
+ *
* @return key domain count in species
*/
public int getKeyDomainCount();
/**
* Returns how many proteins with the key domain are present in a given
* species genome.
- *
+ *
* @return key domain proteins count in species
*/
public int getKeyDomainProteinsCount();
/**
* Returns the species of this combinable domains.
- *
+ *
* @return the species
*/
public Species getSpecies();
void addKeyDomainProtein( String protein );
/**
- *
+ *
* This must return all domains in this set of combinable domains (i.e.
* the key domain and all domains which can combine with the key domain).
- *
+ *
* @return all domains
*/
List<String> getAllDomains();
/**
* Sets how many times the key domain is present in a given species genome.
- *
+ *
* @param key_domain_count
* key domain count in species
*/
/**
* counts_difference: (counts for domain 1) minus (counts for domain 2).
- *
- *
+ *
+ *
* @param counts_difference value of domain_1 minus value of domain_2
* @param counts_sum
*/
/**
* Returns (counts for domain 1) minus (counts for domain 2).
- *
+ *
*/
@Override
public int getDifferenceInCounts() {
}
/**
- * This returns a score between 0.0 (no binary domain combination in common)
+ * This returns a score between 0.0 (no binary domain combination in common)
* and 1.0 (all binary domain combinations in common) measuring the similarity between two
* genomes based on the number of shared binary domain combinations:
- *
+ *
* t: sum of (distinct) binary domain combinations
* s: sum of shared (distinct) binary domain combinations
*
* 1 - ( ( t - s ) / t )
- *
- * @return shared binary domain combinations based similarity score
+ *
+ * @return shared binary domain combinations based similarity score
*/
public double calculateSharedBinaryDomainCombinationBasedGenomeSimilarityScore() {
final double t = getAllBinaryDomainCombinations().size();
}
/**
- * This returns a score between 0.0 (no domains in common)
+ * This returns a score between 0.0 (no domains in common)
* and 1.0 (all domains in common) measuring the similarity between two
* genomes based on the number of shared domains:
- *
+ *
* t: sum of (distinct) domains
* s: sum of shared (distinct) domains
*
* 1 - ( ( t - s ) / t )
- *
- * @return shared domains based similarity score
+ *
+ * @return shared domains based similarity score
*/
public double calculateSharedDomainsBasedGenomeSimilarityScore() {
final double t = getAllDomains().size();
/**
* Does not return binary combinations which contain one or two domains
* to be ignored -- if ignoring is allowed.
- *
+ *
* @return SortedSet<BinaryDomainCombination>
*/
public Set<BinaryDomainCombination> getAllBinaryDomainCombinations() {
/**
* Does not return domains which are to be
* ignored -- if ignoring is allowed.
- *
- *
+ *
+ *
* @return
*/
public Set<String> getAllDomains() {
if ( high_copy_base_species.contains( high_copy_target_species )
|| low_copy_species.contains( high_copy_target_species ) ) {
throw new IllegalArgumentException( "species [" + high_copy_target_species
- + "] appears in other list as well" );
+ + "] appears in other list as well" );
}
if ( min_diff < 0 ) {
throw new IllegalArgumentException( "attempt to use negative addition [" + min_diff + "]" );
writeGoIdsToFile( passing_gos_writer, go_ids_of_passing_domains );
}
- //FIXME really needs to be tested!
+ //FIXME really needs to be tested!
private static void addCounts( final SortedMap<BinaryDomainCombination, List<Integer>> copy_counts,
final BinaryDomainCombination dc,
final GenomeWideCombinableDomains genome,
private static void appendGoTerm( final StringBuilder sb, final GoTerm go_term ) {
final GoId go_id = go_term.getGoId();
sb.append( "<a href=\"" + SurfacingConstants.AMIGO_LINK + go_id + "\" target=\"amigo_window\">" + go_id
- + "</a>" );
+ + "</a>" );
sb.append( ":" );
sb.append( go_term.getName() );
sb.append( " [" );
final SortedMap<BinaryDomainCombination, Double> low_copy_values,
final SortedSet<BinaryDomainCombination> all_bdcs,
final Map<String, Set<BinaryDomainCombination>> bdcs_per_genome )
- throws IOException {
+ throws IOException {
int counter = 0;
int total_absense_counter = 0;
int not_total_absense_counter = 0;
}
++counter;
html_writer.write( "<tr><td><a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + bdc.getId0()
- + "\">" + bdc.getId0() + "</a> = <a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK
- + bdc.getId1() + "\">" + bdc.getId1() + "</a>" );
+ + "\">" + bdc.getId0() + "</a> = <a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK
+ + bdc.getId1() + "\">" + bdc.getId1() + "</a>" );
html_writer.write( "</td><td>" );
html_writer.write( "<table>" );
for( final GenomeWideCombinableDomains genome : genomes ) {
bdcs_per_genome,
species,
html_writer,
- "#0000FF" );
+ "#0000FF" );
html_writer.write( "</tr>" );
}
else if ( low_copy_species.contains( species ) ) {
bdcs_per_genome,
species,
html_writer,
- "#A0A0A0" );
+ "#A0A0A0" );
html_writer.write( "</tr>" );
}
else if ( high_copy_base_species.contains( species ) ) {
bdcs_per_genome,
species,
html_writer,
- "#404040" );
+ "#404040" );
html_writer.write( "</tr>" );
}
}
final SortedSet<String> all_domains,
final SortedSet<GoId> go_ids_of_passing_domains,
final SortedMap<Species, List<Protein>> protein_lists_per_species )
- throws IOException {
+ throws IOException {
int counter = 0;
int total_absense_counter = 0;
int not_total_absense_counter = 0;
plain_writer.write( domain_id );
plain_writer.write( SurfacingConstants.NL );
html_writer.write( "<tr><td><a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + domain_id
- + "\">" + domain_id + "</a></td><td>" );
+ + "\">" + domain_id + "</a></td><td>" );
html_writer.write( addGoInformation( domain_id, domain_id_to_go_ids_map, go_id_to_term_map )
- .toString() );
+ .toString() );
html_writer.write( "</td><td>" );
html_writer.write( "<table>" );
for( final GenomeWideCombinableDomains genome : genomes ) {
species,
plain_writer,
html_writer,
- "#0000FF" );
+ "#0000FF" );
html_writer.write( "</tr>" );
}
else if ( low_copy_species.contains( species ) ) {
species,
plain_writer,
html_writer,
- "#A0A0A0" );
+ "#A0A0A0" );
html_writer.write( "</tr>" );
}
else if ( high_copy_base_species.contains( species ) ) {
species,
plain_writer,
html_writer,
- "#404040" );
+ "#404040" );
html_writer.write( "</tr>" );
}
}
final SortedMap<Species, List<Protein>> protein_lists_per_species,
final String domain_id ) throws IOException {
final File my_proteins_file = new File( proteins_file_base.getParentFile() + ForesterUtil.FILE_SEPARATOR
- + domain_id + PLUS_MINUS_PROTEINS_FILE_DOM_SUFFIX );
+ + domain_id + PLUS_MINUS_PROTEINS_FILE_DOM_SUFFIX );
SurfacingUtil.checkForOutputFileWriteability( my_proteins_file );
final Writer proteins_file_writer = new BufferedWriter( new FileWriter( my_proteins_file ) );
SurfacingUtil.extractProteinNames( protein_lists_per_species,
/**
* Returns descriptive statistics based on the arithmetic means
- * for each species.
- *
- *
+ * for each species.
+ *
+ *
* @return
*/
public DescriptiveStatistics calculateMeanBasedStatistics() {
}
/**
- *
+ *
* Note. This is not technically a Z-score since the distribution
* of means is unknown (and not normal).
- *
+ *
* @param species
* @return
*/
private void addDomainLengths( final DomainLengths domain_lengths ) {
if ( getDomainLengths().containsKey( domain_lengths.getDomainId() ) ) {
throw new IllegalArgumentException( "domain lengths for [" + domain_lengths.getDomainId()
- + "] already added" );
+ + "] already added" );
}
getDomainLengths().put( domain_lengths.getDomainId(), domain_lengths );
}
throw new IllegalArgumentException( "binary states matrix number of identifiers is not equal to the number of tree nodes provided" );
}
final CharacterStateMatrix<GainLossStates> gl_matrix = new BasicCharacterStateMatrix<GainLossStates>( binary_states_matrix
- .getNumberOfIdentifiers(),
- binary_states_matrix
- .getNumberOfCharacters() );
+ .getNumberOfIdentifiers(),
+ binary_states_matrix
+ .getNumberOfCharacters() );
int total_gains = 0;
int total_losses = 0;
int total_unchanged = 0;
final PhylogenyNode node = it.next();
final String name = node.getName();
final BinaryStates bin_state = binary_states_matrix.getState( binary_states_matrix
- .getIdentifierIndex( name ), c );
+ .getIdentifierIndex( name ), c );
final PhylogenyNode parent_node = getPhylogeny().getNode( name ).getParent();
GainLossStates gl_state = null;
if ( node.isRoot() ) {
}
else {
final BinaryStates parent_bin_state = binary_states_matrix.getState( binary_states_matrix
- .getIdentifierIndex( parent_node.getName() ), c );
+ .getIdentifierIndex( parent_node.getName() ), c );
if ( bin_state == BinaryStates.ABSENT ) {
if ( parent_bin_state == BinaryStates.ABSENT ) {
++total_unchanged;
final List<GenomeWideCombinableDomains> gwcd_list ) {
if ( phylogeny.getNumberOfExternalNodes() != gwcd_list.size() ) {
throw new IllegalArgumentException( "number of external nodes [" + phylogeny.getNumberOfExternalNodes()
- + "] does not equal size of genome wide combinable domains list [" + gwcd_list.size() + "]" );
+ + "] does not equal size of genome wide combinable domains list [" + gwcd_list.size() + "]" );
}
return new DomainParsimonyCalculator( phylogeny, gwcd_list );
}
}
final int number_of_characters = all_binary_combinations.size();
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> matrix = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( number_of_identifiers,
- number_of_characters );
+ number_of_characters );
int character_index = 0;
for( final BinaryDomainCombination bc : all_binary_combinations ) {
matrix.setCharacter( character_index++, bc.toString() );
}
int number_of_characters = all_domain_ids.size();
if ( positive_filter != null ) {
- //number_of_characters = positive_filter.size(); -- bad if doms in filter but not in genomes
+ //number_of_characters = positive_filter.size(); -- bad if doms in filter but not in genomes
number_of_characters = 0;
for( final String id : all_domain_ids ) {
if ( positive_filter.contains( id ) ) {
}
}
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> matrix = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( number_of_identifiers,
- number_of_characters );
+ number_of_characters );
int character_index = 0;
for( final String id : all_domain_ids ) {
if ( positive_filter == null ) {
}
if ( !no_mappings.isEmpty() ) {
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 );
}
}
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 );
+ number_of_characters );
int character_index = 0;
for( final BinaryDomainCombination bc : all_binary_combinations_mapped ) {
matrix.setCharacter( character_index++, bc.toString() );
/**
* For folds instead of Pfam-domains, for example
- *
- *
+ *
+ *
* @param gwcd_list
* @return
*/
}
final int number_of_characters = all_secondary_features.size();
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> matrix = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( number_of_identifiers,
- number_of_characters );
+ number_of_characters );
int character_index = 0;
for( final String second_id : all_secondary_features ) {
matrix.setCharacter( character_index++, second_id );
final int s = species_data.size();
if ( ( ( s * s ) - s ) != ( getN() * 2 ) ) {
throw new IllegalArgumentException( "illegal species count and n: species count:" + s + ", n:" + _n
- + " for domain " + combinable_domains.getKeyDomain() );
+ + " for domain " + combinable_domains.getKeyDomain() );
}
if ( s > 2 ) {
if ( getMaximalDifferenceInCounts() < 0 ) {
/**
* For pairwise similarities, this should return the "difference"; for example the difference in counts
* for copy number based features (the same as getMaximalDifferenceInCounts(), or the number
- * of actually different domain combinations.
+ * of actually different domain combinations.
* For pairwise similarities, this should return the difference,
* while for comparisons of more than two domains, this should return the maximal difference
- *
+ *
*/
public int getMaximalDifference() {
return _max_difference;
* For pairwise similarities, this should return the difference in counts,
* while for comparisons of more than two domains, this should return the maximal difference
* in counts
- *
- *
+ *
+ *
* @return the (maximal) difference in counts
*/
public int getMaximalDifferenceInCounts() {
/**
* This should return the number of pairwise distances used to calculate
* this similarity score
- *
+ *
* @return the number of pairwise distances
*/
public int getN() {
/**
* This should return a map, which maps species names to
* SpeciesSpecificDomainSimilariyData
- *
- *
+ *
+ *
* @return SortedMap<String, SpeciesSpecificDomainSimilariyData>
*/
public SortedMap<Species, SpeciesSpecificDcData> getSpeciesData() {
sb.append( "</td>" );
sb.append( "<td>" );
sb.append( "<a href=\"" + SurfacingConstants.GOOGLE_SCHOLAR_SEARCH + getDomainId()
- + "\" target=\"gs_window\">gs</a>" );
+ + "\" target=\"gs_window\">gs</a>" );
sb.append( "</td>" );
if ( getMaximalSimilarityScore() > 0 ) {
sb.append( "<td>" );
final boolean ignore_domains_without_combinations_in_any_genome,
final boolean ignore_domains_specific_to_one_genome );;
- public static enum Detailedness {
- BASIC, LIST_COMBINING_DOMAIN_FOR_EACH_SPECIES, PUNCTILIOUS
- }
+ public static enum Detailedness {
+ BASIC, LIST_COMBINING_DOMAIN_FOR_EACH_SPECIES, PUNCTILIOUS
+ }
- public static enum GoAnnotationOutput {
- ALL, NONE
- }
+ public static enum GoAnnotationOutput {
+ ALL, NONE
+ }
}
/**
* This should return all domains ids present in the genome.
- *
+ *
* @return a sorted set of domains ids
*/
public SortedSet<String> getAllDomainIds();
public DomainCombinationType getDomainCombinationType();
/**
- * This should return a statistic for per domain
+ * This should return a statistic for per domain
* promiscuity in a genome.
- *
+ *
* @return descriptive statistics for per domain promiscuity in a genome
*/
public DescriptiveStatistics getPerGenomeDomainPromiscuityStatistics();
/**
* This should return all binary domain combinations present in the genome.
- *
+ *
* @return a sorted set of binary domain combinations
*/
public SortedSet<BinaryDomainCombination> toBinaryDomainCombinations();
* This should return the -- not normalized, not absolute -- difference in
* counts (for example domain counts) for the two domains.
* It is important that it is: (counts for domain 1) minus (counts for domain 2).
- *
+ *
* @return the difference in counts
*/
public int getDifferenceInCounts();
if ( ( list_of_genome_wide_combinable_domains.get( i ).getSize() < 1 )
|| ( list_of_genome_wide_combinable_domains.get( j ).getSize() < 1 ) ) {
domain_distance_scores_means
- .setValue( i, j, DomainArchitectureBasedGenomeSimilarityCalculator.MAX_SIMILARITY_SCORE );
+ .setValue( i, j, DomainArchitectureBasedGenomeSimilarityCalculator.MAX_SIMILARITY_SCORE );
shared_domains_based_distances
- .setValue( i, j, DomainArchitectureBasedGenomeSimilarityCalculator.MAX_SIMILARITY_SCORE );
+ .setValue( i, j, DomainArchitectureBasedGenomeSimilarityCalculator.MAX_SIMILARITY_SCORE );
shared_binary_combinations_based_distances
- .setValue( i, j, DomainArchitectureBasedGenomeSimilarityCalculator.MAX_SIMILARITY_SCORE );
+ .setValue( i, j, DomainArchitectureBasedGenomeSimilarityCalculator.MAX_SIMILARITY_SCORE );
continue;
}
final List<GenomeWideCombinableDomains> genome_pair = new ArrayList<GenomeWideCombinableDomains>( 2 );
.calculateDescriptiveStatisticsForMeanValues( similarities );
final String species_j = species[ j ].getSpeciesId();
final DomainArchitectureBasedGenomeSimilarityCalculator genome_similarity_calculator = new DomainArchitectureBasedGenomeSimilarityCalculator( list_of_genome_wide_combinable_domains
- .get( i ),
+ .get( i ),
list_of_genome_wide_combinable_domains
- .get( j ) );
+ .get( j ) );
genome_similarity_calculator.setAllowDomainsToBeIgnored( false );
double dissimilarity_score_mean;
if ( stats.getN() < 1 ) {
genome_pair.add( list_of_genome_wide_combinable_domains.get( i ) );
genome_pair.add( list_of_genome_wide_combinable_domains.get( j ) );
final DomainArchitectureBasedGenomeSimilarityCalculator genome_simiarity_calculator = new DomainArchitectureBasedGenomeSimilarityCalculator( list_of_genome_wide_combinable_domains
- .get( i ),
+ .get( i ),
list_of_genome_wide_combinable_domains
- .get( j ) );
+ .get( j ) );
genome_simiarity_calculator.setAllowDomainsToBeIgnored( true );
genome_simiarity_calculator.setDomainIdsToIgnore( domain_ids_to_ignore );
shared_domains_based_distances.setValue( i, j, 1.0 - genome_simiarity_calculator
- .calculateSharedDomainsBasedGenomeSimilarityScore() );
+ .calculateSharedDomainsBasedGenomeSimilarityScore() );
shared_binary_combinations_based_distances.setValue( i, j, 1.0 - genome_simiarity_calculator
- .calculateSharedBinaryDomainCombinationBasedGenomeSimilarityScore() );
+ .calculateSharedBinaryDomainCombinationBasedGenomeSimilarityScore() );
}
}
getSharedDomainsBasedDistances().add( shared_domains_based_distances );
sb.append( " " );
if ( html ) {
sb.append( "<a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + domain_id + "\">" + domain_id
- + "</a>" );
+ + "</a>" );
}
else {
sb.append( domain_id );
/**
* This should return a sorted map mapping domain ids to their corresponding
* counts
- *
+ *
* @return a sorted map mapping domain ids to their corresponding counts
*/
public SortedMap<String, Integer> getCombinableDomainIdToCountsMap();
private final static Map<String, String> _TAXCODE_TAXGROUP_MAP = new HashMap<String, String>();
private static final Comparator<Domain> ASCENDING_CONFIDENCE_VALUE_ORDER = new Comparator<Domain>() {
- @Override
- public int compare( final Domain d1,
- final Domain d2 ) {
- if ( d1.getPerDomainEvalue() < d2
- .getPerDomainEvalue() ) {
- return -1;
- }
- else if ( d1.getPerDomainEvalue() > d2
- .getPerDomainEvalue() ) {
- return 1;
- }
- else {
- return d1.compareTo( d2 );
- }
- }
- };
+ @Override
+ public int compare( final Domain d1,
+ final Domain d2 ) {
+ if ( d1.getPerDomainEvalue() < d2
+ .getPerDomainEvalue() ) {
+ return -1;
+ }
+ else if ( d1.getPerDomainEvalue() > d2
+ .getPerDomainEvalue() ) {
+ return 1;
+ }
+ else {
+ return d1.compareTo( d2 );
+ }
+ }
+ };
private final static NumberFormat FORMATTER_3 = new DecimalFormat( "0.000" );
private SurfacingUtil() {
|| ( !get_gains && ( matrix.getState( id, c ) == CharacterStateMatrix.GainLossStates.LOSS ) ) ) {
if ( dc_type == BinaryDomainCombination.DomainCombinationType.DIRECTED_ADJACTANT ) {
all_binary_domains_combination_gained.add( AdjactantDirectedBinaryDomainCombination
- .obtainInstance( matrix.getCharacter( c ) ) );
+ .obtainInstance( matrix.getCharacter( c ) ) );
}
else if ( dc_type == BinaryDomainCombination.DomainCombinationType.DIRECTED ) {
all_binary_domains_combination_gained.add( DirectedBinaryDomainCombination
- .obtainInstance( matrix.getCharacter( c ) ) );
+ .obtainInstance( matrix.getCharacter( c ) ) );
}
else {
all_binary_domains_combination_gained.add( BasicBinaryDomainCombination.obtainInstance( matrix
- .getCharacter( c ) ) );
+ .getCharacter( c ) ) );
}
}
}
final String my_outfile,
final Map<Character, Writer> split_writers ) throws IOException {
split_writers.put( 'a', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_A.html" ) ) );
+ + "_domains_A.html" ) ) );
split_writers.put( 'b', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_B.html" ) ) );
+ + "_domains_B.html" ) ) );
split_writers.put( 'c', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_C.html" ) ) );
+ + "_domains_C.html" ) ) );
split_writers.put( 'd', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_D.html" ) ) );
+ + "_domains_D.html" ) ) );
split_writers.put( 'e', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_E.html" ) ) );
+ + "_domains_E.html" ) ) );
split_writers.put( 'f', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_F.html" ) ) );
+ + "_domains_F.html" ) ) );
split_writers.put( 'g', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_G.html" ) ) );
+ + "_domains_G.html" ) ) );
split_writers.put( 'h', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_H.html" ) ) );
+ + "_domains_H.html" ) ) );
split_writers.put( 'i', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_I.html" ) ) );
+ + "_domains_I.html" ) ) );
split_writers.put( 'j', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_J.html" ) ) );
+ + "_domains_J.html" ) ) );
split_writers.put( 'k', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_K.html" ) ) );
+ + "_domains_K.html" ) ) );
split_writers.put( 'l', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_L.html" ) ) );
+ + "_domains_L.html" ) ) );
split_writers.put( 'm', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_M.html" ) ) );
+ + "_domains_M.html" ) ) );
split_writers.put( 'n', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_N.html" ) ) );
+ + "_domains_N.html" ) ) );
split_writers.put( 'o', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_O.html" ) ) );
+ + "_domains_O.html" ) ) );
split_writers.put( 'p', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_P.html" ) ) );
+ + "_domains_P.html" ) ) );
split_writers.put( 'q', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_Q.html" ) ) );
+ + "_domains_Q.html" ) ) );
split_writers.put( 'r', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_R.html" ) ) );
+ + "_domains_R.html" ) ) );
split_writers.put( 's', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_S.html" ) ) );
+ + "_domains_S.html" ) ) );
split_writers.put( 't', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_T.html" ) ) );
+ + "_domains_T.html" ) ) );
split_writers.put( 'u', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_U.html" ) ) );
+ + "_domains_U.html" ) ) );
split_writers.put( 'v', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_V.html" ) ) );
+ + "_domains_V.html" ) ) );
split_writers.put( 'w', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_W.html" ) ) );
+ + "_domains_W.html" ) ) );
split_writers.put( 'x', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_X.html" ) ) );
+ + "_domains_X.html" ) ) );
split_writers.put( 'y', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_Y.html" ) ) );
+ + "_domains_Y.html" ) ) );
split_writers.put( 'z', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_Z.html" ) ) );
+ + "_domains_Z.html" ) ) );
split_writers.put( '0', new BufferedWriter( new FileWriter( out_dir + ForesterUtil.FILE_SEPARATOR + my_outfile
- + "_domains_0.html" ) ) );
+ + "_domains_0.html" ) ) );
}
public static Map<String, Integer> createTaxCodeToIdMap( final Phylogeny phy ) {
/**
* Warning: This side-effects 'all_bin_domain_combinations_encountered'!
- *
- *
+ *
+ *
* @param output_file
* @param all_bin_domain_combinations_changed
* @param sum_of_all_domains_encountered
* @param all_bin_domain_combinations_encountered
* @param is_gains_analysis
- * @param protein_length_stats_by_dc
+ * @param protein_length_stats_by_dc
* @throws IOException
*/
public static void executeFitchGainsAnalysis( final File output_file,
}
if ( is_gains_analysis ) {
out.write( "Sum of all distinct domain combinations appearing once : " + one
- + ForesterUtil.LINE_SEPARATOR );
+ + ForesterUtil.LINE_SEPARATOR );
out.write( "Sum of all distinct domain combinations appearing more than once : " + above_one
- + ForesterUtil.LINE_SEPARATOR );
+ + ForesterUtil.LINE_SEPARATOR );
out.write( "Sum of all distinct domains in combinations apppearing only once : "
+ all_domains_in_combination_changed_only_once.size() + ForesterUtil.LINE_SEPARATOR );
out.write( "Sum of all distinct domains in combinations apppearing more than once: "
}
else {
out.write( "Sum of all distinct domain combinations never lost : " + never_lost
- + ForesterUtil.LINE_SEPARATOR );
+ + ForesterUtil.LINE_SEPARATOR );
out.write( "Sum of all distinct domain combinations lost once : " + one
- + ForesterUtil.LINE_SEPARATOR );
+ + ForesterUtil.LINE_SEPARATOR );
out.write( "Sum of all distinct domain combinations lost more than once : " + above_one
- + ForesterUtil.LINE_SEPARATOR );
+ + ForesterUtil.LINE_SEPARATOR );
out.write( "Sum of all distinct domains in combinations lost only once : "
+ all_domains_in_combination_changed_only_once.size() + ForesterUtil.LINE_SEPARATOR );
out.write( "Sum of all distinct domains in combinations lost more than once: "
+ all_domains_in_combination_changed_more_than_once.size() + ForesterUtil.LINE_SEPARATOR );
}
out.write( "All binary combinations : " + all
- + ForesterUtil.LINE_SEPARATOR );
+ + ForesterUtil.LINE_SEPARATOR );
out.write( "All domains : "
+ sum_of_all_domains_encountered );
out.close();
ForesterUtil.programMessage( surfacing.PRG_NAME,
"Wrote fitch domain combination dynamics counts analysis to \"" + output_file
- + "\"" );
+ + "\"" );
}
/**
- *
- * @param all_binary_domains_combination_lost_fitch
- * @param use_last_in_fitch_parsimony
- * @param perform_dc_fich
- * @param consider_directedness_and_adjacency_for_bin_combinations
+ *
+ * @param all_binary_domains_combination_lost_fitch
+ * @param use_last_in_fitch_parsimony
+ * @param perform_dc_fich
+ * @param consider_directedness_and_adjacency_for_bin_combinations
* @param all_binary_domains_combination_gained if null ignored, otherwise this is to list all binary domain combinations
* which were gained under unweighted (Fitch) parsimony.
*/
domain_parsimony.executeDolloParsimonyOnDomainPresence();
}
SurfacingUtil.writeMatrixToFile( domain_parsimony.getGainLossMatrix(), outfile_name
- + surfacing.PARSIMONY_OUTPUT_GL_SUFFIX_DOLLO_DOMAINS, Format.FORESTER );
+ + surfacing.PARSIMONY_OUTPUT_GL_SUFFIX_DOLLO_DOMAINS, Format.FORESTER );
SurfacingUtil.writeMatrixToFile( domain_parsimony.getGainLossCountsMatrix(), outfile_name
- + surfacing.PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_DOLLO_DOMAINS, Format.FORESTER );
+ + surfacing.PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_DOLLO_DOMAINS, Format.FORESTER );
SurfacingUtil.writeBinaryStatesMatrixAsListToFile( domain_parsimony.getGainLossMatrix(),
CharacterStateMatrix.GainLossStates.GAIN,
outfile_name + surfacing.PARSIMONY_OUTPUT_DOLLO_GAINS_D,
ForesterUtil.LINE_SEPARATOR,
null );
SurfacingUtil.writeBinaryStatesMatrixAsListToFile( domain_parsimony.getGainLossMatrix(), null, outfile_name
- + surfacing.PARSIMONY_OUTPUT_DOLLO_PRESENT_D, sep, ForesterUtil.LINE_SEPARATOR, null );
+ + surfacing.PARSIMONY_OUTPUT_DOLLO_PRESENT_D, sep, ForesterUtil.LINE_SEPARATOR, null );
//HTML:
writeBinaryStatesMatrixToList( domain_id_to_go_ids_map,
go_id_to_term_map,
"dollo_on_domains_" + outfile_name,
parameters_str );
SurfacingUtil.writePhylogenyToFile( local_phylogeny_l, outfile_name
- + surfacing.DOMAINS_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO );
+ + surfacing.DOMAINS_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO );
try {
writeAllDomainsChangedOnAllSubtrees( local_phylogeny_l, true, outfile_name, "_dollo_all_gains_d" );
writeAllDomainsChangedOnAllSubtrees( local_phylogeny_l, false, outfile_name, "_dollo_all_losses_d" );
domain_parsimony.executeFitchParsimonyOnBinaryDomainCombintion( use_last_in_fitch_parsimony );
}
SurfacingUtil.writeMatrixToFile( domain_parsimony.getGainLossMatrix(), outfile_name
- + surfacing.PARSIMONY_OUTPUT_GL_SUFFIX_FITCH_BINARY_COMBINATIONS, Format.FORESTER );
+ + surfacing.PARSIMONY_OUTPUT_GL_SUFFIX_FITCH_BINARY_COMBINATIONS, Format.FORESTER );
SurfacingUtil.writeMatrixToFile( domain_parsimony.getGainLossCountsMatrix(), outfile_name
- + surfacing.PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_FITCH_BINARY_COMBINATIONS, Format.FORESTER );
+ + surfacing.PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_FITCH_BINARY_COMBINATIONS, Format.FORESTER );
SurfacingUtil
- .writeBinaryStatesMatrixAsListToFile( domain_parsimony.getGainLossMatrix(),
- CharacterStateMatrix.GainLossStates.GAIN,
- outfile_name + surfacing.PARSIMONY_OUTPUT_FITCH_GAINS_BC,
- sep,
- ForesterUtil.LINE_SEPARATOR,
- null );
+ .writeBinaryStatesMatrixAsListToFile( domain_parsimony.getGainLossMatrix(),
+ CharacterStateMatrix.GainLossStates.GAIN,
+ outfile_name + surfacing.PARSIMONY_OUTPUT_FITCH_GAINS_BC,
+ sep,
+ ForesterUtil.LINE_SEPARATOR,
+ null );
SurfacingUtil.writeBinaryStatesMatrixAsListToFile( domain_parsimony.getGainLossMatrix(),
CharacterStateMatrix.GainLossStates.LOSS,
outfile_name
- + surfacing.PARSIMONY_OUTPUT_FITCH_LOSSES_BC,
+ + surfacing.PARSIMONY_OUTPUT_FITCH_LOSSES_BC,
sep,
ForesterUtil.LINE_SEPARATOR,
null );
SurfacingUtil.writeBinaryStatesMatrixAsListToFile( domain_parsimony.getGainLossMatrix(), null, outfile_name
- + surfacing.PARSIMONY_OUTPUT_FITCH_PRESENT_BC, sep, ForesterUtil.LINE_SEPARATOR, null );
+ + surfacing.PARSIMONY_OUTPUT_FITCH_PRESENT_BC, sep, ForesterUtil.LINE_SEPARATOR, null );
if ( all_binary_domains_combination_gained_fitch != null ) {
collectChangedDomainCombinationsFromBinaryStatesMatrixAsListToFile( domain_parsimony.getGainLossMatrix(),
dc_type,
}
if ( output_binary_domain_combinations_for_graphs ) {
SurfacingUtil
- .writeBinaryStatesMatrixAsListToFileForBinaryCombinationsForGraphAnalysis( domain_parsimony
- .getGainLossMatrix(),
- null,
- outfile_name
- + surfacing.PARSIMONY_OUTPUT_FITCH_PRESENT_BC_OUTPUTFILE_SUFFIX_FOR_GRAPH_ANALYSIS,
- sep,
- ForesterUtil.LINE_SEPARATOR,
- BinaryDomainCombination.OutputFormat.DOT );
+ .writeBinaryStatesMatrixAsListToFileForBinaryCombinationsForGraphAnalysis( domain_parsimony
+ .getGainLossMatrix(),
+ null,
+ outfile_name
+ + surfacing.PARSIMONY_OUTPUT_FITCH_PRESENT_BC_OUTPUTFILE_SUFFIX_FOR_GRAPH_ANALYSIS,
+ sep,
+ ForesterUtil.LINE_SEPARATOR,
+ BinaryDomainCombination.OutputFormat.DOT );
}
// HTML:
writeBinaryStatesMatrixToList( domain_id_to_go_ids_map,
date_time,
"Fitch parsimony on binary domain combination presence/absence randomization: "
+ randomization,
- "fitch_on_binary_domain_combinations_" + outfile_name,
- parameters_str );
+ "fitch_on_binary_domain_combinations_" + outfile_name,
+ parameters_str );
SurfacingUtil.writePhylogenyToFile( local_phylogeny_l, outfile_name
- + surfacing.BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH );
+ + surfacing.BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH );
calculateIndependentDomainCombinationGains( local_phylogeny_l,
outfile_name
- + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_COUNTS_OUTPUT_SUFFIX,
+ + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_COUNTS_OUTPUT_SUFFIX,
outfile_name
- + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_DC_OUTPUT_SUFFIX,
+ + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_DC_OUTPUT_SUFFIX,
outfile_name
- + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_OUTPUT_SUFFIX,
+ + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_OUTPUT_SUFFIX,
outfile_name
- + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_OUTPUT_UNIQUE_SUFFIX,
+ + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_DC_FOR_GO_MAPPING_OUTPUT_UNIQUE_SUFFIX,
outfile_name + "_indep_dc_gains_fitch_lca_ranks.txt",
outfile_name + "_indep_dc_gains_fitch_lca_taxonomies.txt",
outfile_name + "_indep_dc_gains_fitch_protein_statistics.txt",
Phylogeny local_phylogeny_copy = phylogeny.copy();
secondary_features_parsimony.executeDolloParsimonyOnSecondaryFeatures( mapping_results_map );
SurfacingUtil.writeMatrixToFile( secondary_features_parsimony.getGainLossMatrix(), outfile_name
- + surfacing.PARSIMONY_OUTPUT_GL_SUFFIX_DOLLO_SECONDARY_FEATURES, Format.FORESTER );
+ + surfacing.PARSIMONY_OUTPUT_GL_SUFFIX_DOLLO_SECONDARY_FEATURES, Format.FORESTER );
SurfacingUtil.writeMatrixToFile( secondary_features_parsimony.getGainLossCountsMatrix(), outfile_name
- + surfacing.PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_DOLLO_SECONDARY_FEATURES, Format.FORESTER );
+ + surfacing.PARSIMONY_OUTPUT_GL_COUNTS_SUFFIX_DOLLO_SECONDARY_FEATURES, Format.FORESTER );
SurfacingUtil
- .writeBinaryStatesMatrixAsListToFile( secondary_features_parsimony.getGainLossMatrix(),
- CharacterStateMatrix.GainLossStates.GAIN,
- outfile_name
- + surfacing.PARSIMONY_OUTPUT_DOLLO_GAINS_SECONDARY_FEATURES,
- sep,
- ForesterUtil.LINE_SEPARATOR,
- null );
+ .writeBinaryStatesMatrixAsListToFile( secondary_features_parsimony.getGainLossMatrix(),
+ CharacterStateMatrix.GainLossStates.GAIN,
+ outfile_name
+ + surfacing.PARSIMONY_OUTPUT_DOLLO_GAINS_SECONDARY_FEATURES,
+ sep,
+ ForesterUtil.LINE_SEPARATOR,
+ null );
SurfacingUtil
- .writeBinaryStatesMatrixAsListToFile( secondary_features_parsimony.getGainLossMatrix(),
- CharacterStateMatrix.GainLossStates.LOSS,
- outfile_name
- + surfacing.PARSIMONY_OUTPUT_DOLLO_LOSSES_SECONDARY_FEATURES,
- sep,
- ForesterUtil.LINE_SEPARATOR,
- null );
+ .writeBinaryStatesMatrixAsListToFile( secondary_features_parsimony.getGainLossMatrix(),
+ CharacterStateMatrix.GainLossStates.LOSS,
+ outfile_name
+ + surfacing.PARSIMONY_OUTPUT_DOLLO_LOSSES_SECONDARY_FEATURES,
+ sep,
+ ForesterUtil.LINE_SEPARATOR,
+ null );
SurfacingUtil
- .writeBinaryStatesMatrixAsListToFile( secondary_features_parsimony.getGainLossMatrix(),
- null,
- outfile_name
- + surfacing.PARSIMONY_OUTPUT_DOLLO_PRESENT_SECONDARY_FEATURES,
- sep,
- ForesterUtil.LINE_SEPARATOR,
- null );
+ .writeBinaryStatesMatrixAsListToFile( secondary_features_parsimony.getGainLossMatrix(),
+ null,
+ outfile_name
+ + surfacing.PARSIMONY_OUTPUT_DOLLO_PRESENT_SECONDARY_FEATURES,
+ sep,
+ ForesterUtil.LINE_SEPARATOR,
+ null );
preparePhylogeny( local_phylogeny_copy,
secondary_features_parsimony,
date_time,
"dollo_on_secondary_features_" + outfile_name,
parameters_str );
SurfacingUtil.writePhylogenyToFile( local_phylogeny_copy, outfile_name
- + surfacing.SECONDARY_FEATURES_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO );
+ + surfacing.SECONDARY_FEATURES_PARSIMONY_TREE_OUTPUT_SUFFIX_DOLLO );
// FITCH DOMAIN COMBINATIONS
// -------------------------
local_phylogeny_copy = phylogeny.copy();
final String randomization = "no";
secondary_features_parsimony
- .executeFitchParsimonyOnBinaryDomainCombintionOnSecondaryFeatures( use_last_in_fitch_parsimony );
+ .executeFitchParsimonyOnBinaryDomainCombintionOnSecondaryFeatures( use_last_in_fitch_parsimony );
preparePhylogeny( local_phylogeny_copy,
secondary_features_parsimony,
date_time,
"Fitch parsimony on secondary binary domain combination presence/absence randomization: "
+ randomization,
- "fitch_on_binary_domain_combinations_" + outfile_name,
- parameters_str );
+ "fitch_on_binary_domain_combinations_" + outfile_name,
+ parameters_str );
SurfacingUtil.writePhylogenyToFile( local_phylogeny_copy, outfile_name
- + surfacing.BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH_MAPPED );
+ + surfacing.BINARY_DOMAIN_COMBINATIONS_PARSIMONY_TREE_OUTPUT_SUFFIX_FITCH_MAPPED );
calculateIndependentDomainCombinationGains( local_phylogeny_copy, outfile_name
- + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_COUNTS_MAPPED_OUTPUT_SUFFIX, outfile_name
- + 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", null, null, null, null );
+ + surfacing.INDEPENDENT_DC_GAINS_FITCH_PARS_COUNTS_MAPPED_OUTPUT_SUFFIX, outfile_name
+ + 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", null, null, null, null );
}
public static void executePlusMinusAnalysis( final File output_file,
final File html_out_dc = new File( output_file + surfacing.PLUS_MINUS_DC_SUFFIX_HTML );
final File all_domains_go_ids_out_dom = new File( output_file + surfacing.PLUS_MINUS_ALL_GO_IDS_DOM_SUFFIX );
final File passing_domains_go_ids_out_dom = new File( output_file
- + surfacing.PLUS_MINUS_PASSING_GO_IDS_DOM_SUFFIX );
+ + surfacing.PLUS_MINUS_PASSING_GO_IDS_DOM_SUFFIX );
final File proteins_file_base = new File( output_file + "" );
final int min_diff = ( ( Integer ) plus_minus_analysis_numbers.get( 0 ) ).intValue();
final double factor = ( ( Double ) plus_minus_analysis_numbers.get( 1 ) ).doubleValue();
ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote plus minus domain analysis results to \""
+ plain_out_dom + "\"" );
ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote plus minus domain analysis results to \"" + html_out_dc
- + "\"" );
+ + "\"" );
ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote plus minus domain analysis based passing GO ids to \""
+ passing_domains_go_ids_out_dom + "\"" );
ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote plus minus domain analysis based all GO ids to \""
final PhylogenyNode n = it.next();
if ( ForesterUtil.isEmpty( n.getName() )
&& ( !n.getNodeData().isHasTaxonomy() || ForesterUtil.isEmpty( n.getNodeData().getTaxonomy()
- .getScientificName() ) )
- && ( !n.getNodeData().isHasTaxonomy() || ForesterUtil.isEmpty( n.getNodeData().getTaxonomy()
- .getCommonName() ) ) ) {
+ .getScientificName() ) )
+ && ( !n.getNodeData().isHasTaxonomy() || ForesterUtil.isEmpty( n.getNodeData().getTaxonomy()
+ .getCommonName() ) ) ) {
if ( n.getParent() != null ) {
names.append( " " );
names.append( n.getParent().getName() );
.create( intree_file, ParserUtils.createParserDependingOnFileType( intree_file, true ) );
if ( p_array.length < 1 ) {
ForesterUtil.fatalError( surfacing.PRG_NAME, "file [" + intree_file
- + "] does not contain any phylogeny in phyloXML format" );
+ + "] does not contain any phylogeny in phyloXML format" );
}
else if ( p_array.length > 1 ) {
ForesterUtil.fatalError( surfacing.PRG_NAME, "file [" + intree_file
- + "] contains more than one phylogeny in phyloXML format" );
+ + "] contains more than one phylogeny in phyloXML format" );
}
intree = p_array[ 0 ];
}
catch ( final Exception e ) {
ForesterUtil.fatalError( surfacing.PRG_NAME, "failed to read input tree from file [" + intree_file
- + "]: " + error );
+ + "]: " + error );
}
if ( ( intree == null ) || intree.isEmpty() ) {
ForesterUtil.fatalError( surfacing.PRG_NAME, "input tree [" + intree_file + "] is empty" );
if ( intree.getNumberOfExternalNodes() < number_of_genomes ) {
ForesterUtil.fatalError( surfacing.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 + "]" );
+ + "] 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 = getNumberOfNodesLackingName( intree, parent_names );
preparePhylogenyForParsimonyAnalyses( intree, input_file_properties );
if ( !intree.isCompletelyBinary() ) {
ForesterUtil.printWarningMessage( surfacing.PRG_NAME, "input tree [" + intree_file
- + "] is not completely binary" );
+ + "] is not completely binary" );
}
intrees[ i++ ] = intree;
}
.create( intree_file, ParserUtils.createParserDependingOnFileType( intree_file, true ) );
if ( phys.length < 1 ) {
ForesterUtil.fatalError( surfacing.PRG_NAME, "file [" + intree_file
- + "] does not contain any phylogeny in phyloXML format" );
+ + "] does not contain any phylogeny in phyloXML format" );
}
else if ( phys.length > 1 ) {
ForesterUtil.fatalError( surfacing.PRG_NAME, "file [" + intree_file
- + "] contains more than one phylogeny in phyloXML format" );
+ + "] contains more than one phylogeny in phyloXML format" );
}
intree = phys[ 0 ];
}
final Color c = ForesterUtil.obtainColorDependingOnTaxonomyGroup( group );
if ( c == null ) {
throw new IllegalArgumentException( "no color found for taxonomy group \"" + group
- + "\" for code \"" + tax_code + "\"" );
+ + "\" for code \"" + tax_code + "\"" );
}
final String hex = String.format( "#%02x%02x%02x", c.getRed(), c.getGreen(), c.getBlue() );
_TAXCODE_HEXCOLORSTRING_MAP.put( tax_code, hex );
}
else {
throw new IllegalArgumentException( "unable to obtain color for code " + tax_code
- + " (tree is null or empty and code is not in map)" );
+ + " (tree is null or empty and code is not in map)" );
}
}
return _TAXCODE_HEXCOLORSTRING_MAP.get( tax_code );
if ( n.getNodeData().isHasTaxonomy()
&& !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getScientificName() ) ) {
group = ForesterUtil.obtainNormalizedTaxonomyGroup( n.getNodeData().getTaxonomy()
- .getScientificName() );
+ .getScientificName() );
}
if ( ForesterUtil.isEmpty( group ) && !ForesterUtil.isEmpty( n.getName() ) ) {
group = ForesterUtil.obtainNormalizedTaxonomyGroup( n.getName() );
}
else {
throw new IllegalArgumentException( "unable to obtain group for code " + tax_code
- + " (tree is null or empty and code is not in map)" );
+ + " (tree is null or empty and code is not in map)" );
}
}
return _TAXCODE_TAXGROUP_MAP.get( tax_code );
}
else {
ForesterUtil
- .fatalError( surfacing.PRG_NAME,
- "node with no name, scientific name, common name, or taxonomy code present" );
+ .fatalError( surfacing.PRG_NAME,
+ "node with no name, scientific name, common name, or taxonomy code present" );
}
}
}
}
else {
ForesterUtil
- .fatalError( surfacing.PRG_NAME,
- "species/genome names in 'plus minus' file must begin with '*' (high copy target genome), '+' (high copy base genomes), '-' (low copy genomes), '$D=<integer>' minimal Difference (default is 1), '$F=<double>' factor (default is 1.0), double), or '#' (ignore) suffix, encountered: \""
- + species + "\"" );
+ .fatalError( surfacing.PRG_NAME,
+ "species/genome names in 'plus minus' file must begin with '*' (high copy target genome), '+' (high copy base genomes), '-' (low copy genomes), '$D=<integer>' minimal Difference (default is 1), '$F=<double>' factor (default is 1.0), double), or '#' (ignore) suffix, encountered: \""
+ + species + "\"" );
}
numbers.add( new Integer( min_diff + "" ) );
numbers.add( new Double( factor + "" ) );
/*
* species | protein id | n-terminal domain | c-terminal domain | n-terminal domain per domain E-value | c-terminal domain per domain E-value
- *
- *
+ *
+ *
*/
static public StringBuffer proteinToDomainCombinations( final Protein protein,
final String protein_id,
final SortedSet<String> domains = collectAllDomainsChangedOnSubtree( node, get_gains );
if ( domains.size() > 0 ) {
final Writer writer = ForesterUtil.createBufferedWriter( base_dir + ForesterUtil.FILE_SEPARATOR
- + node.getName() + suffix_for_filename );
+ + node.getName() + suffix_for_filename );
for( final String domain : domains ) {
writer.write( domain );
writer.write( ForesterUtil.LINE_SEPARATOR );
final BufferedWriter out_dot = new BufferedWriter( new FileWriter( dc_outfile_dot ) );
for( final BinaryDomainCombination bdc : binary_combinations ) {
out_dot.write( bdc.toGraphDescribingLanguage( BinaryDomainCombination.OutputFormat.DOT, null, null )
- .toString() );
+ .toString() );
out_dot.write( SurfacingConstants.NL );
}
out_dot.close();
per_node_counter = 0;
if ( matrix.getNumberOfCharacters() > 0 ) {
per_node_go_mapped_domain_gain_loss_outfile = new File( per_node_go_mapped_domain_gain_loss_files_base_dir
- + ForesterUtil.FILE_SEPARATOR + id + suffix_for_per_node_events_file );
+ + ForesterUtil.FILE_SEPARATOR + id + suffix_for_per_node_events_file );
SurfacingUtil.checkForOutputFileWriteability( per_node_go_mapped_domain_gain_loss_outfile );
per_node_go_mapped_domain_gain_loss_outfile_writer = ForesterUtil
.createBufferedWriter( per_node_go_mapped_domain_gain_loss_outfile );
out.write( SurfacingConstants.NL );
out.write( "<hr>" );
out.write( SurfacingConstants.NL );
- } // for( final String id : sorted_ids ) {
+ } // for( final String id : sorted_ids ) {
out.write( "</body>" );
out.write( SurfacingConstants.NL );
out.write( "</html>" );
}
else {
per_genome_domain_promiscuity_statistics_writer.write( FORMATTER_3.format( stats
- .sampleStandardDeviation() ) + "\t" );
+ .sampleStandardDeviation() ) + "\t" );
}
per_genome_domain_promiscuity_statistics_writer.write( FORMATTER_3.format( stats.median() ) + "\t" );
per_genome_domain_promiscuity_statistics_writer.write( ( int ) stats.getMin() + "\t" );
if ( single_writer != null ) {
if ( !ForesterUtil.isEmpty( pos_filter_doms ) && pos_filter_doms.contains( similarity.getDomainId() ) ) {
single_writer.write( "<tr><td><b><a href=\"#" + similarity.getDomainId()
- + "\"><span style=\"color:#00ff00\">" + similarity.getDomainId()
- + "</span></a></b></td></tr>" );
+ + "\"><span style=\"color:#00ff00\">" + similarity.getDomainId()
+ + "</span></a></b></td></tr>" );
}
else {
single_writer.write( "<tr><td><b><a href=\"#" + similarity.getDomainId() + "\">"
}
else {
Writer local_writer = split_writers.get( ( similarity.getDomainId().charAt( 0 ) + "" ).toLowerCase()
- .charAt( 0 ) );
+ .charAt( 0 ) );
if ( local_writer == null ) {
local_writer = split_writers.get( '0' );
}
if ( !ForesterUtil.isEmpty( pos_filter_doms ) && pos_filter_doms.contains( similarity.getDomainId() ) ) {
local_writer.write( "<tr><td><b><a href=\"#" + similarity.getDomainId()
- + "\"><span style=\"color:#00ff00\">" + similarity.getDomainId()
- + "</span></a></b></td></tr>" );
+ + "\"><span style=\"color:#00ff00\">" + similarity.getDomainId()
+ + "</span></a></b></td></tr>" );
}
else {
local_writer.write( "<tr><td><b><a href=\"#" + similarity.getDomainId() + "\">"
}
else {
Writer local_writer = split_writers.get( ( similarity.getDomainId().charAt( 0 ) + "" ).toLowerCase()
- .charAt( 0 ) );
+ .charAt( 0 ) );
if ( local_writer == null ) {
local_writer = split_writers.get( '0' );
}
writeMatrixToFile( DomainParsimonyCalculator.createMatrixOfDomainPresenceOrAbsence( gwcd_list,
positive_filter_file == null ? null
: filter ),
- output_file + surfacing.DOMAINS_PRESENT_NEXUS,
- Format.NEXUS_BINARY );
+ output_file + surfacing.DOMAINS_PRESENT_NEXUS,
+ Format.NEXUS_BINARY );
writeMatrixToFile( DomainParsimonyCalculator.createMatrixOfBinaryDomainCombinationPresenceOrAbsence( gwcd_list ),
output_file + surfacing.BDC_PRESENT_NEXUS,
Format.NEXUS_BINARY );
writer.write( " [" );
if ( ( tax_code_to_id_map != null ) && tax_code_to_id_map.containsKey( species ) ) {
writer.write( "<a href=\"" + SurfacingConstants.UNIPROT_TAXONOMY_ID_LINK
- + tax_code_to_id_map.get( species ) + "\" target=\"taxonomy_window\">uniprot</a>" );
+ + tax_code_to_id_map.get( species ) + "\" target=\"taxonomy_window\">uniprot</a>" );
}
else {
writer.write( "<a href=\"" + SurfacingConstants.EOL_LINK + species
- + "\" target=\"taxonomy_window\">eol</a>" );
+ + "\" target=\"taxonomy_window\">eol</a>" );
writer.write( "|" );
writer.write( "<a href=\"" + SurfacingConstants.GOOGLE_SCHOLAR_SEARCH + species
- + "\" target=\"taxonomy_window\">scholar</a>" );
+ + "\" target=\"taxonomy_window\">scholar</a>" );
writer.write( "|" );
writer.write( "<a href=\"" + SurfacingConstants.GOOGLE_WEB_SEARCH_LINK + species
- + "\" target=\"taxonomy_window\">google</a>" );
+ + "\" target=\"taxonomy_window\">google</a>" );
}
writer.write( "]" );
}
dc_reapp_counts_to_protein_length_stats.put( count, new BasicDescriptiveStatistics() );
}
dc_reapp_counts_to_protein_length_stats.get( count ).addValue( protein_length_stats_by_dc.get( dc )
- .arithmeticMean() );
+ .arithmeticMean() );
}
if ( domain_number_stats_by_dc != null ) {
if ( !dc_reapp_counts_to_domain_number_stats.containsKey( count ) ) {
dc_reapp_counts_to_domain_number_stats.put( count, new BasicDescriptiveStatistics() );
}
dc_reapp_counts_to_domain_number_stats.get( count ).addValue( domain_number_stats_by_dc.get( dc )
- .arithmeticMean() );
+ .arithmeticMean() );
}
if ( domain_length_stats_by_domain != null ) {
if ( !dc_reapp_counts_to_domain_lengths_stats.containsKey( count ) ) {
}
final String[] ds = dc.split( "=" );
dc_reapp_counts_to_domain_lengths_stats.get( count ).addValue( domain_length_stats_by_domain
- .get( ds[ 0 ] ).arithmeticMean() );
+ .get( ds[ 0 ] ).arithmeticMean() );
dc_reapp_counts_to_domain_lengths_stats.get( count ).addValue( domain_length_stats_by_domain
- .get( ds[ 1 ] ).arithmeticMean() );
+ .get( ds[ 1 ] ).arithmeticMean() );
}
if ( count > 1 ) {
more_than_once.add( dc );
final CharacterStateMatrix.GainLossStates state,
final String outfile ) {
File per_node_go_mapped_domain_gain_loss_files_base_dir = new File( new File( outfile ).getParent()
- + ForesterUtil.FILE_SEPARATOR + base_dir );
+ + ForesterUtil.FILE_SEPARATOR + base_dir );
if ( !per_node_go_mapped_domain_gain_loss_files_base_dir.exists() ) {
per_node_go_mapped_domain_gain_loss_files_base_dir.mkdir();
}
if ( domain_combinations ) {
per_node_go_mapped_domain_gain_loss_files_base_dir = new File( per_node_go_mapped_domain_gain_loss_files_base_dir
- + ForesterUtil.FILE_SEPARATOR + "DC" );
+ + ForesterUtil.FILE_SEPARATOR + "DC" );
}
else {
per_node_go_mapped_domain_gain_loss_files_base_dir = new File( per_node_go_mapped_domain_gain_loss_files_base_dir
- + ForesterUtil.FILE_SEPARATOR + "DOMAINS" );
+ + ForesterUtil.FILE_SEPARATOR + "DOMAINS" );
}
if ( !per_node_go_mapped_domain_gain_loss_files_base_dir.exists() ) {
per_node_go_mapped_domain_gain_loss_files_base_dir.mkdir();
}
if ( state == GainLossStates.GAIN ) {
per_node_go_mapped_domain_gain_loss_files_base_dir = new File( per_node_go_mapped_domain_gain_loss_files_base_dir
- + ForesterUtil.FILE_SEPARATOR + "GAINS" );
+ + ForesterUtil.FILE_SEPARATOR + "GAINS" );
}
else if ( state == GainLossStates.LOSS ) {
per_node_go_mapped_domain_gain_loss_files_base_dir = new File( per_node_go_mapped_domain_gain_loss_files_base_dir
- + ForesterUtil.FILE_SEPARATOR + "LOSSES" );
+ + ForesterUtil.FILE_SEPARATOR + "LOSSES" );
}
else {
per_node_go_mapped_domain_gain_loss_files_base_dir = new File( per_node_go_mapped_domain_gain_loss_files_base_dir
- + ForesterUtil.FILE_SEPARATOR + "PRESENT" );
+ + ForesterUtil.FILE_SEPARATOR + "PRESENT" );
}
if ( !per_node_go_mapped_domain_gain_loss_files_base_dir.exists() ) {
per_node_go_mapped_domain_gain_loss_files_base_dir.mkdir();
final SortedSet<String> all_pfams_encountered ) {
final File all_pfams_encountered_file = new File( outfile_name + surfacing.ALL_PFAMS_ENCOUNTERED_SUFFIX );
final File all_pfams_encountered_with_go_annotation_file = new File( outfile_name
- + surfacing.ALL_PFAMS_ENCOUNTERED_WITH_GO_ANNOTATION_SUFFIX );
+ + surfacing.ALL_PFAMS_ENCOUNTERED_WITH_GO_ANNOTATION_SUFFIX );
final File encountered_pfams_summary_file = new File( outfile_name + surfacing.ENCOUNTERED_PFAMS_SUMMARY_SUFFIX );
int biological_process_counter = 0;
int cellular_component_counter = 0;
all_pfams_encountered_writer.close();
all_pfams_encountered_with_go_annotation_writer.close();
ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote all [" + all_pfams_encountered.size()
- + "] encountered Pfams to: \"" + all_pfams_encountered_file + "\"" );
+ + "] encountered Pfams to: \"" + all_pfams_encountered_file + "\"" );
ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote all [" + pfams_with_mappings_counter
- + "] encountered Pfams with GO mappings to: \"" + all_pfams_encountered_with_go_annotation_file
- + "\"" );
+ + "] encountered Pfams with GO mappings to: \"" + all_pfams_encountered_with_go_annotation_file
+ + "\"" );
ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote summary (including all ["
+ pfams_without_mappings_counter + "] encountered Pfams without GO mappings) to: \""
+ encountered_pfams_summary_file + "\"" );
summary_writer.write( "# Sum of Pfams encountered : " + all_pfams_encountered.size() );
summary_writer.write( ForesterUtil.LINE_SEPARATOR );
summary_writer.write( "# Pfams without a mapping : " + pfams_without_mappings_counter
- + " [" + ( ( 100 * pfams_without_mappings_counter ) / all_pfams_encountered.size() ) + "%]" );
+ + " [" + ( ( 100 * pfams_without_mappings_counter ) / all_pfams_encountered.size() ) + "%]" );
summary_writer.write( ForesterUtil.LINE_SEPARATOR );
summary_writer.write( "# Pfams without mapping to proc. or func. : "
+ pfams_without_mappings_to_bp_or_mf_counter + " ["
if ( ForesterUtil.isEmpty( domain_1 ) ) {
domain_count = 1;
}
- // The following has a difficult to understand logic.
+ // The following has a difficult to understand logic.
for( int d = 0; d < domain_count; ++d ) {
List<GoId> go_ids = null;
boolean go_annotation_present = false;
final String go_id_str = go_id.getId();
out.write( "<td>" );
out.write( "<a href=\"" + SurfacingConstants.AMIGO_LINK + go_id_str
- + "\" target=\"amigo_window\">" + go_id_str + "</a>" );
+ + "\" target=\"amigo_window\">" + go_id_str + "</a>" );
out.write( "</td><td>" );
out.write( go_term.getName() );
if ( domain_count == 2 ) {
out.write( SurfacingConstants.NL );
}
}
- } // for( int d = 0; d < domain_count; ++d )
+ } // for( int d = 0; d < domain_count; ++d )
if ( !any_go_annotation_present ) {
out.write( "<tr>" );
writeDomainIdsToHtml( out, domain_0, domain_1, prefix_for_html, domain_id_to_secondary_features_maps );
final String domain_1,
final String prefix_for_detailed_html,
final Map<String, Set<String>>[] domain_id_to_secondary_features_maps )
- throws IOException {
+ throws IOException {
out.write( "<td>" );
if ( !ForesterUtil.isEmpty( prefix_for_detailed_html ) ) {
out.write( prefix_for_detailed_html );
}
writer.close();
ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote " + pfams.size() + " pfams to [" + outfile_name
- + "]" );
+ + "]" );
}
catch ( final IOException e ) {
ForesterUtil.printWarningMessage( surfacing.PRG_NAME, "Failure to write: " + e );
final Phylogeny phylogeny ) {
if ( !( matrix instanceof BasicCharacterStateMatrix ) ) {
throw new IllegalArgumentException( "can only write matrices of type [" + BasicCharacterStateMatrix.class
- + "] to nexus" );
+ + "] to nexus" );
}
final BasicCharacterStateMatrix<BinaryStates> my_matrix = ( org.forester.evoinference.matrix.character.BasicCharacterStateMatrix<BinaryStates> ) matrix;
final List<Phylogeny> phylogenies = new ArrayList<Phylogeny>( 1 );
final BinaryStates O = BinaryStates.ABSENT;
try {
final CharacterStateMatrix<BinaryStates> binary_states_matrix_0 = new BasicCharacterStateMatrix<BinaryStates>( 7,
- 6 );
+ 6 );
binary_states_matrix_0.setIdentifier( 0, "A" );
binary_states_matrix_0.setIdentifier( 1, "B" );
binary_states_matrix_0.setIdentifier( 2, "C" );
final GenomeWideCombinableDomains gwcd_1 = BasicGenomeWideCombinableDomains
.createInstance( list_1, false, new BasicSpecies( "1" ), DomainCombinationType.DIRECTED );
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "A",
- "B" ) ) ) {
+ "B" ) ) ) {
return false;
}
if ( gwcd_1.toBinaryDomainCombinations()
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "A",
- "C" ) ) ) {
+ "C" ) ) ) {
return false;
}
if ( gwcd_1.toBinaryDomainCombinations()
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "B",
- "C" ) ) ) {
+ "C" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "C",
- "X" ) ) ) {
+ "X" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "C",
- "Y" ) ) ) {
+ "Y" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "A",
- "X" ) ) ) {
+ "X" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "A",
- "Y" ) ) ) {
+ "Y" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "Y",
- "A" ) ) ) {
+ "A" ) ) ) {
return false;
}
if ( gwcd_1.toBinaryDomainCombinations()
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "X",
- "Y" ) ) ) {
+ "Y" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "Y",
- "X" ) ) ) {
+ "X" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "A",
- "Y" ) ) ) {
+ "Y" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "A",
- "X" ) ) ) {
+ "X" ) ) ) {
return false;
}
if ( gwcd_1.toBinaryDomainCombinations()
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "M",
- "N" ) ) ) {
+ "N" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "N",
- "M" ) ) ) {
+ "M" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "N",
- "P" ) ) ) {
+ "P" ) ) ) {
return false;
}
if ( !gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "M",
- "P" ) ) ) {
+ "P" ) ) ) {
return false;
}
if ( gwcd_1.toBinaryDomainCombinations()
return false;
}
if ( gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "XX",
- "YY" ) ) ) {
+ "YY" ) ) ) {
return false;
}
if ( gwcd_1.toBinaryDomainCombinations().contains( DirectedBinaryDomainCombination.obtainInstance( "YY",
- "XX" ) ) ) {
+ "XX" ) ) ) {
return false;
}
if ( gwcd_1.toBinaryDomainCombinations()
// if ( matrix_bc.getState( 0, 0 ) != X ) {
// return false;
// }
- //
+ //
//
// final BasicCharacterStateMatrix<BinaryStates> dm = new BasicCharacterStateMatrix<BinaryStates>( new BinaryStates[][] {
// { X, X, X, X, X, X }, { X, X, X, X, X, X } } );
return false;
}
if ( !calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "v",
- "u" ) ) ) {
+ "u" ) ) ) {
return false;
}
if ( !calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "w",
- "v" ) ) ) {
+ "v" ) ) ) {
return false;
}
if ( !calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "w",
- "x" ) ) ) {
+ "x" ) ) ) {
return false;
}
if ( !calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "w",
- "u" ) ) ) {
+ "u" ) ) ) {
return false;
}
if ( !calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "z",
- "y" ) ) ) {
+ "y" ) ) ) {
return false;
}
calc_u.setAllowDomainsToBeIgnored( true );
return false;
}
if ( calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "v",
- "u" ) ) ) {
+ "u" ) ) ) {
return false;
}
if ( !calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "w",
- "v" ) ) ) {
+ "v" ) ) ) {
return false;
}
if ( !calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "w",
- "x" ) ) ) {
+ "x" ) ) ) {
return false;
}
if ( calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "w",
- "u" ) ) ) {
+ "u" ) ) ) {
return false;
}
if ( !calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "z",
- "y" ) ) ) {
+ "y" ) ) ) {
return false;
}
calc_u.setAllowDomainsToBeIgnored( false );
return false;
}
if ( !calc_u.getAllBinaryDomainCombinations().contains( BasicBinaryDomainCombination.obtainInstance( "z",
- "y" ) ) ) {
+ "y" ) ) ) {
return false;
}
if ( !isEqual( calc_u.calculateSharedBinaryDomainCombinationBasedGenomeSimilarityScore(),
private static boolean testDomainCombinationCounting( final File test_dir ) {
try {
final HmmPfamOutputParser parser = new HmmPfamOutputParser( new File( test_dir
- + ForesterUtil.getFileSeparator() + "hmmpfam_output2" ), "human", "ls" );
+ + ForesterUtil.getFileSeparator() + "hmmpfam_output2" ), "human", "ls" );
parser.setEValueMaximum( 0.2 );
parser.setIgnoreDufs( true );
parser.setReturnType( HmmPfamOutputParser.ReturnType.UNORDERED_PROTEIN_DOMAIN_COLLECTION_PER_PROTEIN );
private static boolean testHmmPfamOutputParser( final File test_dir ) {
try {
final HmmPfamOutputParser parser = new HmmPfamOutputParser( new File( test_dir
- + ForesterUtil.getFileSeparator() + "hmmpfam_output" ), "human", "ls" );
+ + ForesterUtil.getFileSeparator() + "hmmpfam_output" ), "human", "ls" );
parser.setEValueMaximum( 0.2 );
parser.setIgnoreDufs( true );
parser.setReturnType( HmmPfamOutputParser.ReturnType.UNORDERED_PROTEIN_DOMAIN_COLLECTION_PER_PROTEIN );
return false;
}
final HmmPfamOutputParser parser2 = new HmmPfamOutputParser( new File( test_dir
- + ForesterUtil.getFileSeparator() + "hmmpfam_output_short" ), "human", "ls" );
+ + ForesterUtil.getFileSeparator() + "hmmpfam_output_short" ), "human", "ls" );
parser2.setEValueMaximum( 0.2 );
parser2.setIgnoreDufs( true );
parser2.setReturnType( HmmPfamOutputParser.ReturnType.UNORDERED_PROTEIN_DOMAIN_COLLECTION_PER_PROTEIN );
private static boolean testHmmPfamOutputParserWithFilter( final File test_dir ) {
try {
HmmPfamOutputParser parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator()
- + "hmmpfam_output3" ), "human", "ls" );
+ + "hmmpfam_output3" ), "human", "ls" );
parser.setEValueMaximum( 0.2 );
parser.setIgnoreDufs( true );
parser.setReturnType( HmmPfamOutputParser.ReturnType.UNORDERED_PROTEIN_DOMAIN_COLLECTION_PER_PROTEIN );
public final class Test {
private final static String PATH_TO_RESOURCES = System.getProperty( "user.dir" )
- + ForesterUtil.getFileSeparator() + "resources"
- + ForesterUtil.getFileSeparator();
+ + ForesterUtil.getFileSeparator() + "resources"
+ + ForesterUtil.getFileSeparator();
private final static String PATH_TO_TEST_DATA = System.getProperty( "user.dir" )
- + ForesterUtil.getFileSeparator() + "test_data"
- + ForesterUtil.getFileSeparator();
+ + ForesterUtil.getFileSeparator() + "test_data"
+ + ForesterUtil.getFileSeparator();
private final static boolean PERFORM_DB_TESTS = false;
private static final boolean PERFORM_WEB_TREE_ACCESS = true;
private static final String PHYLOXML_LOCAL_XSD = PATH_TO_RESOURCES + "phyloxml_schema/"
- + ForesterConstants.PHYLO_XML_VERSION + "/"
- + ForesterConstants.PHYLO_XML_XSD;
+ + ForesterConstants.PHYLO_XML_VERSION + "/"
+ + ForesterConstants.PHYLO_XML_XSD;
private static final String PHYLOXML_REMOTE_XSD = ForesterConstants.PHYLO_XML_LOCATION + "/"
- + ForesterConstants.PHYLO_XML_VERSION + "/"
- + ForesterConstants.PHYLO_XML_XSD;
+ + ForesterConstants.PHYLO_XML_VERSION + "/"
+ + ForesterConstants.PHYLO_XML_XSD;
private final static boolean USE_LOCAL_PHYLOXML_SCHEMA = true;
private final static double ZERO_DIFF = 1.0E-9;
public static void main( final String[] args ) {
System.out.println( "[Java version: " + ForesterUtil.JAVA_VERSION + " " + ForesterUtil.JAVA_VENDOR + "]" );
System.out.println( "[OS: " + ForesterUtil.OS_NAME + " " + ForesterUtil.OS_ARCH + " " + ForesterUtil.OS_VERSION
- + "]" );
+ + "]" );
Locale.setDefault( Locale.US );
System.out.println( "[Locale: " + Locale.getDefault() + "]" );
int failed = 0;
System.exit( -1 );
}
final long start_time = new Date().getTime();
-
-
-
System.out.print( "MSA entropy: " );
if ( Test.testMsaEntropy() ) {
System.out.println( "OK." );
System.out.println( phys[ 1 ].toNewHampshire() );
return false;
}
-
final URL u2 = new URL( s );
-
final Phylogeny[] phys2 = factory.create( u2.openStream(), new NHXParser() );
if ( ( phys2 == null ) || ( phys2.length != 5 ) ) {
return false;
}
}
catch ( final Exception e ) {
- System.out.println( e.toString());
+ System.out.println( e.toString() );
e.printStackTrace();
return false;
}
}
if ( !ParserUtils.extractTaxonomyCodeFromNodeName( "BCL2_MOUSE function = 23445",
TAXONOMY_EXTRACTION.PFAM_STYLE_RELAXED )
- .equals( "MOUSE" ) ) {
+ .equals( "MOUSE" ) ) {
return false;
}
if ( !ParserUtils.extractTaxonomyCodeFromNodeName( "BCL2_MOUSE+function = 23445",
TAXONOMY_EXTRACTION.PFAM_STYLE_RELAXED )
- .equals( "MOUSE" ) ) {
+ .equals( "MOUSE" ) ) {
return false;
}
if ( !ParserUtils.extractTaxonomyCodeFromNodeName( "BCL2_MOUSE|function = 23445",
TAXONOMY_EXTRACTION.PFAM_STYLE_RELAXED )
- .equals( "MOUSE" ) ) {
+ .equals( "MOUSE" ) ) {
return false;
}
if ( ParserUtils.extractTaxonomyCodeFromNodeName( "BCL2_MOUSEfunction = 23445",
final String test_dir = Test.PATH_TO_TEST_DATA;
try {
final HmmscanPerDomainTableParser parser1 = new HmmscanPerDomainTableParser( new File( test_dir
- + ForesterUtil.getFileSeparator() + "hmmscan30b3_output_1" ), "MONBR", INDIVIDUAL_SCORE_CUTOFF.NONE );
+ + ForesterUtil.getFileSeparator() + "hmmscan30b3_output_1" ), "MONBR", INDIVIDUAL_SCORE_CUTOFF.NONE );
parser1.parse();
final HmmscanPerDomainTableParser parser2 = new HmmscanPerDomainTableParser( new File( test_dir
- + ForesterUtil.getFileSeparator() + "hmmscan30b3_output_2" ), "MONBR", INDIVIDUAL_SCORE_CUTOFF.NONE );
+ + ForesterUtil.getFileSeparator() + "hmmscan30b3_output_2" ), "MONBR", INDIVIDUAL_SCORE_CUTOFF.NONE );
final List<Protein> proteins = parser2.parse();
if ( parser2.getProteinsEncountered() != 4 ) {
return false;
return false;
}
if ( !isEqual( 0.48039661496919533, phylogenies[ 0 ].getNode( "Diadocidia_spinosula" )
- .getDistanceToParent() ) ) {
+ .getDistanceToParent() ) ) {
return false;
}
if ( !isEqual( 0.3959796191512233, phylogenies[ 0 ].getNode( "Diadocidia_stanfordensis" )
- .getDistanceToParent() ) ) {
+ .getDistanceToParent() ) ) {
return false;
}
if ( !phylogenies[ 0 ].getName().equals( "Family Diadocidiidae MLT (Imported_tree_0)" ) ) {
final Phylogeny[] p11 = factory.create( "(A,B11);(C,D11) (E,F11)\t(G,H11)", new NHXParser() );
final Phylogeny[] p12 = factory.create( "(A,B12) (C,D12) (E,F12) (G,H12)", new NHXParser() );
final Phylogeny[] p13 = factory.create( " ; (;A; , ; B ; 1 3 ; \n)\t ( \n ;"
- + " C ; ,; D;13;);;;;;;(;E;,;F;13 ;) ; "
- + "; ; ( \t\n\r\b; G ;, ;H ;1 3; ) ; ; ;",
- new NHXParser() );
+ + " C ; ,; D;13;);;;;;;(;E;,;F;13 ;) ; "
+ + "; ; ( \t\n\r\b; G ;, ;H ;1 3; ) ; ; ;",
+ new NHXParser() );
if ( !p13[ 0 ].toNewHampshireX().equals( "(';A;',';B;13;')" ) ) {
return false;
}
if ( !n7.toNewHampshire( true, PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE.IN_SQUARE_BRACKETS )
.equals( "'gks:dr-m4 \" ` `@:[]sadq04'" ) ) {
System.out.println( n7
- .toNewHampshire( true, PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE.IN_SQUARE_BRACKETS ) );
+ .toNewHampshire( true, PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE.IN_SQUARE_BRACKETS ) );
return false;
}
}
}
final Phylogeny p2 = factory
.create( "(1[something_else(?)s,prob=0.9500000000000000e+00{}(((,p)rob_stddev=0.110000000000e+00,"
- + "prob_range={1.000000000000000e+00,1.000000000000000e+00},prob(percent)=\"100\","
- + "prob+-sd=\"100+-0\"]:4.129000000000000e-02[&length_mean=4.153987461671767e-02,"
- + "length_median=4.129000000000000e-02,length_95%HPD={3.217800000000000e-02,"
- + "5.026800000000000e-02}],2[&prob=0.810000000000000e+00,prob_stddev=0.000000000000000e+00,"
- + "prob_range={1.000000000000000e+00,1.000000000000000e+00},prob(percent)=\"100\","
- + "prob+-sd=\"100+-0\"]:6.375699999999999e-02[&length_mean=6.395210411945065e-02,"
- + "length_median=6.375699999999999e-02,length_95%HPD={5.388600000000000e-02,"
- + "7.369400000000000e-02}])",
- new NHXParser() )[ 0 ];
+ + "prob_range={1.000000000000000e+00,1.000000000000000e+00},prob(percent)=\"100\","
+ + "prob+-sd=\"100+-0\"]:4.129000000000000e-02[&length_mean=4.153987461671767e-02,"
+ + "length_median=4.129000000000000e-02,length_95%HPD={3.217800000000000e-02,"
+ + "5.026800000000000e-02}],2[&prob=0.810000000000000e+00,prob_stddev=0.000000000000000e+00,"
+ + "prob_range={1.000000000000000e+00,1.000000000000000e+00},prob(percent)=\"100\","
+ + "prob+-sd=\"100+-0\"]:6.375699999999999e-02[&length_mean=6.395210411945065e-02,"
+ + "length_median=6.375699999999999e-02,length_95%HPD={5.388600000000000e-02,"
+ + "7.369400000000000e-02}])",
+ new NHXParser() )[ 0 ];
if ( p2.getNode( "1" ) == null ) {
return false;
}
// J. of Comput Bio. Vol. 4, No 2, pp.177-187
final Phylogeny species6 = factory
.create( "(((1:[&&NHX:S=1],5:[&&NHX:S=5])1-5,((4:[&&NHX:S=4],6:[&&NHX:S=6])4-6,2:[&&NHX:S=2])4-6-2)1-5-4-6-2,"
- + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
- new NHXParser() )[ 0 ];
+ + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
+ new NHXParser() )[ 0 ];
final Phylogeny gene6 = factory
.create( "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1,3:0.1[&&NHX:S=3])1-2-3:0.1,"
- + "((4:0.1[&&NHX:S=4],(5:0.1[&&NHX:S=5],6:0.1[&&NHX:S=6])5-6:0.1)4-5-6:0.1,"
- + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],9:0.1[&&NHX:S=9])8-9:0.1)7-8-9:0.1)4-5-6-7-8-9:0.1)r;",
- new NHXParser() )[ 0 ];
+ + "((4:0.1[&&NHX:S=4],(5:0.1[&&NHX:S=5],6:0.1[&&NHX:S=6])5-6:0.1)4-5-6:0.1,"
+ + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],9:0.1[&&NHX:S=9])8-9:0.1)7-8-9:0.1)4-5-6-7-8-9:0.1)r;",
+ new NHXParser() )[ 0 ];
species6.setRooted( true );
gene6.setRooted( true );
final SDI sdi6 = new SDI( gene6, species6 );
}
final Phylogeny species6 = factory
.create( "(((1:[&&NHX:S=1],5:[&&NHX:S=5])1-5,((4:[&&NHX:S=4],6:[&&NHX:S=6])4-6,2:[&&NHX:S=2])4-6-2)1-5-4-6-2,"
- + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
- new NHXParser() )[ 0 ];
+ + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
+ new NHXParser() )[ 0 ];
final Phylogeny gene6 = factory
.create( "((5:0.1[&&NHX:S=5],6:0.1[&&NHX:S=6])5-6:0.05[&&NHX:S=6],(4:0.1[&&NHX:S=4],"
- + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
- + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
- + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
- + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
- new NHXParser() )[ 0 ];
+ + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
+ + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
+ + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
+ + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
+ new NHXParser() )[ 0 ];
species6.setRooted( true );
gene6.setRooted( true );
Phylogeny[] p6 = sdi_unrooted.infer( gene6, species6, false, true, true, true, 10 );
p6 = null;
final Phylogeny species7 = factory
.create( "(((1:[&&NHX:S=1],5:[&&NHX:S=5])1-5,((4:[&&NHX:S=4],6:[&&NHX:S=6])4-6,2:[&&NHX:S=2])4-6-2)1-5-4-6-2,"
- + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
- new NHXParser() )[ 0 ];
+ + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
+ new NHXParser() )[ 0 ];
final Phylogeny gene7 = factory
.create( "((5:0.1[&&NHX:S=5],6:0.1[&&NHX:S=6])5-6:0.05[&&NHX:S=6],(4:0.1[&&NHX:S=4],"
- + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
- + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
- + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
- + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
- new NHXParser() )[ 0 ];
+ + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
+ + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
+ + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
+ + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
+ new NHXParser() )[ 0 ];
species7.setRooted( true );
gene7.setRooted( true );
Phylogeny[] p7 = sdi_unrooted.infer( gene7, species7, true, true, true, true, 10 );
p7 = null;
final Phylogeny species8 = factory
.create( "(((1:[&&NHX:S=1],5:[&&NHX:S=5])1-5,((4:[&&NHX:S=4],6:[&&NHX:S=6])4-6,2:[&&NHX:S=2])4-6-2)1-5-4-6-2,"
- + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
- new NHXParser() )[ 0 ];
+ + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
+ new NHXParser() )[ 0 ];
final Phylogeny gene8 = factory
.create( "((5:0.1[&&NHX:S=5],6:0.1[&&NHX:S=6])5-6:0.05[&&NHX:S=6],(4:0.1[&&NHX:S=4],"
- + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
- + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
- + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
- + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
- new NHXParser() )[ 0 ];
+ + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
+ + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
+ + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
+ + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
+ new NHXParser() )[ 0 ];
species8.setRooted( true );
gene8.setRooted( true );
Phylogeny[] p8 = sdi_unrooted.infer( gene8, species8, false, false, true, true, 10 );
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
final Phylogeny t0_1 = factory.create( "(((A,B),C),(D,E))", new NHXParser() )[ 0 ];
final Phylogeny[] phylogenies_1 = factory.create( "(((A,B),C),(D,E)) " + "(((C,B),A),(D,E))"
- + "(((A,B),C),(D,E)) " + "(((A,B),C),(D,E))"
- + "(((A,B),C),(D,E))" + "(((C,B),A),(D,E))"
- + "(((E,B),D),(C,A))" + "(((C,B),A),(D,E))"
- + "(((A,B),C),(D,E))" + "(((A,B),C),(D,E))",
- new NHXParser() );
+ + "(((A,B),C),(D,E)) " + "(((A,B),C),(D,E))"
+ + "(((A,B),C),(D,E))" + "(((C,B),A),(D,E))"
+ + "(((E,B),D),(C,A))" + "(((C,B),A),(D,E))"
+ + "(((A,B),C),(D,E))" + "(((A,B),C),(D,E))",
+ new NHXParser() );
SupportCount.count( t0_1, phylogenies_1, true, false );
final Phylogeny t0_2 = factory.create( "(((((A,B),C),D),E),(F,G))", new NHXParser() )[ 0 ];
final Phylogeny[] phylogenies_2 = factory.create( "(((((A,B),C),D),E),(F,G))"
- + "(((((A,B),C),D),E),((F,G),X))"
- + "(((((A,Y),B),C),D),((F,G),E))"
- + "(((((A,B),C),D),E),(F,G))"
- + "(((((A,B),C),D),E),(F,G))"
- + "(((((A,B),C),D),E),(F,G))"
- + "(((((A,B),C),D),E),(F,G),Z)"
- + "(((((A,B),C),D),E),(F,G))"
- + "((((((A,B),C),D),E),F),G)"
- + "(((((X,Y),F,G),E),((A,B),C)),D)",
- new NHXParser() );
+ + "(((((A,B),C),D),E),((F,G),X))"
+ + "(((((A,Y),B),C),D),((F,G),E))"
+ + "(((((A,B),C),D),E),(F,G))"
+ + "(((((A,B),C),D),E),(F,G))"
+ + "(((((A,B),C),D),E),(F,G))"
+ + "(((((A,B),C),D),E),(F,G),Z)"
+ + "(((((A,B),C),D),E),(F,G))"
+ + "((((((A,B),C),D),E),F),G)"
+ + "(((((X,Y),F,G),E),((A,B),C)),D)",
+ new NHXParser() );
SupportCount.count( t0_2, phylogenies_2, true, false );
final PhylogenyNodeIterator it = t0_2.iteratorPostorder();
while ( it.hasNext() ) {
for( final Confidence confidence : confidences ) {
if ( confidence.getType().equals( confidence_type ) ) {
throw new IllegalArgumentException( "confidence [" + confidence_type
- + "] is already present in target" );
+ + "] is already present in target" );
}
}
}
if ( strict ) {
if ( evaluator.getNumberOfExternalNodes() != target.getNumberOfExternalNodes() ) {
throw new IllegalArgumentException( "evaluator #" + counter
- + " does not have the same number of external nodes ["
- + evaluator.getNumberOfExternalNodes() + "] than the corresponding target ["
- + target.getNumberOfExternalNodes() + "]" );
+ + " does not have the same number of external nodes ["
+ + evaluator.getNumberOfExternalNodes() + "] than the corresponding target ["
+ + target.getNumberOfExternalNodes() + "]" );
}
}
final TreeSplitMatrix s = new TreeSplitMatrix( evaluator, strict, target );
&& new_values.containsKey( TP_TAXONOMY_ID_PROVIDER ) ) {
ForesterUtil.ensurePresenceOfTaxonomy( node );
node.getNodeData()
- .getTaxonomy()
- .setIdentifier( new Identifier( new_values.get( TP_TAXONOMY_ID ),
- new_values.get( TP_TAXONOMY_ID_PROVIDER ) ) );
+ .getTaxonomy()
+ .setIdentifier( new Identifier( new_values.get( TP_TAXONOMY_ID ),
+ new_values.get( TP_TAXONOMY_ID_PROVIDER ) ) );
}
else if ( new_values.containsKey( TP_TAXONOMY_ID ) ) {
ForesterUtil.ensurePresenceOfTaxonomy( node );
node.getNodeData().getTaxonomy()
- .setIdentifier( new Identifier( new_values.get( TP_TAXONOMY_ID ) ) );
+ .setIdentifier( new Identifier( new_values.get( TP_TAXONOMY_ID ) ) );
}
if ( new_values.containsKey( TP_TAXONOMY_SN ) ) {
ForesterUtil.ensurePresenceOfTaxonomy( node );
&& new_values.containsKey( TP_SEQ_ACCESSION_SOURCE ) ) {
ForesterUtil.ensurePresenceOfSequence( node );
node.getNodeData()
- .getSequence()
- .setAccession( new Accession( new_values.get( TP_SEQ_ACCESSION ),
- new_values.get( TP_SEQ_ACCESSION_SOURCE ) ) );
+ .getSequence()
+ .setAccession( new Accession( new_values.get( TP_SEQ_ACCESSION ),
+ new_values.get( TP_SEQ_ACCESSION_SOURCE ) ) );
}
if ( new_values.containsKey( TP_SEQ_ANNOTATION_DESC ) ) {
ForesterUtil.ensurePresenceOfSequence( node );
if ( new_values.containsKey( TP_NODE_NAME ) ) {
node.setName( new_values.get( TP_NODE_NAME ) );
}
- } // if ( new_values != null )
+ } // if ( new_values != null )
} // if ( map.containsKey( name ) || ( numbers_of_chars_allowed_to_remove_if_not_found_in_map > 0 ) )
else if ( picky ) {
throw new IllegalArgumentException( "\"" + name + "\" not found in name map" );
final boolean cut_name_after_space,
final boolean trim_after_tilde,
final boolean verbose ) throws IllegalArgumentException, NHXFormatException,
- PhyloXmlDataFormatException {
+ PhyloXmlDataFormatException {
return PhylogenyDecorator.decorate( phylogeny,
map,
field,
}
/**
- *
- *
- *
+ *
+ *
+ *
* @param phylogeny
* @param map
* maps names (in phylogeny) to new values if intermediate_map is
* @param intermediate_map
* maps name (in phylogeny) to a intermediate value
* @throws IllegalArgumentException
- * @throws PhyloXmlDataFormatException
+ * @throws PhyloXmlDataFormatException
*/
public static String decorate( final Phylogeny phylogeny,
final Map<String, String> map,
}
else if ( picky ) {
throw new IllegalArgumentException( " could not get taxonomy from \"" + new_value
- + "\"" );
+ + "\"" );
}
}
switch ( field ) {
node.getNodeData().setSequence( new Sequence() );
}
node.getNodeData().getSequence()
- .setDomainArchitecture( new DomainArchitecture( new_value ) );
+ .setDomainArchitecture( new DomainArchitecture( new_value ) );
break;
case TAXONOMY_CODE:
if ( verbose ) {
}
}
return "updated " + ext_nodes_updated + "/" + ext_nodes + " external nodes, updated " + int_nodes_updated + "/"
- + int_nodes + " internal nodes";
+ + int_nodes + " internal nodes";
}
public static Map<String, Map<String, String>> parseMappingTable( final File mapping_table_file )
/*
* A simple class containing a static method to evaluate the topology of a given
* phylogeny with a list of resampled phylogenies.
- *
- *
+ *
+ *
* @author Christian M Zmasek
*/
public final class SupportCount {
}
/**
- *
+ *
* Precondition: phylogeny and evaluator_phylogeny have to be rooted in the
* same manner.
- *
+ *
* Returns a measure of the similarity ("average bootstrap similarity")
* between the topologies of phylogeny and evaluator_phylogeny: (sum of
* branches which divide phylogeny in a manner consitent with
* evaluator_phylogeny)/sum of branches in phylogeny. Therefore, this
* measure is 1.0 for indentical topologies and 0.0 for completely
* incompatible topologies.
- *
- *
+ *
+ *
* @param phylogeny
* @param evaluator_phylogeny
* @param external_names_per_node
* phylogenies. If phylogenies contains topogies with names not present in
* phylogeny, strip_phylogenies must be set to true. phylogeny must not
* contain names not found in all phylogenies.
- *
+ *
* @param phylogeny
* the topology to be evaluated
* @param evaluator_phylogenies
/**
* If strict is true, target nodes (all external nodes of the phylogeny for
* which support values are to be calculated) is not used for anything during construction.
- *
- *
+ *
+ *
* @param target
* @param evaluator
* @param strict
* Computes the sample standard unit (z-score). Used to compute 'value' in
* terms of standard units. Note that 'value', 'mean' and 'sd' must be all
* from the same sample data.
- *
+ *
* @param value
* a double in the sample for which
* @param mean
final boolean use_last_separator_only,
final String start_of_comment_line,
final boolean tables_separated_by_single_string_line )
- throws IOException {
+ throws IOException {
if ( use_first_separator_only && use_last_separator_only ) {
throw new IllegalArgumentException();
}
if ( !ForesterUtil.isEmpty( line )
&& ( ( ( line.charAt( 0 ) == '"' ) && ( line.charAt( line.length() - 1 ) == '"' ) && ( ForesterUtil
.countChars( line, '"' ) == 2 ) ) || ( ( line.charAt( 0 ) == '\'' )
- && ( line.charAt( line.length() - 1 ) == '\'' ) && ( ForesterUtil.countChars( line, '\'' ) == 2 ) ) ) ) {
+ && ( line.charAt( line.length() - 1 ) == '\'' ) && ( ForesterUtil.countChars( line, '\'' ) == 2 ) ) ) ) {
line = line.substring( 1, line.length() - 1 ).trim();
}
if ( saw_first_table
/**
* Removes quotes
- *
+ *
*/
public String getOptionValueAsCleanString( final String option_name ) throws IllegalArgumentException {
return getOptionValue( option_name ).replaceAll( "\"", "" ).replaceAll( "\'", "" );
// }
if ( getAllOptions().containsKey( key ) ) {
throw new IllegalArgumentException( "attempt to set option \"" + key + "\" mutiple times [" + option
- + "]" );
+ + "]" );
}
options_map.put( key, value );
}
public class CommandProcessBuilder {
public static Process execute( final List<String> command, final File working_dir ) throws InterruptedException,
- IOException {
+ IOException {
final ProcessBuilder builder = new ProcessBuilder( command );
if ( working_dir != null ) {
if ( !working_dir.exists() ) {
/**
* Computes the coefficient of variation. Used to express standard deviation
* independent of units of measure.
- *
+ *
* @return
*/
public abstract double coefficientOfVariation();
/**
* Determines relationship between the mean and the median. This reflects
* how the data differs from the normal bell shaped distribution.
- *
+ *
* @return
*/
public abstract double pearsonianSkewness();
public class FailedConditionCheckException extends RuntimeException {
/**
- *
+ *
*/
private static final long serialVersionUID = -860013990231493438L;
* This calculates a color. If value is equal to min the returned color is
* minColor, if value is equal to max the returned color is maxColor,
* otherwise a color 'proportional' to value is returned.
- *
+ *
* @param value
- * the value
+ * the value
* @param min
- * the smallest value
+ * the smallest value
* @param max
- * the largest value
+ * the largest value
* @param minColor
* the color for min
* @param maxColor
* value is equal to mean the returned color is meanColor, otherwise a color
* 'proportional' to value is returned -- either between min-mean or
* mean-max
- *
+ *
* @param value
* the value
* @param min
* the smallest value
* @param max
- * the largest value
+ * the largest value
* @param mean
- * the mean/median value
+ * the mean/median value
* @param minColor
* the color for min
* @param maxColor
/**
* Helper method for calcColor methods.
- *
+ *
* @param smallercolor_component_x
* color component the smaller color
* @param largercolor_component_x
/**
* Helper method for calcColor methods.
- *
- *
+ *
+ *
* @param value
* the value
* @param larger
/**
* Returns true is Domain domain falls in an uninterrupted stretch of
* covered positions.
- *
+ *
* @param domain
* @param covered_positions
* @return
* This determines whether String[] a and String[] b have at least one
* String in common (intersect). Returns false if at least one String[] is
* null or empty.
- *
+ *
* @param a
* a String[] b a String[]
* @return true if both a and b or not empty or null and contain at least
}
else {
throw new IllegalArgumentException( "attempt to parse object of type [" + source.getClass()
- + "] (can only parse objects of type File, InputStream, String, or StringBuffer)" );
+ + "] (can only parse objects of type File, InputStream, String, or StringBuffer)" );
}
return reader;
}
}
/**
- *
+ *
* Example regarding engulfment: ------------0.1 ----------0.2 --0.3 =>
* domain with 0.3 is ignored
- *
+ *
* -----------0.1 ----------0.2 --0.3 => domain with 0.3 is ignored
- *
- *
+ *
+ *
* ------------0.1 ----------0.3 --0.2 => domains with 0.3 and 0.2 are _not_
* ignored
- *
+ *
* @param max_allowed_overlap
* maximal allowed overlap (inclusive) to be still considered not
* overlapping (zero or negative value to allow any overlap)
final boolean remove_engulfed_domains,
final Protein protein ) {
final Protein pruned_protein = new BasicProtein( protein.getProteinId().getId(), protein.getSpecies()
- .getSpeciesId(), protein.getLength() );
+ .getSpeciesId(), protein.getLength() );
final List<Domain> sorted = SurfacingUtil.sortDomainsWithAscendingConfidenceValues( protein );
final List<Boolean> covered_positions = new ArrayList<Boolean>();
for( final Domain domain : sorted ) {
/**
* Removes all white space from String s.
- *
+ *
* @return String s with white space removed
*/
final public static String removeWhiteSpace( String s ) {
final public static void unexpectedFatalError( final String prg_name, final Exception e ) {
System.err.println();
System.err.println( "[" + prg_name
- + "] > unexpected error; should not have occured! Please contact program author(s)." );
+ + "] > unexpected error; should not have occured! Please contact program author(s)." );
e.printStackTrace( System.err );
System.err.println();
System.exit( -1 );
final public static void unexpectedFatalError( final String prg_name, final String message ) {
System.err.println();
System.err.println( "[" + prg_name
- + "] > unexpected error: should not have occured! Please contact program author(s)." );
+ + "] > unexpected error: should not have occured! Please contact program author(s)." );
System.err.println( message );
System.err.println();
System.exit( -1 );
final public static void unexpectedFatalError( final String prg_name, final String message, final Exception e ) {
System.err.println();
System.err.println( "[" + prg_name
- + "] > unexpected error: should not have occured! Please contact program author(s)." );
+ + "] > unexpected error: should not have occured! Please contact program author(s)." );
System.err.println( message );
e.printStackTrace( System.err );
System.err.println();
public class IllegalFormatUseException extends IllegalArgumentException {
/**
- *
+ *
*/
private static final long serialVersionUID = -1126329548396073983L;
//Protein: 3 letters + 5 numerals\r
//http://www.ncbi.nlm.nih.gov/Sequin/acc.html\r
public final static Pattern GENBANK_NUC_PATTERN_1 = Pattern\r
- .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]\\d{5}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
+ .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]\\d{5}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
public final static Pattern GENBANK_NUC_PATTERN_2 = Pattern\r
- .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{2}\\d{6}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
+ .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{2}\\d{6}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
public final static Pattern GENBANK_PROT_PATTERN = Pattern\r
- .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{3}\\d{5}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
+ .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{3}\\d{5}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
public final static Pattern GI_PATTERN = Pattern\r
- .compile( "(?:\\b|_)(?:GI|gi)[|_=:](\\d+)(?:\\b|_)" );\r
+ .compile( "(?:\\b|_)(?:GI|gi)[|_=:](\\d+)(?:\\b|_)" );\r
public final static String UNIPROT_KB_BASE_PATTERN_STR = "((?:[OPQ][0-9][A-Z0-9]{3}[0-9])|(?:[A-NR-Z][0-9]([A-Z][A-Z0-9]{2}[0-9]){1,2}))";\r
public final static Pattern UNIPROT_KB_PATTERN_0 = Pattern.compile( "(?:\\b|_)"\r
- + UNIPROT_KB_BASE_PATTERN_STR + "(?:\\b|_)" );\r
+ + UNIPROT_KB_BASE_PATTERN_STR + "(?:\\b|_)" );\r
public final static Pattern UNIPROT_KB_PATTERN_1 = Pattern.compile( "(?:\\b|_)(?:sp|tr)[\\.|\\-_=/\\\\]"\r
- + UNIPROT_KB_BASE_PATTERN_STR + "(?:\\b|_)" );\r
+ + UNIPROT_KB_BASE_PATTERN_STR + "(?:\\b|_)" );\r
public final static Pattern UNIPROT_KB_PATTERN_2 = Pattern\r
- .compile( "(?:\\b|_)(?:[A-Z0-9]{2,5}|"\r
- + UNIPROT_KB_BASE_PATTERN_STR\r
- + ")_(([A-Z9][A-Z]{2}[A-Z0-9]{2})|RAT|PIG|PEA)(?:\\b|_)" );\r
+ .compile( "(?:\\b|_)(?:[A-Z0-9]{2,5}|"\r
+ + UNIPROT_KB_BASE_PATTERN_STR\r
+ + ")_(([A-Z9][A-Z]{2}[A-Z0-9]{2})|RAT|PIG|PEA)(?:\\b|_)" );\r
public final static Pattern ENSEMBL_PATTERN = Pattern.compile( "(?:\\b|_)(ENS[A-Z]*[0-9]+)(?:\\b|_)" );\r
- // RefSeq accession numbers can be distinguished from GenBank accessions \r
+ // RefSeq accession numbers can be distinguished from GenBank accessions\r
// by their distinct prefix format of 2 characters followed by an\r
- // underscore character ('_'). For example, a RefSeq protein accession is NP_015325. \r
+ // underscore character ('_'). For example, a RefSeq protein accession is NP_015325.\r
private final static Pattern REFSEQ_PATTERN = Pattern\r
- .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{2}_\\d{6,})(?:[^a-zA-Z0-9]|\\Z)" );\r
+ .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{2}_\\d{6,})(?:[^a-zA-Z0-9]|\\Z)" );\r
\r
private SequenceAccessionTools() {\r
// Hiding the constructor.\r
* This class can be used to execute a system command from a Java application.
* See the documentation for the public methods of this class for more
* information.
- *
+ *
* Documentation for this class is available at this URL:
- *
+ *
* http://devdaily.com/java/java-processbuilder-process-system-exec
- *
+ *
* Copyright 2010 alvin j. alexander, devdaily.com.
- *
+ *
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
* Please see the following page for the LGPL license:
* http://www.gnu.org/licenses/lgpl.txt
- *
+ *
*/
package org.forester.util;
/**
* Pass in the system command you want to run as a List of Strings, as shown here:
- *
+ *
* List<String> commands = new ArrayList<String>();
* commands.add("/sbin/ping");
* commands.add("-c");
* commands.add("www.google.com");
* SystemCommandExecutor commandExecutor = new SystemCommandExecutor(commands);
* commandExecutor.executeCommand();
- *
+ *
* Note: I've removed the other constructor that was here to support executing
* the sudo command. I'll add that back in when I get the sudo command
* working to the point where it won't hang when the given password is
/**
* This class is intended to be used with the SystemCommandExecutor class to let
* users execute system commands from Java applications.
- *
+ *
* This class is based on work that was shared in a JavaWorld article named
* "When System.exec() won't". That article is available at this url:
- *
+ *
* http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
- *
+ *
* Documentation for this class is available at this URL:
- *
+ *
* http://devdaily.com/java/java-processbuilder-process-system-exec
- *
- *
+ *
+ *
* Copyright 2010 alvin j. alexander, devdaily.com.
- *
+ *
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
* Please ee the following page for the LGPL license:
* http://www.gnu.org/licenses/lgpl.txt
- *
+ *
*/
package org.forester.util;
* A simple constructor for when the sudo command is not necessary.
* This constructor will just run the command you provide, without
* running sudo before the command, and without expecting a password.
- *
+ *
* @param inputStream
* @param streamType
*/
/**
* Use this constructor when you want to invoke the 'sudo' command.
* The outputStream must not be null. If it is, you'll regret it. :)
- *
+ *
* TODO this currently hangs if the admin password given for the sudo command is wrong.
- *
+ *
* @param inputStream
* @param streamType
* @param outputStream
private static final String REGQUERY_UTIL = "reg query ";
private static final String REGSTR_TOKEN = "REG_SZ";
private static final String DESKTOP_FOLDER_CMD = REGQUERY_UTIL
- + "\"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\"
- + "Explorer\\Shell Folders\" /v DESKTOP";
+ + "\"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\"
+ + "Explorer\\Shell Folders\" /v DESKTOP";
private WindowsUtils() {
}
private String _tax_id;
// TODO PUBMED 15798186
- //TODO (FEATURES)
+ //TODO (FEATURES)
// source /db_xref="taxon:9606"
- // gene 1..2881
- // /gene="RBM39"
+ // gene 1..2881
+ // /gene="RBM39"
//
- // /db_xref="MIM:604739"
+ // /db_xref="MIM:604739"
// CDS
// /gene="RBM39"
// /db_xref="MIM:604739"
reference sequence was derived from DC346351.1, BC141835.1 and
C75555.1.
On Jun 16, 2011 this sequence version replaced gi:35493810.
-
+
Summary: This gene encodes a member of the U2AF65 family of
proteins. The encoded protein is found in the nucleus, where it
co-localizes with core spliceosomal proteins. It has been shown to
coregulator of the viral oncoprotein v-Rel. Multiple transcript
variants have been observed for this gene. A related pseudogene has
been identified on chromosome X. [provided by RefSeq, Aug 2011].
-
+
Transcript Variant: This variant (1) encodes the longest isoform
(a, also called CC1.4).
-
+
Publication Note: This RefSeq record includes a subset of the
publications that are available for this gene. Please see the Gene
record to access additional publications.
-
+
##Evidence-Data-START##
Transcript exon combination :: BC141835.1, L10911.1 [ECO:0000332]
RNAseq introns :: mixed/partial sample support
recorded"
/note="N-acetylalanine; propagated from
UniProtKB/Swiss-Prot (Q14498.2); acetylation site"
-
+
exon 461..510
/gene="RBM39"
/gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
/inference="alignment:Splign:1.39.8"
-
+
exon 1902..2874
/gene="RBM39"
/gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
/gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
/standard_name="REN58785"
/db_xref="UniSTS:383585"
-
+
polyA_signal 2851..2856
/gene="RBM39"
/gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
polyA_site 2874
/gene="RBM39"
/gene_synonym="CAPER; CAPERalpha; FSAP59; HCC1; RNPC2"
- ORIGIN
+ ORIGIN
1 atttggagct tggggcagct tctcgcgaga gcccgtgctg agggctctgt gaggccccgt
61 gtgtttgtgt gtgtgtatgt gtgctggtga atgtgagtac agggaagcag cggccgccat
121 ttcagggagc ttgtcgacgc tgtcgcaggg gtggatcctg agctgccgaa gccgccgtcc
181 tgctctcccg cgtgggcttc tctaattcca ttgttttttt tagattctct cgggcctagc
241 cgtccttgga acccgatatt cgggctgggc ggttccgcgg cctgggccta ggggcttaac
-
-
-
- */
+
+
+
+ */
private EbiDbEntry() {
}
public static List<UniProtTaxonomy> getTaxonomiesFromCommonNameStrict( final String cn,
final int max_taxonomies_return )
- throws IOException {
+ throws IOException {
final List<UniProtTaxonomy> taxonomies = getTaxonomiesFromCommonName( cn, max_taxonomies_return );
if ( ( taxonomies != null ) && ( taxonomies.size() > 0 ) ) {
final List<UniProtTaxonomy> filtered_taxonomies = new ArrayList<UniProtTaxonomy>();
* Does not return "sub-types".
* For example, for "Mus musculus" only returns "Mus musculus"
* and not "Mus musculus", "Mus musculus bactrianus", ...
- *
+ *
*/
public static List<UniProtTaxonomy> getTaxonomiesFromScientificNameStrict( final String sn,
final int max_taxonomies_return )
- throws IOException {
+ throws IOException {
final List<UniProtTaxonomy> taxonomies = getTaxonomiesFromScientificName( sn, max_taxonomies_return );
if ( ( taxonomies != null ) && ( taxonomies.size() > 0 ) ) {
final List<UniProtTaxonomy> filtered_taxonomies = new ArrayList<UniProtTaxonomy>();
public static List<UniProtTaxonomy> getTaxonomiesFromTaxonomyCode( final String code,
final int max_taxonomies_return )
- throws IOException {
+ throws IOException {
final String my_code = new String( code );
final List<String> result = getTaxonomyStringFromTaxonomyCode( my_code, max_taxonomies_return );
if ( result.size() > 0 ) {
final Accession acc = SequenceAccessionTools.parseAccessorFromString( acc_str );
if ( acc == null ) {
throw new IllegalArgumentException( "could not extract acceptable sequence db accessor from \"" + acc_str
- + "\"" );
+ + "\"" );
}
if ( acc.getSource().equals( Source.REFSEQ.toString() ) || acc.getSource().equals( Source.EMBL.toString() )
|| acc.getSource().equals( Source.NCBI.toString() ) ) {
}
else {
throw new IllegalArgumentException( "don't know how to handle request for source \"" + acc.getSource()
- + "\"" );
+ + "\"" );
}
}
}
in.close();
try {
- // To prevent accessing online dbs in too quick succession.
+ // To prevent accessing online dbs in too quick succession.
Thread.sleep( SLEEP );
}
catch ( final InterruptedException e ) {
final int i_b = target.indexOf( b );
if ( ( i_a < 0 ) || ( i_b < i_a ) ) {
throw new IllegalArgumentException( "attempt to extract from \"" + target + "\" between \"" + a
- + "\" and \"" + b + "\"" );
+ + "\" and \"" + b + "\"" );
}
return target.substring( i_a + a.length(), i_b ).trim();
}
private static List<UniProtTaxonomy> getTaxonomiesFromScientificName( final String sn,
final int max_taxonomies_return )
- throws IOException {
+ throws IOException {
final List<String> result = getTaxonomyStringFromScientificName( sn, max_taxonomies_return );
if ( result.size() > 0 ) {
return parseUniProtTaxonomy( result );
return ( !( ( acc == null ) || ForesterUtil.isEmpty( acc.getSource() ) || ForesterUtil.isEmpty( acc.getValue() ) || ( ( acc
.getSource().equals( Source.UNIPROT.toString() ) )
&& ( acc.getSource().toString().equals( Source.EMBL.toString() ) ) && ( acc.getSource().toString()
- .equals( Source.REFSEQ.toString() ) ) ) ) );
+ .equals( Source.REFSEQ.toString() ) ) ) ) );
}
private static List<UniProtTaxonomy> parseUniProtTaxonomy( final List<String> result ) throws IOException {
&& ForesterUtil.isEmpty( getTaxonomyScientificName() ) && ForesterUtil.isEmpty( getSequenceSymbol() )
&& ForesterUtil.isEmpty( getGeneName() ) && ForesterUtil.isEmpty( getTaxonomyIdentifier() )
&& ForesterUtil.isEmpty( getSequenceSymbol() ) && ( ( getGoTerms() == null ) || getGoTerms().isEmpty() ) && ( ( getCrossReferences() == null ) || getCrossReferences()
- .isEmpty() ) );
+ .isEmpty() ) );
}
private void addCrossReference( final Accession accession ) {
/**
* Creates deep copy for all fields, except lineage.
- *
+ *
* @return
*/
public UniProtTaxonomy copy() {
return new UniProtTaxonomy( getLineage(),
getCode() != null ? new String( getCode() ) : null,
- getCommonName() != null ? new String( getCommonName() ) : null,
- getScientificName() != null ? new String( getScientificName() ) : null,
- getSynonym() != null ? new String( getSynonym() ) : null,
- getRank() != null ? new String( getRank() ) : null,
- getId() != null ? new String( getId() ) : null );
+ getCommonName() != null ? new String( getCommonName() ) : null,
+ getScientificName() != null ? new String( getScientificName() ) : null,
+ getSynonym() != null ? new String( getSynonym() ) : null,
+ getRank() != null ? new String( getRank() ) : null,
+ getId() != null ? new String( getId() ) : null );
}
public String getCode() {
import java.util.List;
/**
- *
+ *
* This is to access the Web API for Biology (WABI) at DDBJ.
* See: http://xml.nig.ac.jp/
*
import java.util.List;
/**
- *
+ *
* This is to access the Web API for Biology (WABI) at DDBJ.
* See: http://xml.nig.ac.jp/
- *
+ *
* Service Description:
- * TXSearch is a retrieval system for a Taxonomy Database which
+ * TXSearch is a retrieval system for a Taxonomy Database which
* was unified by DDBJ, GenBank and EMBL, which is developed by DDBJ.
* See: http://xml.nig.ac.jp/wabi/Method?serviceName=TxSearch&mode=methodList
*