~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to t/SearchIO/megablast.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-Perl-*- Test Harness script for Bioperl
 
2
# $Id: SearchIO_megablast.t 14995 2008-11-16 06:20:00Z cjfields $
 
3
 
 
4
use strict;
 
5
 
 
6
BEGIN {
 
7
    use lib '.';
 
8
    use Bio::Root::Test;
 
9
    
 
10
    test_begin(-tests => 31);
 
11
    
 
12
    use_ok('Bio::SearchIO');
 
13
}
 
14
 
 
15
my ($searchio, $result, $hit, $hsp);
 
16
 
 
17
# this is megablast output type 0 
 
18
my $in = Bio::SearchIO->new(-file          => test_input_file('503384.MEGABLAST.0'),
 
19
                        -report_format => 0,
 
20
                        -format        => 'megablast'); 
 
21
my $r = $in->next_result;
 
22
my @dcompare = ( 
 
23
              ['Contig634', 7620, 7941, 1, 1, 321, -1],
 
24
              ['Contig1853', 6406, 6620, 1, 1691, 1905, 1],  
 
25
              ['Contig3700', 8723,9434, 1, 4083, 4794, -1],
 
26
              ['Contig3997', 1282, 1704, 1, 1546, 1968,-1 ],
 
27
              );
 
28
 
 
29
is($r->query_name, '503384');
 
30
 
 
31
while( my $hit = $r->next_hit ) {
 
32
    my $d = shift @dcompare;
 
33
    is($hit->name, shift @$d);
 
34
    my $hsp = $hit->next_hsp;
 
35
    is($hsp->query->start, shift @$d);
 
36
    is($hsp->query->end, shift @$d);
 
37
    is($hsp->query->strand, shift @$d);
 
38
    is($hsp->hit->start, shift @$d);
 
39
    is($hsp->hit->end, shift @$d);
 
40
    is($hsp->hit->strand, shift @$d);
 
41
}
 
42
is(@dcompare, 0);
 
43