Sha256: a35a6783924085fda7425c8fd51e341d08ee190fe5ad54598f527332cfe8d3c9

Contents?: true

Size: 894 Bytes

Versions: 49

Compression:

Stored size: 894 Bytes

Contents

#!/usr/bin/env ruby

require 'bio'
require 'rubygems'
require 'pathname'
require 'bio-samtools'

require 'set'

$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
$: << File.expand_path('.')
path= File.expand_path(File.dirname(__FILE__) + '/../lib/bioruby-polyploid-tools.rb')
require path

puts  ARGV[0]

fasta_db = Bio::DB::Fasta::FastaFile.new( {:fasta=>ARGV[0]})
fasta_db.load_fai_entries
bam1 =  Bio::DB::Sam.new({:fasta=>ARGV[0], :bam=>ARGV[1]})

fasta_db.index.entries.each do | r |
  #Np r.get_full_region
  #container.process_region( { :region => r.get_full_region.to_s, :output_file => output_file } )
  region=r.get_full_region
  
  

  cons_1 = bam1.consensus_with_ambiguities({:region=>region, :case=>true})

  snps = cons_1.count_ambiguities
 
  snps_per_1k = (1000 * snps.to_f ) / region.size
  
  puts "#{r.id}\t#{region.size}\t#{snps}\t#{snps_per_1k}\n#{cons_1}"
  
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
bio-polyploid-tools-1.2.1 bin/count_variations.rb
bio-polyploid-tools-1.2.0 bin/count_variations.rb
bio-polyploid-tools-1.1.2 bin/count_variations.rb
bio-polyploid-tools-1.1.1 bin/count_variations.rb
bio-polyploid-tools-1.1.0 bin/count_variations.rb
bio-polyploid-tools-1.0.0 bin/count_variations.rb
bio-polyploid-tools-0.10.1 bin/count_variations.rb
bio-polyploid-tools-0.10.0 bin/count_variations.rb
bio-polyploid-tools-0.9.10 bin/count_variations.rb
bio-polyploid-tools-0.9.9 bin/count_variations.rb
bio-polyploid-tools-0.9.8 bin/count_variations.rb
bio-polyploid-tools-0.9.7 bin/count_variations.rb
bio-polyploid-tools-0.9.6 bin/count_variations.rb
bio-polyploid-tools-0.9.5 bin/count_variations.rb
bio-polyploid-tools-0.9.4 bin/count_variations.rb
bio-polyploid-tools-0.9.3 bin/count_variations.rb
bio-polyploid-tools-0.9.2 bin/count_variations.rb
bio-polyploid-tools-0.9.1 bin/count_variations.rb
bio-polyploid-tools-0.9.0 bin/count_variations.rb
bio-polyploid-tools-0.8.9 bin/count_variations.rb