2 # = lib/soft/raxml - Raxml class
4 # Copyright:: Copyright (C) 2009 Christian M. Zmasek
5 # License:: GNU Lesser General Public License (LGPL)
7 # $Id: raxml.rb,v 1.1 2009/10/07 00:08:35 cmzmasek Exp $
9 # last modified: 2009/10/06
11 require 'lib/evo/soft/resource_locations'
12 require 'lib/evo/util/util'
21 @fast_me_home = Util.get_env_variable_value( ResourceLocations::FASTME_HOME_ENV_VARIABLE )
22 Util.check_file_for_readability( @fast_me_home )
25 def run( pwd_file, bootstrap_number, initial_tree )
26 Util.check_file_for_readability( pwd_file )
27 if bootstrap_number == nil || bootstrap_number < 0
28 error_msg = "illegal bootstrap number: " + bootstrap_number
29 raise ArgumentError, error_msg
31 if initial_tree == nil || (!initial_tree.eql?( "BME" ) && !initial_tree.eql?( "GME" ) && !initial_tree.eql?( "NJ" ) )
32 error_msg = "illegal initial tree: " + initial_tree
33 raise ArgumentError, error_msg
36 if bootstrap_number > 1
37 input = '-b #{initial_tree} -i #{pwd_file} -n #{bootstrap_number} -s b'
39 input = '-b #{initial_tree} -i #{pwd_file} -s b'
42 puts @fast_me_home + " " + input
44 IO.popen( @fast_me_home, 'r+' ) do |io|