This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert from transcripts coordinates to genomic coordinates in python

I have a list with transcripts and two coordinates, for example, ENST00000490680_1_550.

Is it possible to convert them to genomic coordinates in python, is there a package for it?

I know that, in R, I can use the ensembldb package and the function transcriptToGenome, but I would like to keep everything in python.

With the pyensembl package, I can use the transcript_by_id function to get the start and end points of the transcript in genomic coordinates, but the coordinates I have usually are the start and a breakpoint in the middle of the transcript, so I only get half of the job done.

On a similar question there is an answer with python code that I think should do it but I am unable to install one of the packages needed (cgat), but maybe I should ask a different question for that.

conversion python coordinates pyensembl

1 answer

Ensembl REST API has an endpoint that does this. There's a training course on using this with Python.

Ah

I regularly use the ensembl rest API to convert from GRCh37 to GRCh38, it is literally in the same section of the documentation. I have no idea how I missed it.

Thank you!

Log in to answer this question.