How to use Ruby BioSamtools for SNP finding on .bam and .sam files?
0
0
Entering edit mode
8.3 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
ruby bioruby samtools • 1.9k views
ADD COMMENT
2
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 1574 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6