Skip to main content
Bioinformatics logoLink to Bioinformatics
. 2026 Sep 2;42(9):btag659. doi: 10.1093/bioinformatics/btag659

Identifying expanding TCR clonotypes with a longitudinal Bayesian mixture model and their associations with cancer patient prognosis, metastasis-directed therapy, and VJ gene enrichment

David Swanson 1,✉, Alexander Sherry 2, Cara Haymaker 3, Alexandre Reuben 4, Chad Tang 5
Editor: Ercument Cicek
PMCID: PMC13614417  PMID: 42684031

Abstract

Motivation

Examination of T cell receptor (TCR) clonality has become a way of understanding immunologic response to cancer and its interventions in recent years. An aspect of these analyses is determining which receptors expand or contract statistically significantly as a function of an exogenous perturbation such as therapeutic intervention.

Results

We characterize the commonly used Fisher’s exact test approach for such analyses and propose an alternative formulation that does not necessitate pairwise, within-patient comparisons. We develop this flexible Bayesian longitudinal mixture model that accommodates variable length patient followup and handles missingness where present, not omitting data in estimation because of structural practicalities. Once clones are partitioned by the model into dynamic (expanding or contracting) and static categories, one can associate their counts or other characteristics with disease state, interventions, baseline biomarkers, and patient prognosis. We apply these developments to a cohort of prostate cancer patients who underwent randomized metastasis-directed therapy or not. Our analyses reveal a significant increase in clonal expansions among metastasis-directed therapy (MDT) patients and their association with later progressions both independent and within strata of MDT. Analysis of receptor motifs and VJ gene enrichment combinations using a high-dimensional penalized log-linear model we develop also suggests distinct biological characteristics of expanding clones, with and without inducement by MDT.

Availability and implementation

An example model implementation in R/STAN is available at doi.org/10.5281/zenodo.21209546

1 Introduction

The adaptive immune system plays a central role in human health in part by recognizing and reacting to pathogens present in the body. A critical component of it is T cells, whose eponymous receptors can achieve extraordinary diversity through non-homologous recombination, with some estimates in the range of achieving 1018 different T cell receptor (TCR) genes Jokinen et al. (2021). Analyses of the TCR repertoire have grown more common in recent years as technology for it has developed and their association with immunologic function has been studied and recognized as important (Kidman et al. 2020, Valpione et al. 2020, Bensouda Koraichi et al. 2023, Chen et al. 2024).

While the potential and realized diversity of TCRs is extreme, only a subset of them incur expanding or contracting behavior during immune response. Because statistical noise is a central problem in any setting with data, deciding what constitutes an expanding, contracting, or more generally, dynamic (when there are more than 2 longitudinal cross-sections), clone is an important analysis question generally and with respect to prognosis in cancer (Guo et al. 2020, Chen et al. 2021). Our first contribution in this paper is proposal of a longitudinal Bayesian mixture model consisting of two components, one which fits expanding or contracting longitudinal clonal frequencies, and one which fits static. After fitting the model by sampling the large parameter space with Hamiltonian Monte Carlo (HMC), one is able to make probabilistic statements on whether a particular clone exhibits expanding, contracting, or static behavior in baseline-followup analyses, or dynamic versus static behavior generally (Girolami and Calderhead 2011, Betancourt and Girolami 2015). In keeping with tradition in longitudinal statistics, in proposing the model we seek greater generality than the Fisher’s exact and Beta-binomial approaches commonly used in TCR analyses (Fisher 1928, 1922, Rytlewski et al. 2019), which are primarily suited to pairwise and fully-observed settings, in contrast to our approach which accommodates missing at random (MAR) mechanisms and arbitrary followup Laird and Ware (1982); Little and Rubin (2019); Little (2024). We also note that probabilistic statements on membership in one or the other dynamic versus static categories afforded and yielded by a mixture model accommodate flexible thresholding in associating dynamic clones with patient outcomes–downstream analysis may show that the number of high-probability expanding clones are associated with patient outcomes, while the analogous number using a less stringent threshold are not.

One reason for receptor diversity is their constitution of V, D, and J genes. Some analyses of V, D, and J gene family interaction or enrichment have been performed in the literature, that is examination of combinations of gene families that occur together in higher or lower proportion than expected given marginal totals, but most perspectives on the topic take a visual or descriptive approach (Ma et al. 2016, Shugay et al. 2018, Chen et al. 2025, Wang et al. 2025). An important gap to address in VDJ enrichment analyses is therefore how to calculate statistical significance of coincidence patterns of the genes that present across samples, within samples exposed to certain interventions, or, to incorporate the modeling framework outlined above, within groups of TCRs showing distinct expansion and contraction behavior.

An established class of models within categorical data analysis and ones well-positioned to assess statistically significant co-enrichment of VJ gene families are log-linear models (Agresti 2013). They are a generalization of several model classes like logistic regression and can encode flexible interactions within contingency tables of arbitrary shape and number of categories K1×K2×⋯×KN. Because one generally may approach log-linear modeling with hypotheses and structure one has from expert knowledge, VJ enrichment presents the challenge of necessitating a hypothesis-free and flexible model space. In using a fully-saturated model parameterization, we therefore introduce a L1 penalization parameter which is learned from the data to achieve a sparse model fit by shrinking to zero a large subset of the parameters in the excessively large and flexible model space (Tibshirani 1996). This framework constitutes the second methodological contribution of the manuscript.

