<jupyter_start><jupyter_text>Filter redundancy per motif: Human dataset<jupyter_code>experiment_path = '../results/Human_Promoter_Analysis_euclidean_v8'
motif_dir = os.path.join(experiment_path,'Motif_Analysis')
motif_dir_neg = os.path.join(experiment_path,'Motif_Analysis_Negative')
df_pos = annotate_motifs(annotate_arg='default', motif_dir=motif_dir, store=False)
df_neg = annotate_motifs(annotate_arg='default', motif_dir=motif_dir_neg, store=False)
df_pos = pd.DataFrame(df_pos)
df_neg = pd.DataFrame(df_neg)
df_pos = df_pos[~df_pos[10].isna()]
df_neg = df_neg[~df_neg[10].isna()]
df_pos[10] = df_pos[10].apply(lambda x: x.split(','))
df_neg[10] = df_neg[10].apply(lambda x: x.split(','))
df_pos = df_pos.explode(10)
df_neg = df_neg.explode(10)
df_pos.shape, df_neg.shape
df_pos_redundancy = df_pos.groupby(10)[0].nunique()
df_pos_redundancy.argmax()
df_pos_redundancy.mean(),df_pos_redundancy.median()<jupyter_output><empty_output><jupyter_text>Filter reduandancy per motif: Arabidopsis dataset<jupyter_code>experiment_path = '../results/Arabidopsis_GenomeWide_Analysis_euclidean_v8'
motif_dir = os.path.join(experiment_path,'Motif_Analysis')
motif_dir_neg = os.path.join(experiment_path,'Motif_Analysis_Negative')
df_pos = annotate_motifs(annotate_arg='default', motif_dir=motif_dir, store=False)
df_neg = annotate_motifs(annotate_arg='default', motif_dir=motif_dir_neg, store=False)
df_pos = pd.DataFrame(df_pos)
df_neg = pd.DataFrame(df_neg)
df_pos_redundancy = df_pos.groupby(1)[0].nunique()
df_pos_redundancy.mean(), df_pos_redundancy.median()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13636363636363635, 'fraction_numerical': 0.01452020202020202, 'mean_word_length': 11.007575757575758, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '512473', 'license': 'MIT', 'n_tokens_mistral': 670, 'n_tokens_neox': 632, 'n_words': 71, 'path': 'analysis/Redundancy_Analysis.ipynb', 'repo_name': 'jeffhsu3/satori', 'size': '1584'}