# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/core/00_data.ipynb.

# %% auto 0
__all__ = ['BASE_URL', 'fetch_csv', 'Collins', 'Kras']

# %% ../../nbs/core/00_data.ipynb 3
import pandas as pd
import requests
from functools import lru_cache

# %% ../../nbs/core/00_data.ipynb 7
BASE_URL = "https://github.com/sky1ove/kdock/raw/main/"

# %% ../../nbs/core/00_data.ipynb 8
@lru_cache()
def fetch_csv(url):
    return pd.read_csv(url)

# %% ../../nbs/core/00_data.ipynb 9
class Collins:
    "A class of loading compound datasets from Collins lab."

    @staticmethod
    def get_antibiotics_2k():
        """
        Antibiotics dataset of 50 µM 2,560 compounds screening in E. coli K12 BW25113.
        2,335 unique compounds after deduplicated.
        Table S1B from 2020 Cell: A Deep Learning Approach to Antibiotic Discovery.
        """
        return fetch_csv(BASE_URL + "dataset/antibiotics_2k.csv")

    @staticmethod
    def get_antibiotics_39k():
        """
        Antibiotics dataset of 50 µM 39,128 compounds screening in E. coli K12 BW25113.
        Supplementary dataset EV1 from 2022 Molecular Systems Biology: Benchmarking AlphaFold-enabled molecular docking predictions for antibiotic discovery.
        """
        return fetch_csv(BASE_URL + "dataset/antibiotics_39k.csv")

    @staticmethod
    def get_antibiotics_enzyme():
        """
        Antibiotics enzymatic inhibition dataset of 100 µM 218 compounds and 12 essential proteins in E. coli K12 BW25113.
        Flattened benchmark dataset/Supplementary EV4 from 2022 Molecular Systems Biology: Benchmarking AlphaFold-enabled molecular docking predictions for antibiotic discovery.
        """
        return fetch_csv(BASE_URL + "dataset/antibiotics_enzyme.csv")

# %% ../../nbs/core/00_data.ipynb 19
class Kras:
    "A class of fetching various KRAS datasets."
    @staticmethod
    def get_mirati_g12d():
        "Deduplicated G12D dataset from the mirati paper and patents."
        return fetch_csv(BASE_URL + "dataset/KRASi_g12d_dedup.csv")

    @staticmethod
    def get_mirati_g12d_raw():
        "Raw G12D dataset from the paper and patents without deduplication."
        return fetch_csv(BASE_URL + "dataset/KRASi_g12d.csv")

    @staticmethod
    def get_seq():
        "Protein sequence of human KRAS and its mutants G12D and G12C."
        return fetch_csv(BASE_URL + "dataset/kras_seq.csv")
