== Adding a Wizard to projectmanager ==
The projectmanager wizards are just JSON files specified in the spr.json or tomo.json files.
To add a wizard to a program represented in the projectmanager workflow tree, just add in the the WIZARD key value pair.<
>
For example, to add a wizard to e2ctf.py we would change:
{{{#!highlight python
"ICON": "ctf",
"TABLE": "EMCTFcorrectedParticlesTable(withmodal=False,multiselect=True)",
"NAME": "CTF",
"CHILDREN": [
{
"ICON": "ctf",
"PROGRAM": "e2ctf.py",
"MODE": "autofit",
"WIKIPAGE": "http://blake.bcm.tmc.edu/emanwiki/EMAN2/Programs/e2ctf",
"NAME": "Automated Fitting -e2ctf",
"NOTELEVEL": "1",
"CHILDREN": []
},
}}}
To:
{{{#!highlight python
"ICON": "ctf",
"TABLE": "EMCTFcorrectedParticlesTable(withmodal=False,multiselect=True)",
"NAME": "CTF",
"CHILDREN": [
{
"ICON": "ctf",
"PROGRAM": "e2ctf.py",
"MODE": "autofit",
"WIKIPAGE": "http://blake.bcm.tmc.edu/emanwiki/EMAN2/Programs/e2ctf",
"NAME": "Automated Fitting -e2ctf",
"NOTELEVEL": "1",
"WIZARD":"/lib/pmconfig/ctfauto.json",
"CHILDREN": []
},
}}}
Note that the wizard file, ctfauto.json, is in the directory lib/pmconfig, and that the relative path is given. This path is the path AFTER the build. If you are working with source code, the wizard JSON file should be in /libEM/pmconfig, but after building and installation it will be in /lib/pmconfig. <
>
=== Writing the wizard ===
The Wizard file is a JSON file containing list of dicts. In addition to standard JSON syntax, you can add comments using '''/*''' '''*/''' and '''//'''.
Each dict represents one wizard page and the pages are iterated through until the last one is reached, at which point the wizard closes. Before the wizard pages to the next page, the values entering in the wizard page are checked for errors. If an error is found a description will be listed in the projectmanger status textbox and you will not be allowed to proceed until the error is corrected.
Each dict should have three key value pairs:
.1 'TITLE', this lists the title of the wizard page and needs a short description, just a few words long.
.1 'INST', this is a paragraph long description of the information the wizard page aims to gather
.1 'WIDGETS', this is a list of strings naming empmwidgets that the wizard page aims to fill. These widgets MUST be present in the program GUI interface AND the widget names must be the same as the option names in the e2program the wizard is built for.
Below is an example of the e2ctfauto.json wizard file:
{{{#!highlight python
/* JSON file to make the particle import wizard */
[
{
"TITLE":"e2ctf autofit Wizard",
"INST":"This Wizard is to Help users from e2ctf in autofit mode. This program does the following: First it compute the foreground and background power. Background is defined as a circular region outside the particles. Next Fg-Bg sepctra are computed and used for fitting. First defocus is fit via least squares, then defcous and B factor are fit via simplex multidimensional miniziation using either a precomputed structure factor or the GroEL struccutre factors at high resolution domains. Finally all parameteres are refined using the simplex algorithm",
"WIDGETS":[]
},
{
"TITLE":"Select particle files",
"INST":"Select particle stacks to use for CTF auto fitting",
"WIDGETS":[
"particles"
]
},
{
"TITLE":"Microscope paramaters",
"INST":"List the microscope parameters used during data collection to paramatize the CTF equation ",
"WIDGETS":[
"apix",
"voltage",
"cs"
]
},
{
"TITLE":"CTF parameters",
"INST":"List the amplitude contrast(using set to 10), and the oversampling(this can improve fitting of marginal data). Typically oversampling of 2 is fine.",
"WIDGETS":[
"ac",
"oversamp"
]
},
{
"TITLE":"CTF processing options",
"INST":"To highpass the SNR, check 'autohp'. To disable smoothing of the background power curve, check 'nosmooth'. You almost always want to do this though. To use defcous from any previous fitting with e2ctf.py as a hint, check 'cudefocushint'.",
"WIDGETS":[
"autohp",
"nosmooth",
"curdefocushint"
]
},
{
"TITLE":"Structure factor processing",
"INST":"To compute structure factors directly after CTF autofitting, check 'computesf'. You almost never want to do this, as it's best to compute strucutre factors on only the best particle stacks. Initially the high resolution domains of the GroEL structure factors are used during CTF determination, however if 'sf' is set to auto, previously determined strucutre factors for this molecule are used if available(otherwise GroEL is used. To force GroEL use set 'sf' to none",
"WIDGETS":[
"computesf",
"sf"
]
}
]
}}}