[Chimera-users] [ChimeraX] #4232: RFE: make ViewDockX understand SwissDock output

Elaine Meng meng at cgl.ucsf.edu
Mon Jun 7 09:26:09 PDT 2021

Hi Michael,
I edited out the details of your files below in case you wanted to keep that private, but am CC-ing the chimera users list recommended for asking questions.

Since the Swissdock server only keeps the files for a while, I understand you had to save them locally and now you are trying to modify the Chimera web-data files to use the local files.  However, I think you can simplify and no longer use a web-data file, but simply a Chimera command file (see below), since the python stuff was just retrieving the files.  In that case you would just insert the local file pathnames into the commands that open them.

Just name the plain text file containing the commands something.com and open it with Chimera.  The command file (plain text) would contain something like this, of course substituting your actual file locations for "[pathname-...]":

open [pathname-of-pdb-file]
viewdock [pathname-of-docked-ligands-file]
color byatom #0
ribbon #0
repr stick :LIG
~disp element.H
 hbonds intramodel false lineWidth 5 color green

Other than the opening of files, you wouldn't necessarily have to use those same commands, you could customize as desired.  Further, you could just type in the commands into the command line one by one instead of making a command file, if that's easier.

Chimera command files:

I hope this helps,
Elaine C. Meng, Ph.D.                       
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco

> On Jun 7, 2021, at 9:04 AM, Michael Weber <weberm at posteo.de> wrote:
> Dear Elaine,
> thank you for your quick response.
> I have a question: when now trying to use Chimera instead of ChimeraX to analyze my SwissDock output files I noted that the files may only be analyzed as long as the entire data set related to that docking experiment is still available online on the SwissDock website. Fortunately, I had downloaded the entire data sets and stored them locally.
> SwissDock delivers some sort of script in which Chimera commands and the required input file locations are stored as follows:
> <?xml version="1.0"?>
> <ChimeraPuppet type="std_webdata">
> <web_files>
>    <file name="target.pdb" format="text" loc="http://www.swissdock.ch/files/tmp/[...other stuff...]/target.pdb" />
> </web_files>
> <commands>
>   <py_cmd>
> import urllib
> import tempfile
> from chimera import runCommand
> tmpDirectory = tempfile.mkdtemp()
> urllib.urlretrieve ("http://www.swissdock.ch/files/tmp/[...other stuff...]/clusters.dock4.pdb", "%s/clusters.dock4.pdb"%tmpDirectory)
> runCommand("viewdock %s/clusters.dock4.pdb \"Dock 4, 5 or 6\""%tmpDirectory)
> </py_cmd>
>  <mid_cmd>color byatom #0</mid_cmd>
>   <mid_cmd>ribbon #0</mid_cmd>
>   <mid_cmd>repr stick :LIG</mid_cmd>
>   <mid_cmd>~disp element.H</mid_cmd>
>   <mid_cmd>hbonds intramodel false lineWidth 5 color green</mid_cmd>
> </commands>
> </ChimeraPuppet>
> I thought I might cure the situation by replacing the web locations by the local hard drive file locations, so I modified it as follows:
> [... edited out...]
> Of course it does not work properly because I don't know what exactly the syntax looks like for solving my problem when working with local files.
> I hope it is not asked too much, but could you help me how to fix this?
> Best regards,
> Michael.

More information about the Chimera-users mailing list