"""Int Immunol 2025, doi 10.1093/intimm/dxae072: Supplementary Table 1, FOXP3+ Treg clonotypes of donor Ts-009 reconstituted in
reporter cells. None reacted to SARS-CoV-2 peptide pools; clone 23599 is activated by autologous B cells without added antigen,
restricted by HLA-DQA1*03:03-DQB1*04:01. Supplementary Table 2 (13 more Treg clonotypes) is not downloaded yet."""
import pandas as pd
from atlas import SRC


def parse():
    t = pd.read_excel(SRC / "Takeuchi2025/dxae072_suppl_supplementary_table_s1.xlsx", header=2)
    auto = t.Clonotype.astype(str).eq("23599")
    return pd.DataFrame({"source": "Takeuchi 2025 (Int Immunol)", "study": "doi:10.1093/intimm/dxae072", "species": "human", "cd4_evidence": "FOXP3+ Treg cluster (single cell)",
                         "restriction": auto.map({True: "HLA-DQA1*03:03/DQB1*04:01"}), "TRAV": t.TRAV, "TRAJ": t.TRAJ, "CDR3a": t["CDR3.alpha"], "TRBV": t.TRBV, "TRBJ": t.TRBJ, "CDR3b": t["CDR3.beta"],
                         "antigen": auto.map({True: "unknown self antigen presented by B cells"}),
                         "context": "Treg clonotype " + t.Clonotype.astype(str) + ", convalescent severe COVID-19; no response to SARS-CoV-2 peptide pools",
                         "specificity_evidence": auto.map({True: "TCR reconstitution, reporter assay with B cells", False: "TCR reconstitution, reporter assay: no SARS-CoV-2 reactivity"}),
                         "annotation_level": auto.map({True: "antigen", False: "none"}), "donor": "Ts-009", "cells": t["Cell number of clonotype"]})
