Frustratometer classes

The frustratometer package provides a handful of classes used to encapsulate the data.

class frustratometer.Structure[source]

Bases: object

classmethod full_pdb(pdb_file: Path | str, chain: str | None = None, aligned_sequence: str = None, filtered_aligned_sequence: str = None, distance_matrix_method: str = 'CB', pdb_directory: Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/frustratometer/checkouts/latest/docs'), repair_pdb: bool = False)[source]

Generates structure object

Parameters:
  • pdb_file (str) – PDB file path

  • chain (str) – PDB chain name. If “chain=None”, all chains will be included.

  • distance_matrix_method (str) – The method to use for calculating the distance matrix. Defaults to ‘CB’, which uses the CB atom for all residues except GLY, which uses the CA atom. Other options are ‘CA’ for using only the CA atom, and ‘minimum’ for using the minimum distance between all atoms in each residue.

  • pdb_directory (str) – Directory where repaired pdb will be downloaded

  • repair_pdb (bool) – If False, provided pdb file will be repaired with missing residues inserted and heteroatoms removed.

Return type:

Structure object

classmethod spliced_pdb(pdb_file: Path | str, chain: str, seq_selection: str, aligned_sequence: str = None, filtered_aligned_sequence: str = None, distance_matrix_method: str = 'CB', repair_pdb: bool = True, pdb_directory: str = '/home/docs/checkouts/readthedocs.org/user_builds/frustratometer/checkouts/latest/docs')[source]

Generates substructure object

Parameters:
  • pdb_file (str) – PDB file path

  • chain (str) – PDB chain name

  • seq_selection (str) – Subsequence selection command, using Prody select module.

    *If wanting to use original PDB indexing, set seq_selection as: “resnum {initial_index}to{final_index}

    *If wanting to use absolute PDB indexing (first residue has index=0), set seq_selection as: “resindex {initial_index}to{final_index}

    Note that using “to” will create a substructure including both the initial and final designated residue. If you would like to not include the final desginated residue, replace “to” with “:”

    Note that the algorithm will account for any gaps in the PDB and adjust the provided residue range accordingly.

  • distance_matrix_method (str) – The method to use for calculating the distance matrix. Defaults to ‘CB’, which uses the CB atom for all residues except GLY, which uses the CA atom. Other options are ‘CA’ for using only the CA atom, and ‘minimum’ for using the minimum distance between all atoms in each residue.

  • pdb_directory (str) – Directory where repaired pdb will be downloaded

  • repair_pdb (bool) – If True, provided pdb file will be repaired with missing residues inserted and heteroatoms removed.

Return type:

Substructure object

class frustratometer.AWSEM(pdb_structure, expose_indicator_functions=False, **parameters)[source]

Bases: Frustratometer

q = 20
aa_map_awsem_list = [0, 0, 4, 3, 6, 13, 7, 8, 9, 11, 10, 12, 2, 14, 5, 1, 15, 16, 19, 17, 18]
aa_map_awsem_x = array([[ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,          0,  0,  0,  0,  0],        [ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,          0,  0,  0,  0,  0],        [ 4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,          4,  4,  4,  4,  4],        [ 3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,          3,  3,  3,  3,  3],        [ 6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,          6,  6,  6,  6,  6],        [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,         13, 13, 13, 13, 13],        [ 7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,          7,  7,  7,  7,  7],        [ 8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,          8,  8,  8,  8,  8],        [ 9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,          9,  9,  9,  9,  9],        [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,         11, 11, 11, 11, 11],        [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,         10, 10, 10, 10, 10],        [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,         12, 12, 12, 12, 12],        [ 2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,          2,  2,  2,  2,  2],        [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,         14, 14, 14, 14, 14],        [ 5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,          5,  5,  5,  5,  5],        [ 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,          1,  1,  1,  1,  1],        [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,         15, 15, 15, 15, 15],        [16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,         16, 16, 16, 16, 16],        [19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,         19, 19, 19, 19, 19],        [17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,         17, 17, 17, 17, 17],        [18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,         18, 18, 18, 18, 18]])
aa_map_awsem_y = array([[ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18],        [ 0,  0,  4,  3,  6, 13,  7,  8,  9, 11, 10, 12,  2, 14,  5,  1,         15, 16, 19, 17, 18]])
auc()

Computes area under the curve of the receiver-operating characteristic. Function intended

compute_configurational_decoy_statistics(n_decoys=4000)[source]
couplings_energy(sequence: str = None, ignore_couplings_of_gaps: bool = False)
decoy_energy(kind: str = 'singleresidue', sequence: str = None)
decoy_fluctuation(sequence: str = None, kind: str = 'singleresidue', mask: array = None)
fields_energy(sequence: str = None, ignore_fields_of_gaps: bool = False)
frustration(sequence: str = None, kind: str = 'singleresidue', mask: array = None, aa_freq: array = None, correction: int = 0)
generate_frustration_pair_distribution(sequence: str = None, kind: str = 'singleresidue')
native_energy(sequence: str = None, ignore_couplings_of_gaps: bool = False, ignore_fields_of_gaps: bool = False)
plot_decoy_energy(sequence: str = None, kind: str = 'singleresidue', method: str = 'clustermap')
plot_roc()
roc()
scores()
sequences_energies(sequences: array, split_couplings_and_fields: bool = False)
view_frustration(sequence: str = None, single: str = 'singleresidue', pair: str = 'mutational', aa_freq: array = None, correction: int = 0)
vmd(sequence: str = None, single: str = 'singleresidue', pair: str = 'mutational', aa_freq: array = None, correction: int = 0, max_connections: int = 100)
compute_configurational_energies()[source]
configurational_frustration(n_decoys=4000)[source]
class frustratometer.DCA[source]

Bases: Frustratometer

classmethod from_distance_matrix(potts_model: dict, distance_matrix: array, sequence: str, sequence_cutoff: float | None = None, distance_cutoff: float | None = None)[source]
classmethod from_potts_model_file(pdb_structure, potts_model_file: str, reformat_potts_model: bool = False, sequence_cutoff: float | None = None, distance_cutoff: float | None = None)[source]
classmethod from_pottsmodel(potts_model: dict, pdb_file: str | None = None, chain: str | None = None, sequence_cutoff: float | None = None, distance_cutoff: float | None = None, distance_matrix_method='minimum')[source]
classmethod from_pfam_alignment(sequence: str, PFAM_ID: str, pdb_file: str, pdb_chain: str, download_all_alignment_files: bool, alignment_files_directory: str, sequence_cutoff: float | None = None, distance_cutoff: float | None = None, distance_matrix_method='minimum')[source]
classmethod from_hmmer_alignment(sequence: str, PFAM_ID: str, pdb_file: str, pdb_chain: str, download_all_alignment_files: bool, alignment_files_directory: str, alignment_output_file: bool, alignment_sequence_database: str, sequence_cutoff: float | None = None, distance_cutoff: float | None = None, distance_matrix_method='minimum')[source]
classmethod from_alignment(alignment: str, pdb_file: str, chain: str, sequence_cutoff: float | None = None, distance_cutoff: float | None = None, distance_matrix_method='minimum')[source]
property sequence
property pdb_file
property pdb_name

Returns PDBid from pdb name

property chain
property pfamID

Returns pfamID from pdb name

property alignment_type
property alignment_sequence_database
property download_all_alignment_files
property alignment_files_directory
property alignment_output_file
property sequence_cutoff
property distance_cutoff
auc()

Computes area under the curve of the receiver-operating characteristic. Function intended

couplings_energy(sequence: str = None, ignore_couplings_of_gaps: bool = False)
decoy_energy(kind: str = 'singleresidue', sequence: str = None)
decoy_fluctuation(sequence: str = None, kind: str = 'singleresidue', mask: array = None)
fields_energy(sequence: str = None, ignore_fields_of_gaps: bool = False)
frustration(sequence: str = None, kind: str = 'singleresidue', mask: array = None, aa_freq: array = None, correction: int = 0)
generate_frustration_pair_distribution(sequence: str = None, kind: str = 'singleresidue')
native_energy(sequence: str = None, ignore_couplings_of_gaps: bool = False, ignore_fields_of_gaps: bool = False)
plot_decoy_energy(sequence: str = None, kind: str = 'singleresidue', method: str = 'clustermap')
plot_roc()
roc()
scores()
sequences_energies(sequences: array, split_couplings_and_fields: bool = False)
view_frustration(sequence: str = None, single: str = 'singleresidue', pair: str = 'mutational', aa_freq: array = None, correction: int = 0)
vmd(sequence: str = None, single: str = 'singleresidue', pair: str = 'mutational', aa_freq: array = None, correction: int = 0, max_connections: int = 100)
property distance_matrix_method
property potts_model_file
property potts_model
class frustratometer.Map(map_array)[source]

Bases: object

classmethod from_path(path)[source]
classmethod from_sequences(sequence_a, sequence_b, substitution_matrix='BLOSUM62', match_score=2, mismatch_score=-1, open_gap_score=-0.5, extend_gap_score=-0.1, target_end_gap_score=-0.01, query_end_gap_score=-0.01)[source]
map(sequence=None, reverse=False)[source]
reverse()[source]
copy()[source]
property map_array