Class: Bio::Freebayes
- Inherits:
-
Object
- Object
- Bio::Freebayes
- Defined in:
- lib/bio/freebayes.rb,
lib/bio/freebayes/version.rb
Constant Summary collapse
- VERSION =
"0.1.6"
- EXTVERSION =
"0.9.20"
Instance Method Summary collapse
-
#help ⇒ Object
run help github.com/ekg/freebayes.
-
#initialize(path = nil) ⇒ Freebayes
constructor
instantiate Freebayes command tools.
-
#run(fasta_reference, bam, *options) ⇒ String
run freebayes tools for command and all options please go to github.com/ekg/freebayes.
-
#vcfeval(eval) ⇒ Freebayes
set command for the eval option of bio-vcf more details please go to github.com/pjotrp/bioruby-vcf the chaning have to end with run.
-
#vcffilter(filter) ⇒ Freebayes
set bio-vcf Filter for details please go to github.com/pjotrp/bioruby-vcf the chaning have to end with run.
Constructor Details
#initialize(path = nil) ⇒ Freebayes
instantiate Freebayes command tools
8 9 10 11 12 |
# File 'lib/bio/freebayes.rb', line 8 def initialize(path = nil) @filter = nil @eval = nil @path = path || File.join(File.(File.dirname(__FILE__)), 'freebayes', 'external', 'freebayes') end |
Instance Method Details
#help ⇒ Object
run help github.com/ekg/freebayes
59 60 61 |
# File 'lib/bio/freebayes.rb', line 59 def help `#{@path} -h` end |
#run(fasta_reference, bam, *options) ⇒ String
run freebayes tools for command and all options please go to github.com/ekg/freebayes
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/bio/freebayes.rb', line 21 def run(fasta_reference, bam, *) result = `#{@path} #{.flatten.join(' ')} --fasta-reference #{fasta_reference} #{bam}` if @filter != nil || @eval != nil || @filter != '' || @eval != '' Open3.popen2("bio-vcf #{@filter != nil && !@filter.empty? ? "--filter '#{@filter}' " : ''}#{@eval != nil && !@eval.empty? ? "--eval '#{@eval}' " : ''}") {|stdin, stdout, wthr| stdin.print result stdin.close return stdout.gets } else return result end end |
#vcfeval(eval) ⇒ Freebayes
set command for the eval option of bio-vcf more details please go to github.com/pjotrp/bioruby-vcf the chaning have to end with run
51 52 53 54 |
# File 'lib/bio/freebayes.rb', line 51 def vcfeval(eval) @eval = eval return self end |
#vcffilter(filter) ⇒ Freebayes
set bio-vcf Filter for details please go to github.com/pjotrp/bioruby-vcf the chaning have to end with run
40 41 42 43 |
# File 'lib/bio/freebayes.rb', line 40 def vcffilter(filter) @filter = filter return self end |