[Bioperl-l] Popgene::Statistics

Jason Stajich jason at cgt.duhs.duke.edu
Tue Jan 27 18:25:59 EST 2004

On Tue, 27 Jan 2004, Eric Wang wrote:

> Dear all,
> I am a bit confused on the input format for the Bio::PopGen::Statistics
> class.  It seems the IO will take CSV, and PrettyBase format.
> So does this mean the tests (Tajima_D, Fu_Li_D, etc) will compute the
> scores for heterozygote (diploid) dataset too?
Yeah the tests were initially written for dealing directly with output
from the Coalescent simulations - forgot to add the part to deal with
diploid pops.

You have to convert the population to haploid first by making fake
chromosomes -  (This is only possible with new code I just committed)
my $happop = $pop->haploid_population;
my $D = Bio::PopGen::Statistics->tajima_D($happop);

> Also, it seems that we need to implement our own next_individual
> subroutine? is that the current status?

Not really - only if you want to implement your own Bio::PopGen::IO
parser...  Where did you get the impression you need to implement
next_individual yourself?

Here is some basic code
#!/usr/bin/perl -w
use strict;
use Bio::PopGen::IO;
use Bio::PopGen::Statistics;
my $in = Bio::PopGen::IO->new(-format => 'prettybase',
			      -file   => 'diploid.prettybase.txt');

my $pop = $in->next_population;
my $happop = $pop->haploid_population;
print Bio::PopGen::Statistics->tajima_D($happop),"\n";

Let me know if you have any more questions.

> Many thanks!
> Eric T. Wang
> Graduate Student
> University of California, Irvine
> Molecular biology, Genetics, and Biochemistry
> Bioinformatics Track
> tewang at uci.edu
> 949-824-1870
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

Jason Stajich
Duke University
jason at cgt.mc.duke.edu

More information about the Bioperl-l mailing list