PopGen modules

From BioPerl
(Redirected from Module:Bio::PopGen)
Jump to: navigation, search


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 [1] [2] [3] as does the PopGen HOWTO.

Population genetic modules

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";


  1. Stajich JE and Hahn MW. Disentangling the effects of demography and selection in human history. Mol Biol Evol. 2005 Jan;22(1):63-73. DOI:10.1093/molbev/msh252 | PubMed ID:15356276 | HubMed [perlymorphism2005]
  2. Hahn MW, Rockman MV, Soranzo N, Goldstein DB, and Wray GA. Population genetic and phylogenetic evidence for positive selection on regulatory mutations at the factor VII locus in humans. Genetics. 2004 Jun;167(2):867-77. DOI:10.1534/genetics.103.025726 | PubMed ID:15238535 | HubMed [hahnFIV]
  3. Rockman MV, Hahn MW, Soranzo N, Goldstein DB, and Wray GA. Positive selection on a human-specific transcription factor binding site regulating IL4 expression. Curr Biol. 2003 Dec 2;13(23):2118-23. PubMed ID:14654003 | HubMed [rockman2003]
All Medline abstracts: PubMed | HubMed
Personal tools
Main Links