$allele = Bio::EnsEMBL::Variation::Allele->new
(-allele => 'A',
-frequency => 0.85,
-population => $population);
$delete = Bio::EnsEMBL::Variation::Allele->new
(-allele => '-',
-frequency => 0.15,
-population => $population);
...
$astr = $a->allele();
$pop = $a->population();
$freq = $a->frequency();
print $a->allele();
if($a->populaton) {
print " found in population ", $allele->population->name();
}
if(defined($a->frequency())) {
print " with frequency ", $a->frequency();
}
print "\n";
This is a class representing a single allele of a variation. In addition to
the nucleotide(s) (or absence of) that representing the allele frequency
and population information may be present.
sub new
{ my $caller = shift;
my $class = ref($caller) || $caller;
my ($dbID, $adaptor, $allele, $freq, $pop) =
rearrange(['dbID', 'ADAPTOR', 'ALLELE', 'FREQUENCY', 'POPULATION'], @_);
return bless {'dbID' => $dbID,
'adaptor' => $adaptor,
'allele' => $allele,
'frequency' => $freq,
'population' => $pop}, $class; } |
sub population
{ my $self = shift;
if(@_) {
if(!ref($_[0]) || !$_[0]->isa('Bio::EnsEMBL::Variation::Population')) {
throw('Bio::EnsEMBL::Variation::Population argument expected.');
}
$self->{'population'} = shift;
}
return $self->{'population'};
}
1; } |