Finding experiments and reads from SRA/ENA can be done using the following steps:
- Download the SQL database and make the connection:
library(SRAdb)
sqlfile <- file.path(system.file('extdata', package='SRAdb'), 'SRAmetadb_demo.sqlite')
sra_con <- dbConnect(SQLite(),sqlfile)
- Get the study information:
dbGetQuery(sra_con, "select study_accession, study_description from study where study_description like '%coli%' ")
- Get information on what is contained in that study:
sraConvert( c('ERP000350'), sra_con = sra_con )
- Get a list of the files available:
listSRAfile( c("ERR019652","ERR019653"), sra_con, fileType = 'sra' )
- Download the sequence files:
getSRAfile( c("ERR019652","ERR019653"), sra_con, fileType = 'fastq', destDir = file.path(getwd(), "datasets", "ch8") )