Question: How To Ignore Species In Ensembl Biomart
0
gravatar for pld
5.5 years ago by
pld4.8k
United States
pld4.8k wrote:

I want to use the BioMart to access ensembl with the registry ensembl_mart_75, but I'm only interested in a specific list of species. When I run it now, I can see that it is gathering all species that are in ensembl, is it possible to specify which species to choose?

I am accessing Ensembl via the BioMart Perl module.

Suppose I run the following code:

use strict;
use BioMart::Initializer;
use BioMart::Query;
use BioMart::QueryRunner;

my $confFile = "conf.reg";
my $action='cached';
my $initializer = BioMart::Initializer->new('registryFile'=>$confFile, 'action'=>$action);
my $registry = $initializer->getRegistry;

my $query = BioMart::Query->new('registry'=>$registry,'virtualSchemaName'=>'default');        
$query->setDataset("hsapiens_gene_ensembl");
$query->addAttribute("ensembl_gene_id");
$query->formatter("TSV");
$query_runner = BioMart::QueryRunner->new;
$query_runner->execute($query);
$query_runner->printResults;

If the configuration for my registry file has not yet been performed, it attempts to configure for all species in ensembl. This takes a while, I wanted to see if there was a way to speed this up by only configuring for species I want, rather than all of them.

perl ensembl biomart • 1.3k views
ADD COMMENTlink modified 5.5 years ago • written 5.5 years ago by pld4.8k
2

You seem to have the species specified in your code:

$query->setDataset("hsapiens_gene_ensembl");

Is it doing something you don't expect?

ADD REPLYlink written 5.5 years ago by Emily_Ensembl19k

Any time I've used Ensembl, step two is "choose species", so I don't understand what you mean by "it is gathering all species that are in ensembl." Can you provide more specific details about how you are accessing Ensembl?

ADD REPLYlink written 5.5 years ago by Neilfws48k

Thanks for the edit. I generally use R/biomaRt, not the Perl registry, so have not seen this issue. Hopefully our friendly Ensembl outreach have some ideas.

ADD REPLYlink written 5.5 years ago by Neilfws48k

Sorry for the cruddy OP, I got distracted and submitted before I finished. Is this possible in biomaRt?

ADD REPLYlink written 5.5 years ago by pld4.8k
1

In biomaRt, I'd type:

library(biomaRt)
mart.hs <- useMart("ensembl", "hsapiens_gene_ensembl")

and the useMart() function might take a few seconds to run, at most.

ADD REPLYlink written 5.5 years ago by Neilfws48k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1691 users visited in the last hour