crisprzip.coarsegrain module

Simplify a full landscape to a coarse-grained, 3-state model.

class crisprzip.coarsegrain.CoarseGrainedComplex(on_target_landscape: ndarray, mismatch_penalties: ndarray, internal_rates: dict, target_mismatches: MismatchPattern, *args, **kwargs)

Bases: SearcherTargetComplex

Extends the SearchTargetComplex class with coarse-graining functionality.

get_coarse_grained_rates(intermediate_range: Tuple[int, int] = (7, 14)) Tuple[Dict[str, float], int]

Calculate the coarse-grained rates over two barrier regions.

Parameters:

intermediate_range (tuple [int], optional) – The states a and b between which intermediate state is looked for. The lowest-energy state in the range [a, b) is the intermediate state. Default is [7, 14).

Returns:

  • coarse_grained_rates (dict [str, float]) – Dictionary containing the rates k_OI, k_IC, k_IO, k_CI between the states Open (=PAM), Intermediate, Closed (=full R-loop).

  • intermediate_id (int) – Location of the intermediate state.

class crisprzip.coarsegrain.CoarseGrainedSequenceComplex(*args, **kwargs)

Bases: SearcherSequenceComplex, CoarseGrainedComplex

Like CoarseGrainedComplex but works for SearcherSequenceComplexes.

crisprzip.coarsegrain.coarse_grain_landscape(searcher_target_complex: SearcherTargetComplex | SearcherSequenceComplex, intermediate_range: Tuple[int, int] = (7, 14)) Tuple[Dict[str, float], int]

Calculate the coarse-grained rates over two barrier regions.

A typical off-target landscape for CRISPR-Cas9 has 2 barriers, corresponding to the formation of the seed and the PAM-distal R-loop. By coarse-graining the full landscape, one can obtain the effective kinetics between the semi-stable states (PAM, intermediate, full R-loop) that can be experimentally discriminated.

Parameters:
  • searcher_target_complex (crisprzip.kinetics.SearcherTargetComplex or)

  • crisprzip.kinetics.SearcherSequenceComplex – The off-target hybridization landscape from this instance is used to calculate the coarse-grained rates

  • intermediate_range (tuple [int], optional) – The states a and b between which intermediate state is looked for. The lowest-energy state in the range [a, b) is the intermediate state. Default is [7, 14).

Returns:

  • coarse_grained_rates (dict [str, float]) – Dictionary containing the rates k_OI, k_IC, k_IO, k_CI between the states Open (=PAM), Intermediate, Closed (=full R-loop).

  • intermediate_id (int) – Location of the intermediate state.

Notes

Coarse-grained landscapes are obtained by first obtaining the intermediate state (see intermediate_range). Then, for the state pairs open-intermediate and intermediate-closed, a partial rate matrix is obtained. By solving the Master Equation, we obtain the average arrival time between the state pairs. The inverse of the average arrival time gives the rate. The coarse-graining approach is explained in detail in [12345].

Note that state labelling is different in some sources, where open and closed refer to the state of the R-loop, not the protein structure. Also, the open state “O” can be labelled as PAM state “P”.

References