if( file.exists( 'SRAmetadb.sqlite' ) ) {
library(SRAdb)
sra_dbname <- 'SRAmetadb.sqlite'
sra_con <- dbConnect( dbDriver("SQLite"), sra_dbname )
## Not run:
# ## Download sra files from NCBI SRA using ftp protocol:
# getSRAfile( in_acc = c("SRR000648","SRR000657"), sra_con = sra_con, destDir = getwd(), fileType = 'sra' )
#
# ## Convert NCBI SRA format (.sra) data to fastq:
# ## Download SRA Toolkit: http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?cmd=show&f=software&m=software&s=software
# ## Run fastq-dump to
# ## system ("fastq-dump SRR000648.sra")
#
# ## Download fastq files from EBI using ftp protocol:
# getSRAfile( in_acc, sra_con, destDir = getwd(), fileType = 'fastq', srcType = 'ftp', makeDirectory = FALSE, method = 'curl', ascpCMD = NULL )
#
# ## Download fastq files from EBI ftp siteusing fasp protocol:
# ascpCMD <- 'ascp -QT -l 300m -i /usr/local/aspera/connect/etc/asperaweb_id_dsa.putty'
# getSRAfile( in_acc, sra_con, fileType = 'fastq', srcType = 'fasp', ascpCMD = ascpCMD )
# ## End(Not run)
dbDisconnect( sra_con )
} else {
print( "use getSRAdbFile() to get a copy of the SRAmetadb.sqlite file and then rerun the example" )
}
Run the code above in your browser using DataLab