This is a test version of Biostars. For the public version, visit https://www.biostars.org.
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
ruby bioruby samtools

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.

0 answers

No answers yet.

Log in to answer this question.