File: tinyseq.t

package info (click to toggle)
bioperl 1.7.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 35,888 kB
  • sloc: perl: 94,151; xml: 14,982; makefile: 20
file content (48 lines) | stat: -rw-r--r-- 1,186 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*-Perl-*- Test Harness script for Bioperl
# $Id$

use strict;

BEGIN {
    use Bio::Root::Test;

    test_begin(-tests => 16,
               -requires_modules => [qw(XML::Parser::PerlSAX XML::Writer)]);

    use_ok('Bio::SeqIO::tinyseq');
}

my $file    = test_input_file('test.tseq');
my $outfile = test_output_file();

my $instream = Bio::SeqIO->new( -file    => $file,
                                -format  => 'tinyseq' );

my $outstream = Bio::SeqIO->new( -file   => ">$outfile",
                                 -format => 'tinyseq' );

my $seq = $instream->next_seq;
ok(defined $seq);
ok(defined $seq->seq);
is($seq->length, 5830);
is($seq->accession_number,'NM_002253');
ok($seq->species);
is($seq->species->binomial, 'Homo sapiens');
is($seq->species->ncbi_taxid, 9606);
$outstream->write_seq($seq);
undef $outstream;

ok(-s $outfile);

my $reread = Bio::SeqIO->new( -file   => $outfile,
                              -format => 'tinyseq' );

my $seq2 = $reread->next_seq;

ok($seq2);
ok($seq2->seq);
is($seq2->length, 5830);
is($seq2->accession_number, 'NM_002253');
ok($seq2->species);
is($seq2->species->binomial, 'Homo sapiens');
is($seq2->species->ncbi_taxid, 9606);