How To Ignore Species In Ensembl Biomart
0
0
Entering edit mode
10.7 years ago
pld 5.1k

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 • 2.3k views
ADD COMMENT
2
Entering edit mode

You seem to have the species specified in your code:

$query->setDataset("hsapiens_gene_ensembl");

Is it doing something you don't expect?

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 1679 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6