Ensembler subpackage

The AMPLE ensembler sub-package

This sub-package contains the source to apply AMPLE’s cluster-and-truncate approach to protein structure models. It contains a series of different modules to apply varying cluster and truncation algorithms to those models.

add_argparse_options(parser=None)[source]

Function to add the ensemble-specific options

Parameters:
parser : argparse.ArgumentParser
standalone : bool, optional

Define if the parser is standalone [default: False]

cluster_script(amoptd, python_path=’ccp4-python’)[source]

Create the script for ensembling on a cluster

Parameters:
amoptd : dict

An AMPLE option dictionary

python_path : str, optional

The path to the CCP4 python executable

Returns:
str

The path to the cluster script

cluster_table_data(clusters, cluster_num, side_chain_treatments)[source]

Generate a table containing the cluster data

Parameters:
clusters : list, tuple

A list of cluster dictionaries

cluster_num : int

The cluster number of interest

side_chain_treatments : list, tuple

A list of side chain treatments

Returns:
list

A list of table data lines

collate_cluster_data(ensembles_data)[source]

Collate the cluster data into a dictionary structure

Parameters:
ensembles_data : list, tuple

A list of ensembles’ data dictionaries

Returns:
A dictionary with the collated data
create_ensembles(amoptd)[source]

Create the ensembles using the values in the amoptd dictionary

Parameters:
amoptd : dict

An AMPLE option dictionary

ensemble_summary(ensembles_data)[source]

Print a summary of the ensembling process

Parameters:
ensembles_data : list, tuple

A list of ensembles’ data dictionaries

Returns:
str
ensembler_factory(amoptd)[source]

Return an ensembler object for the required ensembles

Parameters:
amoptd : dict

An AMPLE option dictionary

Returns:
:obj:`HomologEnsembler`, :obj:`SingleModelEnsembler`, or :obj:`AbinitioEnsembler`

Instantiated ensembler object

import_ensembles(amoptd)[source]

Import ensembles using their file paths

Parameters:
amoptd : dict

An AMPLE option dictionary

Returns:
list

A list of absolute files paths of the ensembles

reorder_models(models, ordered_list_file)[source]

Reorder the list of models from a list of models (possibly in a different directory)

Parameters:
models : list, tuple

A list of model file paths

ordered_list_file : str

The path to a file with a model order list

Returns:
list

The model list reordered

set_phaser_rms_from_subcluster_score(optd)[source]

Set the phaser_rms for each ensemble based on its score

sort_ensembles(ensemble_pdbs, ensembles_data=None, keys=None, prioritise=True)[source]

Sort AMPLE ensemble data.

Parameters:
ensemble_pdbs: list, tuple

A list of ensemble file paths

ensembles_data : list, tuple, optional

A list of ensembles’ data dictionaries

keys : list, tuple, optional

A list of keys in ensembles_data by which we sort. The key order must be high > middle > low!

prioritise : bool, optional

Favour ensembles in truncation level 20-50% [default: True]

Returns:
list

A sorted list of the ensemble pdb file paths

Raises:
RuntimeError

Not enough ensembles provided