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 SDI_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_LIST_OF_STIPPED_GENE_TREE_NODES = "_stripped_gene_tree_nodes.txt";
74     final static private String SUFFIX_FOR_SPECIES_TREE_USED               = "_species_tree_used.xml";
75     final static private String LOGFILE_SUFFIX                             = "_gsdi_log.txt";
76     final static private String PRG_NAME                                   = "gsdi";
77     final static private String PRG_VERSION                                = "0.901";
78     final static private String PRG_DATE                                   = "120608";
79     final static private String PRG_DESC                                   = "general speciation duplication inference";
80     final static private String E_MAIL                                     = "phylosoft@gmail.com";
81     final static private String WWW                                        = "www.phylosoft.org/forester";
82
83     public static void main( final String args[] ) {
84         try {
85             ForesterUtil.printProgramInformation( PRG_NAME,
86                                                   PRG_DESC,
87                                                   PRG_VERSION,
88                                                   PRG_DATE,
89                                                   E_MAIL,
90                                                   WWW,
91                                                   ForesterUtil.getForesterLibraryInformation() );
92             CommandLineArguments cla = null;
93             try {
94                 cla = new CommandLineArguments( args );
95             }
96             catch ( final Exception e ) {
97                 ForesterUtil.fatalError( PRG_NAME, e.getMessage() );
98             }
99             if ( cla.isOptionSet( gsdi.HELP_OPTION_1 ) || cla.isOptionSet( gsdi.HELP_OPTION_2 ) ) {
100                 System.out.println();
101                 gsdi.print_help();
102                 System.exit( 0 );
103             }
104             else if ( ( args.length < 2 ) || ( cla.getNumberOfNames() < 2 ) || ( cla.getNumberOfNames() > 3 ) ) {
105                 System.out.println();
106                 System.out.println( "Wrong number of arguments." );
107                 System.out.println();
108                 gsdi.print_help();
109                 System.exit( -1 );
110             }
111             final List<String> allowed_options = new ArrayList<String>();
112             allowed_options.add( gsdi.SDI_OPTION );
113             allowed_options.add( gsdi.GUESS_FORMAT_OF_SPECIES_TREE );
114             allowed_options.add( gsdi.MOST_PARSIMONIOUS_OPTION );
115             allowed_options.add( gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION );
116             final String dissallowed_options = cla.validateAllowedOptionsAsString( allowed_options );
117             if ( dissallowed_options.length() > 0 ) {
118                 ForesterUtil.fatalError( gsdi.PRG_NAME, "unknown option(s): " + dissallowed_options );
119             }
120             execute( cla );
121         }
122         catch ( final IOException e ) {
123             ForesterUtil.fatalError( gsdi.PRG_NAME, e.getMessage() );
124         }
125     }
126
127     private static void execute( final CommandLineArguments cla ) throws IOException {
128         BASE_ALGORITHM base_algorithm = BASE_ALGORITHM.GSDI;
129         boolean most_parsimonous_duplication_model = false;
130         boolean species_tree_in_phyloxml = true;
131         boolean allow_stripping_of_gene_tree = false;
132         if ( cla.isOptionSet( gsdi.SDI_OPTION ) ) {
133             base_algorithm = BASE_ALGORITHM.SDI;
134         }
135         if ( cla.isOptionSet( gsdi.MOST_PARSIMONIOUS_OPTION ) ) {
136             if ( base_algorithm != BASE_ALGORITHM.GSDI ) {
137                 ForesterUtil.fatalError( gsdi.PRG_NAME, "Can only use most parsimonious duplication mode with GSDI" );
138             }
139             most_parsimonous_duplication_model = true;
140         }
141         if ( cla.isOptionSet( gsdi.GUESS_FORMAT_OF_SPECIES_TREE ) ) {
142             species_tree_in_phyloxml = false;
143         }
144         if ( cla.isOptionSet( gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION ) ) {
145             if ( base_algorithm != BASE_ALGORITHM.GSDI ) {
146                 ForesterUtil.fatalError( gsdi.PRG_NAME, "Can only allow stripping of gene tree with GSDI" );
147             }
148             allow_stripping_of_gene_tree = true;
149         }
150         Phylogeny species_tree = null;
151         Phylogeny gene_tree = null;
152         File gene_tree_file = null;
153         File species_tree_file = null;
154         File out_file = null;
155         File log_file = null;
156         EasyWriter log_writer = null;
157         try {
158             gene_tree_file = cla.getFile( 0 );
159             species_tree_file = cla.getFile( 1 );
160             if ( cla.getNumberOfNames() == 3 ) {
161                 out_file = cla.getFile( 2 );
162             }
163             else {
164                 out_file = new File( ForesterUtil.removeSuffix( gene_tree_file.toString() ) + DEFAULT_OUTFILE_SUFFIX );
165             }
166             log_file = new File( ForesterUtil.removeSuffix( out_file.toString() ) + LOGFILE_SUFFIX );
167         }
168         catch ( final IllegalArgumentException e ) {
169             ForesterUtil.fatalError( gsdi.PRG_NAME, "error in command line: " + e.getMessage() );
170         }
171         if ( ForesterUtil.isReadableFile( gene_tree_file ) != null ) {
172             ForesterUtil.fatalError( gsdi.PRG_NAME, ForesterUtil.isReadableFile( gene_tree_file ) );
173         }
174         if ( ForesterUtil.isReadableFile( species_tree_file ) != null ) {
175             ForesterUtil.fatalError( gsdi.PRG_NAME, ForesterUtil.isReadableFile( species_tree_file ) );
176         }
177         if ( ForesterUtil.isWritableFile( out_file ) != null ) {
178             ForesterUtil.fatalError( gsdi.PRG_NAME, ForesterUtil.isWritableFile( out_file ) );
179         }
180         if ( ForesterUtil.isWritableFile( log_file ) != null ) {
181             ForesterUtil.fatalError( gsdi.PRG_NAME, ForesterUtil.isWritableFile( log_file ) );
182         }
183         try {
184             log_writer = ForesterUtil.createEasyWriter( log_file );
185         }
186         catch ( final IOException e ) {
187             ForesterUtil.fatalError( gsdi.PRG_NAME, "Failed to create [" + log_file + "]: " + e.getMessage() );
188         }
189         try {
190             final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
191             gene_tree = factory.create( gene_tree_file, new PhyloXmlParser() )[ 0 ];
192         }
193         catch ( final IOException e ) {
194             ForesterUtil.fatalError( gsdi.PRG_NAME,
195                                      "Failed to read gene tree from [" + gene_tree_file + "]: " + e.getMessage() );
196         }
197         try {
198             final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
199             if ( species_tree_in_phyloxml ) {
200                 species_tree = factory.create( species_tree_file, new PhyloXmlParser() )[ 0 ];
201             }
202             else {
203                 final PhylogenyParser p = ParserUtils.createParserDependingOnFileType( species_tree_file, true );
204                 if ( REPLACE_UNDERSCORES_IN_NH_SPECIES_TREE && ( p instanceof NHXParser ) ) {
205                     ( ( NHXParser ) p ).setReplaceUnderscores( true );
206                 }
207                 species_tree = factory.create( species_tree_file, p )[ 0 ];
208                 final TaxonomyComparisonBase comp_base = GSDI.determineTaxonomyComparisonBase( gene_tree );
209                 switch ( comp_base ) {
210                     case SCIENTIFIC_NAME:
211                         try {
212                             PhylogenyMethods
213                                     .transferNodeNameToField( species_tree,
214                                                               PhylogenyMethods.PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME,
215                                                               true );
216                         }
217                         catch ( final PhyloXmlDataFormatException e ) {
218                             ForesterUtil.fatalError( gsdi.PRG_NAME,
219                                                      "Failed to transfer general node name to scientific name, in ["
220                                                              + species_tree_file + "]: " + e.getMessage() );
221                         }
222                         break;
223                     case CODE:
224                         try {
225                             PhylogenyMethods
226                                     .transferNodeNameToField( species_tree,
227                                                               PhylogenyMethods.PhylogenyNodeField.TAXONOMY_CODE,
228                                                               true );
229                         }
230                         catch ( final PhyloXmlDataFormatException e ) {
231                             ForesterUtil.fatalError( gsdi.PRG_NAME,
232                                                      "Failed to transfer general node name to taxonomy code, in ["
233                                                              + species_tree_file + "]: " + e.getMessage() );
234                         }
235                         break;
236                     case ID:
237                         try {
238                             PhylogenyMethods.transferNodeNameToField( species_tree,
239                                                                       PhylogenyMethods.PhylogenyNodeField.TAXONOMY_ID,
240                                                                       true );
241                         }
242                         catch ( final PhyloXmlDataFormatException e ) {
243                             ForesterUtil.fatalError( gsdi.PRG_NAME,
244                                                      "Failed to transfer general node name to taxonomy id, in ["
245                                                              + species_tree_file + "]: " + e.getMessage() );
246                         }
247                         break;
248                     default:
249                         ForesterUtil.fatalError( gsdi.PRG_NAME, "unable to determine comparison base" );
250                 }
251             }
252         }
253         catch ( final IOException e ) {
254             ForesterUtil.fatalError( gsdi.PRG_NAME, "Failed to read species tree from [" + species_tree_file + "]: "
255                     + e.getMessage() );
256         }
257         gene_tree.setRooted( true );
258         species_tree.setRooted( true );
259         if ( !gene_tree.isCompletelyBinary() ) {
260             log_writer.println( "User Error: gene tree is not completely binary" );
261             log_writer.close();
262             ForesterUtil.fatalError( gsdi.PRG_NAME, "gene tree is not completely binary" );
263         }
264         if ( base_algorithm != BASE_ALGORITHM.GSDI ) {
265             if ( !species_tree.isCompletelyBinary() ) {
266                 log_writer.println( "User Error: species tree is not completely binary, use GSDI instead" );
267                 log_writer.close();
268                 ForesterUtil.fatalError( gsdi.PRG_NAME, "species tree is not completely binary, use GSDI instead" );
269             }
270         }
271         log_writer.println( PRG_NAME + " - " + PRG_DESC );
272         log_writer.println( "  version         : " + PRG_VERSION );
273         log_writer.println( "  date            : " + PRG_DATE );
274         log_writer.println( "  forester version: " + ForesterConstants.FORESTER_VERSION );
275         log_writer.println();
276         log_writer.println( "Start time                               : "
277                 + new SimpleDateFormat( "yyyyMMdd HH:mm:ss" ).format( new Date() ) );
278         System.out.println( "Start time                               : "
279                 + new SimpleDateFormat( "yyyyMMdd HH:mm:ss" ).format( new Date() ) );
280         log_writer.println( "Gene tree file                           : " + gene_tree_file.getCanonicalPath() );
281         System.out.println( "Gene tree file                           : " + gene_tree_file.getCanonicalPath() );
282         log_writer.println( "Gene tree name                           : "
283                 + ( ForesterUtil.isEmpty( gene_tree.getName() ) ? "" : gene_tree.getName() ) );
284         System.out.println( "Gene tree name                           : "
285                 + ( ForesterUtil.isEmpty( gene_tree.getName() ) ? "" : gene_tree.getName() ) );
286         log_writer.println( "Species tree file                        : " + species_tree_file.getCanonicalPath() );
287         System.out.println( "Species tree file                        : " + species_tree_file.getCanonicalPath() );
288         log_writer.println( "Species tree name                        : "
289                 + ( ForesterUtil.isEmpty( species_tree.getName() ) ? "" : gene_tree.getName() ) );
290         System.out.println( "Species tree name                        : "
291                 + ( ForesterUtil.isEmpty( species_tree.getName() ) ? "" : gene_tree.getName() ) );
292         SDI sdi = null;
293         final long start_time = new Date().getTime();
294         try {
295             if ( base_algorithm == BASE_ALGORITHM.GSDI ) {
296                 System.out.println( "Use most parsimonous duplication model   : " + most_parsimonous_duplication_model );
297                 System.out.println( "Allow stripping of gene tree nodes       : " + allow_stripping_of_gene_tree );
298                 log_writer.println( "Use most parsimonous duplication model   : " + most_parsimonous_duplication_model );
299                 log_writer.println( "Allow stripping of gene tree nodes       : " + allow_stripping_of_gene_tree );
300                 log_writer.flush();
301                 sdi = new GSDI( gene_tree,
302                                 species_tree,
303                                 most_parsimonous_duplication_model,
304                                 allow_stripping_of_gene_tree,
305                                 true );
306             }
307             else {
308                 System.out.println();
309                 System.out.println( "Using SDIse algorithm" );
310                 log_writer.println( "Using SDIse algorithm" );
311                 log_writer.flush();
312                 sdi = new SDIse( gene_tree, species_tree );
313             }
314         }
315         catch ( final SDIException e ) {
316             log_writer.println( "User Error: " + e.getLocalizedMessage() );
317             log_writer.close();
318             ForesterUtil.fatalError( PRG_NAME, e.getLocalizedMessage() );
319         }
320         catch ( final IOException e ) {
321             log_writer.println( "Error: " + e );
322             log_writer.close();
323             ForesterUtil.fatalError( PRG_NAME, e.toString() );
324         }
325         catch ( final Exception e ) {
326             log_writer.println( "Error: " + e );
327             log_writer.close();
328             e.printStackTrace();
329             System.exit( -1 );
330         }
331         System.out.println( "Running time (excluding I/O)             : " + ( new Date().getTime() - start_time )
332                 + "ms" );
333         log_writer.println( "Running time (excluding I/O)             : " + ( new Date().getTime() - start_time )
334                 + "ms" );
335         if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
336             final GSDI gsdi = ( GSDI ) sdi;
337             System.out.println( "Mapping based on                         : " + gsdi.getTaxCompBase() );
338             log_writer.println( "Mapping based on                         : " + gsdi.getTaxCompBase() );
339         }
340         try {
341             final PhylogenyWriter writer = new PhylogenyWriter();
342             writer.toPhyloXML( out_file, gene_tree, 0 );
343         }
344         catch ( final IOException e ) {
345             ForesterUtil.fatalError( PRG_NAME, "Failed to write to [" + out_file + "]: " + e.getMessage() );
346         }
347         System.out.println( "Wrote resulting gene tree to             : " + out_file );
348         log_writer.println( "Wrote resulting gene tree to             : " + out_file );
349         if ( base_algorithm == BASE_ALGORITHM.SDI ) {
350             sdi.computeMappingCostL();
351             System.out.println( "Mapping cost                             : " + sdi.computeMappingCostL() );
352             log_writer.println( "Mapping cost                             : " + sdi.computeMappingCostL() );
353         }
354         else if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
355             final GSDI gsdi = ( GSDI ) sdi;
356             final File species_tree_used_file = new File( out_file + SUFFIX_FOR_SPECIES_TREE_USED );
357             try {
358                 final PhylogenyWriter writer = new PhylogenyWriter();
359                 writer.toPhyloXML( species_tree_used_file, gsdi.getSpeciesTree(), 0 );
360             }
361             catch ( final IOException e ) {
362                 ForesterUtil.fatalError( PRG_NAME,
363                                          "Failed to write to [" + species_tree_used_file + "]: " + e.getMessage() );
364             }
365             System.out.println( "Wrote (stripped) species tree to         : " + species_tree_used_file );
366             log_writer.println( "Wrote (stripped) species tree to         : " + species_tree_used_file );
367         }
368         System.out.println( "Number of external nodes in gene tree    : " + gene_tree.getNumberOfExternalNodes() );
369         log_writer.println( "Number of external nodes in gene tree    : " + gene_tree.getNumberOfExternalNodes() );
370         System.out.println( "Number of external nodes in species tree : "
371                 + sdi.getSpeciesTree().getNumberOfExternalNodes() );
372         log_writer.println( "Number of external nodes in species tree : "
373                 + sdi.getSpeciesTree().getNumberOfExternalNodes() );
374         if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
375             final GSDI gsdi = ( GSDI ) sdi;
376             final int poly = PhylogenyMethods.countNumberOfPolytomies( gsdi.getSpeciesTree() );
377             System.out.println( "Number of polytomies in species tree     : " + poly );
378             log_writer.println( "Number of polytomies in species tree     : " + poly );
379             System.out.println( "External nodes stripped from gene tree   : "
380                     + gsdi.getStrippedExternalGeneTreeNodes().size() );
381             log_writer.println( "External nodes stripped from gene tree   : "
382                     + gsdi.getStrippedExternalGeneTreeNodes().size() );
383             System.out.println( "External nodes stripped from species tree: "
384                     + gsdi.getStrippedSpeciesTreeNodes().size() );
385             log_writer.println( "External nodes stripped from species tree: "
386                     + gsdi.getStrippedSpeciesTreeNodes().size() );
387         }
388         System.out.println();
389         System.out.println( "Number of duplications                   : " + sdi.getDuplicationsSum() );
390         log_writer.println( "Number of duplications                   : " + sdi.getDuplicationsSum() );
391         if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
392             final GSDI gsdi = ( GSDI ) sdi;
393             if ( !most_parsimonous_duplication_model ) {
394                 final int u = gsdi.getSpeciationOrDuplicationEventsSum();
395                 System.out.println( "Number of potential duplications         : " + u );
396                 log_writer.println( "Number of potential duplications         : " + u );
397             }
398             System.out.println( "Number of speciations                    : " + gsdi.getSpeciationsSum() );
399             log_writer.println( "Number of speciations                    : " + gsdi.getSpeciationsSum() );
400             log_writer.println();
401             printMappedNodesToLog( log_writer, gsdi );
402             log_writer.println();
403             printStrippedGeneTreeNodesToLog( log_writer, gsdi );
404             log_writer.println();
405             printStrippedSpeciesTreeNodesToLog( log_writer, gsdi );
406         }
407         System.out.println();
408         System.out.println( "Wrote log to                             : " + log_file );
409         System.out.println();
410         log_writer.close();
411     }
412
413     private static void printMappedNodesToLog( final EasyWriter log_writer, final GSDI gsdi ) throws IOException {
414         final SortedSet<String> ss = new TreeSet<String>();
415         for( final PhylogenyNode n : gsdi.getMappedExternalSpeciesTreeNodes() ) {
416             ss.add( n.toString() );
417         }
418         log_writer.println( "The following " + ss.size() + " species were used: " );
419         for( final String s : ss ) {
420             log_writer.println( "  " + s );
421         }
422     }
423
424     private static void printStrippedGeneTreeNodesToLog( final EasyWriter log_writer, final GSDI gsdi )
425             throws IOException {
426         final SortedMap<String, Integer> sm = new TreeMap<String, Integer>();
427         for( final PhylogenyNode n : gsdi.getStrippedExternalGeneTreeNodes() ) {
428             final String s = n.toString();
429             if ( sm.containsKey( s ) ) {
430                 sm.put( s, sm.get( s ) + 1 );
431             }
432             else {
433                 sm.put( s, 1 );
434             }
435         }
436         log_writer.println( "The following " + sm.size() + " nodes were stripped from the gene tree: " );
437         for( final String s : sm.keySet() ) {
438             final int count = sm.get( s );
439             if ( count == 1 ) {
440                 log_writer.println( "  " + s );
441             }
442             else {
443                 log_writer.println( "  " + s + " [" + count + "]" );
444             }
445         }
446     }
447
448     private static void printStrippedSpeciesTreeNodesToLog( final EasyWriter log_writer, final GSDI gsdi )
449             throws IOException {
450         final SortedSet<String> ss = new TreeSet<String>();
451         for( final PhylogenyNode n : gsdi.getStrippedSpeciesTreeNodes() ) {
452             ss.add( n.toString() );
453         }
454         log_writer.println( "The following " + ss.size() + " nodes were stripped from the species tree: " );
455         for( final String n : ss ) {
456             log_writer.println( "  " + n );
457         }
458     }
459
460     private static void print_help() {
461         System.out.println( "Usage: " + gsdi.PRG_NAME
462                 + " [-options] <gene tree in phyloXML format> <species tree in phyloXML format> [outfile]" );
463         System.out.println();
464         System.out.println( "Options:" );
465         //    System.out.println( " -" + gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION + ": to allow stripping of gene tree nodes without a matching species in the species tree (writes list of stripped nodes to " + );
466         System.out.println( " -" + gsdi.SDI_OPTION + ": to use SDI algorithm instead of GSDI algorithm" );//TODO gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION not allowed
467         System.out.println( " -" + gsdi.MOST_PARSIMONIOUS_OPTION
468                 + ": use most parimonious duplication model for GSDI: " );
469         System.out.println( "     assign nodes as speciations which would otherwise be assiged" );
470         System.out.println( "     as unknown because of polytomies in the species tree" );
471         System.out.println( " -" + gsdi.GUESS_FORMAT_OF_SPECIES_TREE
472                 + ": to allow species tree in other formats than phyloXML (i.e. Newick, NHX, Nexus)" );
473         System.out.println();
474         System.out.println( "Species tree:" );
475         System.out
476                 .println( " In phyloXML format (unless option -"
477                         + gsdi.GUESS_FORMAT_OF_SPECIES_TREE
478                         + " is used, in which case the species matching between gene tree and species tree must be via scientific name), with taxonomy data in appropriate fields" );
479         System.out.println();
480         System.out.println( "Gene tree:" );
481         System.out.println( " In phyloXM format, with taxonomy and sequence data in appropriate fields" );
482         System.out.println();
483         System.out.println( "Example:" );
484         //  System.out.println( "gsdi 
485         //    System.out.println();
486         System.out.println( "Note -- GSDI algorithm is under development" );
487         System.out.println();
488     }
489 }