Using R to format a file using a server (PDB to PQR file)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using R to format a file using a server (PDB to PQR file)

Amitoj S. Chopra
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.

Reply | Threaded
Open this post in threaded view
|

Re: Using R to format a file using a server (PDB to PQR file)

Dieter Menne
Amitoj S. Chopra 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.
Try Curl

http://curl.haxx.se/

and the RCurl package. It not complicated, but can be a lot of work in detail.

Dieter

Reply | Threaded
Open this post in threaded view
|

Re: Using R to format a file using a server (PDB to PQR file)

barry rowlingson
In reply to this post by Amitoj S. Chopra
On Wed, Feb 10, 2010 at 6:16 AM, Amitoj S. Chopra <[hidden email]> 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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Using R to format a file using a server (PDB to PQR file)

Martin Morgan
In reply to this post by Amitoj S. Chopra
On 02/09/2010 10:16 PM, Amitoj S. Chopra 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.

Maybe bio3d::write.pqr is for you?

  http://mccammon.ucsd.edu/~bgrant/bio3d/index.html

Martin

>
>


--
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.