Sidechain packing methods

Modules to compute sidechains.

This package contains all methods integrated in idpconfgen to compute side chains. It implements a strategy pattern where depending on the sidechain option (str) the building workflow will use one function or another.

For this reason, all functions computing sidechains should output the same types and have a compatible input api.

All functions should return an array mask to be used in all_atom_coords and return the coordinate compatible with such a mask.

For that, in general, the init_ functions receive the template and all_atom masks named tuples (see libbuild).

idpconfgen.components.sidechain_packing.add_sidechain_method(parser)[source]

Add option to choose from sidechain packing algorithms.

idpconfgen.components.sidechain_packing.get_sidechain_packing_parameters(parameters, mode)[source]

Extract sidechain packaging related parameters.

idpconfgen.components.sidechain_packing.sidechain_packing_methods = {'faspr': <function init_faspr_sidechains>, 'mcsce': <function init_mcsce_sidechains>}

Sidechain packing algorithms.

FASPR

Use FASPR to build sidechains.

idpconfgen.components.sidechain_packing.faspr.init_faspr_sidechains(input_seq, template_masks, all_atom_masks, **ignore)[source]

Instantiate dedicated function environment for FASPR sidechain calculation.

Examples

>>> calc_faspr = init_fastpr_sidechains('MASFRTPKKLCVAGG', ...)
>>> # a (N, 3) array with the N,CA,C,O coordinates
>>> coords = np.array( ... )
>>> calc_faspr(coords)
Parameters:
  • input_seq (str) – The FASTA sequence of the protein for which this function will be used.

  • template_masks (libbuil.ConfMasks object) – Related to the building template in cli_build.

  • all_atom_masks (libbuil.ConfMasks object) – Related to the all atoom coordinate system in cli_build.

Returns:

  • np.ndarray, dtype=bool, (M, 3) – Array mask for the builder.

  • np.ndarray (M, 3) – Heavy atom coordinates of the protein sequence.

MC-SCE

Implement MC-SCE sidechain packing algorithm logic.

MC-SCE repository at: https://github.com/THGLab/MCSCE

idpconfgen.components.sidechain_packing.mcsce.add_mcsce_subparser(ap)[source]

Add MC-SCE related parameters to client.

idpconfgen.components.sidechain_packing.mcsce.init_mcsce_sidechains(input_seq, template_masks, all_atom_masks, user_parameters=None, **ignore)[source]

Instantiate dedicated function environment for MC-SCE sidechain building.

Examples

>>> calc_mcsce = init_mcsce_sidechains('MASFRTPKKLCVAGG', ...)
>>> # a (N, 3) array with the N,CA,C,O coordinates
>>> coords = np.array( ... )
>>> calc_mcsce(coords)
Parameters:
  • input_seq (str) – The FASTA sequence of the protein for which this function will be used.

  • template_masks (libbuil.ConfMasks object) – Related to the building template in cli_build.

  • all_atom_masks (libbuil.ConfMasks object) – Related to the all atoom coordinate system in cli_build.

  • user_parameters (dict) – Dictionary with additional parameters for the MC-SCE package.

Returns:

  • np.ndarray, dtype=bool, (M, 3) – Array mask for the builder.

  • np.ndarray (M, 3) – Heavy atom coordinates of the protein sequence.