[R] Using R to format a file using a server (PDB to PQR file)
Barry Rowlingson
b.rowlingson at lancaster.ac.uk
Wed Feb 10 11:30:35 CET 2010
On Wed, Feb 10, 2010 at 6:16 AM, Amitoj S. Chopra <amitojc at gmail.com> wrote:
>
> I am trying to write a program that uses R and takes a pdb file, and converts
> it to a pqr file. This task is simple generally, using the website,
> http://pdb2pqr-1.wustl.edu/pdb2pqr/. How do you use R to input a pdb file
> (that is on hand) into the upload pdb file input, and run the website and
> give the return file to be a pqr file. Thanks for your help.
You can use RCurl to upload a file to an HTML form POST URL using
postForm (and see also fileUpload).
Then you need to poll the returned URL to see when the conversion is
finished, so sleep for 30 seconds or so, and use getURL until the
returned HTML looks like the completion page. Then find the link to
the output file and use getURL to download it.
RCurl is on CRAN, and docs are here - lots of examples:
http://www.omegahat.org/RCurl/
Warning: this post contains small parts. Some assembly required.
Barry
More information about the R-help
mailing list