"""Front Immunol 2023, doi 10.3389/fimmu.2023.1161538: TCR B13.14.1 (clonotype1 of DataSheet_3, TIL line B13.14, colorectal cancer),
shown to recognise KRAS G12V (not wild type) presented by HLA-DPB1*03:01 (TCR-transduced T cells, IFN-gamma release, see MANIFEST_tumour.md).
Only this clonotype is loaded. The other clonotypes of the three TIL lines were not sorted by lineage, so CD4 is not established for them.
CD4 identity here is the class II (DP) restriction. Cells = the clonotype frequency of the TIL line."""
import pandas as pd
from atlas import SRC


def parse():
    t = pd.read_csv(SRC / "Ai2023/DataSheet_3.csv").iloc[0]
    assert (t.clonotype_id, t.tra_cdr3s, t.trb_cdr3s) == ("clonotype1", "CAVRDGRGGGNKLTF", "CASSPGQRDNSPLHF")
    return pd.DataFrame([{"source": "Ai 2023 (Front Immunol)", "study": "doi:10.3389/fimmu.2023.1161538", "species": "human", "cd4_evidence": "MHC class II restriction",
                          "restriction": "HLA-DPB1*03:01", "TRAV": t.tra_v_genes, "TRAJ": t.tra_j_genes, "CDR3a": t.tra_cdr3s, "TRBV": t.trb_v_genes, "TRBJ": t.trb_j_genes, "CDR3b": t.trb_cdr3s,
                          "epitope": "KRAS G12V", "antigen": "KRAS G12V", "organism": "human (tumour neoantigen)", "context": "B13.14.1, colorectal cancer TIL line B13.14",
                          "specificity_evidence": "TCR transduction, IFN-gamma release with peptide-pulsed or mRNA-electroporated LCL and DP-matched tumour lines; mutant not wild type",
                          "annotation_level": "epitope", "donor": "B13", "cells": t.frequency}])