We begin the exposition in Sections 2.1 and 2.2 by analyzing and contrasting error models of the Fisher’s exact test approach and our model in distinguishing static from expanding/contracting clones. In Section 2.3 we specify the Bayesian mixture model proposed as an alternative. We conclude our Methods in Section 2.4 with a description of the log-linear L1 penalized regression model framework for identifying joint VJ gene and patient characteristic enrichment patterns. In Section 3, we perform an extensive study of a prostate cancer cohort to whom metastasis-directed therapy (MDT) and its lack (no MDT) had been randomized, with each arm consisting of a mixture of patients who received additional intermittent or continuous androgen deprivation therapy (ADT). Using the tools developed in Methods, we fit our model to the longitudinal TCR frequencies to identify counts of expanding, contracting, or, generally, dynamic clonotypes. We associate these groups and counts thereof with patient characteristics including MDT, receptor motifs, baseline biomarkers, and progression-free survival (PFS). Additional entropy and distributional analyses demonstrated trajectory differences between expanding and contracting clones. Finally, application of the penalized log-linear model framework found several statistically significant enrichment of VJ gene families and some interaction and clonotype expansion status. We conclude in Section 4 with a discussion of the clinical and biological insights offered by our analysis, possible therapeutic targets, and ways in which one could improve the Bayesian mixture and penalized log-linear models.

2 Methods

2.1 Error model for Fisher’s exact test to assess longitudinal clonal changes

We begin by considering the error model of the Fisher’s exact test which will prove useful when considering the expanding and contracting clonal trajectories the test is powered to detect. Consider the ith clone template count for person j at time k, Cijk, and the total number of template counts for person j at time k, Ojk=∑i=1UjkCijk, where Ujk is the number of unique clones for person j at time k. Since there is significant variability in the total number of template reads and it is of primary biological interest how proportions of clones change over time, we model the proportion, or frequency, Cijk/Ojk over time and patient.

In the Fisher’s exact approach, one takes pairs of these measurements along longitudinal followup and performs hypothesis tests for changes in them DeWitt et al. (2015); Fisher (1922) and likewise for a variation thereof with a weakly informative Beta prior Rytlewski et al. (2019). These are reasonable approaches that have been used with success, and one can attempt to understand their statistical characteristics. Consider such a test when we have observed Cij1 and Cij2, that is the template count of clonotype i of person j at times 1 and 2 respectively and without loss of generality, and correspondingly Oj1 and Oj2, the total reads at those times.

The null hypothesis that the proportion of the Cijk to Ojk is constant over k=1,2 is tested with the hypergeometric distribution. So envisioning these 4 cell counts Cijk and Ojk−Cijk for k=1,2 as a 2×2 table (Table 1) and conditioning on all marginal totals, one can calculate the Fisher’s exact test P-value.

Table 1.

2×2 contingency table of TCR template reads and total number of reads for person j at times k=1,2.

Time 1 Time 2
Clone ij  Cij1  Cij2
Not clone ij  Oj1−Cij1  Oj2−Cij2

It is known that the Fisher’s exact test is approximated increasingly well by the usual score test of equal proportions as cell counts increase and convergence to some proportion Cijk/Ojk→pk for k=1,2, different in that one is only conditioning on 2 cell count marginal distributions along the vertical axis as opposed to additionally the horizontal axis (Casella and Berger 2024). For convenience of that form and exposition, we therefore consider the test statistic p^1=Cij1/Oj1 and p^2=Cij2/Oj2 and p^=(Cij1+Cij2)/(Oj1+Oj2)

p^1−p^2(1/Oj1+1/Oj2)·p^(1−p^)∼N(0,1) under H0

which follows a standard normal distribution under the null hypothesis Rosner and others (2006). One notes the variance estimator in the denominator, which is powered as a function of the total count of template reads at person-time jk, and importantly whose form is p(1−p). For small p, which low frequency clonotypes correspond to, 1−p≈1, so that the unit variance is approximately p≈p(1−p). However, for higher frequency clonotypes, one cannot ignore the 1−p term, and so the variance is O(p2). Since p<1, this implies a smaller variance and therefore standard deviation. So higher frequency clones require less proportional change to be viewed as a significant expansion or contraction because of their smaller denominator in the test statistic, other things equal. This phenomenon occurs in addition to the decrease in error coverage and therefore increase in power for some fixed longitudinal change as the mean scales linearly with p while the standard deviation increases at square root rate. That is, the Fisher error model powers changes for high frequency clones in 2 ways: (1) the (1−p) term in the denominator of the test statistic cannot be ignored with increasing p, and (2) the p term changes slower than p, the difference widest at highest frequencies.

2.2 Alternative error model to incorporate biological variability of high frequency clones

Use of the Fisher error model described above may be an appropriate approach in some cases because incorporation of the biological prior of greater interest in higher frequency clones is likely warranted. However, it may not duly acknowledge biological variability that one may want to specify as more nearly proportional to the clonal mean frequency so that one does not label trivial biological change as statistically significant dynamic behavior. That is, one does not want to detect a change from, say, 11%–11.5% frequency as a significant change even if a change from 0.5% to 1.0% should be.

It may seem preferable to keep a consistent and explicit view of the error term and therefore what constitutes significant biological variability by using the model Cijk∼Pois(λOjk), Ojk treated as an offset, for some λ whose distribution has the important property E[Cijk]=Var[Cijk]=λ·Ojk. Remember that because error coverage of a random variable scales with the standard deviation rather than variance, this formulation still incorporates a biological prior of greater interest in higher frequency clones, while maintaining a more consistent perspective on the error term. This means that one is better powered for a proportional change in some clone at higher as compared to lower frequencies. This is because for some change proportional to the mean, call it δ·E[Cijk] for some 0<δ<1, the inverse of the coefficient of variation (a value associated with its powering) is

