Module: cmap
The module cmap is a module for comparison analysis of various predicted contactmaps. One focus is on analysung the contact map topology.
Examples
Members
- class BioHelpers_FABER.cmap.Cmap(length: int = 0, variance: float = 4.0)
Class to load restraint files and compare different predicted contacts.
- native_contacts
Contact matrix from native PDB, labelling here: all residues from 1 to L (no unmodelled regions)
- Type:
np.ndarray
- contacts
Loaded Contacts from file, with unmodelled regions!
- Type:
dict[str, np.ndarray]
- ppvs
PPV for each contact matrix, keys are the same like in contacts
- Type:
dict[str, float]
- gauss
Gauss measure for each contact matrix, keays are the like in contacts
- Type:
dict[str, float]
- l
Length of the molecule in Residues contact_definition (float): Distance \(d\). If distance \(d(N_i, N_j)<d\) between the two nitrogen atoms of residues \(i\) and \(j\), then it is treated as a contact. Default \(d=9.5\) Angstrom.
- Type:
int
- variance
Variance for the Gauss meausre. Default \(\sigma^2 = 4\).
- Type:
float
- poisitioning
List of the border of unmodelled regions. Labelling from 1.
- Type:
list
- get_unmodelled_regions() list[tuple[int]]
All the unmodelled regions in self.positioning[0] and self.positioning[-1]
- Returns:
List of tuples
- Return type:
list[tuple[int]]
- load_contacts_from_restraints(filename: str, contact_name: str = ' ') None
Loading Contact Map from a SimRNA Restraint file. The contacts are stored internally in a dictionary unter contact_name, PPV and Gauss Score are calculated automatically.
- Parameters:
filename (str) – Filename of the SimRNA Restraint File
contact_name (str, optional) – Key name of the Contact Map. Defaults to “ “.
- load_native_pdb(filename: str, id: str = ' ', reference: str = 'nitrogen', contact_threshold: float = 9.5, start_from_one: bool = True, added_tail: int = 0) None
Method to load the experimental PDB file for comparison
- Parameters:
filename (str) – Filename of the PDB File.
id (str, optional) – ID of the PDB. Has no influence on the comparison. Defaults to “ “.
- num_to_id(position: int) int
Maps the residue number (0 to L) from the pdb to the correct Residue ID
- Parameters:
position (int) – Residue number
- Returns:
Residue ID
- Return type:
int
- static simrna_restraints_to_contacts(data: list[str]) list[tuple[int, int]]
Convert a simrna Restraint file into a contact list.
- Parameters:
data (list[str]) – List of all lines from a simrna restraint file.
- Returns:
list of contacts, format \((i,j)\)
- Return type:
list[tuple[int, int]]