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

« back to all changes in this revision

Viewing changes to t/SearchIO/Writer/HitTableWriter.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_HitTableWriter.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 => 8);
 
11
    
 
12
    use_ok('Bio::SearchIO');
 
13
    use_ok('Bio::SearchIO::Writer::HitTableWriter');
 
14
}
 
15
 
 
16
my ($searchio, $result, $hit, $hsp);
 
17
 
 
18
$searchio = Bio::SearchIO->new('-format' => 'blast',
 
19
    '-file'   => test_input_file('HUMBETGLOA.tblastx'));
 
20
 
 
21
$result = $searchio->next_result;
 
22
 
 
23
isa_ok($result,'Bio::Search::Result::ResultI');
 
24
$hit = $result->next_hit;
 
25
is($hit->accession, 'AE000479');
 
26
is($hit->bits, 33.6);
 
27
$hsp = $hit->next_hsp;
 
28
is($hit->hsp->bits,$hsp->bits);
 
29
isa_ok($hsp->get_aln,'Bio::Align::AlignI');
 
30
 
 
31
my $writer = Bio::SearchIO::Writer::HitTableWriter->new( 
 
32
    -columns => [qw(query_name
 
33
                    query_length
 
34
                    hit_name
 
35
                    hit_length
 
36
                    bits
 
37
                    score
 
38
                    frac_identical_query
 
39
                    expect
 
40
                    )]  );
 
41
 
 
42
my $outfile = test_output_file();
 
43
my $out = Bio::SearchIO->new(-writer => $writer,
 
44
             -file   => ">$outfile");
 
45
$out->write_result($result, 1);
 
46
ok(-s $outfile);
 
47
 
 
48
# tests checking file output?