baSeq
baSeq docs › TCR repertoires

TCR repertoires

A TCR Repertoire analysis takes clonotype tables from bulk T-cell receptor sequencing and measures each sample's diversity and expanded clones, the V and J genes it uses, and the clonotypes samples share.

Start a TCR repertoire analysis

In a project, click New session and choose TCR Repertoire as the kind of analysis. The sidebar marks TCR repertoires with two prongs on a line.

What to upload

A clonotype table per sample, or one table with a sample column, from any of these:

  • AIRR rearrangement files (junction_aa, v_call, j_call, duplicate_count), with repertoire_id or sample_id when one file holds several samples;
  • MiXCR clone exports, from version 1 to 4 (a sample's files of one chain each, such as Sample1.clones_TRB.tsv and Sample1.clones_TRAD.tsv, are one sample, and MiXCR 3's .clonotypes.ALL.txt beside them is not counted again);
  • Adaptive ImmunoSEQ exports, version 1 and 2 or later, and immuneACCESS sample exports (a sample without template counts, such as an RNA one, is counted in reads, and the upload says so);
  • TRUST4 reports and its AIRR output;
  • VDJtools and immunarch tables;
  • IMGT/HighV-QUEST's 1_Summary.txt, a sequence per row;
  • iRepertoire tables (CDR3(pep), V, J, copy);
  • 10x Genomics filtered_contig_annotations.csv, counted as cells per clonotype (of a run's copies of its contigs, such as its airr_rearrangement.tsv, one is read), and scRepertoire's table of cells (CTaa, CTgene);
  • any other table of CDR3s and counts, as GEO series often hold them: a column of amino acid CDR3s with, optionally, V and J genes and a chain, and either one count per row (with a sample column, such as Sample Name, sample_id or read set, for several samples), or a column per sample. Frequencies alone are turned back into counts, each sample's smallest counting as one, and the upload says so; a table without a header row is read by what its columns hold; a table of single cells' contigs (a cell_barcode column) counts cells.

Files can be gzipped, in an Excel workbook (each sheet holding a table is a sample of the sheet's name, and a sheet showing part of another's table, such as its top clones, is left out), or packed in a .zip or .tar.gz; a CSV that Excel saved with semicolons and decimal commas reads too. Each file's name becomes its sample's name (without 10x's _filtered_contig_annotations), unless the table names its samples; files of one name in different folders are named by the folders that tell them apart. A dropped folder sends every file in it: files that are not clonotype tables (reports, metrics, READMEs) are listed as set aside, and the rest is read.

A sample's chains in files of their own are one sample: files named alike but for the chain (D2_tcra_CD8RA and D2_tcrb_CD8RA, ..._alpha and ..._beta, even under two GEO sample numbers), or a GEO sample's files of different chains. A GEO sample's two files of one library (raw and filtered, read 1 and read 2) are read once, and the upload says which was left out. A table that names no chain (no V or J gene, no locus) has its clonotypes called TCR.

How clonotypes are counted

A clonotype is the chain, the CDR3 amino acids and the V and J genes, without alleles. Gene names follow IMGT, so Adaptive's TCRBV07-09 is TRBV7-9. Only productive sequences are measured; out-of-frame sequences and stop codons make up the unproductive share in Repertoire QC. The counts are what your tool counted: templates (ImmunoSEQ), molecules (UMIs), reads, or cells (10x). The steps measure the chain with the most counts, TRB in most bulk TCR runs.

Sample metadata

As in bulk RNA-seq, the metadata editor asks for a condition per sample, for example pre and post, a time point, or a tissue. Clonotypes are mostly private to a person, so when the samples come from several people, add a column for the patient or donor and choose it in Pair by: Diversity then compares each person's samples with their own (a paired t-test for two groups, the Friedman test for more, over the people with samples in every group), Clone Tracking follows each person's own clonotypes, and Expanded Clones compares each person with their own samples. When no one has samples in both groups (each mouse is either wild or lab), Diversity says so and compares the groups unpaired with one value per person (the mean of their samples), Clone Tracking says there is no one to follow, and Expanded Clones says there is nothing to compare.

The same clonotype in two samples

Two samples hold the same clonotype when its chain, CDR3, V and J all agree. V calls of one clone can differ between samples: FFPE tissue at survey depth calls V genes differently from deep blood, and leaves some with none. Following the 10 largest clonotypes of the 12 tumours in Snyder et al. (2017), 32 of the 120 are in the same patient's blood under the same V and J, and 101 when only the CDR3 and J have to agree. Clone Tracking, Repertoire Overlap and Expanded Clones therefore have Match clonotypes by: CDR3, V and J (the default), CDR3 and J, or CDR3. With the last two, the figure's title says so, and each row of a table shows the most counted V and J and how many exact clonotypes it brings together (exact_clonotypes). Two clones that happen to share a CDR3 then count as one, more often across people, so these suit one person's samples best: use them with Pair by. CDR3 and J found as many of those tumour clones as CDR3 alone, and brings fewer clonotypes together.

Diversity at the same depth

A sample sequenced deeper finds more clonotypes. Diversity therefore measures every sample at the depth of the smallest by default: the clonotypes expected at that depth, and the other measures averaged over ten random subsamples. Chao1 estimates the clonotypes in the whole sample from all its counts. When samples with under a tenth of the median sample's counts set that depth, the figure names them: leave them out, or measure each sample as sequenced.

Diversity: older donors have fewer clonotypes, lower Shannon diversity and higher clonality
Diversity on 12 donors of Britanova et al. (2014), every sample at 9,678 reads: the donors over 85 have fewer clonotypes and more clonal repertoires than the donors under 25.

Expanded clones

Clonal Expansion: older donors hold more of their repertoire in hyperexpanded clonotypes
Clonal Expansion: in the older donors, clonotypes above 1% of the sample each hold up to about half of the repertoire.
Expanded Clones, old against young: 425 expanded clonotypes, most not found in the young donors
Expanded Clones, old against young. Here the two groups are different people, so the expanded clonotypes are the older donors' own large clones.

The clonotype card

Click a CDR3 in a TCR result table to open its card in the side panel: its share and rank in every sample, what Expanded Clones called it, the clonotypes nearly like it in the same analysis (the same CDR3 with other V or J genes, and CDR3s one amino acid apart), and the other analyses you can open that hold it. A similar clonotype opens its own card. Type a CDR3 in the Findings search to list every analysis you can open that holds it.

The clonotype card: 13.5% of one older donor's repertoire, expanded against the young donors
CAIRTGTHNEQFF: 13.5% of one older donor's repertoire and expanded against the young donors, with a clonotype one amino acid apart in the same donor.

What samples share

Repertoire Overlap: two samples share their largest clonotypes, the others share almost none
Repertoire Overlap: A3-i150 and A3-i151 share their largest clonotypes (Morisita-Horn 0.99); every other pair shares almost none.

Sample datasets

Browse Sample Datasets in a TCR repertoire session lists twelve published studies, with their samples already named and described. Six come from Zenodo:

  • T-cell Memory After Mild COVID-19: two donors before infection and 15, 30 and 85 days after (Minervina et al., eLife 2021).
  • TCR Repertoires from Cord Blood to Centenarians: 20 people aged 0 to 103 (Britanova et al., J Immunol 2016).
  • Radiotherapy-Induced Lymphopenia: Photons vs Protons: 20 patients before radiotherapy, at their lowest lymphocyte count and during recovery.
  • Wild vs Laboratory Mice: splenic CD4 and CD8 T cells of laboratory and wild-caught mice.
  • Anti-PD-L1 in Metastatic Bladder Cancer: tumours and blood of responders and patients whose disease progressed (Snyder et al., PLoS Med 2017).
  • Origin of Zoster Vaccine T-cell Clones: naive and memory CD4 T cells before vaccination and the vaccine-specific ones after.

Six come from GEO, read as a GEO import reads them, each in another of the formats above:

  • PD-1+TIGIT+ CD8 T Cells in Melanoma on Anti-PD-1: 116 libraries of four CD8 populations from 12 patients over three months of treatment, alpha and beta chains with UMIs in one long table (GEO GSE141120).
  • Anti-CD4 and the CD8 T-cell Repertoire (Mouse): VDJtools tables, each mouse's alpha and beta chains in two files read as one sample (GSE181280).
  • Gamma Delta T Cells in Neonatal Heart Repair (Mouse): iRepertoire tables of TRG and TRD after myocardial infarction or sham surgery (GSE344996).
  • Tumour-Specific CD8 T Cells Without TrIP (Mouse MC38): TRUST4's reports of 12 samples in one workbook (GSE302185).
  • Gene-Edited Stem Cells Restore T-cell Responses (Jinx Mice): MIGEC tables of six groups after LCMV infection, P14 TCR-transgenic cells among them (GSE225534).
  • Thymic Treg and Conventional CD4 T-cell Repertoires (Mouse): tables without a header row, each chain a GEO sample of its own, joined (GSE143291).

Step reference

StepStageWhat it doesYou getKey inputs
Data UploadSetupReads the clonotype tables, names the V and J genes as IMGT does, and keeps the productive clonotypes.A data object with every productive clonotype of every sample and where each sample came from.Clonotype tables (see What to upload).
Repertoire QCQCShows how well each sample was sampled: productive counts, clonotypes, the unproductive share, the share of clonotypes seen once, the ten largest clonotypes' share and Chao1's estimate of the clonotypes there are. Rarefaction curves show whether deeper sequencing would find more.Rarefaction curves, the ten largest clonotypes' share per sample, and a table per sample.None.
DiversityAnalysisMeasures each sample at the same sequencing depth: the clonotypes expected at that depth, Shannon, inverse Simpson, clonality, Gini and Chao1, and the diversity profile (Hill numbers). Compares the groups with Welch's t-test, or one-way ANOVA for more than two.The diversity profile of each sample, three measures per group with p-values, and the tables.Parameter to compare; Sequencing depth: Smallest sample (default) or As sequenced; Pair by: each person's mean per group against their own (a paired t-test for two groups, the Friedman test for more, which with two people cannot reach P below 0.05, as the figure says), or, with no one to pair, one value per person.
Clonal ExpansionAnalysisShows how much of each sample its large clones hold: by clone size, from Rare (up to 0.001% of the sample each) to Hyperexpanded (above 1%), and by rank. D50 is how many of the largest clonotypes hold half the counts. The sizes are shares of a sample, so every sample is drawn down to the smallest sample's depth first.Stacked bars per sample, a table per sample, and each sample's 20 largest clonotypes.Parameter to compare; Sequencing depth: Smallest sample (default) or As sequenced.
V and J Gene UsageAnalysisEach V and J gene's share of a sample's clonotypes (or of its counts). Compares each V and J gene between the groups, Benjamini-Hochberg adjusted; a gene under 0.1% in every group is not tested.Heatmaps of V and J usage per sample, and tables.Parameter to compare, and Weight by: Clonotypes (default) or Counts.
CDR3 LengthAnalysisThe distribution of CDR3 lengths (the spectratype) per sample, and the mean length compared between the groups.A line per sample, the mean length per group, and tables.Parameter to compare, and Weight by.
Repertoire OverlapAnalysisHow much each pair of samples share: Morisita-Horn (by the clonotypes' shares) and Jaccard (by the clonotypes in common), and the clonotypes found in two samples or more.Two heatmaps with the samples ordered by similarity, and tables.Parameter to compare, and Match clonotypes by.
Clone TrackingAnalysisFollows the largest clonotypes of one group through every sample. With Pair by, each person's own largest clonotypes through that person's samples.A line per clonotype across the samples, on a log scale (a panel per person when paired), and a table.Parameter to compare, Follow the largest clonotypes of, Clonotypes to follow (5, 10 or 20), Pair by, Match clonotypes by.
Expanded ClonesAnalysisFinds the clonotypes that take a larger or smaller share in one group than in another: each group's counts added together, or with Pair by each person against their own samples. A clonotype with five counts or more is tested with a binomial test, Benjamini-Hochberg adjusted. Expanded: adjusted p below 0.05 and at least twice the share's odds (twice the share for a small clonotype; a clonotype already holding much of the repertoire can be called too). The test counts sampling noise only: when over half the clonotypes tested come out changed, the figure says so (replicate samples tell real changes apart).Each clonotype's share in the two groups (a panel per person when paired), the largest expanded clonotypes, and a table; paired, the clonotypes that expanded in two people or more.Parameter to compare, two values, Pair by, and Match clonotypes by.
Checked on a published dataset

On 12 donors of the aging study of Britanova et al. (2014), from the VDJtools examples, the six donors over 85 have fewer distinct clonotypes at the same depth than the six under 25 (p = 0.002), lower Shannon diversity and higher clonality, as the paper reports.

Every kind of analysis baSeq runs: baseq.bio/analyses

baSeq ApS · CVR 44568691 · Vermlandsgade 51, 2300 Copenhagen, Denmark · [email protected]

For research use only. Not for diagnostic or clinical decisions.