Class: Raxml
- Inherits:
-
Object
- Object
- Raxml
- Defined in:
- lib/rraxml.rb
Direct Known Subclasses
GammaScorer, Parsimonator, RaxmlAlignmentChecker, RaxmlGammaSearch, RaxmlLight
Instance Attribute Summary collapse
-
#binary ⇒ Object
readonly
Returns the value of attribute binary.
-
#infofile ⇒ Object
readonly
Returns the value of attribute infofile.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#ops ⇒ Object
readonly
Returns the value of attribute ops.
-
#outdir ⇒ Object
readonly
Returns the value of attribute outdir.
-
#phylip ⇒ Object
readonly
Returns the value of attribute phylip.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #after_run ⇒ Object
- #before_run ⇒ Object
-
#initialize(opts) ⇒ Raxml
constructor
A new instance of Raxml.
- #run ⇒ Object
- #salute ⇒ Object
Constructor Details
#initialize(opts) ⇒ Raxml
Returns a new instance of Raxml.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rraxml.rb', line 14 def initialize(opts) raise "No alignment in #{opts[:phylip]}" if opts[:phylip].nil? or not File.exist?(opts[:phylip]) @phylip = opts[:phylip] @name = opts[:name] || "RUN_NAME" @seed = opts[:seed] || "12345" @outdir = opts[:outdir] || "test/outdir/#{@name}" @stderr = opts[:stderr] || File.join(@outdir, 'stderr') @stdout = opts[:stdout] || File.join(@outdir, 'stdout') @binary = "" @flags = opts[:flags] || "" @ops = "-s #{@phylip} -n #{@name} #{@flags}" end |
Instance Attribute Details
#binary ⇒ Object (readonly)
Returns the value of attribute binary.
13 14 15 |
# File 'lib/rraxml.rb', line 13 def binary @binary end |
#infofile ⇒ Object (readonly)
Returns the value of attribute infofile.
13 14 15 |
# File 'lib/rraxml.rb', line 13 def infofile @infofile end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/rraxml.rb', line 13 def name @name end |
#ops ⇒ Object (readonly)
Returns the value of attribute ops.
13 14 15 |
# File 'lib/rraxml.rb', line 13 def ops @ops end |
#outdir ⇒ Object (readonly)
Returns the value of attribute outdir.
13 14 15 |
# File 'lib/rraxml.rb', line 13 def outdir @outdir end |
#phylip ⇒ Object (readonly)
Returns the value of attribute phylip.
13 14 15 |
# File 'lib/rraxml.rb', line 13 def phylip @phylip end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
13 14 15 |
# File 'lib/rraxml.rb', line 13 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
13 14 15 |
# File 'lib/rraxml.rb', line 13 def stdout @stdout end |
Instance Method Details
#after_run ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rraxml.rb', line 30 def after_run @infofile = File.join Dir.pwd, "RAxML_info.#{@name}" @outfiles = [@stdout, @stderr, @infofile] self.gather_outfiles @outfiles.each do |f| unless f.nil? or not File.exist?(f) FileUtils.move(f, @outdir) unless File.join(@outdir, File.basename(f)) == f end end end |
#before_run ⇒ Object
26 27 28 29 |
# File 'lib/rraxml.rb', line 26 def before_run FileUtils.mkdir_p @outdir unless File.exist?(@outdir) self.complete_call end |
#run ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/rraxml.rb', line 40 def run self.before_run raise "#{@binary} not found" unless binary_available(@binary) puts "#{@binary} #{@ops} " system "(#{@binary} #{@ops} 2> #{@stderr}) > #{@stdout}" self.after_run end |
#salute ⇒ Object
47 48 49 |
# File 'lib/rraxml.rb', line 47 def salute puts "This is a RAxML instance" end |