1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: po.t 14971 2008-10-28 16:08:52Z cjfields $
10 test_begin(-tests => 11);
12 use_ok('Bio::AlignIO::po');
15 my $DEBUG = test_debug();
17 my ($str,$aln,$strout,$status);
20 # just skip on perl 5.6.0 and earlier as it causes a crash on
21 # default perl with OS X 10.2
22 # fink perl 5.6.0 does not seem to have the problem
23 # can't figure out what it is so just skip for now
25 skip("skipping due to bug in perl 5.6.0 that comes with OS X 10.2", 10) unless ($^O ne 'darwin' || $] > 5.006);
27 $str = Bio::AlignIO->new(
28 -file => test_input_file('testaln.po'),
31 isa_ok($str, 'Bio::AlignIO');
32 $aln = $str->next_aln();
33 isa_ok($aln,'Bio::Align::AlignI');
34 is $aln->num_sequences, 6;
36 # output is? i.e. does conversion from clustalw to po give the same alignment?
37 $str = Bio::AlignIO->new(
38 '-file' => test_input_file('testaln.clustalw'),
39 '-format' => 'clustalw');
40 isa_ok($str,'Bio::AlignIO');
41 $aln = $str->next_aln();
42 isa_ok($aln,'Bio::Align::AlignI');
43 $strout = Bio::AlignIO->new(
44 '-file' => ">" . test_output_file(),
46 $status = $strout->write_aln($aln);
47 is $status, 1, "po output test";
49 $str = Bio::AlignIO->new(
50 '-file' => test_input_file('testaln.po'),
52 isa_ok($str,'Bio::AlignIO');
53 my $aln2 = $str->next_aln();
54 isa_ok($aln2,'Bio::Align::AlignI');
55 is $aln2->num_sequences, $aln->num_sequences;
56 is $aln2->length, $aln->length;