Thank you! I just realized that you can retrieve not only JSON but also TSV, which is easier to parse afterwards.
Hi all,
I was wondering if there are tools similar to entrez-direct from NCBI, that can be applied to ENA?
What I have is, say, a list of 50 ERR or ERX IDs. When looking through the browser, I can see that each one is linked to a bam file, which I'd like to download. E.g. this link should give an idea: https://www.ebi.ac.uk/ena/browser/view/ERX4126872?show=reads
As you can see the file is named in a way that's completely unrelated to the ENA ID. How can I avoid doing this manually?
Thank you in advance, as always.
1 answer
On the page, look at the JSON link at the bottom.
You could use this as part of a REST API (which it indeed is) to automate the task in a simple script:
The result is a JSON file you can parse to retrieve the FTP URL. Note, not all download options are available here.
{
"run_accession":"ERR4161442",
"fastq_ftp":"",
"submitted_ftp":"ftp.sra.ebi.ac.uk/vol1/run/ERR416/ERR4161442/5dc932bd71fe4a0008e5699d.bam",
"sra_ftp":""
}
You can also refer to the documentation of programmatic access to ENA:
For further simplicity, enaBrowserTools can be downloaded and run locally on the command line to fetch files associated with records by accession. It can also be used to bulk download records related to a specified Sample or Study.
This is as close to e-utils as you can get.
Log in to answer this question.
https://sra-explorer.info/
it can give you all the URLs you need to download (which you then can loop in a terminal or such)