δ·E[Cijk]Var[Cijk]=δλ·Ojkλ·Ojk=δλ·Ojk

As the expression increases in λ and keeping δ constant, one is better powered to detect small changes as the mean frequency increases.

2.3 Proposed model hierarchy

In the Fisher’s exact test setting, the null hypothesis amounts to a common success probability pk across time k so that using the notation above, we have H0:p1=p2. Analogous for our proposal, our model attempts to distinguish between a Poisson intensity parameter λ, up to scaling by an offset, that is common across time or varies. We therefore use two distinct parameterizations, one that is static, λij, and one that changes or is dynamic across time, λijk. That is, we have

Dynamic: Cijk|Ojk∼Pois(λijkOjk)Static: Cijk|Ojk∼Pois(λijOjk) (1)

Notably, while a simple Fisher’s exact test or test of proportions would be comparing 2 cross sections in time, here we index generically by some k=1,…,Tj, where Tj is the number of followup times of observations j, some of which may be missing for Cijk, and therefore is a more general formulation. Because λ is a single degree of freedom so that marginals are not sufficiently flexible to fully describe observed data and also motivated by Bayesian conjugacy, we assert the hierarchical formulation:

λijk|αj,βj∼Gamma(αj,βj)   λij|αj,βj∼Gamma(αj,βj) (2)

noting that αj and βj are held in common across the two components and that indexing them by j addresses possible within-person correlation induced by variation in the number of unique clones across subjects.

Leveraging conjugacy relationships yields the following convenient probability mass functions upon integration out of λij or λijk depending on the component:

 pS(Cij·|Oj·,αj,βj)=∫pS(Cij·,λij|Ojk,αj,βj)dλij =∫lS(Ci·|λijOjk)p(λij|αj,βj)dλij =Γ(∑kCijk+αj)Γ(αj)∏k=1TjCijk!(βjβj+∑kOjk)αj∏k=1Tj(Ojkβj+∑kOjk)Cijk (3)
pD(Cij·|Oj·,αj,βj)=∫pD(Cij·,λijk|Ojk,αj,βj)dλijk=∫lD(Ci·|λijkOjk)p(λijk|αj,βj)dλijk=∏k=1TjΓ(Cijk+αj)Γ(αj)Cijk!(βjβj+Ojk)αj(Ojkβj+Ojk)Cijk (4)

where pD(·|·) and lD(·|·) are the posteriors and likelihood for the dynamic component with respect to their arguments and conditioning events, similarly for pS(·|·) and lS(·|·) of the static component, p(·|·) is a prior in the expressions with respect to its arguments, and where we use the notation for any Vij·=(Vij1Vij2⋯VijNij), an Nij dimension vector, and analogously for Vi·.

The mixture of dynamic and static components is then

p(Cij·|Oj·,αj,βj) =(1−π)·pS(Cij·|Oj·,αj,βj)+π·pD(Cij·|Oj·,αj,βj)

where the marginal or population mixing proportion for dynamic clones is π. We show the derivation in greater detail in Section A2, available as supplementary data at Bioinformatics online. We remark that integration of λij and λijk out of their respective expressions yields a negative multinomial or product of negative binomials probability mass functions as the posterior predictive distributions for the static and dynamic components, respectively, modified according to the offset term. Indexing αj and βj by person adds flexibility and allows for a variable number of unique clones within patient, which is desirable because inherent in modeling frequencies is the linear dependence of their sum equaling 1.

The empirically estimated αj and βj will play a moderating role in the “powering” of the mixture model, that is the ability of it to distinguish clonotypes falling into respective components. Since they are empirically estimated based on realized frequencies, they are not subject to analyst-chosen biases. As we proceed in examining the two component probability mass functions, it is notable that for data whose estimated αj and βj imply a small mean and variance, one is less powered to distinguish between static and dynamic behavior precisely because of the points made above–when drawing different λijk|αj,βj∼Gamma(αj,βj) with a small mean and variance, the Poisson error overwhelms variability at the next level of hierarchy and one cannot distinguish the two components. Indeed, one can have an arbitrarily large mean with a small variance, but the tendency and worst case scenario will be small mean and small variance because the coverage of the Poisson error gets smaller relative to the mean for an increasing mean.

To share information across the population, we introduce another layer of hierarchy:

log αj∼N(μα,σα2) log βj∼N(μβ,σβ2) (5)

where μα, μβ, σα2, and σβ2 will be estimated empirically under a flat prior, and log  is applied to induce symmetry about zero on the parameters. We place a diffuse and weak prior on π asserting

logit  π∼N(0,σπ2)

for large σπ2 set to 20 for stability and fit the model using Hamiltonian Monte Carlo (HMC), implemented in STAN, because of the hierarchical formulation and lack of closed-form integrals (Hoffman et al. 2014, Stan Development Team 2024). Recovery of all parameters by the fitting procedure is demonstrated in Section A1, available as supplementary data at Bioinformatics online.

2.4 Penalized log-linear modeling for VJ gene enrichment testing and interaction with patient phenotype

