1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 8);
12 use_ok('Bio::PopGen::HtSNP');
25 my $snp = [qw/s1 s2 s3 s4 s5 s6 s7 s8 s9/];
37 my $obj = Bio::PopGen::HtSNP->new(-haplotype_block => $hap,
39 -pattern_freq => $pop,
43 # check lenght of the haplotype
44 is($obj->hap_length,9); # length of the haplotype must be 9
47 is( (join ' ', @{$obj->silent_snp}) ,'s4'); # the silent snp is in position 4 (counting from 1)
49 # check degenerated SNPs
50 is( (join ' ', @{$obj->deg_snp}) ,'s7 s5 s3'); # degenerate SNPs
53 is( (join ' ', @{$obj->useful_snp}) ,'s1 s2 s6 s8 s9'); # degenerate SNPs
56 is( (join ' ',@{$obj->snp_type_code}),'36 63 36 75 36'); # code for SNPs
59 is( (join ' ',@{$obj->ht_type}),'36 63 75'); # min snp_code
61 my $tmp = $obj->deg_pattern();
64 foreach my $family (keys %$tmp){
66 unless ( (join ' ', @{$tmp->{$family}}) eq '0 6'){
71 unless ( (join ' ', @{$tmp->{$family}}) eq '1'){
76 unless ( (join ' ', @{$tmp->{$family}}) eq '2 4 5'){
81 unless ( (join ' ', @{$tmp->{$family}}) eq '3'){
87 ok(! $err); # clustering degenerated haplotypes