Differences between revisions 14 and 15
Revision 14 as of 2011-10-07 21:22:50
Size: 5427
Editor: JohnFlanagan
Comment:
Revision 15 as of 2011-10-07 21:23:07
Size: 5437
Editor: JohnFlanagan
Comment:
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
 * "ICON", the icon representing this item in the tree. The possibilites are: "single_image", "multiple_images", "green_boxes", "ctf", "web", "single_image_3d", "refine", "eulers", "resolution", "tomo_hunter". Additional icons can be added by editing icons.json  * "ICON", the icon representing this item in the tree. The possibilites are: "single_image", "multiple_images", "green_boxes", "ctf", "web", "single_image_3d", "refine", "eulers", "resolution", "tomo_hunter". Additional icons can be added by editing the icons.json file.

e2ProjectManager

The e2projectmanager is a GUI project manager system for EMAN2, which guides the user through a series of steps to achieve either a single particle reconstruction or an sub tomogram average depending on the mode e2projectmanager is being used. This GUI is intended to replace the antiquated e2workflow system.

To run, simply type (in any directory):

e2projectmanager.py

If you run the project manager in a project directory, e2projectmanager will load this project. If you are not in a project directory or you want to work with a different project, simply open a project using the menu, Project->Open Project. To create a new project, Project->New Project, and to edit an existing project, Project->Edit Project. Once a project is loaded all new data that the project manger creates will be placed in the project directory no matter when e2projectmanger is being run from. This represents a significant improvement over e2workflow.py.

e2ProjectManger can, currently, be run in two modes, SPR (Single Particle Reconstruction) and Tomo(tomographic). To change modes use the menu, Mode->SPR mode or Mode->Tomo mode.

Customizing the e2projectmanager worlflow tree:

Unlike, e2workflow.py, e2projectmanager can be easily customized. The SPR and Tomo workflow tree are constructed using the JSON files, spr.json and tomojson, respectivly. These files reside in lib/pyemtbx 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 the following key-value pairs:

  • "ICON", the icon representing this item in the tree. The possibilites are: "single_image", "multiple_images", "green_boxes", "ctf", "web", "single_image_3d", "refine", "eulers", "resolution", "tomo_hunter". Additional icons can be added by editing the icons.json file.
  • "PROGRAM", the name of the e2 program that runs when this tree item is clicked
  • "NAME", the name of this tree item
  • "CHILDREN", a list of dicts that list the child tree items. If the are no children then use a blank list, []
  • "MODE", an optional key-value pair, that determines the mode the program is run in more on this in the following section.

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.

  • guitype (required), the type of gui widget you want ot display. The possibilites are: 'intbox', 'floatbox', 'strbox', 'boolbox', 'filebox', 'combobox', 'comboparambox', 'symbox', 'automask3d'
  • row (required), determines which row the GUI is placed in (uses QGridLayout)
  • col (required), determines which colum the GUI is placed in (uses QGridLayout)
  • rowspan (required), determines the rowspan of the widget
  • colspan (required), determines the columnspan of the widget
  • expert, a boolean value which tells the widget(option) to only appear in expert mode. Default=False
  • choicelist, used in the combobox and comboparambox widgets. This is a string which is eval'ed to generate a list or a dictionary whose keys are displayed in the combobox widget
  • guidefault, this overrides the argparse default to set the widget default value
  • mode, this is only used if in the JSON file you added the key-value pair, "MODE":"myvalue". This is used if you want to have multiple tree items that run the same program, but display different GUIs. The mode allows specification of which GUI should display which option(widget). For example if in the JSON file I set "MODE":"test", then I would add mode="test" as an option key-value pair.

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

  • add_pos_argument, this method allows a positional argument widget to set. The above key-value pairs can be used, in addition to:
  • positional, set this boolean value to True to use this as a positional argument
  • name, the name of this argument, displayed in the widget
  • add_header, this method allows a header label to be displayed in the GUI. This method used the key-value pairs, row,col,colspan,rowspan in addition to:
  • Title, the text to display in this header label
  • Name, the name of this widget

For examples please see the programs, e2poxer.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 a value is not in the database, the default is set to guidefault key-value pair, listed in the options code
  3. If guidefault is not set, then the default is set to default key-value pair, listed in the options code
  4. otherwise the default=""

In addition to strings you get set guidefault to (see e2ctf.py for an example):

  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

EMAN2/Programs/e2projectmanager (last edited 2013-01-25 19:10:47 by StephenMurray)