<jupyter_start><jupyter_text>Global folding assessment<jupyter_code>df = pd.read_json(os.environ['ETERNABENCH_PATH']+'/data/ExternalData/thermodynamic_global_folding_data.json.zip')
tmp1 = df.loc[~df.package.str.contains('LinearFold')]

tmp2 = df.loc[df.package.str.contains('LinearFold')]
tmp2 = tmp2.loc[~tmp2.package.str.contains('window')]

df = tmp1.append(tmp2, ignore_index=True)


types=['viral_gRNA', 'rRNA', 'SARS-CoV-2_gRNA', 'mRNA',]

for i, rna in enumerate(types):

    if rna=='SARS-CoV-2_gRNA':
        zscores, _ = eb.stats.calculate_Z_scores(df.loc[df.Class==rna][~df.package.isin(['LinearFold-E_100','LinearFold-E_5000','vienna_2_60C'])])
        
    else:
        zscores, _ = eb.stats.calculate_Z_scores(df.loc[df.Class==rna])
        
    n=len(zscores.Dataset.unique())
    k = len(zscores.package.unique())
    
    eb.plot.ranked_heatmap(zscores, vmin=-2,vmax=2,figsize=(.2*n+2,.2*k-0.5),width_ratios=[.2*n, 2],ext=True)
    #savefig('FIGURES/SI/global_thermo_ranking_%s.pdf' % rna, bbox_inches='tight')<jupyter_output><empty_output><jupyter_text>Perform significance test<jupyter_code>ctr=0

zscores_window_900 = zscores.loc[zscores.window_size==900]

for ds in zscores_window_900.Dataset.unique():
    tmp = zscores_window_900.loc[zscores_window_900.Dataset==ds]
    not_efold = tmp.loc[tmp.package!='eternafold_B']
    efold_min_cutoff = tmp.loc[tmp.package=='eternafold_B']['pearson_percentile_2.5'].values[0]
    if all(efold_min_cutoff > not_efold['pearson_percentile_97.5'].values):
        print('YES', ds)
        ctr+=1
    else:
        print('NO', ds)
        
        for pkg in ['contrafold_2', 'rnasoft_blstar','vienna_2_60C','rnastructure_60C','vienna_2','rnastructure']:
            pkg_max_cutoff = tmp.loc[tmp.package==pkg]['pearson_percentile_97.5'].values[0]
            if efold_min_cutoff < pkg_max_cutoff:
                print('\t%s tied, %.2f, %.2f' % (pkg, efold_min_cutoff, pkg_max_cutoff))
            not_pkg = tmp.loc[tmp.package!=pkg]
            pkg_min_cutoff = tmp.loc[tmp.package==pkg]['pearson_percentile_2.5'].values[0]   
            if all(pkg_min_cutoff > not_pkg['pearson_percentile_97.5'].values):
                print('BUT: %s won' % pkg)

print('FINAL COUNT', ctr)
len(zscores)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1645458534444932, 'fraction_numerical': 0.030715225976305396, 'mean_word_length': 4.377358490566038, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, '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': '106513', 'license': 'MIT', 'n_tokens_mistral': 975, 'n_tokens_neox': 903, 'n_words': 93, 'path': 'analysis/4_External_Datasets.ipynb', 'repo_name': 'eternagame/EternaBench', 'size': '2279'}