Class: Bio::DB::Sam
- Inherits:
-
Object
- Object
- Bio::DB::Sam
- Defined in:
- lib/cheripic/variants.rb
Overview
An extension of Bio::DB::Sam object to modify depth method
Instance Method Summary collapse
-
#depth(opts = {}) ⇒ Object
A method to retrieve depth information from bam object.
Instance Method Details
#depth(opts = {}) ⇒ Object
A method to retrieve depth information from bam object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cheripic/variants.rb', line 22 def depth(opts={}) command = form_opt_string(self.samtools, 'depth', opts) # capture returns string output, so careful not to give whole genome or big contigs for depth analysis stdout, stderr, status = Open3.capture3(command) unless status.success? logger.error "resulted in exit code #{status.exitstatus} using #{command}" logger.error "stderr output is: #{stderr}" raise CheripicError end # return stdout stdout end |