Skip to content

Instantly share code, notes, and snippets.

@jashapiro
Last active June 30, 2020 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jashapiro/b14cd90156b8173ab67173f9cb81b25b to your computer and use it in GitHub Desktop.
Save jashapiro/b14cd90156b8173ab67173f9cb81b25b to your computer and use it in GitHub Desktop.
An R function to get a table of ENA FTP urls for an SRA project
get_ena_ftp <- function(SRA_project){
ena_url <- stringr::str_interp("http://www.ebi.ac.uk/ena/data/warehouse/filereport?accession=${SRA_project}&result=read_run&fields=run_accession,fastq_ftp,fastq_md5,fastq_bytes")
ena_table <- readr::read_tsv(ena_url) %>%
tidyr::separate_rows(fastq_ftp, fastq_md5, fastq_bytes, sep = ";")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment