Please do not post identical questions to BioStars and Ensembl helpdesk. As you've already seen here, Ensembl do monitor BioStars, and posting to both just creates duplicate work.
Hi,
Is there any way to get a list of variants that are presentt within ensembl regulatroy feature, that is, get a list of SNPs that are present in any ENSR ID, particulalry in an enhancer ID.
I got some clue from here (http://www.ensembl.info/blog/2013/01/24/variants-in-regulatory-regions-2/ and http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1DBSQL_1_1RegulatoryFeatureVariationAdaptor.html) but not sure is this the right way...,,!!!???
Thanks,
Waqas.
2 answers
You can get the data by using Ensembl's API. In the synopsis for the RegulatoryFeatureVariationAdaptor you can find some code examples for how to retrieve variants that overlap regulatory features:
- fetch the RegulatoryFeature object
- use the RegulatoryFeatureVariationAdaptor to fetch all RegulatoryFeatureVariations for the given RegulatoryFeature
- a RegulatoryFeatureVariation object stores information about the RegulatoryFeature and the VariationFeature
- you can retrieve the VariationFeature object by calling variation_feature on the RegulatoryFeatureVariation object: my $variation_feature = $regulatory_feature_variation->variation_feature;
- the VariationFeature object contains information about the variation and location information: http://www.ensembl.org/info/docs/Doxygen/variation-api/classBio_1_1EnsEMBL_1_1Variation_1_1VariationFeature.html
We have more tutorials about how to use our APIs:
- http://www.ensembl.org/info/docs/api/variation/variation_tutorial.html
- http://www.ensembl.org/info/docs/api/funcgen/regulation_tutorial.html
- http://www.ensembl.org/info/docs/api/core/core_tutorial.html
If you already have a checkout of our most recent branch (ensembl-variation(release/84)) could you please pull the most recent changes?
Please let me know if you have more questions.
Hi Anja,
and Thanks, from nothing till here, I am able to perform most of the task.
I am trying to runn this test script available at:
use strict; use warnings; use Bio::EnsEMBL::Registry;
my $reg = 'Bio::EnsEMBL::Registry';
$reg->load_registry_from_db(-host => 'ensembldb.ensembl.org',-user => 'anonymous');
my $rfa = $reg->get_adaptor('human', 'funcgen', 'RegulatoryFeature');
my $va = $reg->get_adaptor('human', 'variation', 'Variation');
my $vfa = $reg->get_adaptor('human', 'variation', 'VariationFeature');
my $rfva = $reg->get_adaptor('human','variation','RegulatoryFeatureVariation');
# fetch RegulatoryFeature by dbID
my $rf_stable_id = 'ENSR00000316845';
my $rf = $rfa->fetch_by_stable_id($rf_stable_id);
# fetch all RegulatoryFeatureVariations falling in the MotifFeature
my $rfvs = $rfva->fetch_all_by_RegulatoryFeatures([$rf]);
# fetch by VariationFeatures
my $variation_name = 'rs191666497';
my $v = $va->fetch_by_name($variation_name);
my $vfs = $vfa->fetch_all_by_Variation($v);
# fetch all RegulatoryFeatureVariations for the list of VariationFeatures
for my $vf (@$vfs) {
print $vf->variation_name, "\n";
}
$rfvs = $rfva->fetch_all_by_VariationFeatures($vfs);
for my $rfv (@$rfvs) {
print $rfv->regulatory_feature_stable_id, "\n";
}
But I go the following error:
Can't call method "stable_id" on an undefined value at /home/regmwkh/src/ensembl-variation/modules/Bio/EnsEMBL/Variation/DBSQL/VariationFeatureOverlapAdaptor.pm line 126.
Do I need to download some thing?
Best,
Waqas.
Log in to answer this question.
I've let my colleagues in charge of the Ensembl variation API know about your question and they will get back to you.