This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to do variant calling on .sam and .bam files using 'bio-samtools'?

How to do variant calling on .sam files using 'bio-samtools'?

I have the code:

#!/usr/bin/ruby

require 'bio-samtools'

bam = Bio::DB::Sam.new(:bam=>"my_sorted.bam", :fasta=>'ref.fasta')
  bam.open

What methods to call on bam object or what next steps to do? Thank you.

wgs sequencing sequence software-error

Need all in one Ruby workflow, thank you for you replies

3 answers

Have you read the github page?

Looks like you'll want to call mpileup with the :g option. Documentation and code are here:

https://github.com/helios/bioruby-samtools/blob/fe97402bf150877f0d84587abc82fab35d66297c/lib/bio/db/sam.rb#L186

I've created ruby-htslib to make this sort of thing possible. It's not as well tested as the fine libraries in Python and other languages, so there may be some bugs left, but if you find a bug, I'll fix it.

https://github.com/kojix2/ruby-htslib

Log in to answer this question.