We conclude the Methods by proposing a different model and one serving a complementary purpose to that above which partitions expanding and contracting clones from static ones. One aspect of TCR repertoire analysis is examination of V, D, and J gene recombination, and where there exists gene family enrichment marginally or in combinations of these gene families. To our knowledge, a formal framework for modeling and testing statistical significance of this enrichment has not been proposed for VDJ analyses. Here, we propose using L1 penalized and fully saturated log-linear models for parameterizing the contingency tables of gene family coincidences by which these data can be described. When using this framework, one can introduce still other characteristics of the T cell receptor, such as whether it expanded or contracted, and thus test for associations between gene families and that characteristic. In the model description below, we focus on just V and J genes in our notation and then some arbitrary TCR or patient characteristic notated with P, done for exposition and to connect the notation with our analysis in Section 3.

Let Gpvj be the count of the number of clonotypes with patient characteristic p, V gene family v, J gene family j. That is, Gpvj is the number of Cij· composed of those gene families and found in patient j with phenotype p. Then define

f(βpP,…,βpvjPVJ)=f(βpP,βvV,βjJ,βpvPV,βpjPJ,βvjVJ,βpvjPVJ)=βpP+βvV+βjJ+βpvPV+βpjPJ+βvjVJ+βpvjPVJ

and now consider the model

 log E[Gpvj]=β+f(βpP,…,βpvjPVJ)+λβ∑pvjf| |(βpP,…,βpvjPVJ) (6)

where f| |(βpP,…,βpvjPVJ)=|βpP|+|βvV|+|βjJ|+|βpvPV|+|βpjPJ|+|βvjVJ|+|βpvjPVJ| and λβ is the penalization parameter, and this adopts the notation of log-linear models for modeling contingency tables of arbitrary size and dimension. So here the interpretation of, say, βpvPV is the odds ratio of patient characteristic p for having V gene v as compared to the V family gene reference category. This is a saturated and high-dimensional, L1 penalized log-linear model, and, because of the penalty, one achieves sparse solutions under the hypothesis that only a subset of VJ interactions, indicating enrichment, with or without patient phenotype are significant. The fully saturated parameterization means it has NP·NV·NJ parameters, the respective numbers of categories of patient characteristics, v genes, and j genes, respectively, so that every cell in the contingency table can be modeled without error prior to penalization. We estimate λβ by cross validation. After identifying a sparse subset of parameters on which to fit the model, we do so and identify significance of parameters in the usual way.

3 Results

We fit the longitudinal Bayesian mixture model to 62 662 productive T cell receptors observed over baseline and followup among 97 prostate cancer patients randomized to MDT and no MDT, and to 86 381 productive TCRs on 104 observations for the baseline with two followups analysis. Results shown are for the baseline-followup analysis unless otherwise noted, for example as in the dynamic clone by MDT stratum comparison, out of consideration of missing at random (MAR) assumptions necessary in the baseline with two followups analysis. T cell receptor–β complementarity-determining region (CDR) 3 regions were sequenced with an immunoSEQ assay of Adaptive Technologies, where peripheral blood samples were derived from patients at their visits. We filtered T cell receptors for non-productive sequences and those with less than 8 total read counts across all of followup so that if a clone had few reads at one cross section, but experienced significant expansion, it would still be included in analysis. The threshold was chosen to filter those clones of likely little biological relevance in addition to numerical artifacts arising in the mixture when modeling low counts. After convergence of the Hamiltonian Monte Carlo fitting procedure (Betancourt and Girolami 2015, Stan Development Team 2024), we counted the number of expanding, contracting, and static clones within each patient based on some threshold probability of dynamic component membership, which we chose as 0.95 so that the more aggressively dynamic, expanding, or contracting clones would be labeled as such, having observed stronger associations with a more stringent definition.

3.1 Prognostic models

We fit Cox proportional hazards models to the progression-free survival (PFS) endpoint in the prostate cancer cohort, with 53 events observed on the 97 subjects with the immunoSEQ assay at their baseline and followup visits Cox (1972); Ludmir et al. (2024); Sherry et al. (2022). We log-transformed the counts of the number of expansions and contractions because of the right-skewness of the measure and to make inference robust to the influence of leveraged observations. To improve estimation efficiency and account for disease and performance status heterogeneity, we adjusted the Cox model for patient age, ADT, and number of lesions. Models were fit to maximize the quasi-likelihood and in the R statistical programming environment Cox (1972) and R Core Team (2022).

The three Cox models shown in Table 2 demonstrate that clonal expansions tend to be more significant in prognostic models than dynamic clones (expansions and contractions combined) or contractions, and more expansions suggest protection against a PFS event, though significance depends on whether the model is adjusted for MDT, and one would expect to see greater significance in the model with MDT were one better-powered. MDT is the most prognostic and protective of explanatory variables in time-to-event analysis. We also see that expansions tend to be more significant with inclusion of contractions, suggesting that it is within strata of contractions that expansions are more protective. The interpretation is that the ratio of these is important for explaining variation in PFS, though formal testing of this hypothesis is difficult and underpowered and did not yield a significant result. Lastly, MDT confounds the expansions-PFS relationship, though examination of parameter estimates suggests modest mediation of MDT-PFS by the number of expanding clones.

Table 2.

Three PFS Cox models with combinations of expansions/contractions and MDT, all adjusted for Age, ADT, and lesion group.

HR^ 95% CI Z-statistic Pr( > |  Z  |)
Full model
MDT 0.321 (0.17, 0.61) −3.51 0.000449
Logged expansions 0.825 (0.61, 1.08) −1.41 0.158
Logged contractions 1.19 (0.88, 1.62) 1.15 0.251
Dynamism only
Logged expansions 0.743 (0.57, 0.96) −2.2 0.0275
Logged contractions 1.11 (0.82, 1.5) 0.711 0.477
Expansions excluded
MDT 0.299 (0.16, 0.55) −3.87 0.00011
Logged contractions 1.03 (0.83, 1.28) 0.268 0.789

