Question: How to use Ruby BioSamtools for SNP finding on .bam and .sam files?
0
gravatar for elvissober
5.0 years ago by
elvissober20
South Africa
elvissober20 wrote:

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

 

samtools bioruby ruby • 1.3k views
ADD COMMENTlink modified 4.5 years ago by Biostar ♦♦ 20 • written 5.0 years ago by elvissober20
2

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 REPLYlink modified 11 months ago by _r_am31k • written 5.0 years ago by andrew.j.skelton736.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1568 users visited in the last hour