crested.tl.modisco.create_pattern_tf_dict#
- crested.tl.modisco.create_pattern_tf_dict(pattern_match_dict, motif_to_tf_df, all_patterns, cols, motif_col='Motif_name')#
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.motif_col (
str(default:'Motif_name')) – Name of the column inmotif_to_tf_dfholding the motif identifier that the tomtom matches (pattern_match_dict[...]["matches"]) are looked up against. Default"Motif_name". Set this to match the column name used by your motif-to-TF table.
- Return type:
- Returns:
A tuple containing the pattern to TF mappings dictionary and an array of all unique TFs.