PopGen modules
From BioPerl
Contents |
Goals of population genetics tools in BioPerl
The purpose of these modules is to enable automation of population genomics.
Some papers describe the use of these modules perlymorphism2005 hahnFIV rockman2003 as does the PopGen HOWTO.
Population genetic modules
- Bio::PopGen::Statistics - population genetics summary statistics
- Bio::PopGen::PopStats - population statistics (Fst)
- Bio::PopGen::IO - reading and writing datafiles
- Bio::PopGen::Simulation::Coalescent - a very vanilla Coalescent simulator.
- Bio::PopGen::Simulation::GeneticDrift - cute genetic drift simulation, does not do recombination
Some Examples
Read in prettybase data from Seattle SNPs
#!/usr/bin/perl -w use strict; use Bio::PopGen::IO; my $in = Bio::PopGen::IO->new(-format => 'prettybase', -file => 'file.prettybase'); my $pop = $in->next_population; # do something with the population ...
Run Fu and Li's D
#!/usr/bin/perl -w use strict; use Bio::PopGen::Statistics; use Bio::AlignIO; use Bio::PopGen::Utilities; # pass file on the command line my $in = Bio::AlignIO->new(-format => 'clustalw', -file => shift @ARGV); # get the 1st alignment from file if( my $aln = $in->next_aln ) { # get a population object from an alignment my $pop = Bio::PopGen::Utilities->aln_to_population(-alignment=>$aln); my (@ingroup, @outgroup); for my $ind ( $pop->get_Individuals) { if( $ind->unique_id =~ /^OUT/ ) { # outgroup starts with OUT in this example push @outgroup, $ind; } else { push @ingroup, $ind; } } my $fld = Bio::PopGen::Statistics->fu_and_li_D(\@ingroup,\@outgroup); print "$fld\n"; }
References
<biblio>
- rockman2003 pmid=14654003
- hahnFIV pmid=15238535
- perlymorphism2005 pmid=15356276
</biblio>