# SOURCES — isalgo/airr_tcga Provenance of every artifact. **experimental** = measured/sequenced; **derived** = computed or re-formatted from experimental data. ## Shipped artifacts | Artifact | Origin | Format | Provenance | |---|---|---|---| | `samples.tar.gz` | TCGA tumour bulk RNA-seq → AIRR clonotypes (RNA-seq receptor profiling, Bolotin 2017) | tar.gz of per-sample AIRR TSVs | **experimental** (RNA-derived receptor rearrangements) | | `metadata.tsv` | join of the source tables below, restricted to the 9,591 AIRR samples | TSV, keyed by `sample_id` | **derived** | | `total_reads` (col) | GDC `rna_seq.genomic.gdc_realn.bam` `Total_Reads` | integer | **experimental** (raw library read total, all reads) | | `aligned_reads` (col) | GDC realigned-BAM `Aligned_Reads` | integer | **experimental** (genome-aligned subset) | | `metadata.hla.tsv` | HLA class-I: TCGA PanImmune (primary) ∪ OptiType-2017 fill, one row per donor | TSV, keyed by `subject_id`, `hla_source` col | **derived** (from experimental OptiType-based calls) | ## Upstream sources (internal staging, 2025) | Source | Path | Role | |---|---|---| | AIRR clonotypes | `airr/tcga_formatted_airr.tsv.gz` | the receptor tables (split per `sample_id` into `samples.tar.gz`) | | Sample metadata | `meta/tcga_meta_slim.tsv` | `sample_id`, demographics, **`total_reads`** (backbone; covers 100% of AIRR samples) | | Clinical annotation | `meta/tcga_annotation_standardized.tsv` | disease/cancer_type/stage/therapy/response/OS/PFS/AE (covers 9,104 / 9,591) | | Read counts | `meta/readcount/tcga_read_counts.tsv` | per-BAM `Total_Reads` / `Aligned_Reads`, keyed by aliquot UUID | | GDC sample sheets | `meta/readcount/tcga_*_sample_sheet.tsv` | UUID → TCGA barcode (`Case ID`, `Sample ID`) | | HLA class-I (primary) | TCGA PanCanAtlas PanImmune, `tcga_hla_alleles.tsv` | TCGA PanImmune A/B/C calls, donor-level (`patientBarcode`) — 8,507 donors | | HLA class-I (fill) | TCGA PanCanAtlas OptiType, `OptiTypeCallsHLA_20171207.tsv` | OptiType A/B/C per aliquot (`aliquot_id`); collapsed to donor, used only where PanImmune lacks the donor | ## Public origin - **TCGA Research Network** — ; data via the **GDC** (). - RNA-seq AIRR-profiling method: Bolotin DA et al., *Nat Biotechnol* 2017;35(10):908–911, DOI [10.1038/nbt.3979](https://doi.org/10.1038/nbt.3979), PMID 29020005. - HLA typing: TCGA PanImmune — Thorsson V et al., *Immunity* 2018;48(4):812–830.e14, DOI [10.1016/j.immuni.2018.03.023](https://doi.org/10.1016/j.immuni.2018.03.023), PMID 29628290; via . OptiType — Szolek A et al., *Bioinformatics* 2014;30(23):3310–3316, DOI [10.1093/bioinformatics/btu548](https://doi.org/10.1093/bioinformatics/btu548), PMID 25143287. ## Build / verification (2026-07-14) - `sample_id` (`TCGA-XX-XXXX.N`) is the single key; **all 9,591 AIRR samples are present in `tcga_meta_slim`** (0 missing), no duplicate ids. - **Read-count semantics verified**: `tcga_meta_slim.total_reads` == GDC realigned-BAM `Total_Reads` on matched samples (median ratio 1.000, 84% exact); clearly ≠ `Aligned_Reads` (9% match). So `total_reads` is the **total raw FASTQ read count**, not mapped reads. - **Read-count gap fill**: 556 AIRR samples had blank `total_reads` in `tcga_meta_slim`; 514 single-BAM cases were filled unambiguously from the GDC read-count table (UUID→barcode via the sample sheets), leaving 42 (0.4%) without a matchable BAM. - Regeneration: `samples.tar.gz` = per-`sample_id` split of the AIRR table (already sample-contiguous, no sort needed); `metadata.tsv` = `tcga_meta_slim` ⟕ annotation extras ⟕ `aligned_reads`, filtered to AIRR samples. - **HLA** (`metadata.hla.tsv`): key `subject_id` (`TCGA-XX-XXXX`). Union of two donor-level OptiType-based call sets to maximise coverage — **PanImmune** primary (`hla_source=panimmune`, 7,649 donors, from `tcga_hla_alleles.tsv` `patientBarcode`) plus **OptiType-2017** fill (`hla_source=optitype`, 1,474 donors, from `OptiTypeCallsHLA_20171207.tsv` collapsed per donor = first 3 barcode fields of `aliquot_id`). Alleles `HLA-A*02:01` (4-digit). **9,123 / 9,450 airr_tcga donors carry HLA (96.5%)** → 9,263 / 9,591 samples; 187 donors in neither set. (PanImmune alone covered 80.9%, OptiType alone 87.0%, union 96.5%.)