Skip to content
Snippets Groups Projects
Commit 6d61c54a authored by William McLaren's avatar William McLaren
Browse files

Added get_all_VariationFeatures_by_Population method

parent 66786cd7
No related branches found
No related tags found
No related merge requests found
......@@ -1552,6 +1552,7 @@ sub get_all_VariationFeatures{
If $annotation_source is set only variations whose annotations come from
$annotation_source will be retrieved.
If $annotation_name is set only variations with that annotation will be retrieved.
$annotation_name can be a phenotype's internal dbID.
ReturnType : listref of Bio::EnsEMBL::Variation::VariationFeature
Exceptions : none
Caller : contigview, snpview
......@@ -1665,6 +1666,46 @@ sub get_all_StructuralVariations{
}
=head2 get_all_VariationFeatures_by_Population
Arg [1] : Bio::EnsEMBL::Variation::Population
Arg [2] : $minimum_frequency (optional)
Example : $pop = $pop_adaptor->fetch_by_dbID(659);
@vfs = @{$slice->get_all_VariationFeatures_by_Population(
$pop,$slice)};
Description: Retrieves all variation features in a slice which are stored for
a specified population. If $minimum_frequency is supplied, only
variations with a minor allele frequency (MAF) greater than
$minimum_frequency will be returned.
Returntype : listref of Bio::EnsEMBL::Variation::VariationFeature
Exceptions : throw on incorrect argument
Caller : general
Status : At Risk
=cut
sub get_all_VariationFeatures_by_Population {
my $self = shift;
if(!$self->adaptor()) {
warning('Cannot get variation features without attached adaptor');
return [];
}
my $vf_adaptor = Bio::EnsEMBL::DBSQL::MergedAdaptor->new(-species => $self->adaptor()->db()->species, -type => "VariationFeature");
if( $vf_adaptor ) {
return $vf_adaptor->fetch_all_by_Slice_Population($self, @_);
}
else {
warning("Variation database must be attached to core database to " .
"retrieve variation information" );
return [];
}
}
=head2 get_all_IndividualSlice
Args : none
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment