processing_outputsΒΆ

Auxiliary functions for processing files from sampling output.

FunctionsΒΆ

check_clashes(sampled_pdb, pulchra_output_buffer, ...)

Check if there are recorded steric clashes in given PULCHRA output.

process_pdb(sampled_pdb, faspr_path, pulchra_path, ...)

Repack the side-chains and check for steric clashes in a sampled .pdb structure.

Module ContentsΒΆ

ensemblify.generation.ensemble_utils.processing_outputs.check_clashes(sampled_pdb, pulchra_output_buffer, sampling_targets, input_clashes)ΒΆ

Check if there are recorded steric clashes in given PULCHRA output.

Clashes present in input structure are not considered. Clashes are only considered when at least one residue belongs to a sampled region.

Parameters:
  • sampled_pdb (str) – Filepath 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]]]) – 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:

True if the given PULCHRA output mentions clashes not already present in sampling input structure, False otherwise.

Return type:

bool

ensemblify.generation.ensemble_utils.processing_outputs.process_pdb(sampled_pdb, faspr_path, pulchra_path, input_clashes, sampling_targets, valid_pdbs_dir, goal_ensemble_size)ΒΆ

Repack the side-chains and check for steric clashes in a sampled .pdb structure.

Side-chain repacking is done by passing the structure through FASPR. The resulting .pdb file is then rewritten into a single chain with sequential residue numbering before being passed into PULCHRA, as it does not support multi-chain structures. Clash checking is done by passing the structure through PULCHRA and checking its output. If no clashes are present, the resulting .pdb file has its chain and residue numbering information restored to its original status.

Parameters:
  • sampled_pdb (str | None) – Sampled .pdb structure, unprocessed. If None, processing is cancelled.

  • faspr_path (str) – Path to FASPR executable or its alias.

  • pulchra_path (str) – Path to PULCHRA executable or its alias.

  • input_clashes (list[tuple[str,str]]) – List of clashes present in the input structure that, if present, will be ignored.

  • sampling_targets (dict[str,tuple[tuple[str,tuple[int,...],str,str]]]) – Mapping of chain letters to target regions for sampling.

  • valid_pds_dir (str) – Path to directory where valid structures will be output.

  • goal_ensemble_size (int) – If the number of structures in valid pdbs directory is ever greater than this value do not write any more structures into the directory.

  • valid_pdbs_dir (str)

Returns:

True if the sampled .pdb structure has steric clashes, False otherwise. None if an error occured.

Return type:

bool | None