ample.util.contact_util module

Wrapper module for the ConKit package

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

Bases: object

Attributes:
bbcontacts_file : str

The path to bbcontacts_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 neighboring contacts

sequence_file : str

The path to sequence_file

sequence_format : str

The format of sequence_file

Methods

check_options(optd) Function to check that all contact files are available
subselect_decoys(decoys, decoy_format[, …]) 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
bbcontacts_file

The path to bbcontacts_file

bbcontacts_format

The format of bbcontacts_file

static check_options(optd)[source]

Function to check that all contact files are available

Raises:
ValueError

You must provide -contact_file when using -bbcontacts_file or use as -contact_file instead

ValueError

Cannot find contact file

ValueError

Rosetta energy function unavailable

contact_format

The format of contact_file

contacts_file

The path to contacts_file

cutoff_factor

The contact list truncation factor

distance_to_neighbor

The minimum distance between neighboring contacts

sequence_file

The path to sequence_file

sequence_format

The format of sequence_file

subselect_decoys(decoys, decoy_format, mode=’linear’, subdistance_to_neighbor=24, **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 satisfaction scores of >= 0.287
subdistance_to_neighbor : int, optional

The minimum distance between neighboring residues in the subselection [default: 24]

**kwargs

Job submission related keyword arguments

Returns:
list

A list of paths to the 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
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 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