1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 16);
12 use_ok('Bio::SeqIO::largefasta');
15 my $tmpfile = test_output_file();
17 my $seqio = Bio::SeqIO->new('-format' => 'largefasta',
18 '-file' => test_input_file('genomic-seq.fasta'),
20 isa_ok($seqio, 'Bio::SeqIO');
22 my $pseq = $seqio->next_seq();
23 $pseq->alphabet('dna');
24 $pseq->desc('this is my description');;
25 my $plength = $pseq->length();
26 my $last_3 = $pseq->subseq($plength-3,$plength);
30 is length($pseq->subseq(100, 299)), 200;
31 is $pseq->trunc(100,199)->length(), 100;
32 is $pseq->alphabet(), 'dna';
33 is $pseq->display_id(), 'HSBA536C5';
34 is $pseq->accession_number(), 'unknown';
35 is $pseq->desc, 'this is my description';
37 is open(OUT, '>', $tmpfile), 1;
39 my $seqout = Bio::SeqIO->new('-format' => 'largefasta',
41 is defined $seqout, 1;
43 is $seqout->write_seq($pseq), 1;
46 my $seqin = Bio::SeqIO->new('-format' => 'largefasta',
48 my $pseq2 = $seqin->next_seq;
49 is ($plength, $pseq2->length());
50 is ($pseq->display_id(), $pseq2->display_id());
51 is ($pseq->desc(), $pseq2->desc());