"""Viruses 2024, doi 10.3390/v16101623 (GSE273224, sample GSM8424378): AIM+ CD4 T cells (CD69 and CD40L) sorted from PBMC of one HCV spontaneous resolver (Montreal HEPCO cohort,
two cleared infections) after stimulation with HCV peptide pools (GEO: "HCV-specific AIM+ TCR", library `CD4VDJ`). Cell Ranger contigs of the extracted archive; is_cell, high_confidence and productive only,
top-UMI TRA and TRB per barcode pair a cell (1,401 cells, 951 with a productive pair per the metrics). One record per TCR, `cells` = number of cells. The CD8 library is not loaded.
Level "antigen": activation after HCV peptide pools; the pools are not itemised in the files and no per-cell flag or epitope exists. The donor has no identifier in the files: "HCV resolver (single donor)"."""
import pandas as pd
from atlas import SRC, pair_contigs, clones


def parse():
    c = pd.read_csv(SRC / "Eisa2024/CD4VDJ/filtered_contig_annotations.csv")
    c = c[c.is_cell.astype(str).eq("True") & c.high_confidence.astype(str).eq("True") & c.productive.astype(str).eq("True")]
    return clones(pair_contigs(c, ["barcode"]), [], source="Eisa 2024 (Viruses)", study="GEO:GSE273224", species="human", cd4_evidence="sorted CD4+ (AIM+ CD69+CD40L+)",
                  antigen="HCV peptide pools", organism="hepatitis C virus", context="HCV spontaneous resolver, AIM+ CD4 sorted after HCV peptide pools", donor="HCV resolver (single donor)",
                  specificity_evidence="CD69+CD40L+ (AIM) after HCV peptide pools, TCR not tested", annotation_level="antigen")
