Sha256: 340319251ceb695de4111f1f3bf57db00e88efad8c50e89263f02c6fa502642e

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

#!/usr/bin/env ruby
require 'bio'
require 'optparse'
$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
$: << File.expand_path('.')
path= File.expand_path(File.dirname(__FILE__) + '/../lib/bio-polymarker.rb')
require path

options = {}
options[:identity] = 95
options[:covered] = 90
OptionParser.new do |opts|
  
  opts.banner = "Usage: filter_exonerate_by_identity.rb [options]"

  opts.on("-e", "--exo FILE", "Exonerate alignment produced by polymarker or with the following ryo: 'RESULT:\\t%S\\t%pi\\t%ql\\t%tl\\t%g\\t%V\\n'") do |o|
    options[:exo_file] = o.upcase
  end
  opts.on("-i", "--identity FLOAT", "Minimum percentage identity") do |o|
    options[:identity] = o.to_f
  end
  opts.on("-c", "--covered FLOAT", "Minimum percentage coverage") do |o|
    options[:covered] = o.to_f
  end
  
end.parse!


exo_file = options[:exo_file]
min_identity = options[:identity];
min_coverage = options[:covered]
File.foreach(exo_file) do |line|  
  aln = Bio::DB::Exonerate::Alignment.parse_custom(line)
  if aln.identity > min_identity and aln.query_coverage > min_coverage
	puts aln.line
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bio-polymarker-1.3.3 bin/filter_exonerate_by_identity.rb
bio-polymarker-1.3.2 bin/filter_exonerate_by_identity.rb
bio-polymarker-1.3.1 bin/filter_exonerate_by_identity.rb
bio-polymarker-1.3.0 bin/filter_exonerate_by_identity.rb