[R] how to download pdb structure files?

Gabor Csardi csardi at rmki.kfki.hu
Sun Oct 28 20:09:06 CET 2007


On Sun, Oct 28, 2007 at 11:25:06AM -0700, Ben Bolker wrote:
> 
> 
> 
> Baoqiang Cao-2 wrote:
> > 
> > Dear All,
> > 
> > I'd like to know if there is anyway to download a certain structure file
> > from http://www.pdb.org/. I tried the following but failed:
> > 
> > tmp <-
> > download.file(url="ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb",
> > destfile="pdb100d.ent.gz")
> > 
> > trying URL 'ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb'
> > Error in download.file(url =
> > "ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb",  : 
> >         cannot open URL
> > 'ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb'
> > 
> > Any tips to fix it please? Thanks in advance.
> > 
> > Best,
> > Baoqiang
> > 
> 
>   I don't know that this is possible within R.  I would try obtaining wget
> and using
> wget -r to fetch the files ...

If you don't know then you might try to read the documentation. Then it takes
about five seconds to get the right syntax:

download.file("ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb/pdb100d.ent.gz", destfile="pdb100d.ent.gz")

Hint: you can use gzfile to decompress the file on th fly, while reading 
it into R.

Gabor

> -- 
> View this message in context: http://www.nabble.com/how-to-download-pdb-structure-files--tf4707557.html#a13456168
> Sent from the R help mailing list archive at Nabble.com.
[...]

-- 
Csardi Gabor <csardi at rmki.kfki.hu>    MTA RMKI, ELTE TTK



More information about the R-help mailing list