ample.ensembler.truncation_util module

Truncation utility module

class ScoreVariances

Bases: tuple

Attributes:
idx

Alias for field number 0

resSeq

Alias for field number 1

variance

Alias for field number 2

Methods

count(…)
index((value, [start, …) Raises ValueError if the value is not present.
idx

Alias for field number 0

resSeq

Alias for field number 1

variance

Alias for field number 2

class Truncation[source]

Bases: object

Holds information relating to a single truncation of a cluster of models

Attributes:
num_residues
num_residues
class Truncator(work_dir)[source]

Bases: object

Methods

calculate_truncations([models, …]) Returns a list of Truncation objects, one for each truncation level.
truncate_models(models[, max_cluster_size, …]) Generate a set of Truncation objects, referencing a set of truncated models generated from the supplied models
calculate_truncations(models=None, truncation_method=None, percent_truncation=None, truncation_pruning=None, residue_scores=None, alignment_file=None, homologs=False)[source]

Returns a list of Truncation objects, one for each truncation level.

This method doesn’t do any truncating - it just calculates the data for each truncation level.

truncate_models(models, max_cluster_size=200, truncation_method=None, percent_truncation=None, truncation_pruning=None, residue_scores=None, homologs=False, alignment_file=None, work_dir=None)[source]

Generate a set of Truncation objects, referencing a set of truncated models generated from the supplied models

calculate_residues_focussed(var_by_res)[source]

The sweet spot for success seems to occur in the interval 5-40 residues. Up till now we have always worked in 5% intervals, so 20 truncation levels The new strategy is to ensure that always have at least half of the truncations in the interval < 40 residues => 10 truncations in 40, so at least 4 residue chunks in this interval.

The strategy is therefore for < 80 residues, just split evenly into 20 chunks.

For > 80 residues, split < 40 into 10 4-residue chunks, and split the interval 40 -> end into 10 even chunks.

calculate_residues_percent(var_by_res, percent_interval)[source]

Calculate the list of residues to keep if we are keeping self.percent residues under each truncation bin. The threshold is just the threshold of the most variable residue

calculate_residues_thresh(var_by_res, percent_interval)[source]

Txxx

generate_thresholds(var_by_res, percent_interval)[source]

This is the original method developed by Jaclyn and used in all work until November 2014 (including the coiled-coil paper)

Calculate the residue variance thresholds that will keep self.percent_interval residues for each truncation level

prune_residues(residues, chunk_size=1, allowed_gap=2)[source]

Remove any residues that are < chunk_size where the gap before and after is > allowed_gap