Is there a package that outputs gene coordinates given a list of Ensembl IDs?
2
0
Entering edit mode
3.9 years ago

I need the gene coordinates (CHR, START, END) for a list of genes. I have the Ensembl IDs, but I have over 200 genes. I have been going to NCBI and Ensembl and entering the Ensembl IDs manually. Is there a software package out there that can do this? Biopython and Pyensembl don't seem to have straight-forward options for this and the websites don't seem to accept lists.

Ex:

Gene ID Ensembl ID CHR Start End

ITGA2B ENSG00000005961 chr17 44372180 44389649

ensembl biopython gene • 1.8k views
ADD COMMENT
3
Entering edit mode
3.9 years ago
ATpoint 85k

You can query Ensembl from within R using biomaRt:

library(biomaRt)

# the mart, so-to-say the "universe", here H.Sapiens
mymart <- useMart(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")

# list everything that this mart offers
attrs  <- listAttributes(mart = mymart)

#/ two example genes:
wanted <- c("ENSG00000066336", "ENSG00000102145")

# retrieve the data for these genes:
genes <- biomaRt::getBM(attributes = c("ensembl_gene_id", "chromosome_name", "start_position", "end_position"),
                        mart = mymart, 
                        filters = "ensembl_gene_id", 
                        values = wanted)

> genes
  ensembl_gene_id chromosome_name start_position end_position
1 ENSG00000066336              11       47354860     47378547
2 ENSG00000102145               X       48786562     48794311
ADD COMMENT
0
Entering edit mode

Thank you very much. This is awesome as well.

ADD REPLY
2
Entering edit mode
3.9 years ago
GenoMax 147k

Using EntrezDirect:

$ esearch -db gene -query "ENSG00000005961" | efetch | grep Annotation | awk -F ":" '{print $2}'
 Chromosome 17 NC_000017.11 (44372181..44389649, complement)
ADD COMMENT
0
Entering edit mode

Thank you so much. This is sanity-saving.

ADD REPLY
1
Entering edit mode

Use a loop to get them all.

ADD REPLY

Login before adding your answer.

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