pestifer.tasks.ligate module¶
Definition of the LigateTask class for ligating loops in molecular dynamics simulations.
This class is a descendant of the MDTask class and is used to ligate loops
in a molecular structure using the NAMD molecular dynamics engine.
It measures the distances between loop termini, steers them toward each other, and connects them using a specified patch.
The resulting structure is then saved as a PSF/PDB files.
Usage is described in the ligate documentation.
- class pestifer.tasks.ligate.LigateTask(specs: dict = None, **kwargs)[source]¶
Bases:
MDTaskLigateTask class for ligating loops in molecular dynamics simulations.
- connect_gaps()[source]¶
Connect the gaps in the loop termini. This method uses the psfgen scripter to create a script that connects the gaps in the loop termini using the specified patch. It generates a new PSF file and PDB file based on the current state of the base molecule and the connection patches defined in the data file. The script is then executed, and if successful, the resulting PSF and PDB files are saved in the current state.
- Returns:
The result of the psfgen script execution. A return value of 0 indicates success, while any other value indicates failure.
- Return type:
- do() int[source]¶
Execute the ligate task. This method checks if the base molecule has loops, measures the distances between loop termini, steers them toward each other, and connects them using a specified patch. The resulting structure is saved as a PSF/PDB fileset. It also writes the gaps to a data file and measures the distances between the termini of the loops. If the base molecule does not have loops, the task is bypassed. The method returns the result of the NAMD run, which is 0 on success or a non-zero error code on failure. If the task is successful, it saves the state of the simulation with the specified extensions. If the task is bypassed, it logs a message and returns without performing any operations.
- do_steered_md(specs)[source]¶
Perform steered molecular dynamics to steer the loop termini toward each other.
- measure_distances(specs)[source]¶
Measure the distances between loop termini.
- Parameters:
specs (dict) – Specifications for the measurement, including the radius of the flexible zone around the receiver. This method uses the VMD scripter to create a script that measures the distances between the termini of the loops in the base molecule. It generates a data file containing the distances and saves the results in a specified output file. The method also updates the state variables with the results and the fixed reference structure.
- write_connect_patches()[source]¶
Write the connect patches to a data file. This method generates a data file that contains the connection patches for the loop termini. It uses the base molecule to write the connection patches and updates the state variables with the new data file. The data file is named based on the current basename, which is generated by the
next_basenamemethod.