Bio::EnsEMBL::ExternalData::Glovar
Haplotype
Toolbar
Summary
Bio::EnsEMBL::ExternalData::Glovar::Haplotype -
Object representing a Glovar haplotype
Package variables
No package variables defined.
Included modules
Inherit
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
Methods description
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 |
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 |
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 |
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 |
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 |
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
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 }; } |
sub display_id
{ my $self = shift;
$self->{'display_id'} = shift if (@_);
return $self->{'display_id'}; } |
sub get_all_tagSNPs
{ my $self = shift;
return @{ $self->{'tag_snps'} || [] };
}
1; } |
sub new_fast
{ my $class = shift;
my $hashref = shift;
return bless $hashref, $class; } |
sub num_snps
{ my $self = shift;
$self->{'num_snps'} = shift if (@_);
return $self->{'num_snps'}; } |
sub population
{ my $self = shift;
$self->{'population'} = shift if (@_);
return $self->{'population'}; } |
General documentation
This code is distributed under an Apache style licence:
Please see
/code_licence.html for details