crested.pl.patterns.class_instances#
- crested.pl.patterns.class_instances(pattern_dict, idx, class_representative=False)#
Plot instances of a specific pattern, either the representative pattern per class or all instances for a given pattern index.
- Parameters:
pattern_dict (
dict
) – A dictionary containing pattern data. Each key corresponds to a pattern ID, and each value contains instances of the pattern across different classes, along with their contribution scores. Refer to the output ofcrested.tl.modisco.process_patterns
.idx (
int
) – The index specifying which pattern’s instances to plot. This corresponds to a key in thepattern_dict
.class_representative (
bool
(default:False
)) – If True, only the best representative instance of each class is plotted. If False (default), all instances of the pattern within each class are plotted.
- Return type:
See also
Examples
>>> crested.pl.patterns.class_instances(pattern_dict, 0, class_representative=False)