To investigate marginal associations and by way of non-parametric methods, we used the Kaplan-Meier estimator to estimate PFS stratified by greater or fewer than 30 expansions, yielding a log-rank test with P = 0.08 (Fig. 1). The threshold was chosen to reflect a population mode of expansions fewer than the number, and was approximately the 70th percentile of clonal expansions count. A test of proportional hazards between strata using yielded a P-value of 0.24, suggesting that there was insufficient evidence to reject the modeling assumption. When the count of patient expansions was treated as continuous in the model, we observed a slightly more significant result (P = 0.06).

Figure 1.

For image description, please refer to the figure legend and surrounding text.

KM of PFS stratified by number expansions. Log-rank test of the dichotomized strata yields a P-value of 0.08, and when treated as continuous in a Cox model 0.06.

3.2 Enrichment of VJ gene families and clonal expansions

We fit the penalized saturated log-linear model to indicators of V and J gene families and whether the clone was determined as expanding, contracting, or dynamic, and all higher order interactions, with results shown in Table 3. Penalization parameter tuning was performed with cross validation. We did not include D genes in our analysis because information on their gene family was only available for a minority of the TCR. Model fits suggested highly significant enrichment above expected between select V and J gene families, and no enrichment by clone contraction status. The main effect of expansion status in Table 3 is estimated as a large negative number because expanding clones are in the minority of the clone population. The analysis was well-powered because of the thousands of TCR analyzed and so we focus on the orthogonal information offered by the effect size parameters, β^, which are helpful to understand magnitude of difference by fold change. Most β^’s are positive, suggesting that when there is gene family interaction, joint frequencies are greater than expected under the null of no interaction rather than less, and one observes J gene family 02 with V family 11 and 24 in particular as having some of these highest levels. We did observe significant interaction between being an expanding clone and V gene family 06, in this case with coincidence below what would be expected by their marginal frequencies, though a biological rationale for the phenomenon was unclear. Out of concern for variable selection instability in L1 penalized models, we additionally performed stability selection, conditioning the regression on the same design matrix as the penalized log-linear model Meinshausen and Bühlmann (2010). Results of that analysis are in Section A4, available as supplementary data at Bioinformatics online of the Supplementary Material. While there is broad overlap in the interactions between gene families in the respective models, interaction terms with clonal expansion do not overlap and so may be interpreted as hypothesis generating rather than implying stronger conclusions.

Table 3.

VJ gene with expansion interaction identified by log-linear model penalized regression. Intercept and gene family main effects not shown.

β^ 95% CI Z-statistic Pr( > |  Z  |)
Expansion main effect
Expansion −2.95 (−3, −2.9) −144 0
Gene family interactions
TCRBJ02 * TCRBV02 −0.0321 (−0.13, 0.066) −0.643 0.52
TCRBJ02 * TCRBV03 0.166 (0.055, 0.28) 2.94 0.00328
TCRBJ02 * TCRBV04 0.203 (0.11, 0.3) 4.26 2.02e-05
TCRBJ02 * TCRBV05 0.202 (0.12, 0.28) 4.88 1.05e-06
TCRBJ02 * TCRBV06 0.114 (0.035, 0.19) 2.82 0.00483
TCRBJ02 * TCRBV07 0.263 (0.18, 0.34) 6.57 5.13e-11
TCRBJ02 * TCRBV09 0.327 (0.22, 0.43) 6.04 1.59e-09
TCRBJ02 * TCRBV10 0.163 (0.047, 0.28) 2.76 0.00585
TCRBJ02 * TCRBV11 0.547 (0.44, 0.65) 10 1.34e-23
TCRBJ02 * TCRBV12 −0.0939 (−0.19, 0.0043) −1.87 0.0609
TCRBJ02 * TCRBV14 0.191 (0.036, 0.35) 2.41 0.0161
TCRBJ02 * TCRBV16 −0.557 (−1, −0.13) −2.54 0.0112
TCRBJ02 * TCRBV19 −0.227 (−0.32, −0.13) −4.71 2.45e-06
TCRBJ02 * TCRBV20 0.167 (0.08, 0.25) 3.74 0.000182
TCRBJ02 * TCRBV24 1.57 (1.4, 1.7) 20.9 1.19e-96
TCRBJ02 * TCRBV27 0.242 (0.14, 0.35) 4.51 6.41e-06
TCRBJ02 * TCRBV28 −0.0553 (−0.16, 0.049) −1.04 0.299
TCRBJ02 * TCRBV29 0.129 (0.00018, 0.26) 1.96 0.0497
TCRBJ02 * TCRBV30 −0.395 (−0.52, −0.27) −6.07 1.26e-09
Gene family
Expansion interaction
TCRBV06 * Expansion −0.168 (−0.29, −0.048) −2.71 0.00678

3.3 Clonal expansion and contraction distributions

When considering longitudinal movements of TCR clonotypes, one can examine whether expanding and contracting clones do so by some scaling factor or are translated by an absolute amount. Scaling might suggest a strong immune response maintains existing relative proportions for some subset of clones, whereas translations by some absolute amount would tend in the limit to push those clones toward the same frequency. There are different measures related to frequency distribution entropy including Gini coefficients, and in Fig. 2 we use and plot the Lorenz curves from which they are derived, doing so for expanding, contracting, and static clones, stratified by patient and longitudinal followup time. The implication of the marked stratification by baseline-followup among the curves, with movement toward more evenly-distributed frequencies for the expansions, is that clonal movements on average tend to be translations as opposed to scalings–a clone starting at a higher or lower frequency will change by X amount rather than X percent.

