Bio::EnsEMBL::Variation Allele
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Variation::Allele - A single allele of a nucleotide variation.
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Storable
Bio::EnsEMBL::Utils::Argument qw ( rearrange )
Inherit
Bio::EnsEMBL::Storable
Synopsis
    $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";
Description
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.
Methods
alleleDescriptionCode
frequencyDescriptionCode
newDescriptionCode
populationDescriptionCode
Methods description
allelecode    nextTop
  Arg [1]    : string $newval (optional) 
The new value to set the allele attribute to
Example : print $a->allele();
$a1->allele('A');
$a2->allele('-');
Description: Getter/Setter for the allele attribute. The allele is a string
of nucleotide sequence, or a '-' representing the absence of
sequence (deletion).
Returntype : string
Exceptions : none
Caller : general
Status : At Risk
frequencycodeprevnextTop
  Arg [1]    : float $newval (optional) 
The new value to set the frequency attribute to
Example : $frequency = $a->frequency();
Description: Getter/Setter for the frequency attribute. The frequency is
the frequency of the occurance of the allele. If the population
attribute it is the frequency of the allele within that
population.
Returntype : float
Exceptions : none
Caller : general
Status : At Risk
newcodeprevnextTop
  Arg [-dbID]: int - unique internal identifier for the Allele
Arg [-ADAPTOR]: Bio::EnsEMBL::Variation::DBSQL::AlleleAdaptor
Arg [-ALLELE]: string - the nucleotide string representing the allele
Arg [-FREQUENCY]: float - the frequency of the allele
Arg [-POPULATION]: Bio::EnsEMBL::Variation::Population - the population
in which the allele was recorded
Example : $allele = Bio::EnsEMBL::Variation::Allele->new
(-allele => 'A',
-frequency => 0.85,
-population => $pop);
Description: Constructor. Instantiates a new Allele object. Returntype : Bio::EnsEMBL::Variation::Allele Exceptions : none Caller : general Status : At Risk
populationcodeprevnextTop
  Arg [1]    : Bio::EnsEMBL::Variation::Population $newval (optional)
The new value to set the population attribute to
Example : $population = $a->population();
Description: Getter/Setter for the population attribute
Returntype : Bio::EnsEMBL::Variation::Population
Exceptions : throw on incorrect argument
Caller : general
Status : At Risk
Methods code
alleledescriptionprevnextTop
sub allele {
  my $self = shift;
  return $self->{'allele'} = shift if(@_);
  return $self->{'allele'};
}
frequencydescriptionprevnextTop
sub frequency {
  my $self = shift;
  return $self->{'frequency'} = shift if(@_);
  return $self->{'frequency'};
}
newdescriptionprevnextTop
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;
}
populationdescriptionprevnextTop
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;
}
General documentation
CONTACTTop
Post questions to the Ensembl development list: ensembl-dev@ebi.ac.uk