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 I<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();
156 Usage : my $annotation_collection = $pop->annotation;
157 Function: Get/set a Bio::AnnotationCollectionI for this population
158 Returns : Bio::AnnotationCollectionI object
159 Args : [optional set] Bio::AnnotationCollectionI object
166 $self->throw_not_implemented();
169 =head2 get_Individuals
171 Title : get_Individuals
172 Usage : my @inds = $pop->get_Individuals();
173 Function: Return the individuals, alternatively restrict by a criteria
174 Returns : Array of L<Bio::PopGen::IndividualI> objects
175 Args : none if want all the individuals OR,
176 -unique_id => To get an individual with a specific id
177 -marker => To only get individuals which have a genotype specific
178 for a specific marker name
185 shift->throw_not_implemented();
190 Title : get_Genotypes
191 Usage : my @genotypes = $pop->get_Genotypes(-marker => $name)
192 Function: Get the genotypes for all the individuals for a specific
194 Returns : Array of L<Bio::PopGen::GenotypeI> objects
195 Args : -marker => name of the marker
201 shift->throw_not_implemented;
207 Usage : my $marker = $population->get_Marker($name)
208 Function: Get a Bio::PopGen::Marker object based on this population
209 Returns : L<Bio::PopGen::MarkerI> object
210 Args : name of the marker
216 shift->throw_not_implemented();
219 =head2 get_marker_names
221 Title : get_marker_names
222 Usage : my @names = $pop->get_marker_names;
223 Function: Get the names of the markers
224 Returns : Array of strings
230 sub get_marker_names
{
232 $self->throw_not_implemented();
238 Usage : my @markers = $pop->get_Markers();
239 Function: Will retrieve a list of instantiated MarkerI objects
240 for a population. This is a convience method combining
241 get_marker_names with get_Marker
242 Returns : List of array of Bio::PopGen::MarkerI objects
250 return map { $self->get_Marker($_) } $self->get_marker_names();
254 =head2 get_number_individuals
256 Title : get_number_individuals
257 Usage : my $count = $pop->get_number_individuals;
258 Function: Get the count of the number of individuals
259 Returns : integer >= 0
260 Args : [optional] marker name, will return a count of the number
261 of individuals which have this marker
266 sub get_number_individuals
{
268 $self->throw_not_implemented();