Figure 2.

For image description, please refer to the figure legend and surrounding text.

Lorenz curves for subjects stratified by baseline/followup cross-sections for expanding, contracting, and static clones.

3.4 Baseline biomarkers and clonal dynamism

We fit linear regression models associating counts of expansions and contractions with baseline biomarkers, within strata of MDT and non-MDT patients. Normalized marginal association parameter estimates are shown in Figs 3 and 4. The primary, clear association between clonal dynamism and biomarkers is UPR, which doesn’t vary significantly by expansion/contraction nor MDT/non-MDT status. Other, weaker associations were found (eg, Il7), but they did not pass multiple testing correction. There was also some modest variation in the normalized effect sizes by expansion and MDT strata.

Figure 3.

For image description, please refer to the figure legend and surrounding text.

Marginal associations between baseline biomarkers and clonal expansions, stratified by MDT.

Figure 4.

For image description, please refer to the figure legend and surrounding text.

Marginal associations between baseline biomarkers and clonal contractions, stratified by MDT.

We explored interactions of baseline biomarkers with glinternet, a model and tool for identifying these terms in penalized high-dimensional regression settings which maintains hierarchical model ordering with main effects (Lim and Hastie 2015). Results are given in Table 4 and show two modest interactions between gmcsf * mip1b and il15 * vegfa with respect to the number of expansions in subjects (Tibshirani 1996). Lastly, in Fig. 5, we see the MDT stratum exhibit a significantly greater number of both contractions and expansions in the baseline-followup analysis and dynamic clones generally in the baseline with two followup analysis. We also found positive and negative associations between the presence of HLA alleles A*03 and C*07, respectively, and clonal expansions for the subset on whom HLA typing was available, with results presented in Section A3, available as supplementary data at Bioinformatics online.

Table 4.

Regressing clonal expansions on baseline biomarkers with interaction-oriented penalized regression enforcing hierarchically-ordered models.

β^ 95% CI t-Statistic Pr( > |  t  |)
Main effects
upr 2.93e-05 (2.2e-05, 3.6e-05) 8.28 1.42e-12
gmcsf 7.8 (−0.62, 16) 1.84 0.0689
il10 0.869 (0.092, 1.6) 2.22 0.0289
il1a 0.0236 (−0.017, 0.064) 1.17 0.247
il15 −0.516 (−0.94, −0.09) −2.41 0.0181
vegfa −0.0351 (−0.067, −0.0033) −2.19 0.0311
mip1b 0.00516 (−0.0054, 0.016) 0.971 0.334
Interaction
gmcsf * mip1b −0.1 (−0.2, −0.0053) −2.1 0.0388
il15 * vegfa 0.0119 (0.002, 0.022) 2.39 0.0192

Figure 5.

For image description, please refer to the figure legend and surrounding text.

Expanding, contracting, and dynamic clones for 2 and 3 followup analysis, respectively. All P-values for MDT strata <10−8 in a generalized linear model.

3.5 Motif and nucleotide analysis

Motif analysis yielded visual indication of similar relative proportions of common motifs among expanding and static clones (Fig. 6a), suggesting there was not enrichment of one or another motif among expanding clones. In contrast, visual inspection of relative proportions of motifs among expanding clones stratified by MDT/non-MDT treatment status suggested the possibility of some difference, with slightly greater uniformity among motifs of MDT-induced expansions. The result could support the idea that expanding clones induced by MDT have some different motif characteristics than those present without MDT. Formal tests of differences in distributions were not significant, but the large number of motif categories underpowers the analysis. Despite being well-powered, we found no difference in CDR3 length between expanding, contracting, and static clones with respect to clonotype clustering. Likewise, there were only modest differences in average nucleotide edit distance between expanding and static clones, matching within person for the number of clones being compared, by a t-test and Wilcoxon rank-sum (P = 0.25), with those expanding having a slightly greater average edit distance.

Figure 6.

For image description, please refer to the figure legend and surrounding text.

Common motifs stratified by expansion status and MDT.

4 Discussion

In this work, we explored how the TCR repertoire and its longitudinal changes are influenced by MDT and in turn have bearing on patient response as measured by progression-free survival independent of and in combination with MDT. We have also tried to characterize the nature of longitudinal clonal trajectories, be they translations or scalings, and explored how determination as a clonal expansion or contraction may be related to enrichment of particular gene families, baseline biomarkers, and receptor motifs.

An important and confirmatory insight of our analyses is that clonal expansions may have some association with patient prognosis both marginally and, weaker, within strata of MDT, contractions, and adjusted for measures of comorbidity. The suggestion is that patients with a stronger or broader immune response with respect to the number of expanding clonotypes may be associated with later disease progression. Because one of the clearer signals from our study is that randomized MDT significantly increases the number of expanding clones, interpretation of the modest association with PFS should be viewed with caution as it is confounded by MDT. While our study constitutes a relatively large prospective cohort of TCR sequenced individuals, we are still underpowered on 53 PFS events from 97 patients and so analyses on future, larger cohorts are warranted.

