crested.tl.modisco.create_pattern_tf_dict

crested.tl.modisco.create_pattern_tf_dict#

crested.tl.modisco.create_pattern_tf_dict(pattern_match_dict, motif_to_tf_df, all_patterns, cols)#

Create a dictionary mapping patterns to their associated transcription factors (TFs) and other metadata.

Parameters:
  • pattern_match_dict (dict) – A dictionary with pattern indices and their matches.

  • motif_to_tf_df (DataFrame) – A DataFrame containing motif to TF mappings.

  • all_patterns (dict) – A list of patterns with metadata.

  • cols (list[str]) – A list of column names to extract TF annotations from.

Return type:

tuple[dict, ndarray]

Returns:

A tuple containing the pattern to TF mappings dictionary and an array of all unique TFs.