drugforge.spectrum.fitness.bloom_abstraction

drugforge.spectrum.fitness.bloom_abstraction(fitness_scores_this_site: dict, threshold: float) int[source]

Applies prescribed abstraction of how mutable a residue is given fitness data. Although the mean fitness was used at first, the current (2023.08.08) prescribed method is as follows (by Bloom et al): > something like “what is the number of mutations at a site that are reasonably well tolerated.” You could do this as something like number (or fraction) of mutations at a site that have a score >= -1 (that is probably a reasonable cutoff), using -1 as a cutoff where mutations start to cross from “highly deleterious” to “conceivably tolerated.”

Parameters:
  • fitness_scores_this_site (dict) – Dictionary containing fitness scores for a single site

  • threshold (float) – fitness value to use as minimum value threshold to treat a mutation as acceptably fit.

Returns:

num_tolerated_mutations

Return type:

int