Much important methodological work has focused on VDJ genes, but our proposal takes an important step toward systematizing assessment of enrichment between VJ gene families in the T cell receptor. Because of the generality of our framework, one can further analyze interaction with other characteristics of the clonotype such as whether it expanded, contracted, or was static. Our analyses revealed interesting enrichment between several V and J gene families in addition to interaction between expanding clones and one particular V gene family. This latter result in combination with visual suggestion from Fig. 6b implies there exist subtle differences between the clonotypes expanding in response to MDT versus in the absence of it.

Supplementary Material

btag659_Supplementary_Data

Acknowledgements

The authors wish to thank anonymous reviewers for comments that improved the manuscript.

Contributor Information

David Swanson, Department of Biostatistics, University of Texas MD Anderson Cancer Center, Houston, TX, United States.

Alexander Sherry, Department of Radiation Oncology, Mayo Clinic, Rochester, MN, United States.

Cara Haymaker, Department of Translational Molecular Pathology, University of Texas MD Anderson Cancer Center, Houston, TX, United States.

Alexandre Reuben, Departments of Thoracic, Head and Neck Medical Oncology, University of Texas MD Anderson Cancer Center, Houston, TX, United States.

Chad Tang, Department of Radiation Oncology, University of Texas MD Anderson Cancer Center, Houston, TX, United States.

Author contributions

David Swanson (Conceptualization [Lead], Data curation [Lead], Formal analysis [Lead], Methodology [Lead], Writing—original draft [Lead], Writing—review & editing [Lead]), Alexander Sherry (Conceptualization [Supporting], Data curation [Supporting], Funding acquisition [Equal], Resources [Equal], Writing—review & editing [Supporting]), Alexandre Reuben (Data curation [Supporting], Funding acquisition [Supporting], Resources [Supporting], Writing—review & editing [Supporting]), Cara Haymaker (Data curation [Supporting], Funding acquisition [Supporting], Resources [Supporting], Writing—review & editing [Supporting]), and Chad Tang (Conceptualization [Supporting], Funding acquisition [Lead], Investigation [Supporting], Resources [Lead], Writing—review & editing [Supporting])

Supplementary material

Supplementary material is available at Bioinformatics online.

Conflicts of interest

None declared.

Funding

This research received support from the National Cancer Institute grant P30 CA016672, the Cancer Prevention and Research Institute of Texas (CPRIT) grant Rp180140, and the Andrew Sabin Family Fellowship.

Data availability

The data underlying this article cannot be shared publicly due to patient confidentiality. The data will be shared on reasonable request to the corresponding author. Example data for model fitting is available at the Zenodo link provided.

