PopGen modules

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

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

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>

  1. rockman2003 pmid=14654003
  2. hahnFIV pmid=15238535
  3. perlymorphism2005 pmid=15356276

</biblio>

Personal tools
Namespaces
Variants
Actions
Main Links
documentation
community
development
Toolbox