pdb_processingΒΆ

Auxiliary functions for processing .pdb files.

FunctionsΒΆ

apply_faspr_single(faspr_path, pdb)

Apply FASPR to a .pdb file and log the outcome.

apply_rewrite_single(pdb)

Convert a .pdb file into single chain with sequential numbering.

apply_pulchra_single(pulchra_path, pdb)

Apply PULCHRA to a .pdb file and log the outcome.

apply_restore_single(pdb, reference_pdb)

Restore chain, residue number and B-Factor info to .pdb from reference .pdb.

process_pdb_structure(pdb[, faspr_path, pulchra_path])

Apply FASPR and PULCHRA to PDB structure.

Module ContentsΒΆ

ensemblify.modelling.pdb_processing.apply_faspr_single(faspr_path, pdb)ΒΆ

Apply FASPR to a .pdb file and log the outcome.

Parameters:
  • faspr_path (str) – Path to FASPR executable.

  • pdb (str) – Path to .pdb file.

Returns:

Path to .pdb file from FASPR output, with filename equal to input .pdb with the suffix β€˜_faspr’ added. None when this function raises an exception.

Return type:

str | None

Raises:

subprocess.CalledProcessError – If FASPR was not applied succesfully.

ensemblify.modelling.pdb_processing.apply_rewrite_single(pdb)ΒΆ

Convert a .pdb file into single chain with sequential numbering.

Necessary when a multichain .pdb will be input into PULCHRA, as it does not support multiple chain structures. The output modified version has the _rewrite suffix added to its name.

Parameters:

pdb (str) – Path to input .pdb file for conversion.

Return type:

str

Returns
str:

Path to modified .pdb. Filename is the same as the input, with _rewrite suffix added.

ensemblify.modelling.pdb_processing.apply_pulchra_single(pulchra_path, pdb)ΒΆ

Apply PULCHRA to a .pdb file and log the outcome.

Parameters:
  • pulchra_path (str) – Path to PULCHRA executable.

  • pdb (str) – Path to .pdb file.

Returns:

str | None:

Path to PULCHRA output structure. Same filename as input .pdb with added .rebuilt suffix. None when this function raises an exception.

str | None:

PULCHRA stdout used for later clash checking. None when this function raises an exception.

Return type:

tuple[str,str] | tuple[None,None]

Raises:

subprocess.CalledProcessError – If PULCHRA was not applied sucessfully.

ensemblify.modelling.pdb_processing.apply_restore_single(pdb, reference_pdb)ΒΆ

Restore chain, residue number and B-Factor info to .pdb from reference .pdb.

Restore chain, residue numbering and B-Factor information to a post-Pulchra .pdb file, following the information in a reference .pdb file (either the first output of sampling process or the sampling input .pdb).

Parameters:
  • pdb (str) – Path to the PULCHRA output .pdb structure (ending in .rebuilt suffix).

  • reference_pdb (str) – Path to .pdb file to use as reference for restoring the chains and residue numbering.

Returns:

Path to the .pdb structure with restored chain and residue numbering. Filename matches that of input, with _restored suffix added.

Return type:

str

ensemblify.modelling.pdb_processing.process_pdb_structure(pdb, faspr_path=None, pulchra_path=None)ΒΆ

Apply FASPR and PULCHRA to PDB structure.

FASPR is used for side-chain repacking and PULCHRA is used for backbone optimization and steric clash checking. The processed PDB file and a PULCHRA clashes report file are created in the same directory as the provided file.

Parameters:
  • fused_pdb (str) – Path to the .pdb file with the PDB structure to process.

  • faspr_path (str) – Path to the FASPR executable. Defaults to the path set in Ensemblify global configuration.

  • pulchra_path (str) – Path to the PULCHRA executable. Defaults to the path set in Ensemblify global configuration.

  • pdb (str)

Returns:

str:

Path to the .log file with the output of applying PULCHRA to the provided structure.

str:

Path to the .pdb file resulting from applying FASPR and PULCHRA to the provided structure.

Return type:

tuple[str,str]