All Atom Scorers¶
AllAtomOverallScorer class¶
- class promod3.scoring.AllAtomOverallScorer¶
Container that allows for the storage of multiple scorers identified by a key (
str
) and the computation of combined scores.Scorers need to be individually set or loaded by
LoadDefaultAllAtomOverallScorer()
- Contains(key)¶
- Get(key)¶
- Returns:
Scorer with the given key (read-only access).
- Return type:
- Parameters:
key (
str
) – Key for desired scorer.- Raises:
RuntimeError
if there is no scorer with that key.
- AttachEnvironment(env)¶
- Parameters:
env (
AllAtomEnv
) – Link all scorers to this score environment.
- CalculateLinearCombination(linear_weights, start_resnum, num_residues, chain_idx)¶
Calculate linear combination of scores for the desired loop(s) (extracted from environment) against the set environment (see
AllAtomScorer.CalculateScore()
).- Parameters:
linear_weights (
dict
(keys:str
, values:float
)) – Weights for each desired scorer. You can add a constant value to each score by defining a weight with key “intercept”.start_resnum (
int
/list
ofint
) – Res. number(s) defining the position(s) in the SEQRES (seeAllAtomEnv
for indexing)chain_idx (
int
/list
ofint
) – Index of chain the loop(s) belongs to (seeAllAtomEnv
for indexing)
- Returns:
Score for the given set of atoms.
- Return type:
- Raises:
RuntimeError
if linear_weights has a key for which no scorer exists or anything raised inAllAtomScorer.CalculateScore()
for any of the used scorers.
- promod3.scoring.LoadDefaultAllAtomOverallScorer()¶
- Returns:
Loads or creates the default scorers accessible through following keys: “aa_interaction”, “aa_packing”, “aa_clash”
- Return type:
AllAtomScorer base class¶
- class promod3.scoring.AllAtomScorer¶
Base class for all the all atom scorers listed below.
- AttachEnvironment(env)¶
- Parameters:
env (
AllAtomEnv
) – Link scorer to this score environment.
- CalculateScore(start_resnum, num_residues, chain_idx)¶
Calculates score for the desired loop(s) (extracted from environment) against the set environment. Unless otherwise noted in the scorer, a lower “score” is better!
- Parameters:
- Returns:
Score for the given set of atoms.
- Return type:
- Raises:
(for most scorers)
RuntimeError
if scorer was never attached to a score environment, if scorer has never been properly initialized or if chain_index / start_resnum lead to invalid positions.
- CalculateScoreProfile(start_resnum, num_residues, chain_idx=0)¶
Calculates per residue scores for the desired loop(s) (extracted from environment) against the set environment.
- Parameters:
start_resnum (
int
/list
ofint
) – Res. number(s) defining the position(s) in the SEQRES (seeAllAtomEnv
for indexing)num_residues (
int
) – Length of loop(s).chain_idx (
int
/list
ofint
) – Index of chain the loop(s) belongs to (seeAllAtomEnv
for indexing)
- Returns:
Scores for the given loop(s), one for each residue.
- Return type:
- Raises:
same
RuntimeError
asCalculateScore()
.
AllAtomInteractionScorer class¶
- class promod3.scoring.AllAtomInteractionScorer(cutoff, bins, seq_sep)¶
Inherits all functionality of
AllAtomScorer
. Evaluates a pairwise pseudo interaction energy between all atoms which are located within a cutoff and which are at least seq_sep residues apart. An energy is assigned to each distance using equally sized bins and distinguishing all possible pairs of atoms (usually the energy only differs for chemically distinguishable heavy atoms). By default, the scorer calculates the scores by including everything, the stuff set in the environment and the coordinates in the input loops. You can change this behaviour with the according functions.The scorer needs to be initialized either by loading a predefined scorer (e.g.
LoadAllAtomInteractionScorer()
) or by setting all energies (seeSetEnergy()
).- Parameters:
- Raises:
RuntimeError
if cutoff < 0, bins < 1 or seq_sep < 1.
- static Load(filename)¶
- static LoadPortable(filename)¶
Loads raw binary file generated with
Save()
(optimized for fast reading) / portable file generated withSavePortable()
(slower but less machine-dependent).
- Save(filename)¶
- SavePortable(filename)¶
Saves a raw / portable binary representation. Use portable files for distribution and convert locally to raw files. See here for details.
- Parameters:
filename (
str
) – Path to the file where it will be saved.- Raises:
RuntimeError
if file cannot be opened.
- SetEnergy(aaa1, aaa2, bin, energy)¶
Setup one energy value. Unless a predefined scorer is loaded, this must be called for every pair of heavy atom types and for every bin < bins. Internal symmetry is enforced => Calling SetEnergy(aaa1, aaa2, bin, energy) is equivalent to calling SetEnergy(aaa1, aaa2, bin, energy) AND SetEnergy(aaa2, aaa1, bin, energy).
- Parameters:
aaa1 (
AminoAcidAtom
) – Heavy atom type for first interaction partner.aaa2 (
AminoAcidAtom
) – Heavy atom type for second interaction partner.bin (
int
) – Discrete bin describing the interaction distance.energy (
float
) – Energy to set for those parameters.
- Raises:
RuntimeError
if inputs are invalid
- DoInternalScores(do_it)¶
- Parameters:
do_it (
bool
) – Whether to include pairwise interactions within the loop. True by default.
- promod3.scoring.LoadAllAtomInteractionScorer()¶
- Returns:
The default predefined AllAtomInteractionScorer (loaded from disk)
- Return type:
AllAtomPackingScorer class¶
- class promod3.scoring.AllAtomPackingScorer(cutoff, max_count)¶
Inherits all functionality of
AllAtomScorer
. Evaluates pseudo energies by counting surrounding atoms within a certain cutoff radius around all heavy atoms not belonging to the assessed residue itself.The scorer needs to be initialized either by loading a predefined scorer (e.g.
LoadAllAtomPackingScorer()
) or by setting all energies (seeSetEnergy()
).- Parameters:
- Raises:
RuntimeError
if cutoff < 0, max_count < 1.
- static Load(filename)¶
- static LoadPortable(filename)¶
Loads raw binary file generated with
Save()
(optimized for fast reading) / portable file generated withSavePortable()
(slower but less machine-dependent).
- Save(filename)¶
- SavePortable(filename)¶
Saves a raw / portable binary representation. Use portable files for distribution and convert locally to raw files. See here for details.
- Parameters:
filename (
str
) – Path to the file where it will be saved.- Raises:
RuntimeError
if file cannot be opened.
- SetEnergy(aaa, count, energy)¶
Setup one energy value. Unless a predefined scorer is loaded, this must be called for every heavy atom type and for every count <= max_count.
- Parameters:
aaa (
AminoAcidAtom
) – Heavy atom type for which to set energy.count (
int
) – Number of surrounding atoms for which to set energy.energy (
float
) – Energy to set for those parameters.
- Raises:
RuntimeError
if inputs are invalid
- promod3.scoring.LoadAllAtomPackingScorer()¶
- Returns:
The default predefined AllAtomPackingScorer (loaded from disk)
- Return type:
AllAtomClashScorer class¶
- class promod3.scoring.AllAtomClashScorer¶
Inherits all functionality of
AllAtomScorer
. Calculates a simple clash score of all atoms against the environment. There is no need to define any parameters here as all interaction energies are fixed (see Eq. (11) in [canutescu2003b]). By default, the scorer calculates the scores by including everything, the stuff set in the environment and the coordinates in the input loops. You can change this behaviour with the according functions.- DoInternalScores(do_it)¶
- Parameters:
do_it (
bool
) – Whether to include pairwise interactions within the loop. True by default.