1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 29);
12 use_ok('Bio::AlignIO');
15 my $DEBUG = test_debug();
17 my ($str,$aln,$strout,$status);
19 # general filehandle tests
20 # not all parsers support output (noted as 0)
23 'testaln.phylip' => ['phylip', 1, 1],
24 'testaln.psi' => ['psi', 1, 1],
25 'testaln.arp' => ['arp', 1, 0],
26 'rfam_tests.stk' => ['stockholm', 1, 1],
27 'testaln.pfam' => ['pfam', 1, 1],
28 'testaln.msf' => ['msf', 1, 1],
29 'testaln.fasta' => ['fasta', 1, 1],
30 'testaln.selex' => ['selex', 1, 1],
31 'testaln.mase' => ['mase', 1, 0],
32 'testaln.prodom' => ['prodom', 1, 0],
33 'testaln.aln' => ['clustalw', 1, 1],
34 'testaln.metafasta' => ['metafasta', 1, 1],
35 'testaln.nexus' => ['nexus', 1, 1],
36 'testaln.po' => ['po', 1, 1],
37 'testaln.xmfa' => ['xmfa', 1, 1],
42 $aln = Bio::AlignIO->new(
43 -file => test_input_file('longnames.aln'),
46 isa_ok($aln, 'Bio::AnnotatableI');
48 while (my ($file, $fdata) = each %files) {
49 my ($format, $in, $out) = @{$fdata};
51 my $fhin = Bio::AlignIO->newFh(
52 '-file' => test_input_file($file),
53 '-format' => $format);
54 my $fhout = Bio::AlignIO->newFh(
55 '-file' => ">".test_output_file(),
56 '-format' => 'clustalw');
57 while ( $aln = <$fhin>) {
58 cmp_ok($aln->num_sequences, '>=', 2, "input filehandle method test : $format");
66 while (my ($file, $fdata) = each %files) {
67 my ($format, $in, $out) = @{$fdata};
70 my $fhin = Bio::AlignIO->newFh(
71 '-file' => test_input_file('testaln.aln'),
72 '-format' => 'clustalw');
73 my $fhout = Bio::AlignIO->newFh(
74 '-file' => '>'.test_output_file(),
75 '-format' => $format);
76 while ( $aln = <$fhin> ) {
77 $status = print $fhout $aln;
80 is $status, 1, "filehandle output test : $format";