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