[ensembl-dev] howto get Minor and Major Allele frequencies for SNPs across all populations?

Duarte Molha duartemolha at gmail.com
Wed Dec 15 15:38:54 GMT 2010


Hi

I was wondering if you could give me a hand with some suggestions on how I
can retrieve Major and Minor allele frequencies for any given SNP accross
all available populations on the database.

Right now the code I have written basically gets a set of coordinates and
retrieves information regarding the snp position. What I would like to
obtain would be a list of major and minor allele frequencies that you can
see on the ensembly website on the population genetics section:

http://www.ensembl.org/Homo_sapiens/Variation/Population?r=1:114377068-114378068;v=rs2476601;vdb=variation;vf=11790081

I am sorry if the question is too obvious I always try to find things on my
own but I am a bit of a newbie working with ensembl api.

Best regards

Duarte

*perl code:*

sub getRCfreq{
my $rsID = shift;
my $chr = shift;
 $chr =~ s/chr//;
my $start = shift;
my $end = shift;
 my @return_data = ();
        #get slice adaptor
 my $sa = $reg->get_adaptor('Human','Core','Slice');
        #get slice
my $slice = $sa->fetch_by_region( 'chromosome', $chr,$start,$end);
  my $vfa = $reg->get_adaptor('human','variation','variationfeature');
 my $variation = $vfa->fetch_all_by_Slice($slice);
  foreach my $vf (@{$variation}){
  push (@return_data, "Variation: ". $vf->variation_name. " with alleles ".
$vf->allele_string,
         " in chromosome ". $slice->seq_region_name, " and position ".
$vf->start,"-".$vf->end );
}

return @return_data;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20101215/a1a88be3/attachment.html>


More information about the Dev mailing list