crested.pl.modisco.selected_instances#
- crested.pl.modisco.selected_instances(pattern_dict, idcs, ax=None, **kwargs)#
Plot the patterns specified by the indices in
idcsfrom thepattern_dict.- Parameters:
pattern_dict (
dict) – A dictionary containing pattern data. Each key corresponds to a pattern ID, and the value is a nested structure containing contribution scores and metadata for the pattern. Refer to the output ofcrested.tl.modisco.process_patterns.idcs (
list[int]) – An index or list of indices specifying which patterns to plot. The indices correspond to keys in thepattern_dict.ax (
Axes|None(default:None)) – An axis to plot the instance on. Only works if providing a single value for idcs.width – Width of the newly created figure if
ax=None. Default is 8.height – Height of the newly created figure if
ax=None. Default is 2*`len(idcs)`.sharex – Whether to share the x axes of the created plots. Default is False.
sharey – Whether to share the y axes of the created plots. Default is False.
kwargs – Additional arguments passed to
render_plot()to control the final plot output. Please seerender_plot()for details. Defaults forselected_instances:title=[pattern_dict[str(idx)]["pattern"]["id"] for idx in idcs].
- Return type:
See also
Examples
>>> pattern_indices = [0, 1, 2] >>> crested.pl.modisco.selected_instances(pattern_dict, pattern_indices)