Customizing the e2projectmanager workflow tree:

Unlike, e2workflow.py, e2projectmanager can be easily customized. The SPR and Tomo workflow trees are constructed using the JSON files, spr.json and tomo.json, respectively. These files reside in lib/pyemtbx or in the source code, libEM/pmconfig, and can be edited to customize the tree. The JSON file contains a list of dictionaries, which represents a toplevel(root/base) item in the workflow tree. Each dictionary must contain(except for those marked 'optional') the following key-value pairs:

Enabling your e2program to be read by e2projectmanager:

To enable e2projectmanger to read your e2program and construct a GUI, some flags in the options code need to be set. You must use the EMAN2 parser, EMArgumentParser, a subclass of argparser. The standard key-value pairs of argparsers add_argument method can be set. In addition, in EMArgumentParser the following key-value pairs are used to build the GUI.

In addition to argparser's add_argument method, EMArgumentParser has the methods:

The add_pos_argument method has in addition to add_arguments key-value options:

The add_header method has in addition to add_arguments's key-value options:

For examples please see the programs, e2boxer.py, e2refine.py, e2ctf.py, etc

Resolving widget default values:

The widget default values are set according to the following rules:

  1. If a value for this widget(option) is found in the database, the default is set to the DB value
  2. If the mode flag is set and it has a defined default, this value will be used. For example mode="boxing['abc']" sets the default to 'abc' in mode "boxing". Note that the order of quotation does matter. Single quotes should be inside double quotes.
  3. If a value is not in the database, the default is set to default key-value pair, listed in the options code
  4. otherwise the default=""

In addition to strings you can set mode['default'] to:

  1. self.getCS() which will set the default to the project spherical aberation
  2. self.getVoltage() which will set the default to the project voltage
  3. self.getAPIX() which will set the default to the project angstrom per pixel
  4. self.getMass() which will set the dafualt to the project mass

For example: mode="autofit['self.pm().getCS()']")

Adding Help information

Help information for a program (this will appear in the help tab of the GUI in e2projectmanager.py) can be added using a line of code: usage = """Blah, Blah, blah """ Most e2programs already have this information, so for an example open one of these up, such as: e2ctf.py

EM Browser widgets

These widgets derive from EMBrowser widget, and serve as a file browser suited to a particular task. Often you will use one of these as a value for the option 'browser' in your e2program. Admittedly, many of these derived classes exist simply to display results in a sub directory or filter files/directories. Perhaps this is not the best design, but it is workable. It might be redesigned in the future.

If you don't find these browser widgets suitable you can derive from EMBrowserWidget and write your own.
In addition to the above browser widgets you may find useful the empmwidget:

Eman2PMCustomization (last edited 2012-05-09 16:08:11 by JohnFlanagan)