ample.util.contact_util module

Wrapper module for the ConKit package

class ContactUtil(sequence_file, sequence_format, contact_file=None, contact_format=None, bbcontacts_file=None, bbcontacts_format=’bbcontacts’, cutoff_factor=1.0, distance_to_neighbor=5)[source]

Bases: object

Attributes:
bbcontacts_file : str

The path to the bbcontacts contact file

bbcontacts_format : str

The format of bbcontacts_file

contact_file : str

The path to the contact file

contact_format : str

The format of contact_file

cutoff_factor : float

The contact list truncation factor

distance_to_neighbor : int

The minimum distance between contacting residues

sequence_file : str

The path to the sequence file

sequence_format : str

The format of the sequence_file

Methods

compute_precision_by_range(decoys, …) Compute restraint precision score by sequence separation range
subselect_decoys(decoys, decoy_format[, mode]) Subselect decoys excluding those not satisfying long-distance restraints
summarize(plot_file[, structure_file, …]) Process the contact file etc
write_restraints(restraint_file, …) Write a list of restraints
check_options  
predict_contacts_from_sequence  
bbcontacts_file
bbcontacts_format
static check_options(optd)[source]
compute_precision_by_range(decoys, decoy_format, **kwargs)[source]

Compute restraint precision score by sequence separation range

Parameters:
decoys : list, tuple

A list containing paths to decoy files

decoy_format : str

The file format of decoys

**kwargs

Job submission related keyword arguments

Returns:
list

A list of short-range scores of all decoys

list

A list of medium-range scores of all decoys

list

A list of long-range scores of all decoys

contact_format
contact_map
contacts_file
cutoff_factor
distance_to_neighbor
do_contact_analysis
found_ccmpred_contact_prediction_deps
predict_contacts_from_sequence(wdir=’.’, min_neff=200)[source]
require_contact_prediction
sequence_file
sequence_format
subselect_decoys(decoys, decoy_format, mode=’linear’, **kwargs)[source]

Subselect decoys excluding those not satisfying long-distance restraints

Parameters:
decoys : list, tuple

A list containing paths to decoy files

decoy_format : str

The file format of decoys

mode : str, optional
The subselection mode to use
  • scaled: keep the decoys with scaled scores of >= 0.5
  • linear: keep the top half of decoys
  • cutoff: keep all decoys with precision scores of >= 0.287
  • ignore: keep all decoys
**kwargs

Job submission related keyword arguments

Returns:
list

A 2-D list of paths and scores of all sub-selected decoys

summarize(plot_file, structure_file=None, structure_format=None, native_cutoff=8)[source]

Process the contact file etc

Parameters:
plot_file : str

The path to the contact map plot

structure_file : str

A reference structure file

structure_format : str

The format of structure_file

native_cutoff : int

The distance cutoff for contact extraction from structure_file

Returns:
str

The path to the contact map plot

float

The precision score, if calculated, else 0.0

Raises:
ValueError

A structure file also needs a structure format

ValueError

A structure format also needs structure file

ValueError

Unknown structure format

write_restraints(restraint_file, restraint_format, energy_function)[source]

Write a list of restraints

Parameters:
restraint_file : str

The file to write the restraints to

restraint_format : str

The restraints format, depends primarily on the program for which the restraints will be used

energy_function : str

The energy function

Returns:
str

The file the restraints were written to

Raises:
ValueError

Unknown restraint format

ValueError

Unknown Rosetta energy function

ValueError

Unknown SAINT2 energy function

class SubselectionAlgorithm[source]

Bases: object

A class to collect all subselection algorithms

Methods

cutoff(data[, cutoff]) A cutoff-defined subselection algorithm
ignore(data) “A subselection algorithm to keep all
linear(data[, cutoff]) A linearly-defined subselection algorithm
scaled(data[, cutoff]) A scaling-defined subselection algorithm
static cutoff(data, cutoff=0.287)[source]

A cutoff-defined subselection algorithm

Parameters:
data : list, tuple

A 1D array of scores

cutoff : float, optional

The cutoff of keeping decoys

Returns:
list

The decoy indices to keep

list

The decoy indices to throw

static ignore(data)[source]

“A subselection algorithm to keep all

Parameters:
data : list, tuple

A 1D array of scores

Returns:
list

The decoy indices to keep

list

The decoy indices to throw

static linear(data, cutoff=0.5)[source]

A linearly-defined subselection algorithm

Parameters:
data : list, tuple

A 1D array of scores

cutoff : float, optional

The porportion of the total number of decoys to keep

Returns:
list

The decoy indices to keep

list

The decoy indices to throw

static scaled(data, cutoff=0.5)[source]

A scaling-defined subselection algorithm

Parameters:
data : list, tuple

A 1D array of scores

cutoff : float, optional

The cutoff of keeping decoys

Returns:
list

The decoy indices to keep

list

The decoy indices to throw