Bio::EnsEMBL::ExternalData::Glovar Haplotype
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::ExternalData::Glovar::Haplotype -
Object representing a Glovar haplotype
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Feature
Bio::EnsEMBL::Utils::Exception qw ( throw )
Inherit
Bio::EnsEMBL::Feature
Synopsis
my $hap = new Bio::EnsEMBL::ExternalData::Glovar::Haplotype(-start => 100,
-end => 300,
-strand => 1,
-slice => $slice
);
$hap->population('Caucasian');
$hap->num_snps(10);
$hap->add_tagSNP(50000, 50000);
Description
This object represents a Glovar haplotype. In addition to the usual attributes
of a Bio::EnsEMBL::Feature, it holds information like sample population, number
of tagSNPs on the haplotype and start/end positions of the tagSNPs.
Methods
add_tagSNPDescriptionCode
display_idDescriptionCode
get_all_tagSNPsDescriptionCode
new_fastDescriptionCode
num_snpsDescriptionCode
populationDescriptionCode
Methods description
add_tagSNPcode    nextTop
  Arg[1]      : String $start - SNP start in chromosomal coordinates
Arg[2] : String $end - SNP end in chromosomal coordinates
Example : $haplotype->add_tagSNP(123, 123);
Description : adds tag SNPs to haplotype
Return type : none
Exceptions : thrown if no start/end are provided or start > end
Caller : general
display_idcodeprevnextTop
  Arg[1]      : (optional) String - ID to set
Example : $self->display_id('1234');
Description : getter/setter for Haplotype display ID
Return type : String
Exceptions : none
Caller : general
get_all_tagSNPscodeprevnextTop
  Example     : my @tags = $haplotype->get_all_tagSNPs;
foreach my $tag (@tags) {
print "tag start: " . $tag->start . "\n";
print "tag end: " . $tag->end . "\n";
}
Description : gets all tag SNPs on the haplotype
Return type : List of hashrefs (keys: start, end)
Exceptions : none
Caller : general
new_fastcodeprevnextTop
  Arg[1]      : Hashref - initial values for the object
Example :
Description : creates a new Bio::EnsEMBL::ExternalData::Glovar::Haplotype
very quickly by blessing a passed hashref into the object. To
be used by the drawingcode for fast object creation
Return type : Bio::EnsEMBL::ExternalData::Glovar::Haplotype
Exceptions : none
Caller : drawingcode
num_snpscodeprevnextTop
  Arg[1]      : (optional) String - number of tag SNPs on haplotype to set
Example : $self->num_snps(7);
Description : getter/setter for the number of tag SNPs on the haplotype
Return type : String
Exceptions : none
Caller : general
populationcodeprevnextTop
  Arg[1]      : (optional) String - population to set
Example : $self->population('Caucasian');
Description : getter/setter for population
Return type : String
Exceptions : none
Caller : general
Methods code
add_tagSNPdescriptionprevnextTop
sub add_tagSNP {
    my ($self, $start, $end) = @_;
    throw("Need tagSNP start and end as arguments") unless ($start and $end);
    throw("Start must be < end") if ($start > $end);
    push @{ $self->{'tag_snps'} }, { start => $start, end => $end };
}
display_iddescriptionprevnextTop
sub display_id {
    my $self = shift;
    $self->{'display_id'} = shift if (@_);
    return $self->{'display_id'};
}
get_all_tagSNPsdescriptionprevnextTop
sub get_all_tagSNPs {
    my $self = shift;
    return @{ $self->{'tag_snps'} || [] };
}

1;
}
new_fastdescriptionprevnextTop
sub new_fast {
    my $class = shift;
    my $hashref = shift;
    return bless $hashref, $class;
}
num_snpsdescriptionprevnextTop
sub num_snps {
    my $self = shift;
    $self->{'num_snps'} = shift if (@_);
    return $self->{'num_snps'};
}
populationdescriptionprevnextTop
sub population {
    my $self = shift;
    $self->{'population'} = shift if (@_);
    return $self->{'population'};
}
General documentation
LICENCETop
This code is distributed under an Apache style licence:
Please see /code_licence.html for details
AUTHORTop
Patrick Meidl <pm2@sanger.ac.uk>
CONTACTTop
Post questions to the EnsEMBL development list ensembl-dev@ebi.ac.uk