Sha256: d769061d2ea90686e8d0c9936f3990a8bc603d1b7fc13e2900996eee8d3a4fd2

Contents?: true

Size: 1.51 KB

Versions: 4

Compression:

Stored size: 1.51 KB

Contents

$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
$: << File.expand_path('.')
path= File.expand_path(File.dirname(__FILE__) + '/../lib/bio-polymarker.rb')

#puts path
require path
require "test/unit"

class TestExonerate < Test::Unit::TestCase
  Query  = File.dirname(__FILE__) + '/data/'+"BS00068396_51.fa"
  Target = File.dirname(__FILE__) + '/data/'+"BS00068396_51_contigs.fa"
  #Set up the paths
  def setup
    File.expand_path(File.dirname(__FILE__) + '/data/')
  end
  
  
  
  def test_simple_align_array
    alignments = Bio::DB::Exonerate.align({:query=>Query, :target=>Target})
    assert(alignments.size == 4, "The count of alignments should be 4, it was #{alignments.size}")
  end

  def test_parse_alingn_line
    line="RESULT:\tBS00068396_51 0 101 + 2BS_5163353 7425 7323 - 462\t96.04\t101\t11974\t.\tM 69 69 G 0 1 M 32 32"
    aln =  Bio::DB::Exonerate::Alignment.parse_custom(line)
    assert(aln.query_id == "BS00068396_51")
    assert(aln.query_start==0)
    assert(aln.query_end==101)
    assert(aln.query_strand==:forward)
    assert(aln.target_id=="2BS_5163353")
    assert(aln.target_start==7425) 
    assert(aln.target_end==7323) 
    assert(aln.target_strand==:reverse)
    assert(aln.score==462.0) 
    assert(aln.pi==96.04)
    assert(aln.ql==101)
    assert(aln.tl==11974)
    assert(aln.g==".")
    assert(aln.vulgar_block.join(',')=="M	69	69	0	69	7425	7356,G	0	1	69	69	7356	7355,M	32	32	69	101	7355	7323" )
    assert(aln.line==line)
    
    #puts aln.vulgar_block.inspect
    #puts aln.inspect
  end

  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bio-polymarker-1.3.3 test/test_exonearate.rb
bio-polymarker-1.3.2 test/test_exonearate.rb
bio-polymarker-1.3.1 test/test_exonearate.rb
bio-polymarker-1.3.0 test/test_exonearate.rb