1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 10);
11 use_ok('Bio::AlignIO::fasta');
14 my $DEBUG = test_debug();
16 my ($str,$aln,$strout,$status);
19 $str = Bio::AlignIO->new(
20 -file => test_input_file("testaln.fasta"),
22 $aln = $str->next_aln();
23 isa_ok($aln,'Bio::Align::AlignI');
24 is $aln->get_seq_by_pos(1)->get_nse, 'AK1H_ECOLI/114-431/1-318',
26 is ($aln->get_seq_by_pos(1)->description, 'DESCRIPTION HERE',
27 "fasta input test for description");
28 is ($aln->get_seq_by_pos(11)->display_id, 'AK_YEAST',
29 "fasta input test for id");
31 is ($aln->get_seq_by_pos(2)->end, 318,
32 "fasta input test for end");
34 is ($aln->get_seq_by_pos(11)->description, 'A COMMENT FOR YEAST',
35 "fasta input test for description");
37 $strout = Bio::AlignIO->new(
38 '-file' => ">".test_output_file(),
39 '-format' => 'fasta');
40 $status = $strout->write_aln($aln);
41 is $status, 1,"fasta output test";
43 my $in = Bio::AlignIO->newFh(
44 '-file' => test_input_file("testaln.fasta"),
45 '-format' => 'fasta');
46 my $out = Bio::AlignIO->newFh(
47 '-file' => ">".test_output_file(),
49 while ( $aln = <$in>) {
50 is $aln->get_seq_by_pos(1)->get_nse, 'AK1H_ECOLI/114-431/1-318',
51 "filehandle input test ";
52 $status = print $out $aln;
55 is $status, 1, "filehandle output test";