clash_checkingΒΆ
- Author(s):
Nuno P. Fernandes
- Year:
2026
- Copyright:
GNU Public License v3
Added in version 1.0.0.
Simple module to re-check previously generated ensembles for steric clashes.
FunctionsΒΆ
|
Check if there are recorded steric clashes in given PULCHRA output. |
|
Check for steric clashes in .pdb file, outputting report. |
|
Check a generated ensemble for steric clashes, outputting clash reports. |
Module ContentsΒΆ
- ensemblify.clash_checking.process_pulchra_output(sampled_pdb, pulchra_output_buffer, sampling_targets=None, input_clashes=None)ΒΆ
Check if there are recorded steric clashes in given PULCHRA output.
Clashes present in input structure (if provided) are ignored. Clashes are only considered when at least one residue belongs to a sampled region (if those regions are provided).
- Parameters:
sampled_pdb (
str) β Path to .pdb file output from conformational sampling.pulchra_output_buffer (
str) β Stdout from applying PULCHRA to the sampled .pdb structure.sampling_targets (
dict[str,tuple[tuple[str,tuple[int,...],str,str]]], optional) β Mapping of chain identifiers to sampled residue numbers.input_clashes (
list[tuple[str,str]], optional) β Clashes present in the sampling input structure, that will be ignored if present in the given PULCHRA output.
- Returns:
List of clashes present in sampled .pdb file.
- Return type:
list[str]
- ensemblify.clash_checking.check_report_pdb_clashes(pdb2check, sampling_targets=None, input_clashes=None)ΒΆ
Check for steric clashes in .pdb file, outputting report.
Optionally, sampling targets and clashes in the input structure can be considered.
A steric clash is reported when the distance between any two non bonded atoms is less than two angstrom.
- Parameters:
pdb2check (
str) β Path to .pdb file to check for steric clashes.sampling_targets (
dict[str,tuple[tuple[str,tuple[int,...],str,str]]], optional) β Mapping of chains to sampled regions following Ensemblify parameters style. If provided, clashes are only checked for in these regions. Defaults to None.input_clashes (
list[tuple[str,str]], optional) β List of clashes detected in the ensemble generation input structure. If provided, clashes detailed here will be ignored if found in the .pdb to check (only in sampled regions, if sampling targets is provided). Defaults to None.
- Returns:
- pdb2check (str):
Path to the sampled .pdb to check for clashes.
- steric_clashes (list[str] | None):
List of clashes present in sampled .pdb file or None, if PULCHRA erred.
- Return type:
tuple[str,list[str] | None]
- ensemblify.clash_checking.check_steric_clashes(ensemble_dir, sampling_targets=None, input_structure=None)ΒΆ
Check a generated ensemble for steric clashes, outputting clash reports.
A directory is created inside the ensemble directory where clash reports (simple and detailed) will be stored, as well as any files output by processing the input structure (if provided).
- Parameters:
ensemble_dir (
str) β Path to directory where ensemble .pdb structures are stored.sampling_targets (
str | dict[str,tuple[tuple[str,tuple[int,...],str,str]]], optional) β Mapping of chains to sampled regions following Ensemblify parameters style or path to this mapping in .yaml format. If a path is provided, it can either be solely the mapping or a full Ensemblify parameters file. If provided, clashes are only checked for in these regions. Defaults to None.input_structure (
str, optional) β Path to input structure used to generate the ensemble. If provided, steric clashes present in this structure (only in sampled regions, if sampling targets is provided) are ignored if they are detected in any of the sampled structures. Defaults to None.
- Returns:
- clash_report (str):
Path to file with simplified ensemble clash report, i.e. total number of clashed structures and how many clashes were detected in each structure.
- clash_report_detailed (str):
Path to file with detailed ensemble clash report, i.e. how many clashes were detected in each structure and the atoms involved in the detected clash.
- Return type:
tuple[str,str]