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