References

  1. Agresti A.  Categorical Data Analysis. Hoboken: John Wiley & Sons, 2013. [Google Scholar]
  2. Bensouda Koraichi M, Ferri S, Walczak AM  et al.  Inferring the T cell repertoire dynamics of healthy individuals. Proc Natl Acad Sci U S A  2023;120:e2207516120. 10.1073/pnas.2207516120 [DOI] [PMC free article] [PubMed] [Google Scholar]
  3. Betancourt M, Girolami M.  Hamiltonian Monte Carlo for hierarchical models. Curr Trends Bayesian Methodol Appl  2015;79:2–4. [Google Scholar]
  4. Casella G, Berger R.  Statistical Inference. Boca Raton: CRC Press, 2024. [Google Scholar]
  5. Castorina LV, Noakes MT, Pisani L  et al.  HLA alleles shape distinct biases in the usage preferences of tcr v β segments. Front Immunol  2026;17:1816068. [DOI] [PMC free article] [PubMed] [Google Scholar]
  6. Chen L, Hu Y, Zheng B  et al.  Human TCR repertoire in cancer. Cancer Med  2024;13:e70164. 10.1002/cam4.70164 [DOI] [PMC free article] [PubMed] [Google Scholar]
  7. Chen Y, Xiao W, Yuan S  et al.  Characteristics and specific differential gene analysis of the tcr immune repertoire in secondary adult HLH lymphocytes. Immunol Lett  2025;275:107023. 10.1016/j.imlet.2025.107023 [DOI] [PubMed] [Google Scholar]
  8. Chen Y-T, Hsu H-C, Lee Y-S  et al.  Longitudinal high-throughput sequencing of the T-cell receptor repertoire reveals dynamic change and prognostic significance of peripheral blood TCR diversity in metastatic colorectal cancer during chemotherapy. Front Immunol  2021;12:743448. 10.3389/fimmu.2021.743448 [DOI] [PMC free article] [PubMed] [Google Scholar]
  9. Cox DR.  Regression models and life-tables. J R Stat Soc Ser B (Methodological)  1972;34:187–202. 10.1111/j.2517-6161.1972.tb00899.x [DOI] [Google Scholar]
  10. DeWitt WS, Emerson RO, Lindau P  et al.  Dynamics of the cytotoxic T cell response to a model of acute viral infection. J Virol  2015;89:4517–26. 10.1128/JVI.03474-14 [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. Fisher RA.  On the interpretation of x2 from contingency tables, and the calculation of P. J R Stat Soc  1922;85:87–94. 10.2307/2340521 [DOI] [Google Scholar]
  12. Fisher RA.  Statistical Methods for Research Workers. Number 5. Oliver and Boyd, 1928. [Google Scholar]
  13. Girolami M, Calderhead B.  Riemann manifold Langevin and Hamiltonian Monte Carlo methods. J R Stat Soc Ser B Stat Methodol  2011;73:123–214. 10.1111/j.1467-9868.2010.00765.x [DOI] [Google Scholar]
  14. Guo L, Bi X, Li Y  et al.  Characteristics, dynamic changes, and prognostic significance of TCR repertoire profiling in patients with renal cell carcinoma. J Pathol  2020;251:26–37. 10.1002/path.5396 [DOI] [PMC free article] [PubMed] [Google Scholar]
  15. Hoffman MD, Gelman A.  The No-U-Turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. J Mach Learn Res  2014;15:1593–623. [Google Scholar]
  16. Jokinen E, Huuhtanen J, Mustjoki S  et al.  Predicting recognition between T cell receptors and epitopes with TCRGP. PLoS Comput Biol  2021;17:e1008814. 10.1371/journal.pcbi.1008814 [DOI] [PMC free article] [PubMed] [Google Scholar]
  17. Kidman J, Principe N, Watson M  et al.  Characteristics of TCR repertoire associated with successful immune checkpoint therapy responses. Front Immunol  2020;11:587014. 10.3389/fimmu.2020.587014 [DOI] [PMC free article] [PubMed] [Google Scholar]
  18. Laird NM, Ware JH.  Random-effects models for longitudinal data. Biometrics  1982;38:963–74. 10.2307/2529876 [DOI] [PubMed] [Google Scholar]
  19. Lim M, Hastie T.  Learning interactions via hierarchical group-lasso regularization. J Comput Graph Stat  2015;24:627–54. 10.1080/10618600.2014.938812 [DOI] [PMC free article] [PubMed] [Google Scholar]
  20. Little RJ.  Missing data analysis. Annu Rev Clin Psychol  2024;20:149–73. 10.1146/annurev-clinpsy-080822-051727 [DOI] [PubMed] [Google Scholar]
  21. Little RJ, Rubin DB.  Statistical Analysis with Missing Data. Hoboken: John Wiley & Sons, 2019. [Google Scholar]
  22. Ludmir EB, Sherry AD, Fellman BM  et al.  Addition of metastasis-directed therapy to systemic therapy for oligometastatic pancreatic ductal adenocarcinoma (EXTEND): a multicenter, randomized phase II trial. JCO  2024;42:603. 10.1200/JCO.2024.42.3_suppl.603 [DOI] [PMC free article] [PubMed] [Google Scholar]
  23. Ma L, Yang L, Bin Shi X  et al.  Analyzing the CDR3 repertoire with respect to TCR—beta chain V-D-J and V-J rearrangements in peripheral T cells using HTS. Sci Rep  2016;6:29544. 10.1038/srep29544 [DOI] [PMC free article] [PubMed] [Google Scholar]
  24. Meinshausen N, Bühlmann P.  Stability selection. J R Stat Soc Ser B Stat Methodol  2010;72:417–73. 10.1111/j.1467-9868.2010.00740.x [DOI] [Google Scholar]
  25. Pan M, Tan Y, Wang YT  et al.  Quantitative and large-scale investigation of human TCR-HLA cross-reactivity. Sci Adv  2025;11:eadx1751. 10.1126/sciadv.adx1751 [DOI] [PMC free article] [PubMed] [Google Scholar]
  26. R Core Team. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing, 2022. https://www.R-project.org/. [Google Scholar]
  27. Rosner BA.  Fundamentals of Biostatistics, Vol. 6. Belmont, CA: Thomson-Brooks/Cole, 2006. [Google Scholar]
  28. Rytlewski J, Deng S, Xie T  et al.  Model to improve specificity for identification of clinically-relevant expanded T cells in peripheral blood. PLoS One  2019;14:e0213684. 10.1371/journal.pone.0213684 [DOI] [PMC free article] [PubMed] [Google Scholar]
  29. Sherry AD, Bathala TK, Liu S  et al.  Definitive local consolidative therapy for oligometastatic solid tumors: results from the lead-in phase of the randomized basket trial EXTEND. Int J Radiat Oncol Biol Phys  2022;114:910–8. 10.1016/j.ijrobp.2022.05.023 [DOI] [PMC free article] [PubMed] [Google Scholar]
  30. Shugay M, Bagaev DV, Zvyagin IV  et al.  VDJdb: a curated database of T-cell receptor sequences with known antigen specificity. Nucleic Acids Res  2018;46:D419–27. 10.1093/nar/gkx760 [DOI] [PMC free article] [PubMed] [Google Scholar]
  31. Stan Development Team. Stan Reference Manual. https://mc-stan.org, 2024.
  32. Tibshirani R.  Regression shrinkage and selection via the lasso. J R Stat Soc Ser B Stat Methodol  1996;58:267–88. 10.1111/j.2517-6161.1996.tb02080.x [DOI] [Google Scholar]
  33. Valpione S, Galvani E, Tweedy J  et al.  Immune awakening revealed by peripheral T cell dynamics after one cycle of immunotherapy. Nat Cancer  2020;1:210–21. 10.1038/s43018-019-0022-x [DOI] [PMC free article] [PubMed] [Google Scholar]
  34. Wang Q, Feng D, Song Y  et al.  Biased usage of V/D/J genes and clonal diversity in IgG repertoires correlates with disease activity and clinical features in systemic autoimmune diseases. Immunol Invest  2025;54:1461–81. 10.1080/08820139.2025.2550374 [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

btag659_Supplementary_Data

Data Availability Statement

The data underlying this article cannot be shared publicly due to patient confidentiality. The data will be shared on reasonable request to the corresponding author. Example data for model fitting is available at the Zenodo link provided.


Articles from Bioinformatics are provided here courtesy of Oxford University Press

RESOURCES