In R:
source('http://bioconductor.org/biocLite.R')
biocLite('SRAdb')
library(SRAdb)
srafile = getSRAdbFile()
con = dbConnect('SQLite',srafile)
Now we are ready to query the local SQLite database:
listSRAfile('SRP026197',con)
Results in:
study sample experiment run ftp
1 SRP026197 SRS449410 SRX311638 SRR913951 ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX311/SRX311638/SRR913951/SRR913951.sra
2 SRP026197 SRS449476 SRX311704 SRR914066 ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX311/SRX311704/SRR914066/SRR914066.sra
3 SRP026197 SRS449408 SRX311636 SRR913949 ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX311/SRX311636/SRR913949/SRR913949.sra
....
247 SRP026197 SRS449508 SRX311735 SRR914158 ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX311/SRX311735/SRR914158/SRR914158.sra
248 SRP026197 SRS449460 SRX311688 SRR914006 ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX311/SRX311688/SRR914006/SRR914006.sra
249 SRP026197 SRS449509 SRX311736 SRR914160 ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByExp/sra/SRX/SRX311/SRX311736/SRR914160/SRR914160.sra
If you simply want to have R do the downloads for you, that is also straightforward:
getSRAfile('SRP026197',con,fileType='sra')
If you have access to the aspera client command line utility, ascp
, you can have R use it instead of ftp, resulting in much greater download speeds. See the help for getSRAfile
for details.
Have you tried the SRAdb package from bioconductor? It's been a while, but I think it can be used to do that sort of thing.
Actually, SRA is the repository for sequence data, not GEO. There are links between the two databases, but your question is actually related to SRA.
oh yeah you are right. I will edit my question. thanx
here is another solution A: How to download raw sequence data from GEO/SRA
when I run the code on my computer,I have a problem below,what is wrong?
trying URL 'http://gbnci.abcc.ncifcrf.gov/backup/SRAmetadb.sqlite.gz' Content type 'application/x-gzip' length 1308358823 bytes (1247.7 Mb) opened URL downloaded 1247.7 Mb
Unzipping...
Error in .local(drv, ...) : Could not connect to database: unable to open database file
Perhaps you ran out of space in /tmp or the equivalent. Anyway, please post things like this as new questions.