BiomaRT, retrieve exon positions but filter to chrosomal region
1
0
Entering edit mode
9.6 years ago
tonja.r ▴ 600

I am using biomart to retrieve gene/transcripts/exon information and I need exon start and end positions BUT before I need to filter according to the chromosome and the region.

ensembl=useMart("ensembl")
ensembl = useDataset("hsapiens_gene_ensembl",mart=ensembl)
filterlist <- list("7:128554168:128776507")
attributes = c("chromosome_name", "exon_chrom_start", "exon_chrom_end","transcript_length","strand", "ensembl_gene_id", "ensembl_transcript_id","ensembl_exon_id","hgnc_symbol")
results=getBM(attributes =attributes, filters = c("chromosomal_region"), values = filterlist, mart = ensembl)

It throws an error:

Query ERROR: caught BioMart::Exception::Usage: Attributes from multiple attribute pages are not allowed

Is it possible somehow to retrieve the exon positions in the defined chromosome and region?

R • 3.6k views
ADD COMMENT
2
Entering edit mode
9.6 years ago
komal.rathi ★ 4.1k

As Neilfws explains here, you are trying to query attributes from tables that are not linked. You will have to create two separate queries like this:

# attribute list without hgnc_symbol
attributes.1 = c("chromosome_name", "exon_chrom_start", "exon_chrom_end", "transcript_length","strand", "ensembl_gene_id",  "ensembl_transcript_id","ensembl_exon_id")
# attribute list with hgnc_symbol & ensembl_gene_id
attributes.2 = c("hgnc_symbol","ensembl_gene_id")

# get results for each query
results.1 = getBM(attributes = attributes.1, filters = c("chromosomal_region"), values = filterlist, mart = ensembl)
results.2 = getBM(attributes = attributes.2, filters = c("chromosomal_region"), values = filterlist, mart = ensembl)

# merge the results for both queries
results = merge(results.1,results.2,by='ensembl_gene_id',all.x=T)
ADD COMMENT
0
Entering edit mode

The solution is great however, it takes amazingly much time to retrieve the data.

ADD REPLY

Login before adding your answer.

Traffic: 1490 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