European Nucleotide Archive (ENA) and REST – retrieving NGS data links.

From time to time I get a list of ids such as:

ERR3277096
ERR3277097
ERR3277098
ERR3277099

along with a request for analysis of the data.

Those ids are the so called “Run accession” ids. They usually point out to NGS data that have been deposited in public databases such as SRA, ENA and others.

I prefer to download this kind of public data from ENA because it is faster than SRA (geographic reasons!) .

One way of doing this is individual searches per “Run accession” ids and then get the link to download the raw data. Depending on the number of ids, individual searches can be impractical.

EMBL-EBI offers a very nice way to access ENA database content (and other databases as well) programmatically – via REST.

The command I use relays on “file reports” and looks like:

curl -X GET "https://www.ebi.ac.uk/ena/portal/api/filereport?accession=ERR3277135&download=true&result=read_run"

The output of this command is (converted to a table for better visualization):

run_accessionfastq_ftpfastq_bytesfastq_md5submitted_ftpsubmitted_bytessubmitted_md5sra_ftpsra_bytessra_md5
ERR3277135ftp.sra.ebi.ac.uk/vol1/fastq/ERR327/005/ERR3277135/ERR3277135_1.fastq.gz; ftp.sra.ebi.ac.uk/vol1/fastq/ERR327/005/ERR3277135/ERR3277135_2.fastq.gz1609479869; 1634483165210ef5979c83bec96de9634406d2d885; 20c38495d4be659b3c14f275fa3d9f43ftp.sra.ebi.ac.uk/vol1/run/ERR327/ERR3277135/G97_1.fastq.gz; ftp.sra.ebi.ac.uk/vol1/run/ERR327/ERR3277135/G97_2.fastq.gz1449017399; 1474798735fb44f5b31fcb498dba0ffc72507008dc; b9983932bfd51e5446e1efecd0e75bbcftp.sra.ebi.ac.uk/vol1/err/ERR327/005/ERR32771351677659625cd522d8d9155cefa53af43ccc0c3f25f

In this example, we can check that the download link is in the table field “fastq_ftp“. Also, the md5 for each file is provided and after the download, files can be checked for data integrity.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s