Add dna_to_aa_aln method and tests
[bioperl-live.git] / t / ClusterIO / ClusterIO.t
blob3bf2cf3de6d1c5f4a2c7712fc67f342dc6f51ed4
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN {     
7     use lib '.';
8         use Bio::Root::Test;
9         
10         test_begin(-tests => 12,
11                            -requires_module => 'Time::HiRes');
12     
13         use_ok('Bio::ClusterIO');
14         use_ok('Bio::Cluster::ClusterFactory');
17 SKIP: {
18         test_skip(-tests => 8, -requires_module => 'XML::SAX');
19     
20         my ($clusterio, $result,$hit,$hsp);
21         $clusterio = Bio::ClusterIO->new('-tempfile' => 0,
22                                         '-format' => 'dbsnp',
23                                         '-file'   => test_input_file('LittleChrY.dbsnp.xml'));
24     
25         $result = $clusterio->next_cluster;
26         ok($result);
27         is($result->observed, 'C/T');
28         is($result->type, 'notwithdrawn');
29         ok($result->seq_5);
30         ok($result->seq_3);
31         my @ss = $result->each_subsnp;
32         is scalar @ss,  5;
33         is($ss[0]->handle, 'CGAP-GAI');
34         is($ss[1]->handle, 'LEE');
35         
36         # don't know if these were ever meant to work... cjf 3/7/07
37         #is($result->heterozygous, 0.208738461136818);
38         #is($result->heterozygous_SE, 0.0260274689436777);
41 ###################################
42 # ClusterFactory tests            #
43 ###################################
45 my $fact = Bio::Cluster::ClusterFactory->new();
46 # auto-recognize implementation class
47 my $clu = $fact->create_object(-display_id => 'Hs.2');
48 isa_ok($clu, "Bio::Cluster::UniGeneI");
49 $clu = $fact->create_object(-namespace => "UNIGENE");
50 isa_ok($clu, "Bio::Cluster::UniGeneI");