Getting my head around the Pymol documentation brackets
1
0
Entering edit mode
7.6 years ago
underoath006 ▴ 10

I don't understand this bracket notation here at all:

cmd.load( filename [,object [,state [,format [,finish [,discrete [,multiplex ]]]]]] )

I've been trying to use the Pymol API but I find the documentation to be very confusing. How do you recommend I go about understanding it?

Pymol • 1.5k views
ADD COMMENT
0
Entering edit mode
7.6 years ago
jonasmst ▴ 410

Usually, [ ] means the argument is optional, but I've never seen it nested like this before. Anyway, I found this documentation to be a bit more clear:

cmd.load(string filename, string object-name, integer state,
         string format, int finish, int discrete, int quiet,
         int multiplex, int zoom, int partial)

It even shows how the function is implemented:

def load(filename, object='', state=0, format='', finish=1,
         discrete=-1, quiet=1, multiplex=None, zoom=-1, partial=0):

To summarize, filename is mandatory, the rest is optional with the above default values and types.

ADD COMMENT
0
Entering edit mode

When it's nested like that it just means the inner argument is conditional on the outer argument being present, but the inner argument is optional.

For example, the Unix tool for changing your password "passwd" has a syntax on OSX like:

passwd [-i infosystem [-l location]] [-u authname] [user]

Where you can only use -l if you first use -i.

ADD REPLY

Login before adding your answer.

Traffic: 1703 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6