crested.pl.patterns.modisco_results

crested.pl.patterns.modisco_results#

crested.pl.patterns.modisco_results(classes, contribution, contribution_dir, num_seq, viz='contrib', min_seqlets=0, verbose=False, y_min=-0.05, y_max=0.25, background=None, **kwargs)#

Plot genomic contributions for the given classes.

Requires the modisco results to be present in the specified directory. The contribution scores are trimmed based on information content (IC).

Parameters:
  • classes (list[str]) – List of classes to plot genomic contributions for.

  • contribution (str) – Contribution type to plot. Choose either “positive” or “negative”.

  • contribution_dir (str) – Directory containing the modisco results. Each class should have a separate modisco .h5 results file in the format {class}_modisco_results.h5.

  • num_seq (int) – Total number of sequences used for the modisco run. Necessary to calculate the percentage of sequences with the pattern.

  • viz (str (default: 'contrib')) – Visualization method. Choose either “contrib” or “pwm”.

  • min_seqlets (int (default: 0)) – Minimum number of seqlets required for a pattern to be considered.

  • verbose (bool (default: False)) – Print verbose output.

  • y_min (float (default: -0.05)) – Minimum y-axis limit for the plot if viz is “contrib”.

  • y_max (float (default: 0.25)) – Maximum y-axis limit for the plot if viz is “contrib”.

  • background (Optional[list[float]] (default: None)) – Background probabilities for each nucleotide. Default is [0.27, 0.23, 0.23, 0.27].

  • kwargs – Additional keyword arguments for the plot.

Return type:

None

Examples

>>> crested.pl.patterns.modisco_results(
...     classes=["Lamp5", "Pvalb", "Sst", ""Sst-Chodl", "Vip"],
...     contribution="positive",
...     contribution_dir="/path/to/modisco_results",
...     num_seq=1000,
...     viz="pwm",
...     save_path="/path/to/genomic_contributions.png",
... )
../../../_images/genomic_contributions.png