crested.pl.patterns.class_instances

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 of crested.tl.modisco.process_patterns.

  • idx (int) – The index specifying which pattern’s instances to plot. This corresponds to a key in the pattern_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:

None

Examples

>>> crested.pl.patterns.class_instances(pattern_dict, 0, class_representative=False)
../../../_images/pattern_class_instances.png