R at the command line from ubuntu I am trying to download geo file at the command line I type R, so the command line go to
where I type download.file("http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE89413&format=file", + "gse89413.tar", + mode="wb")
but it does not work, it gave error : unable to resolve "www.ncbi.nlm.nih.gov"
and when I go to command line and type: wget ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE99nnn/GSE99xxx/suppl/GSE99xxx_RAW.tar it gave this message: unable to resolve host address 'ftp.ncbi.nlm.nih.gov'
So how to download this file in R at the command line???
any help is super highly appreciated
1 answer
I don't know about you but I cannot see the file at the location to which you're pointing. I just see the following file at: ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE89nnn/GSE89413/suppl/
- GSE89413_2016-10-30-NBL-cell-line-STAR-fpkm.txt.gz
In R, I got this with:
download.file(url="ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE89nnn/GSE89413/suppl/", destfile="GSE89413_2016-10-30-NBL-cell-line-STAR-fpkm.txt.gz")
If you are attempting to load a GEO dataset directly into R, then you can use the GEO2R package:
- https://www.r-bloggers.com/geo2r-web-app-to-analyze-gene-expression-in-geo-datasets-using-r/
- https://www.ncbi.nlm.nih.gov/geo/geo2r/
There's a lot of information on how to download information from the GEO here. For downloading from the FTP site, they seem to recommended constructing the URL to access the FTP directory structure, as I have done here. By constructing a URL with http and sending 'acc' as the accession number, it just brings up a webpage that lists what information is available for that accession number, like this.
Log in to answer this question.
Hi, Thanks for your response. But did you actually were able to open this link in your R I tried your first method: download.file(url="ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE89nnn/GSE89413/suppl/", destfile="GSE89413_2016-10-30-NBL-cell-line-STAR-fpkm.txt.gz") and did not work either, it gave me cannot open URL "ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE89nnn/GSE89413/suppl/"
Hey, this would have been better as a comment to my answer, in order to maintain 'fluidity' of thought in the thread. Not to worry, though!
Yes, I was able to download the file in R using that exact command. From where do you run R? - a server/cluster installation? Do you have a firewall?
onemore100iq : Please use
ADD REPLY/ADD COMMENTwhen responding to existing posts to keep threads logically organized.If you are getting an
unable to resolve errorthen it sounds like you have a host name resolution problem. Is the problem general or are you only getting it withwww.ncbi.nlm.nih.gov?While not ideal you could try this IP address to see if that fixes the problem:
130.14.29.110instead ofwww.ncbi.nlm.nih.govin the URL above.