How to use Ruby BioSamtools for SNP finding on .bam and .sam files?
How to use Ruby BioSamtools for SNP finding on .bam and .sam files? Does my code call variants or not, I am not sure...
#!/usr/bin/ruby # making script executable
require 'bio-samtools' # calling rubygem
bam=Bio::DB::Sam.new(:bam=>"my.bam",:fasta=>'fake.fa') # creating bam object
bam.open
bam.index
bam.mpileup do |pileup| # calling variants??? how to call them on a bam or sam object
puts pileup.consensus
bam.flag_stats() # getting statistics and plots
bam.plot_coverage()
bam.close
end
• 2,279 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Check out some tutorials like this to make sure you understand what's meant to be happening as a whole. Applying commands without understanding what they're actually doing will not help you in the long run.