1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 27,
10 -requires_module => 'Data::Stag');
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 'testaln.pfam' => ['pfam', 1, 1],
27 'testaln.msf' => ['msf', 1, 1],
28 'testaln.fasta' => ['fasta', 1, 1],
29 'testaln.selex' => ['selex', 1, 1],
30 'testaln.mase' => ['mase', 1, 0],
31 'testaln.prodom' => ['prodom', 1, 0],
32 'testaln.clustalw' => ['clustalw', 1, 1],
33 'testaln.metafasta' => ['metafasta', 1, 1],
34 'testaln.nexus' => ['nexus', 1, 1],
35 'testaln.po' => ['po', 1, 1],
36 'testaln.xmfa' => ['xmfa', 1, 1],
41 $aln = Bio::AlignIO->new(
42 -file => test_input_file('longnames.aln'),
45 isa_ok($aln, 'Bio::AnnotatableI');
47 while (my ($file, $fdata) = each %files) {
48 my ($format, $in, $out) = @{$fdata};
50 my $fhin = Bio::AlignIO->newFh(
51 '-file' => test_input_file($file),
52 '-format' => $format);
53 my $fhout = Bio::AlignIO->newFh(
54 '-file' => ">".test_output_file(),
55 '-format' => 'clustalw');
56 while ( $aln = <$fhin>) {
57 cmp_ok($aln->num_sequences, '>=', 2, "input filehandle method test : $format");
65 while (my ($file, $fdata) = each %files) {
66 my ($format, $in, $out) = @{$fdata};
69 my $fhin = Bio::AlignIO->newFh(
70 '-file' => test_input_file('testaln.clustalw'),
71 '-format' => 'clustalw');
72 my $fhout = Bio::AlignIO->newFh(
73 '-file' => '>'.test_output_file(),
74 '-format' => $format);
75 while ( $aln = <$fhin> ) {
76 $status = print $fhout $aln;
79 is $status, 1, "filehandle output test : $format";