pyrosetta_help.score_mutants package

Submodules

pyrosetta_help.score_mutants.mutation module

class pyrosetta_help.score_mutants.mutation.Mutation(mutation_name: str, chain: str, pose: Pose)[source]

Bases: object

A mutation is an object that has all the details of the mutation. A variant, as interpreted in Model.score_mutations is a pose with a mutation.

__init__(mutation_name: str, chain: str, pose: Pose)[source]
assert_valid()[source]
is_valid()[source]
parse_mutation(mutation: str)[source]

pyrosetta_help.score_mutants.scores module

pyrosetta_help.score_mutants.scores.extend_scores(scores: DataFrame)[source]

Adds the following fields:

  • highest/lowest_contributor

  • highest/lowest_contributor_value

  • highest/lowest_contributor_wordy

Parameters:

scores – pd.DataFrame(output_of_variants)

Returns:

pyrosetta_help.score_mutants.scores.get_highest_contributor(row: Series) Tuple[str, float][source]

Not largest in abs contribution, but highest number (i.e. most positive)

pyrosetta_help.score_mutants.scores.get_largest_contributor(row: Series) Tuple[str, float][source]

Largest in abs amount as per the confusing fact that a very low negative number is large.

pyrosetta_help.score_mutants.scores.get_lowest_contributor(row: Series) Tuple[str, float][source]

Not smallest/infinitesimal in abs contribution, but lowest number (i.e. most negative)

pyrosetta_help.score_mutants.variant module

class pyrosetta_help.score_mutants.variant.MutantScorer(pose: Pose, modelname: str, scorefxn: ScoreFunction | None = None, strict_about_starting_residue: bool = True, verbose: bool = False)[source]

Bases: object

Copy pasted from PI4KA <- GNB2 <- SnoopCatcher

CA_RMSD(poseA: Pose, poseB: Pose, resi: int, chain: str | None, distance: int) float[source]
FA_RMSD(poseA: Pose, poseB: Pose, resi: int, chain: str | None, distance: int) float[source]
__init__(pose: Pose, modelname: str, scorefxn: ScoreFunction | None = None, strict_about_starting_residue: bool = True, verbose: bool = False)[source]
static convert_name3_to_name1_mutation(mutation: str)[source]

Converts a mutation in name3 / 3-letter format to name1 / 1-letter format (e.g. p.Ala123Ile -> A123I)

delta_scoredict(minuend: Dict[str, float], subtrahend: Dict[str, float]) Dict[str, float][source]

minuend - subtrahend = difference given two dict return the difference -without using pandas.

does_contain(mutation: Mutation | str, chain: None | str = None) bool[source]
classmethod from_file(filename: str, params_filenames: List[str] | None = None, **kwargs)[source]
get_neighbor_vector(pose: Pose, resi: int, chain: str, distance: int, include_focus_in_subset: bool = True, own_chain_only: bool = False) vector1_bool[source]
get_present_chains(pose: Pose | None = None)[source]
get_scoredict(pose: Pose) Dict[str, float][source]

Given a pose get the global scores.

get_unweighted_scorefxn()[source]
get_wscoredict(pose: Pose) Dict[str, float][source]
has_interface(pose: Pose, interface: str) bool[source]
has_residue(pose: Pose, resi: int, chain: str) bool[source]
make_mutant(pose: Pose, mutation: str | Mutation, chain='A', distance: int = 10, cycles: int = 5, inplace: bool = False) Pose[source]

Make a point mutant (A23D).

Parameters:
  • pose – pose

  • mutation

  • chain

  • inplace

Returns:

a copy if inplace is false

make_output_folder()[source]
movement(original: Pose, resi: int, chain: str, distance: int, trials: int = 50, temperature: int = 1.0, replicate_number: int = 10)[source]

This method adapted from a notebook of mine, but not from an official source, is not well written. It should be a filter and score combo.

Used BackrubMover

It returns the largest bb_rmsd of the pdb residue resi following backrub.

parse_mutation(mutation: str | Mutation, chain, pose: Pose | None = None)[source]
prefix_dict(dex: Dict[str, Any], prefix: str) Dict[str, Any][source]
relax_around_mover(pose: Pose, mutation: Mutation | None = None, resi: int | None = None, chain: str | None = None, cycles=5, distance=5, own_chain_only=False) None[source]

Relaxes pose distance around resi:chain or mutation

Parameters:
  • resi – PDB residue number.

  • chain

  • pose

  • cycles – of relax (3 quick, 15 thorough)

  • distance

Returns:

score_interface(pose: Pose, interface: str) Dict[str, float][source]
score_mutation(mutation_name: str, chains: str, distance: int, cycles: int, interfaces, ref_interface_dG: Dict[str, float], final_func: Callable | None = None, preminimize: bool = False, movement: bool = False) Tuple[Dict[str, float], Pose, Pose][source]

Scores the mutation mutation_name (str or Mutation instance) returning three objects: a dict of scores, the wt (may differ from pose if preminimise=True) and mutant pose

Parameters:
  • mutation_name

  • chains

  • distance

  • cycles

  • interfaces

  • ref_interface_dG – premade if no preminimise.

  • final_func

  • preminimize

Returns:

score_mutations(mutations, chains='A', interfaces=(), preminimize=False, distance=10, cycles=5, final_func: Callable | None = None) List[Dict[str, float | str]][source]
score_only(variant: Pose, reference: Pose, mutation: Mutation, chains: str, distance: int, interfaces: List[Tuple[str, str]], ref_interface_dG: Dict, final_func: Callable | None = None, movement: bool = False) dict[source]
vector2list(vector: vector1_bool) list_unsigned_long_t[source]

Module contents