<jupyter_start><jupyter_text>Prepare groundtruth binding sites data obtained from BioLiP Link to the original data source https://zhanggroup.org/BioLiP/download.html<jupyter_code>import pickle
import os

data = {'ATP binding': {}, 'GTP binding': {}, 'heme binding': {}}

with open('./binding_sites_data/BioLiP_2013-03-6.txt', 'r') as f:
    for l in f:
        if len(l.split('\t')) > 8:
            if l.split('\t')[4] in ['HEM', 'ATP', 'GTP']:
                name = '-'.join(l.split('\t')[:2]).upper()
                mf = {'ATP': 'ATP binding', 'GTP': 'GTP binding', 'HEM': 'heme binding' }[l.split('\t')[4]]
                sites = [int(w[1:])-1 for w in l.split('\t')[8].split(' ')]
                data[mf][name] = {
                    'name': name,
                    'mf_term': mf,
                    'sites': sites
                }
import pickle
with open('./binding_sites_data/processed.pickle', 'wb') as f:
    pickle.dump(data, f)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19037871033776868, 'fraction_numerical': 0.014329580348004094, 'mean_word_length': 2.3493150684931505, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '641727', 'license': 'MIT-0', 'n_tokens_mistral': 358, 'n_tokens_neox': 336, 'n_words': 78, 'path': 'interpretation/Process_binding_site_data.ipynb', 'repo_name': 'ChrisAllenMing/lm-gvp', 'size': '977'}