pestifer.tasks.merge module¶
Definition of the MergeTask class for combining two or more pre-built
PSF/PDB systems into a single PSF/PDB system.
Usage is described in the merge documentation.
The task uses a two-step VMD/psfgen approach executed in a single script:
Segment renaming (VMD
mol load+atomselect): any systems whose segment names collide with earlier systems get their conflicting segments renamed in a temporary copy.Topology merge (psfgen
readpsf): the (possibly renamed) PSF/PDB files are merged by loading them sequentially into psfgen, which handles serial-number renumbering and topology-table reconstruction automatically.
Segment-name collisions are resolved according to collision_strategy:
'enumerate'(default): strip the last character of the conflicting name and append a digit (0–9, then fall back to two digits) until a unique name is found. E.g.PROA→PRO0,PRO1, …'error': raiseValueErrorimmediately on the first unresolved collision. Use when every rename must be explicit.
Explicit renames take priority over the automatic strategy and are specified
per-system via segname_map.
- class pestifer.tasks.merge.MergeTask(specs: dict = None, **kwargs)[source]¶
Bases:
PsfgenTaskMerge two or more pre-built PSF/PDB systems into a single PSF/PDB system.
Each system is specified by a
psffile plus either apdborcoorcoordinate file. Segment name collisions are detected automatically and resolved according to thecollision_strategy.Parameters (from YAML
specs)¶- pipeline_systemdict, optional
Rename options applied to the pipeline state when it is automatically prepended. Accepted keys:
segname_mapandchainID_map. Ignored when there is no prior pipeline state.- systemslist of dict
Each entry must contain
psfand eitherpdborcoor. An optionalsegname_mapdict provides explicit renames for that system’s PSF segment names ({old_segname: new_segname}). An optionalchainID_mapdict renames PDB chain IDs for that system ({old_chainID: new_chainID}).- collision_strategystr, optional
'enumerate'(default) or'error'.
- do() int[source]¶
Execute the psfgen task. This method initializes the task, ingests the base molecule, and runs the psfgen process. It also handles any necessary coormods and declashing of loops and glycans based on the task specifications. The results of the psfgen process are saved as a PSF/PDB fileset, and the state is updated accordingly.