--- license: other task_categories: - tabular-classification tags: - immunogenomics - AIRR - TCR - BCR - repertoire-sequencing - TCGA - cancer - tumor-infiltrating-lymphocytes - RNA-seq pretty_name: TCGA — tumour AIRR (TCR/BCR) repertoires with clinical annotation size_categories: - 10M The results shown here are in part based upon data generated by the **TCGA Research Network** > (). AIRR rearrangements were extracted from tumour RNA-seq; for the > RNA-seq receptor-profiling approach see **Bolotin DA, Poslavsky S, Davydov AN, et al. > "Antigen receptor repertoire profiling from RNA-seq data." *Nature Biotechnology* 2017;35(10):908–911.** > [DOI: 10.1038/nbt.3979](https://doi.org/10.1038/nbt.3979) · PMID > [29020005](https://pubmed.ncbi.nlm.nih.gov/29020005/). ## Contents | File | What | |---|---| | `samples.tar.gz` | 9,591 per-sample AIRR tables, `samples/.tsv` (git-LFS) | | `metadata.tsv` | one row per sample, keyed by `sample_id` — clinical, demographic, read counts | | `metadata.hla.tsv` | one row per **donor**, keyed by `subject_id` — HLA class-I typing (OptiType) | | `load.py` | minimal `huggingface_hub` + `pandas` bootstrap loader | | `SOURCES.md` | provenance of every field (source file, fetch, experimental vs derived) | ### Per-sample AIRR tables (`samples/.tsv`) Tab-separated, AIRR Rearrangement field names, one clonotype per row: | column | meaning | |---|---| | `locus` | `IGH/IGK/IGL/TRA/TRB/TRG/TRD` | | `v_call`, `j_call`, `c_call` | IMGT V / J / constant (isotype) gene calls | | `junction`, `junction_aa` | junction nucleotide / amino-acid sequence (conserved anchors included) | | `duplicate_count` | number of reads supporting the clonotype (RNA-seq abundance) | | `sample_id` | back-reference to the metadata key | The dataset is **immunoglobulin-dominant** (as expected for tumour RNA-seq, where the plasma-cell / B-cell infiltrate contributes most receptor reads): | locus | clonotypes | share | |---|---:|---:| | IGK | 9,036,576 | 44.4% | | IGL | 5,580,569 | 27.4% | | IGH | 5,045,108 | 24.8% | | TRB | 352,641 | 1.7% | | TRA | 306,824 | 1.5% | | TRG | 23,243 | 0.1% | | TRD | 5,133 | 0.03% | Per sample: **median 634**, mean 2,121, max 52,388 clonotypes (all loci pooled) — the low-coverage regime typical of bulk RNA-seq, 20,350,094 clonotypes total. ### `metadata.tsv` (one row per sample) Key `sample_id` (`TCGA-XX-XXXX.N`) matches the per-sample table names exactly. Columns: - **identity** — `sample_id`, `subject_id` (case), `study_id`/`cohort` (e.g. `TCGA-GBM`), `center_id`, `center_name`, `metacohort_id`. - **phenotype** — `cancer_type`, `disease`, `tumor_type`, `source_type`, `source_tumor`, `source_icd10`, `sex`, `race`, `age`, `cancer_stage`, `tumor_stage`, `therapy`, `therapy_info`, `time_point`, `response`, `response_type`, `OS`, `OS_event`, `PFS`, `PFS_event`, `AE`, `AE_type`, `AE_severity`. - **sequencing depth** — `total_reads`, `aligned_reads` (see below). #### Read counts — total (raw) vs aligned `total_reads` is the **total number of reads in the raw sequencing library** (all reads, mapped *and* unmapped) — **not** the number of reads mapped to a receptor. It is the read total of the GDC `rna_seq.genomic.gdc_realn.bam` (`Total_Reads`), verified to equal `tcga_meta_slim.total_reads` on matched samples (median ratio 1.000). `aligned_reads` is the genome-aligned subset (`Aligned_Reads`) — provided as a bonus. This distinction matters in tumours: the recovered receptor content (`Σ duplicate_count`, or clone count) mixes **sequencing depth** with **immune infiltration**. `total_reads` is the technical denominator that lets you separate them — e.g. the receptor read fraction `Σ duplicate_count / total_reads` is a depth-normalised infiltration proxy, whereas `duplicate_count` alone is not. ### `metadata.hla.tsv` (one row per donor) Germline **HLA class-I** typing (4-digit A/B/C) from TCGA RNA-seq, keyed by `subject_id` (the donor — HLA is germline, so it is per-donor not per-sample). Join to `metadata.tsv` on `subject_id`. | column | meaning | |---|---| | `subject_id` | donor barcode `TCGA-XX-XXXX` — matches `metadata.tsv` `subject_id` | | `HLA-A_1`, `HLA-A_2`, `HLA-B_1`, `HLA-B_2`, `HLA-C_1`, `HLA-C_2` | the two alleles per locus, e.g. `HLA-A*02:01` | | `hla_source` | which call set the row came from — `panimmune` or `optitype` | Two OptiType-based call sets are unioned to maximise coverage: the curated **TCGA PanImmune** HLA table (primary; Thorsson et al. 2018) plus the raw **OptiType** 2017 call set (Szolek et al. 2014) filling donors PanImmune lacks. Both derive from OptiType, so they are methodologically consistent. Provenance: > - **PanImmune** (`hla_source = panimmune`, 7,649 donors) — Thorsson V, Gibbs DL, Brown SD, et al. > "The Immune Landscape of Cancer." *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](https://pubmed.ncbi.nlm.nih.gov/29628290/); via the TCGA PanImmune resource. > - **OptiType** (`hla_source = optitype`, 1,474 donors) — Szolek A, Schubert B, Mohr C, et al. > "OptiType: precision HLA typing from next-generation sequencing data." *Bioinformatics* > 2014;30(23):3310–3316. [DOI 10.1093/bioinformatics/btu548](https://doi.org/10.1093/bioinformatics/btu548) > · PMID [25143287](https://pubmed.ncbi.nlm.nih.gov/25143287/). Coverage: **9,123 / 9,450 donors** carry HLA (**9,263 / 9,591 samples**); 187 donors are in neither call set. ## Coverage / caveats - **All 9,591** AIRR samples are keyed in `metadata.tsv`. - **`total_reads` present for 9,549 / 9,591** (99.6%); 42 samples lack a matchable GDC BAM. Where `tcga_meta_slim` left it blank (556 samples), it was recovered from the GDC read-count table for the 514 single-BAM cases (unambiguous). - **Clinical annotation present for 9,104 / 9,591** (95%); 487 samples (mostly `.2` second aliquots) have `NA` clinical fields but retain demographics + read counts. - `aligned_reads` present for 9,358 / 9,591 (97.6%). - **HLA class-I present for 9,123 / 9,450 donors** (96.5%, `metadata.hla.tsv`) → 9,263 / 9,591 samples (PanImmune ∪ OptiType); 187 donors are in neither call set. ## Usage ```python from load import load_metadata, load_hla, load_sample, iter_samples md = load_metadata() # DataFrame, one row per sample hla = load_hla() # one row per donor (subject_id) md = md.merge(hla, on="subject_id", how="left") # attach HLA to each sample df = load_sample(md.sample_id.iloc[0]) # one sample's AIRR clonotypes for sample_id, clonotypes in iter_samples(): # stream all 9,591 ... ``` ## License TCGA-derived. Use is subject to the **NIH Genomic Data Sharing Policy** and the TCGA data-use terms; the sequences here are de-identified RNA-derived receptor clonotypes and standardised clinical annotation. Cite the TCGA Research Network as above.