cleanup
[jalview.git] / forester / java / src / org / forester / application / gsdi.java
1 // $Id:
2 // FORESTER -- software libraries and applications
3 // for evolutionary biology research and applications.
4 //
5 // Copyright (C) 2008-2009 Christian M. Zmasek
6 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
7 // All rights reserved
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 //
23 // Contact: phylosoft @ gmail . com
24 // WWW: www.phylosoft.org/forester
25
26 package org.forester.application;
27
28 import java.io.File;
29 import java.io.IOException;
30 import java.text.SimpleDateFormat;
31 import java.util.ArrayList;
32 import java.util.Date;
33 import java.util.List;
34 import java.util.SortedMap;
35 import java.util.SortedSet;
36 import java.util.TreeMap;
37 import java.util.TreeSet;
38
39 import org.forester.io.parsers.PhylogenyParser;
40 import org.forester.io.parsers.nhx.NHXParser;
41 import org.forester.io.parsers.phyloxml.PhyloXmlDataFormatException;
42 import org.forester.io.parsers.phyloxml.PhyloXmlParser;
43 import org.forester.io.parsers.util.ParserUtils;
44 import org.forester.io.writers.PhylogenyWriter;
45 import org.forester.phylogeny.Phylogeny;
46 import org.forester.phylogeny.PhylogenyMethods;
47 import org.forester.phylogeny.PhylogenyNode;
48 import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
49 import org.forester.phylogeny.factories.PhylogenyFactory;
50 import org.forester.sdi.GSDI;
51 import org.forester.sdi.SDI;
52 import org.forester.sdi.SDI.TaxonomyComparisonBase;
53 import org.forester.sdi.SDIException;
54 import org.forester.sdi.SDIse;
55 import org.forester.util.CommandLineArguments;
56 import org.forester.util.EasyWriter;
57 import org.forester.util.ForesterConstants;
58 import org.forester.util.ForesterUtil;
59
60 public final class gsdi {
61
62     private enum BASE_ALGORITHM {
63         GSDI, SDI
64     }
65     final static public boolean REPLACE_UNDERSCORES_IN_NH_SPECIES_TREE = true;
66     final static private String ALLOW_STRIPPING_OF_GENE_TREE_OPTION    = "g";
67     final static private String SDISE_OPTION                           = "b";
68     final static private String MOST_PARSIMONIOUS_OPTION               = "m";
69     final static private String GUESS_FORMAT_OF_SPECIES_TREE           = "q";
70     final static private String HELP_OPTION_1                          = "help";
71     final static private String HELP_OPTION_2                          = "h";
72     final static private String DEFAULT_OUTFILE_SUFFIX                 = "_gsdi_out.xml";
73     final static private String SUFFIX_FOR_SPECIES_TREE_USED           = "_species_tree_used.xml";
74     final static private String LOGFILE_SUFFIX                         = "_gsdi_log.txt";
75     final static private String PRG_NAME                               = "gsdi";
76     final static private String PRG_VERSION                            = "1.000";
77     final static private String PRG_DATE                               = "120608";
78     final static private String PRG_DESC                               = "general speciation duplication inference";
79     final static private String E_MAIL                                 = "phylosoft@gmail.com";
80     final static private String WWW                                    = "www.phylosoft.org/forester";
81
82     public static void main( final String args[] ) {
83         try {
84             ForesterUtil.printProgramInformation( PRG_NAME,
85                                                   PRG_DESC,
86                                                   PRG_VERSION,
87                                                   PRG_DATE,
88                                                   E_MAIL,
89                                                   WWW,
90                                                   ForesterUtil.getForesterLibraryInformation() );
91             CommandLineArguments cla = null;
92             try {
93                 cla = new CommandLineArguments( args );
94             }
95             catch ( final Exception e ) {
96                 ForesterUtil.fatalError( PRG_NAME, e.getMessage() );
97             }
98             if ( cla.isOptionSet( gsdi.HELP_OPTION_1 ) || cla.isOptionSet( gsdi.HELP_OPTION_2 ) ) {
99                 System.out.println();
100                 gsdi.print_help();
101                 System.exit( 0 );
102             }
103             else if ( ( args.length < 2 ) || ( cla.getNumberOfNames() < 2 ) || ( cla.getNumberOfNames() > 3 ) ) {
104                 System.out.println();
105                 System.out.println( "Wrong number of arguments." );
106                 System.out.println();
107                 gsdi.print_help();
108                 System.exit( -1 );
109             }
110             final List<String> allowed_options = new ArrayList<String>();
111             allowed_options.add( gsdi.SDISE_OPTION );
112             allowed_options.add( gsdi.GUESS_FORMAT_OF_SPECIES_TREE );
113             allowed_options.add( gsdi.MOST_PARSIMONIOUS_OPTION );
114             allowed_options.add( gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION );
115             final String dissallowed_options = cla.validateAllowedOptionsAsString( allowed_options );
116             if ( dissallowed_options.length() > 0 ) {
117                 ForesterUtil.fatalError( gsdi.PRG_NAME, "unknown option(s): " + dissallowed_options );
118             }
119             execute( cla );
120         }
121         catch ( final IOException e ) {
122             ForesterUtil.fatalError( gsdi.PRG_NAME, e.getMessage() );
123         }
124     }
125
126     private static void execute( final CommandLineArguments cla ) throws IOException {
127         BASE_ALGORITHM base_algorithm = BASE_ALGORITHM.GSDI;
128         boolean most_parsimonous_duplication_model = false;
129         boolean allow_stripping_of_gene_tree = false;
130         if ( cla.isOptionSet( gsdi.SDISE_OPTION ) ) {
131             base_algorithm = BASE_ALGORITHM.SDI;
132         }
133         if ( cla.isOptionSet( gsdi.MOST_PARSIMONIOUS_OPTION ) ) {
134             if ( base_algorithm != BASE_ALGORITHM.GSDI ) {
135                 ForesterUtil.fatalError( gsdi.PRG_NAME, "Can only use most parsimonious duplication mode with GSDI" );
136             }
137             most_parsimonous_duplication_model = true;
138         }
139         if ( cla.isOptionSet( gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION ) ) {
140             if ( base_algorithm != BASE_ALGORITHM.GSDI ) {
141                 ForesterUtil.fatalError( gsdi.PRG_NAME, "Can only allow stripping of gene tree with GSDI" );
142             }
143             allow_stripping_of_gene_tree = true;
144         }
145         Phylogeny species_tree = null;
146         Phylogeny gene_tree = null;
147         File gene_tree_file = null;
148         File species_tree_file = null;
149         File out_file = null;
150         File log_file = null;
151         EasyWriter log_writer = null;
152         try {
153             gene_tree_file = cla.getFile( 0 );
154             species_tree_file = cla.getFile( 1 );
155             if ( cla.getNumberOfNames() == 3 ) {
156                 out_file = cla.getFile( 2 );
157             }
158             else {
159                 out_file = new File( ForesterUtil.removeSuffix( gene_tree_file.toString() ) + DEFAULT_OUTFILE_SUFFIX );
160             }
161             log_file = new File( ForesterUtil.removeSuffix( out_file.toString() ) + LOGFILE_SUFFIX );
162         }
163         catch ( final IllegalArgumentException e ) {
164             ForesterUtil.fatalError( gsdi.PRG_NAME, "error in command line: " + e.getMessage() );
165         }
166         if ( ForesterUtil.isReadableFile( gene_tree_file ) != null ) {
167             ForesterUtil.fatalError( gsdi.PRG_NAME, ForesterUtil.isReadableFile( gene_tree_file ) );
168         }
169         if ( ForesterUtil.isReadableFile( species_tree_file ) != null ) {
170             ForesterUtil.fatalError( gsdi.PRG_NAME, ForesterUtil.isReadableFile( species_tree_file ) );
171         }
172         if ( ForesterUtil.isWritableFile( out_file ) != null ) {
173             ForesterUtil.fatalError( gsdi.PRG_NAME, ForesterUtil.isWritableFile( out_file ) );
174         }
175         if ( ForesterUtil.isWritableFile( log_file ) != null ) {
176             ForesterUtil.fatalError( gsdi.PRG_NAME, ForesterUtil.isWritableFile( log_file ) );
177         }
178         try {
179             log_writer = ForesterUtil.createEasyWriter( log_file );
180         }
181         catch ( final IOException e ) {
182             ForesterUtil.fatalError( gsdi.PRG_NAME, "Failed to create [" + log_file + "]: " + e.getMessage() );
183         }
184         try {
185             final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
186             gene_tree = factory.create( gene_tree_file, new PhyloXmlParser() )[ 0 ];
187         }
188         catch ( final IOException e ) {
189             ForesterUtil.fatalError( gsdi.PRG_NAME,
190                                      "Failed to read gene tree from [" + gene_tree_file + "]: " + e.getMessage() );
191         }
192         try {
193             final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
194             final PhylogenyParser p = ParserUtils.createParserDependingOnFileType( species_tree_file, true );
195             if ( p instanceof PhyloXmlParser ) {
196                 species_tree = factory.create( species_tree_file, p )[ 0 ];
197             }
198             else {
199                 if ( REPLACE_UNDERSCORES_IN_NH_SPECIES_TREE && ( p instanceof NHXParser ) ) {
200                     ( ( NHXParser ) p ).setReplaceUnderscores( true );
201                 }
202                 species_tree = factory.create( species_tree_file, p )[ 0 ];
203                 final TaxonomyComparisonBase comp_base = GSDI.determineTaxonomyComparisonBase( gene_tree );
204                 switch ( comp_base ) {
205                     case SCIENTIFIC_NAME:
206                         try {
207                             PhylogenyMethods
208                                     .transferNodeNameToField( species_tree,
209                                                               PhylogenyMethods.PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME,
210                                                               true );
211                         }
212                         catch ( final PhyloXmlDataFormatException e ) {
213                             ForesterUtil.fatalError( gsdi.PRG_NAME,
214                                                      "Failed to transfer general node name to scientific name, in ["
215                                                              + species_tree_file + "]: " + e.getMessage() );
216                         }
217                         break;
218                     case CODE:
219                         try {
220                             PhylogenyMethods
221                                     .transferNodeNameToField( species_tree,
222                                                               PhylogenyMethods.PhylogenyNodeField.TAXONOMY_CODE,
223                                                               true );
224                         }
225                         catch ( final PhyloXmlDataFormatException e ) {
226                             ForesterUtil.fatalError( gsdi.PRG_NAME,
227                                                      "Failed to transfer general node name to taxonomy code, in ["
228                                                              + species_tree_file + "]: " + e.getMessage() );
229                         }
230                         break;
231                     case ID:
232                         try {
233                             PhylogenyMethods.transferNodeNameToField( species_tree,
234                                                                       PhylogenyMethods.PhylogenyNodeField.TAXONOMY_ID,
235                                                                       true );
236                         }
237                         catch ( final PhyloXmlDataFormatException e ) {
238                             ForesterUtil.fatalError( gsdi.PRG_NAME,
239                                                      "Failed to transfer general node name to taxonomy id, in ["
240                                                              + species_tree_file + "]: " + e.getMessage() );
241                         }
242                         break;
243                     default:
244                         ForesterUtil.fatalError( gsdi.PRG_NAME, "unable to determine comparison base" );
245                 }
246             }
247         }
248         catch ( final IOException e ) {
249             ForesterUtil.fatalError( gsdi.PRG_NAME, "Failed to read species tree from [" + species_tree_file + "]: "
250                     + e.getMessage() );
251         }
252         gene_tree.setRooted( true );
253         species_tree.setRooted( true );
254         if ( !gene_tree.isCompletelyBinary() ) {
255             log_writer.println( "User Error: gene tree is not completely binary" );
256             log_writer.close();
257             ForesterUtil.fatalError( gsdi.PRG_NAME, "gene tree is not completely binary" );
258         }
259         if ( base_algorithm != BASE_ALGORITHM.GSDI ) {
260             if ( !species_tree.isCompletelyBinary() ) {
261                 log_writer.println( "User Error: species tree is not completely binary, use GSDI instead" );
262                 log_writer.close();
263                 ForesterUtil.fatalError( gsdi.PRG_NAME, "species tree is not completely binary, use GSDI instead" );
264             }
265         }
266         log_writer.println( PRG_NAME + " - " + PRG_DESC );
267         log_writer.println( "  version         : " + PRG_VERSION );
268         log_writer.println( "  date            : " + PRG_DATE );
269         log_writer.println( "  forester version: " + ForesterConstants.FORESTER_VERSION );
270         log_writer.println();
271         log_writer.println( "Start time                               : "
272                 + new SimpleDateFormat( "yyyyMMdd HH:mm:ss" ).format( new Date() ) );
273         System.out.println( "Start time                               : "
274                 + new SimpleDateFormat( "yyyyMMdd HH:mm:ss" ).format( new Date() ) );
275         log_writer.println( "Gene tree file                           : " + gene_tree_file.getCanonicalPath() );
276         System.out.println( "Gene tree file                           : " + gene_tree_file.getCanonicalPath() );
277         log_writer.println( "Gene tree name                           : "
278                 + ( ForesterUtil.isEmpty( gene_tree.getName() ) ? "" : gene_tree.getName() ) );
279         System.out.println( "Gene tree name                           : "
280                 + ( ForesterUtil.isEmpty( gene_tree.getName() ) ? "" : gene_tree.getName() ) );
281         log_writer.println( "Species tree file                        : " + species_tree_file.getCanonicalPath() );
282         System.out.println( "Species tree file                        : " + species_tree_file.getCanonicalPath() );
283         log_writer.println( "Species tree name                        : "
284                 + ( ForesterUtil.isEmpty( species_tree.getName() ) ? "" : gene_tree.getName() ) );
285         System.out.println( "Species tree name                        : "
286                 + ( ForesterUtil.isEmpty( species_tree.getName() ) ? "" : gene_tree.getName() ) );
287         SDI sdi = null;
288         final long start_time = new Date().getTime();
289         try {
290             if ( base_algorithm == BASE_ALGORITHM.GSDI ) {
291                 System.out.println( "Use most parsimonous duplication model   : " + most_parsimonous_duplication_model );
292                 System.out.println( "Allow stripping of gene tree nodes       : " + allow_stripping_of_gene_tree );
293                 log_writer.println( "Use most parsimonous duplication model   : " + most_parsimonous_duplication_model );
294                 log_writer.println( "Allow stripping of gene tree nodes       : " + allow_stripping_of_gene_tree );
295                 log_writer.flush();
296                 sdi = new GSDI( gene_tree,
297                                 species_tree,
298                                 most_parsimonous_duplication_model,
299                                 allow_stripping_of_gene_tree,
300                                 true );
301             }
302             else {
303                 System.out.println();
304                 System.out.println( "Using SDIse algorithm" );
305                 log_writer.println( "Using SDIse algorithm" );
306                 log_writer.flush();
307                 sdi = new SDIse( gene_tree, species_tree );
308             }
309         }
310         catch ( final SDIException e ) {
311             log_writer.println( "User Error: " + e.getLocalizedMessage() );
312             log_writer.close();
313             ForesterUtil.fatalError( PRG_NAME, e.getLocalizedMessage() );
314         }
315         catch ( final IOException e ) {
316             log_writer.println( "Error: " + e );
317             log_writer.close();
318             ForesterUtil.fatalError( PRG_NAME, e.toString() );
319         }
320         catch ( final Exception e ) {
321             log_writer.println( "Error: " + e );
322             log_writer.close();
323             e.printStackTrace();
324             System.exit( -1 );
325         }
326         System.out.println( "Running time (excluding I/O)             : " + ( new Date().getTime() - start_time )
327                 + "ms" );
328         log_writer.println( "Running time (excluding I/O)             : " + ( new Date().getTime() - start_time )
329                 + "ms" );
330         if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
331             final GSDI gsdi = ( GSDI ) sdi;
332             System.out.println( "Mapping based on                         : " + gsdi.getTaxCompBase() );
333             log_writer.println( "Mapping based on                         : " + gsdi.getTaxCompBase() );
334         }
335         try {
336             final PhylogenyWriter writer = new PhylogenyWriter();
337             writer.toPhyloXML( out_file, gene_tree, 0 );
338         }
339         catch ( final IOException e ) {
340             ForesterUtil.fatalError( PRG_NAME,
341                                      "Failed to write to [" + out_file.getCanonicalPath() + "]: " + e.getMessage() );
342         }
343         System.out.println( "Wrote resulting gene tree to             : " + out_file.getCanonicalPath() );
344         log_writer.println( "Wrote resulting gene tree to             : " + out_file.getCanonicalPath() );
345         if ( base_algorithm == BASE_ALGORITHM.SDI ) {
346             sdi.computeMappingCostL();
347             System.out.println( "Mapping cost                             : " + sdi.computeMappingCostL() );
348             log_writer.println( "Mapping cost                             : " + sdi.computeMappingCostL() );
349         }
350         else if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
351             final GSDI gsdi = ( GSDI ) sdi;
352             final File species_tree_used_file = new File( ForesterUtil.removeSuffix( out_file.toString() )
353                     + SUFFIX_FOR_SPECIES_TREE_USED );
354             try {
355                 final PhylogenyWriter writer = new PhylogenyWriter();
356                 writer.toPhyloXML( species_tree_used_file, gsdi.getSpeciesTree(), 0 );
357             }
358             catch ( final IOException e ) {
359                 ForesterUtil.fatalError( PRG_NAME, "Failed to write to [" + species_tree_used_file.getCanonicalPath()
360                         + "]: " + e.getMessage() );
361             }
362             System.out.println( "Wrote (stripped) species tree to         : "
363                     + species_tree_used_file.getCanonicalPath() );
364             log_writer.println( "Wrote (stripped) species tree to         : "
365                     + species_tree_used_file.getCanonicalPath() );
366         }
367         System.out.println( "Number of external nodes in gene tree    : " + gene_tree.getNumberOfExternalNodes() );
368         log_writer.println( "Number of external nodes in gene tree    : " + gene_tree.getNumberOfExternalNodes() );
369         System.out.println( "Number of external nodes in species tree : "
370                 + sdi.getSpeciesTree().getNumberOfExternalNodes() );
371         log_writer.println( "Number of external nodes in species tree : "
372                 + sdi.getSpeciesTree().getNumberOfExternalNodes() );
373         if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
374             final GSDI gsdi = ( GSDI ) sdi;
375             final int poly = PhylogenyMethods.countNumberOfPolytomies( gsdi.getSpeciesTree() );
376             System.out.println( "Number of polytomies in species tree     : " + poly );
377             log_writer.println( "Number of polytomies in species tree     : " + poly );
378             System.out.println( "External nodes stripped from gene tree   : "
379                     + gsdi.getStrippedExternalGeneTreeNodes().size() );
380             log_writer.println( "External nodes stripped from gene tree   : "
381                     + gsdi.getStrippedExternalGeneTreeNodes().size() );
382             System.out.println( "External nodes stripped from species tree: "
383                     + gsdi.getStrippedSpeciesTreeNodes().size() );
384             log_writer.println( "External nodes stripped from species tree: "
385                     + gsdi.getStrippedSpeciesTreeNodes().size() );
386         }
387         System.out.println();
388         System.out.println( "Number of duplications                   : " + sdi.getDuplicationsSum() );
389         log_writer.println( "Number of duplications                   : " + sdi.getDuplicationsSum() );
390         if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
391             final GSDI gsdi = ( GSDI ) sdi;
392             if ( !most_parsimonous_duplication_model ) {
393                 final int u = gsdi.getSpeciationOrDuplicationEventsSum();
394                 System.out.println( "Number of potential duplications         : " + u );
395                 log_writer.println( "Number of potential duplications         : " + u );
396             }
397             System.out.println( "Number of speciations                    : " + gsdi.getSpeciationsSum() );
398             log_writer.println( "Number of speciations                    : " + gsdi.getSpeciationsSum() );
399             log_writer.println();
400             printMappedNodesToLog( log_writer, gsdi );
401             log_writer.println();
402             printStrippedGeneTreeNodesToLog( log_writer, gsdi );
403             log_writer.println();
404             printStrippedSpeciesTreeNodesToLog( log_writer, gsdi );
405         }
406         System.out.println();
407         System.out.println( "Wrote log to                             : " + log_file.getCanonicalPath() );
408         System.out.println();
409         log_writer.close();
410     }
411
412     private static void printMappedNodesToLog( final EasyWriter log_writer, final GSDI gsdi ) throws IOException {
413         final SortedSet<String> ss = new TreeSet<String>();
414         for( final PhylogenyNode n : gsdi.getMappedExternalSpeciesTreeNodes() ) {
415             ss.add( n.toString() );
416         }
417         log_writer.println( "The following " + ss.size() + " species were used: " );
418         for( final String s : ss ) {
419             log_writer.println( "  " + s );
420         }
421     }
422
423     private static void printStrippedGeneTreeNodesToLog( final EasyWriter log_writer, final GSDI gsdi )
424             throws IOException {
425         final SortedMap<String, Integer> sm = new TreeMap<String, Integer>();
426         for( final PhylogenyNode n : gsdi.getStrippedExternalGeneTreeNodes() ) {
427             final String s = n.toString();
428             if ( sm.containsKey( s ) ) {
429                 sm.put( s, sm.get( s ) + 1 );
430             }
431             else {
432                 sm.put( s, 1 );
433             }
434         }
435         log_writer.println( "The following " + sm.size() + " nodes were stripped from the gene tree: " );
436         for( final String s : sm.keySet() ) {
437             final int count = sm.get( s );
438             if ( count == 1 ) {
439                 log_writer.println( "  " + s );
440             }
441             else {
442                 log_writer.println( "  " + s + " [" + count + "]" );
443             }
444         }
445     }
446
447     private static void printStrippedSpeciesTreeNodesToLog( final EasyWriter log_writer, final GSDI gsdi )
448             throws IOException {
449         final SortedSet<String> ss = new TreeSet<String>();
450         for( final PhylogenyNode n : gsdi.getStrippedSpeciesTreeNodes() ) {
451             ss.add( n.toString() );
452         }
453         log_writer.println( "The following " + ss.size() + " nodes were stripped from the species tree: " );
454         for( final String n : ss ) {
455             log_writer.println( "  " + n );
456         }
457     }
458
459     private static void print_help() {
460         System.out.println( "Usage: " + gsdi.PRG_NAME
461                 + " [-options] <gene tree in phyloXML format> <species tree> [outfile]" );
462         System.out.println();
463         System.out.println( "Options:" );
464         System.out.println( " -" + gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION
465                 + ": to allow stripping of gene tree nodes without a matching species" );
466         System.out.println( " -" + gsdi.MOST_PARSIMONIOUS_OPTION
467                 + ": use most parimonious duplication model for GSDI: " );
468         System.out.println( "     assign nodes as speciations which would otherwise be assiged" );
469         System.out.println( "     as potential duplications dueof polytomies in the species tree" );
470         System.out.println( " -" + gsdi.GUESS_FORMAT_OF_SPECIES_TREE
471                 + ": to allow species tree in other formats than phyloXML (i.e. Newick, NHX, Nexus)" );
472         System.out.println( " -" + gsdi.SDISE_OPTION
473                 + ": to use SDIse algorithm instead of GSDI algorithm (for binary species trees)" );
474         System.out.println();
475         System.out.println( "Gene tree:" );
476         System.out.println( " in phyloXM format, with taxonomy and sequence data in appropriate fields" );
477         System.out.println();
478         System.out.println( "Species tree:" );
479         System.out.println( " in phyloXML format (unless option -" + gsdi.GUESS_FORMAT_OF_SPECIES_TREE + " is used)" );
480         System.out.println();
481         System.out.println( "Example: gsdi -" + ALLOW_STRIPPING_OF_GENE_TREE_OPTION
482                 + "  gene_tree.xml tree_of_life.xml out.xml" );
483         System.out.println();
484     }
485 }