File: pir.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 (45 lines) | stat: -rw-r--r-- 961 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
# -*-Perl-*- Test Harness script for Bioperl

use strict;

BEGIN {
    use Bio::Root::Test;

    test_begin( -tests => 12 );

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

my $verbose = test_debug();

my $in = Bio::SeqIO->new(
    -file    => test_input_file('seqfile.pir'),
    -verbose => $verbose,
    -format  => 'pir'
);

ok( defined $in, 'new instance is defined ' );
isa_ok( $in, 'Bio::SeqIO' );

my $out = Bio::SeqIO->new(
    -format => 'pir',
    -fh     => \*STDOUT
);

while ( my $seq = $in->next_seq() ) {
    ok( $seq->length > 1, 'checked length' );
    $out->write_seq($seq) if $verbose > 0;
}

# Empty description line
$in = Bio::SeqIO->new(
    -file    => test_input_file('seqfile-no-desc.pir'),
    -verbose => $verbose,
    -format  => 'pir'
);
my $seq = $in->next_seq();
ok( $seq->seq =~ /^MGD/, 'Correct start' );
$seq = $in->next_seq();
ok( $seq->seq =~ /^GDV/, 'Correct start' );
$seq = $in->next_seq();
ok( $seq->seq =~ /^GDV/, 'Correct start' );