symexp module

Expansion of molecular & crystal symmetry.

usage: symexp.py [options] [input-pdb-file]

For help in stand-alone usage:
  • Command-line options: symmetry.py -h
  • Commands: at the (Cmd) prompt: help or help <command>

This is a front-end for module symmetry.py that is called by several packages.

Changed in version 0.1.1: 09/09/11 refactoring into python, support of rsref / use of modules

Changed in version 0.4.1: 07/01/13 Space group / lattice symmetry

Changed in version 0.5.0: 03/12/15 Restructured text documentation

Changed in version 0.5.5: 10/20/15 Riding anisotropic Us

class symexp.Tasks

Bases: object

Program-specific tasks, supporting just-in-time execution.

Methods with names ending _prereq define tasks whose prerequisites will be met, if possible, prior to execution.

read_coords(new_file=None)

Read coordinates without recalculating statistics

Parameters:new_file (string) – PDB file to be read.
read_coords_prereq(*args, **kwargs)

Pass-through, trying to meet the prerequisites.

symmetry_expand(target_atoms=None, center=None, distance=None)

Identify self.atom neighbors of target (or self.atoms) + symm equivs.

Pass through for Symmetry.neighbors.

Parameters:
  • center ([float, float, float]) – atoms w/in distance of this point instead of other atoms.
  • distance (float) – within which considered close (Å).
symmetry_expand_prereq(*args, **kwargs)

Pass-through, trying to meet the prerequisites.

symmetry_init(distance=None)

Initialize symmetry calculation & identify neighbors.

Parameters:distance (float) – neighbor cut-off; default (None) is 3.5 Å, different from RSRef.
symmetry_init_prereq(*args, **kwargs)

Pass-through, trying to meet the prerequisites.

write_coords(new_file=None, header=None, neighbors_only=False, anisotropic=False)
Parameters:
  • new_file (str) – PDB file to be written.
  • header (str) – to be inserted at top of PDB file.
  • boolneighbors_only – output atoms that are close, but not selected evaluation (non-standard), noting “close” can contain “evaluation” atoms after residue or chain completion.
  • anisotropic (bool) – Write riding anisotropic Us.
write_coords_prereq(*args, **kwargs)

Pass-through, trying to meet the prerequisites.

class symexp.TopCommands(tasks, initial_commands=None, py_locals={}, parser=None)

Bases: cmd2nest.TopCmd, cmd2nest.ProgCmd

Top-level commands for Program Prog.

Parameters:
  • tasks (Control) – class instance that defines methods to be called.
  • initial_commands (str or list of str) – file(s) of commands to run before interactive loop at the top level, and before any command-line commands.
  • py_locals (dict) – objects added to the local namespace in the python interpreter invoked by ‘py’ commands.
  • parser (ArgumentParser (argparse) or OptionParser (optparse)) – to which -t / –test option will be added for cmd2 regression testing. Should only be used once / program.
do_neighbors(instance, arg)

Identify neighbors within distance of (selected) atoms. Usage: neighbors [options] arg

Options:
-h, --help show this help message and exit
-d FLOAT, --distance=FLOAT
 Searches for neighbors within distance of any atom (default: 3.5 A).
do_pdbout(instance, arg)

Write coordinates (symmetry expansion as per command-line arguments). Usage: pdbout [options] [Header inserted into top of PDB file]

Options:
-h, --help show this help message and exit
-o FILE, --file=FILE
 Output file name (required argument).
-a, --anisotropic
 Output anisotropic U, riding w/ coordinates from input PDB.
do_sphere(instance, arg)

Find atoms & symmetry equivalents near given point.

Usage: sphere [options] displacement (A)

Options:
-h, --help show this help message and exit
-c (‘x’, ‘y’, ‘z’), –center=(‘x’, ‘y’, ‘z’)
Center of sphere (default: [0.0, 0.0, 0.0]).
-r FLOAT, --radius=FLOAT
 Radius (default: 10.0)
do_test(rest)

Run a program developer’s test.

help_test()
symexp.startup()

Program initialization, reading options etc..

Returns:parser
Return type:Arguments.ArgumentParser