[ensembl-dev] Problem with retrieving VariationAnnotations

Will McLaren wm2 at ebi.ac.uk
Tue Jul 3 10:35:51 BST 2012


Hi Tjaart,

You want to fetch variation sets, not variation annotations (these are
generally phenotype annotations).

my $vsa = $reg->get_adaptor("human", "variation", "variationset");

foreach my $vs(@{$vsa->fetch_all_by_Variation}) {
   # etc
}

Will

On 3 July 2012 10:30, Tjaart de Beer <tjaart at ebi.ac.uk> wrote:
> Hi all,
>
> I currently have a list of RSID's from the 1000 Genomes project for which
> I would like to determine the population in the 1000 Genomes which they
> belong too. My thoughts were to take every rsid, query Ensembl and find
> out either the frequency of the allele in each population or at least the
> population set it belongs too. I tried the following example from the
> Ensembl Variation tutorial but it doesn't seem to work:
>
> use strict;
> use warnings;
> use Bio::EnsEMBL::Registry;
>
> my $registry = 'Bio::EnsEMBL::Registry';
>
> $registry->load_registry_from_db(
>     -host => 'ensembldb.ensembl.org',
>     -user => 'anonymous',
> );
>
> # Fetch a variation object
> my $var_adaptor = $registry->get_adaptor('human', 'variation', 'variation');
> my $var = $var_adaptor->fetch_by_name('rs149944086');
>
> # Fetch all the variation annotations associated with the variation
> my $va_adaptor = $registry->get_adaptor('homo_sapiens', 'variation',
> 'variationannotation');
> foreach my $va (@{$va_adaptor->fetch_all_by_Variation($var)})
> {
>     print $va->variation_names."\n";
>     print $va->source_name."\n";
>     print $va->study_name."\n";
> }
>
>
> According to the webinterface
> (http://www.ensembl.org/Homo_sapiens/Variation/Population?db=core;r=1:870729-871729;v=rs149944086;vdb=variation;vf=30949909)
> of Ensembl this rsid is annotated and I can see that it was imported from
> dbSNP. I can also see the 1000 Genomes allele frequencies on the webpage.
> But when I run my script I get no output whatsoever. I also updated the
> API this morning.
>
> I have two questions which I hope someone can help me with:
>
> 1. What is wrong with my script? Or am I missing something?
> 2. Is there a better approach for me to find out which rsid occurs in
> which 1000 Genome population (along with its frequency)?
>
> Thanks!
>
> --
> Dr. Tjaart de Beer
> Thornton group
> EMBL-EBI
> Cambridge
> United Kingdom
>
>
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe): http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/




More information about the Dev mailing list