Bio::DB::Universal: move into its own distribution
[bioperl-live.git] / t / ClusterIO / SequenceFamily.t
blobbad94b9164928ea03a72e5a8ba68b7cebae99fa6
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN {
7     use lib '.';
8     use Bio::Root::Test;
10     test_begin(-tests           => 17,
11                -requires_module => 'Data::Stag');
13     use_ok('Bio::SeqIO');
14     use_ok('Bio::Cluster::SequenceFamily');
17 my $seqio= Bio::SeqIO->new('-format' => 'swiss',
18                            '-file'   => test_input_file('sequencefamily.dat'));
19 my @mem;
20 while(my $seq = $seqio->next_seq){
21     push @mem, $seq;
23 my $family = Bio::Cluster::SequenceFamily->new(
24     -family_id=>"Family_1",
25     -description=>"SomeFamily",
26     -annotation_score=>"100",
27     -family_score=>"50",
28     -version=>"1.0",
29     -members=>\@mem,
31 is $family->description, "SomeFamily";
32 is $family->annotation_score,100;
33 is $family->size, 5;
34 is $family->family_id,"Family_1";
35 is $family->version, "1.0";
37 $family->add_members($mem[0]);
38 $family->add_members($mem[1]);
39 is $family->size, 7;
40 is $family->cluster_score, "50";
41 is $family->family_score, "50";
43 my @members = $family->get_members(-ncbi_taxid=>9606);
45 foreach my $mem(@members){
46     is $mem->species->ncbi_taxid, 9606;
49 @members = $family->get_members(-binomial=>"Homo sapiens");
51 foreach my $mem(@members){
52     is $mem->species->binomial, "Homo sapiens";
56 $family->flush_members();
58 is $family->size, 0;