File: tinyseq.t

package info (click to toggle)
bioperl 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 40,768 kB
  • ctags: 12,005
  • sloc: perl: 174,299; xml: 13,923; sh: 1,941; lisp: 1,803; asm: 109; makefile: 53
file content (49 lines) | stat: -rwxr-xr-x 1,167 bytes parent folder | download
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
49
# -*-Perl-*- Test Harness script for Bioperl
# $Id: tinyseq.t 15112 2008-12-08 18:12:38Z sendu $

use strict;

BEGIN { 
    use lib '.';
    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);