3 # BioPerl module for Bio::PopGen::PopulationI
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Jason Stajich <jason@bioperl.org>
9 # Copyright Jason Stajich
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::PopGen::PopulationI - Interface for Populations
21 # Get Bio::PopGen::PopulationI object somehow, like
22 # from Bio::Population::Population
24 print "name is ", $population->name(), "\n";
25 print "source is ", $population->source(), "\n";
26 print "description is ", $population->description(), "\n";
28 print "For marker $markername:\n";
29 foreach my $genotype ( $population->get_Genotypes(-marker => $markername) ) {
30 print "Individual ", $genotype->individual_id, " genotype alleles are ",
31 join(',', $genotype->get_Alleles()), "\n";
33 # get a marker with allele frequencies calculated from the population
34 my $marker = $population->get_Marker($markername);
35 my %af = $marker->get_Allele_Frequencies;
36 foreach my $allele ( keys %af ) {
37 print "$allele $af{$allele}\n";
42 This interface describes the basics of a population. One can use this
43 object to get the genotypes of specific individuals, only those
44 individuals which have a certain marker, or create a marker with
45 allele frequency information.
51 User feedback is an integral part of the evolution of this and other
52 Bioperl modules. Send your comments and suggestions preferably to the
53 Bioperl mailing list. Your participation is much appreciated.
55 bioperl-l@bioperl.org - General discussion
56 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
60 Please direct usage questions or support issues to the mailing list:
62 L<bioperl-l@bioperl.org>
64 rather than to the module maintainer directly. Many experienced and
65 reponsive experts will be able look at the problem and quickly
66 address it. Please include a thorough description of the problem
67 with code and data examples if at all possible.
71 Report bugs to the Bioperl bug tracking system to help us keep track
72 of the bugs and their resolution. Bug reports can be submitted via
75 http://bugzilla.open-bio.org/
77 =head1 AUTHOR - Jason Stajich
79 Email jason-at-bioperl.org
83 Matthew Hahn, matthew.hahn-at-duke.edu
87 The rest of the documentation details each of the object methods.
88 Internal methods are usually preceded with a _
93 # Let the code begin...
96 package Bio
::PopGen
::PopulationI
;
100 use base
qw(Bio::Root::RootI);
105 Usage : my $name = $pop->name
106 Function: Get the population name
107 Returns : string representing population name
108 Args : [optional] string representing population name
114 my ($self,@args) = @_;
115 $self->throw_not_implemented();
123 Usage : my $description = $pop->description
124 Function: Get the population description
125 Returns : string representing population description
126 Args : [optional] string representing population description
132 my ($self,@args) = @_;
133 $self->throw_not_implemented();
139 Usage : my $source = $pop->source
140 Function: Get the population source
141 Returns : string representing population source
142 Args : [optional] string representing population source
148 my ($self,@args) = @_;
149 $self->throw_not_implemented();
152 =head2 get_Individuals
154 Title : get_Individuals
155 Usage : my @inds = $pop->get_Individuals();
156 Function: Return the individuals, alternatively restrict by a criteria
157 Returns : Array of L<Bio::PopGen::IndividualI> objects
158 Args : none if want all the individuals OR,
159 -unique_id => To get an individual with a specific id
160 -marker => To only get individuals which have a genotype specific
161 for a specific marker name
167 shift->throw_not_implemented();
172 Title : get_Genotypes
173 Usage : my @genotypes = $pop->get_Genotypes(-marker => $name)
174 Function: Get the genotypes for all the individuals for a specific
176 Returns : Array of L<Bio::PopGen::GenotypeI> objects
177 Args : -marker => name of the marker
183 shift->throw_not_implemented;
189 Usage : my $marker = $population->get_Marker($name)
190 Function: Get a Bio::PopGen::Marker object based on this population
191 Returns : L<Bio::PopGen::MarkerI> object
192 Args : name of the marker
198 shift->throw_not_implemented();
201 =head2 get_marker_names
203 Title : get_marker_names
204 Usage : my @names = $pop->get_marker_names;
205 Function: Get the names of the markers
206 Returns : Array of strings
212 sub get_marker_names
{
214 $self->throw_not_implemented();
220 Usage : my @markers = $pop->get_Markers();
221 Function: Will retrieve a list of instantiated MarkerI objects
222 for a population. This is a convience method combining
223 get_marker_names with get_Marker
224 Returns : List of array of Bio::PopGen::MarkerI objects
232 return map { $self->get_Marker($_) } $self->get_marker_names();
236 =head2 get_number_individuals
238 Title : get_number_individuals
239 Usage : my $count = $pop->get_number_individuals;
240 Function: Get the count of the number of individuals
241 Returns : integer >= 0
242 Args : [optional] marker name, will return a count of the number
243 of individuals which have this marker
248 sub get_number_individuals
{
250 $self->throw_not_implemented();