Ruby IO::popen and crossbow
http://www.ruby-doc.org/core/classes/IO.html#M000880
Looking to use this method ( I think)
To run this commandline command, from within ruby:
$CROSSBOW_HOME/cb_emr \
--name "Crossbow-Ecoli" \
--preprocess \
--input=s3n://bgs.crossbow-01/example/e_coli/small.manifest \
--output=s3n://bgs.crossbow-01/example/e_coli/output_small \
--reference=s3n://
The above is what I enter in to the command line to run directly from console
So I'm pretty sure I've got the IO method correct... but I'm fai开发者_开发知识库rly lost on translating the above code into the input
THis should do the trick:
command =<<END_OF_COMMAND
#{ENV["CROSSBOW_HOME"]}/cb_emr \
--name "Crossbow-Ecoli" \
--preprocess \
--input=s3n://bgs.crossbow-01/example/e_coli/small.manifest \
--output=s3n://bgs.crossbow-01/example/e_coli/output_small \
--reference=s3n://
END_OF_COMMAND
IO.popen(command) do |handle|
handle.each_line do |line|
puts line
end
end
I am iterating over each line of the output, because I'm guessing you may want to process it somehow.
精彩评论