This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Help With Downloading Sequences From Ensembl

Hi All,

I am new to Ensembl Perl API. I searched for "olfactory receptor" in the Chicken Genome and I got 163 hits as genes. I want to download those genes and their nucleotide sequences. I was just wondering if you could provide a search term and the species' genome to be searched, using the Perl API ?

Thanks for your time

Regards
Sashi

ensembl perl sequence

1 answer

The Ensembl Core API Tutorial has information on how to download sequences given an identifier. Specifically, see the description of the fetch_by_gene_stable_id function.

I don't see how the Ensembl Core API allows you to query by GO annotation (which is how I would get olfactory receptors). So I'd suggest checking out the BioMart API.

I don't think the API allows you to execute the search and download sequence in a single step, but you should be able to write a simple wrapper to execute those steps separately...

Thank You Andrew for pointing me to the exact function.

Thanks Andrew. Do you know how I can get all the Ensembl GeneIDs of the hits I get for a search term. Do I have to just parse the html ?? The search for "olfactory receptor Gallus gallus" in GenBank Genes database gives me more number of hits than in ensembl. (480 over 163). May I ask you which number you would consider. Is ensembl better annotated than genbank??

If I get geneids I can either use bioperl or use BioMart to get the sequences.

No, I don't think you want to screen-scape the HTML. I think you should do your query at BioMart (input: GO term, output: Ensembl gene IDs). First use the MartView GUI to do your query by hand, and then if you need to access it programmatically, then use the API. After you get the IDs from BioMart, then I think you download sequence from Ensembl. That's how I would do it anyway. (Clearly, some details in there that you'll need to fill in...)

Log in to answer this question.