dammif
Manual
The following sections shortly describe the method implemented in DAMMIF, how to run DAMMIF from the command-line, detail the interactive mode as well as the required input and the produced output files.
Introduction
DAMMIF, a tool for rapid ab-initio shape determination in small angle scattering, is a reimplementation of the well known bead-modelling program DAMMIN.
In bead modeling a particle is represented as a collection of a large number of densely packed beads inside a search volume. Each bead belongs either to the particle or to the solvent. Starting from an arbitrary initial model DAMMIF utilizes simulated annealing to construct a compact interconnected model yielding a scattering pattern that fits the experimental data.
Running dammif
Usage:
$ dammif [OPTIONS] [GNOMFILE]
OPTIONS known by DAMMIF are described in next section, the optional argument GNOMFILE in the section on input files. In general, command-line options can be used to make choices about the properties of the particle to reconstruct, while the interactive configuration is used to govern the annealing process. If neither OPTIONS nor GNOMFILE is given, the configuration is done in full interactive mode.
Command-Line Arguments and Options
DAMMIF accepts the following command line arguments:
Argument | Description |
---|---|
GNOMFILE | A relative or absolute path to regularised SAS data (.out) |
DAMMIF recognizes the following command-line options. Mandatory arguments to long options are mandatory for short options too.
Short Option | Long Option | Description |
---|---|---|
-u | --unit=<UNIT> | Angular units of the input file, one of ANGSTROM or NANOMETER. By default, an attempt is made to estimate the unit scale. |
-p | --prefix=<PREFIX> | Prefix to prepend to output filenames. May include absolute or relative paths, all directory components must exist. Default is ‘dammif’. |
--model-format=<FMT> | Format of 3D models, one of: cif, pdb (default: cif) | |
-a | --anisometry=<NAME> | If, due to prior studies, it is known that the particle’s shape shall be eithe PROLATE or OBLATE, one may use the anisometry option to enforce a penalty on particles that do not correspond with the expected anisometry. By default, anisometry is ‘UNKNOWN’. |
--shape=<SHAPE> | Expected particle shape to use as a start model (default: use classifier). Valid values are: ‘unknown’, ‘compact’, ‘extended’, ‘flat’, ‘ring’, ‘compact-hollow’, ‘hollow-sphere’, ‘random-chain’. The parameters of the starting model are based on the shape classification. An appropriate classification may significantly improve the reconstruction speed and accuracy as annealing parameters are adjusted by shape, e.g. extended particle generally require more summands in the spherical harmonics calculations. | |
-s | --symmetry=<NAME> | Specify the symmetry to enforce on the particle. Any P_nm_ symmetry known by DAMMIN is supported (P_n_,n=1, …, 19 and P_n_2,n=2, …, 12). Cubic and icosahedral symmetries are not available. By default, no symmetry is enforced (P1). |
-m | --mode=<MODE> | Configuration of the annealing procedure, one of FAST (bigger beads, cooling down quickly), SLOW (smaller beads, cooling down slowly), or INTERACTIVE. Default is INTERACTIVE. See example. |
--constant=<VALUE> | Specify a user defined constant to subtract; 0 to disable constant subtraction. If unspecified, a constant to subtract is automatically determined. | |
-q | --max-bead-count=<N> | Maximum number of beads in the expanding search space (unlimited if undefined). |
-q | --quiet | Suppress screen output, write a .log-file only. By default, all runtime information is printed to screen and the .log-file. |
--seed=<INT> | Set the seed for the random number generator | |
-h | --help | Print a summary of arguments, options, and exit. |
-v | --version | Print version information and exit. |
Interactive Configuration
If the optional argument ‘ GNOMFILE ‘ is omitted, settings available through command-line arguments and options may also be configured interactively as shown in the table below. Otherwise these questions are skipped.
Screen Text | Default | Description |
---|---|---|
GNOM input file? | N/A | Same as GNOMFILE-argument. |
Angular unit? | UNKNOWN | Same as unit-option. |
Output file prefix? | dammif | Same as prefix-option. |
Model output format? | cif | Same as model-format-option. |
Expected/assumed shape? | unknown | Same as shape-option. |
Expected particle symmetry? | P1 | Same as symmetry-option. |
Expected particle anisometry? | UNKNOWN | Same as anisometry-option. |
Constant to subtract? 0 to disable constant subtraction, undefined for automatic (default)? | UNKNOWN | Same as constant-option. |
Simulated annealing setup? | SLOW | Same as mode-option. |
In INTERACTIVE-mode a list of parameters governing the annealing process may be fine-tuned:
Screen Text | Default | FAST-mode Setting | SLOW-mode Setting | Description |
---|---|---|---|---|
Maximum bead count (default: unlimited)? | var | var | var | Same as max-bead-count-option. |
Dummy atom radius? [1.0-?] [Angstrom] | var | var | var | The estimate for the dummy atom radius is based on \(D_\text{max}\) to result in a search volume of about 2.000 (FAST-mode) to about 10.000 (SLOW-mode) beads. The smaller this radius is set, the more beads are generated, the slower the process. |
Maximum number of spherical harmonics? [1-50] | 20 | 15 | 20 | The more harmonics, the more accurate the reconstruction becomes, but the slower the process. Very elongated particles may require up to 50 harmonics, quick screening can be done as low as 10-15. The default values may be adjusted by shape classification. |
Proportion of the curve to be fitted? (0.0-1.0] | 1.0 | 1.0 | 1.0 | Proportion of the scattering curve to fit, starting at the first point. |
Curve weighting function? Select one of: [l]og, [p]orod, [e]mphasised porod, [n]one | emph. porod | emph. porod | emph. porod | Weighting function to ensure a better fit at lower angles. If unsure, use the default. |
Initial random seed? | var | var | var | To reproduce results, re-use the random seed. Default value is time-based. If multiple runs of DAMMIF shall be started at the same time, use an input file with different random seeds. |
Maximum number of temperature steps in annealing procedure? [1-?] | 200 | 200 | 400 | Stop if simulated annealing is not finished after this many steps. The more iterations per step and the slower the system is cooled, the more temperature steps are required. |
Maximum number of iterations within a single temperature step? [1-?] | 200.000 | 20.000 | 100.000 | Finalize temperature step and cool after this many iterations at the latest. |
Maximum number of successes per temperature step before temperature is decreased? [1-?] | 20.000 | 2.000 | 10.000 | Finalize temperature step and cool after at most this many successful phase changes. |
Minimum number of successes per temperature step before temperature is decreased? [1-?] | 200 | 20 | 50 | Stop if not at least this many successful state changes within a single temperature step can be done. |
Temperature schedule factor? [0.0-1.0) | 0.95 | 0.9 | 0.95 | Factor by which the temperature is decreased; 0.95 is a good average value. Faster cooling for smaller systems is possible (0.9), but slower cooling (0.99) needs to be applied more often. The default factor is increased for extended particles. |
Rg penalty weight? [0.0-…) | 0.001 | 0.001 | 0.001 | How much the \(R_g\) Penalty shall influence the acceptance or rejection of phase changes. A value of 0.0 disables the penalty. If unsure, use the default value. |
Center penalty weight? [0.0-…) | 0.00001 | 0.00001 | 0.00001 | How much the Center Penalty shall influence the acceptance or rejection of phase changes. A value of 0.0 disables the penalty. If unsure, use the default value. |
Looseness penalty weight? [0.0-…) | 0.01 | 0.01 | 0.01 | How much the Looseness Penalty shall influence the acceptance or rejection of phase changes. A value of 0.0 disables the penalty. If unsure, use the default value. If unlike smooth surfaces and sharp edges are observed, try decreasing this penalty weight. |
Anisometry penalty weight? [0.0-…) | 0.0/0.5 | 0.0/0.5 | 0.0/0.5 | How much the Anisometry Penalty shall influence the acceptance or rejection of phase changes. A value of 0.0 disables the penalty. If unsure, use the default value, 0.0 if no anisometry was specified, 0.5 otherwise. |
Runtime Output
On runtime, two lines of output will be generated for each temperature step:
Step: 1, T: 0.368E-03, 23/2287, Succ: 1062, Eval: 20002, CPU: 00:00:06
Rf: 0.1504, Los: 0.39, Rg: 0.00, Cen: 0.00, Ani: 0.00, Fit: 0.1504
The fields can be interpreted as follows, top-left to bottom-right:
Field | Description |
---|---|
Step | Step number. Starts at 1, increases monotonically. |
T | Temperature measure, starts at an arbitrary high value, decreases each step by the temperature schedule factor. |
N/M | N beads in phase particle in M beads overall. |
Succ | Number of successful phase changes in this temperature step. Limited by the minimum and maximum number of successes. The number of successes should slowly decrease, the first couple of steps should be terminated by the maximum number of successes criterion. If instead the maximum number of iterations per step are done, or the number of successes drops suddenly by a large amount, the system should probably be cooled more slowly. |
Eval | Accumulated number of function evaluations. |
CPU | Elapsed wall-clock time since the annealing procedure was started. |
Rf | Goodness of fit of simulated data versus experimental data, does not take penalties into account. |
Los | Contribution of Looseness Penalty, not taking the Looseness Penalty Weight into account. |
Rg | Contribution of \(R_g\) Penalty, not taking the Rg Penalty Weight into account. |
Cen | Contribution of Center Penalty, not taking the Center Penalty Weight into account. |
Ani | Contribution of Anisometry Penalty, not taking the Anisometry Penalty Weight into account. |
Fit | A function of Rf including all penalties and their respective weights. Decreases towards zero, the smaller the value, the better the fit. |
dammif Input Files
Like DAMMIN, DAMMIF uses regularised SAS data (.out) as computed by GNOM as input files.
dammif Output Files
With each successful run, DAMMIF creates a set of output files, each filename starts with a customizable prefix that gets an extension appended. If a prefix has been used before, existing files will be overwritten without further note.
Extension | Description |
---|---|
.log | A copy of the screen output |
-1.pdb or -1.cif | The model is proveded in either PDB or mmCIF format, depending on the model-format option. |
.fit | Fit of the simulated scattering curve versus a smoothed-out version of the real-data. See interactive mode how to change the number of supporting points in the spline interpolation. |
.fir | Fit of the simulated scattering curve versus the experimental data. |
.in | This file provides an easy way to re-run DAMMIF with the same set of input parameters (including random seed) to verify the effects of options. |
Thus, if DAMMIF is started as
$ dammif --prefix=../foo/bar gnom.out
the files ‘bar.log’, ‘bar-0.pdb’, ‘bar-1.pdb’, ‘bar.fit’, ‘bar.fir’ and ‘bar.in’ will be written in the directory ‘../foo’, relative to the current working directory.
Examples
All examples use lyz.out as an input file, it is also included in the documentation directory of the installation package. Please note that the prefixes may be chosen arbitrarily. The values below are chosen for maximum clarity only.
A Quick Look
Use DAMMIF in FAST -mode to obtain a first model quickly:
$ dammif --prefix=lyz-fast --mode=fast lyz.out
More Detailed Reconstruction
Use DAMMIF in SLOW -mode get an improved reconstruction:
$ dammif --prefix=lyz-slow --mode=slow lyz.out
Customizing the Annealing Procedure
For best results, run DAMMIF in INTERACTIVE mode, customizing annealing parameters as required:
$ dammif --prefix=lyz-custom --mode=interactive lyz.out
Running dammif Multiple Times
On Linux, in bash syntax:
$ for i in `seq 1 10` ; do dammif --prefix=lyz-$i --mode=slow lyz.out; done
Make sure to use different prefixes when running DAMMIF multiple times in the same working directory. Further, if multiple DAMMIF-runs are started in parallel, e.g. on a cluster, make sure that the random seeds differ, otherwise identical results will be obtained.
Reproducing Results
Input-redirection can be used to let DAMMIF read settings from a configuration file This example uses the .in-file of a previous run to obtain the exact same result:
$ dammif --prefix=lyz-slow-rerun --mode=interactive < lyz-slow.in