Entering edit mode
8.9 years ago
elvissober
▴
20
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
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.