[Bioperl-l] Bio::PopGen::PopStats

Robin Runyowa robrunyowa at gmail.com
Tue Oct 20 17:20:39 UTC 2009


Hi, I am a newbie in bioperl and I am trying to use to
Bio::PopGen::PopStats.
Unfortunately, I am not sure how to create arrays of objects so I keep
getting an error message.
My input files  are below:
testpop3.cvs:
SAMPLE,rs0001
Person1,A T
Person2,T T
Person3,A A
Person4,T A
Person5,A A


testpop4.cvs
SAMPLE,rs0001
Per1,A T
Per2,T T
Per3,A A
Per4,T A
Per5,A A


My script:
use Bio::PopGen::PopStats;
use Bio::PopGen::Individual;
use Bio::PopGen::Genotype;
use Bio::PopGen::Population;
use Bio::PopGen::IO;

my $handle = new Bio::PopGen::IO (-format => 'csv',
                                -file => 'testpop3.cvs');
my $handle2 = new Bio::PopGen::IO (-format => 'csv',
                                -file => 'testpop4.cvs');

my $YRI = $handle ->next_population;
my $CEU = $handle2 ->next_population;
my @pop = ();
push @pop, $YRI;
push @pop, $CEU;
@markers = $YRI->get_marker_names;
my $fst = $stats->Fst(\@pop,\@marker);

Thanks, Rob



More information about the Bioperl-l mailing list