Skip to content

Instantly share code, notes, and snippets.

@seandavi
Created April 20, 2015 20:19
Show Gist options
  • Save seandavi/d6fb151e07fc743e1eb4 to your computer and use it in GitHub Desktop.
Save seandavi/d6fb151e07fc743e1eb4 to your computer and use it in GitHub Desktop.
Get all SRA files associated with one or more SRA accessions using SRAdb
# Run this in R
# Supply any SRA accessions that you like.
# The .sra files will be downloaded.
# The actual sequence will need to be extracted
# with the SRA SDK (for example fastq-dump)
source('http://bioconductor.org/biocLite.R')
biocLite('SRAdb')
library(SRAdb)
sradb = getSRAdbFile()
con = dbConnect(SQLite(),sradb)
results = getSRAfile(c('SRP048560','SRP049295'),con)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment