[Bioperl-l] lack of markers for some genotypes in some Bio::PopGen::Statistics methods

Albert Vilella avilella at gmail.com
Tue Apr 24 12:10:19 EDT 2007


Hi,

I have some genotype data where some individuals don't have a given marker
in the population.

This means that some methods in Bio::PopGen::Statistics will fail when
trying to get them, so I've added a couple of "next unless (defined($sth));"
around to overcome this. But I am not sure if this breaks any assumption
made when implementing the methods.

Anyone able to check this?

Thanks,

    Albert.

avilella at magneto:~$ diff -u
/home/avilella/bioperl/vanilla/bioperl-live/Bio/PopGen/Population.pm.modif
/home/avilella/bioperl/vanilla/bioperl-live/Bio/PopGen/Population.pm
---
/home/avilella/bioperl/vanilla/bioperl-live/Bio/PopGen/Population.pm.modif
2007-04-24 15:05:51.000000000 +0100
+++
/home/avilella/bioperl/vanilla/bioperl-live/Bio/PopGen/Population.pm
2007-04-22 16:03:24.000000000 +0100
@@ -546,7 +546,6 @@
        # separate genotypes into 'chromosomes'
        for my $marker_name( @marker_names ) {
           my ($genotype) = $ind->get_Genotypes(-marker => $marker_name);
-           next unless defined($genotype); #FIXME -- is this correct?
           my $i =0;
           for my $allele ( $genotype->get_Alleles ) {
               push @{$chromosomes[$i]},

avilella at magneto:~$ diff -u
/home/avilella/bioperl/vanilla/bioperl-live/Bio/PopGen/Statistics.pm.modif
/home/avilella/bioperl/vanilla/bioperl-live/Bio/PopGen/Statistics.pm
---
/home/avilella/bioperl/vanilla/bioperl-live/Bio/PopGen/Statistics.pm.modif
2007-04-24 15:04:51.000000000 +0100
+++
/home/avilella/bioperl/vanilla/bioperl-live/Bio/PopGen/Statistics.pm
2007-04-22 16:03:24.000000000 +0100
@@ -656,8 +656,6 @@
                return 0;
            }
            foreach my $m ( @marker_names ) {
-              my $genotype = $ind->get_Genotypes($m);
-              next unless defined($genotype); #FIXME -- is this correct?
                foreach my $allele (map { $_->get_Alleles}
                               $ind->get_Genotypes($m) ) {
                    $data{$m}->{$allele}++;


More information about the Bioperl-l mailing list