{'fraction_non_alphanumeric': 0.03435929215726778, 'fraction_numerical': 0.015974660882737725, 'mean_word_length': 5.02655601659751, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Use of machine learning to identify a T cell response to SARS-CoV-2

Summary The identification of SARS-CoV-2-specific T cell receptor (TCR) sequences is critical for understanding T cell responses to SARS-CoV-2. Accordingly, we reanalyze publicly available data from SARS-CoV-2-recovered patients who had low-severity disease (n = 17) and SARS-CoV-2 infection-naive (control) individuals (n = 39). Applying a machine learning approach to TCR beta (TRB) repertoire data, we can classify patient/control samples with a training sensitivity, specificity, and accuracy of 88.2%, 100%, and 96.4% and a testing sensitivity, specificity, and accuracy of 82.4%, 97.4%, and 92.9%, respectively. Interestingly, the same machine learning approach cannot separate SARS-CoV-2 recovered from SARS-CoV-2 infection-naive individual samples on the basis of B cell receptor (immunoglobulin heavy chain; IGH) repertoire data, suggesting that the T cell response to SARS-CoV-2 may be more stereotyped and longer lived. Following validation in larger cohorts, our method may be useful in detecting protective immunity acquired through natural infection or in determining the longevity of vaccine-induced immunity.


In Brief
To understand T cell responses to SARS-CoV-2, Shoukat et al. analyze TCR beta repertoire data from recovered COVID-19 patients and SARS-CoV-2 infection-naïve controls. Their machine learning approach can classify samples with up to 96.4% training accuracy and 92.9% testing accuracy. This method may detect T-cell responses acquired through natural infection or vaccination.

INTRODUCTION
The identification of public SARS-CoV-2-specific T cell receptor (TCR) sequences, that is those TCR sequences shared between individuals who have recovered from the infection, is critical for understanding T cell responses to SARS-CoV-2. A recent study of T and B cell receptor (BCR) repertoires from coronavirus disease 2019  patients demonstrated an association between TCR and BCR repertoire data and severity of disease. 1 Datasets from this study provide opportunities to look for a TCR/BCR signature of a SARS-CoV-2 adaptive immune response in patients who have recovered, comparing their samples with those from SARS-CoV-2 infection-naive (control) individuals as a first step toward identifying a signal that might indicate that an individual has protective immunity to SARS-CoV-2. Detection of such a signal could be useful in indicating that an individual has developed protective immunity through natural infection or in post-vaccination follow-up when considering the longevity of vaccine-induced immunity.
Until a safe and effective vaccine becomes widely available, determining likely protective immunity to SARS-CoV-2 at an individual level is paramount 2 both for healthcare personnel and to enable wider society to return to a level of normality, with attendant economic recovery. Immune status may be assessed by testing for SARS-CoV-2-specific antibodies, although it remains unclear whether the presence of antibodies confers robust SARS-CoV-2 protective immunity, 3 and studies of other human coronaviruses have demonstrated re-infection despite the presence of virus-specific antibodies. 4 Antibody decay, a recognized phenomenon in response to other human coronaviruses, 5 occurs in post-COVID-19 patients. 2,6 This is more common in individuals who experienced mild/asymptomatic infection and had low antibody titers in the early convalescent period. 7 Complete absence of a detectable antibody response is also described in some individuals following mild/asymptomatic infection. 8 Transient or absent humoral responses to SARS-CoV-2 may be due to dysregulated induction of B cell responses, likely correlating with observations of ineffective differentiation of T follicular helper cells and a reduction in Bcl6+ germinal center B cell levels. 9 Despite these poor humoral responses, recent studies reveal that seronegative individuals with mild or no symptoms and seronegative but exposed family members can produce a SARS-CoV-2-specific T cell response. 10,11 Longitudinal studies in other human coronaviruses suggest virus-specific T cell responses are more enduring than antibodies, persisting for at least 11 years. 5,12 T cell analysis may therefore represent a longer lasting and more sensitive means of evaluating immunity and might be particularly important in individuals experiencing mild/asymptomatic infection, who are less likely to have undergone RNAbased testing for active viral infection 2 and may have no detectable antibodies to SARS-CoV-2. 7,8 The nucleic acid sequence is first translated to amino acid sequences, and functional CDR3 regions are defined with MiXCR. To take account of similar, but not clonotypically identical, TCR sequences, the entire CDR3 sequence of each TCR is split into short overlapping segments of length k, designated kmers, where k = 3-9 amino acids. Because the same kmer occurring at substantially different positions within the CDR3 is likely to differ in its effect on antigen binding, we positionally annotated kmers (start/middle/end) in the functional CDR3s. For example, the kmer sequence CARDR occurring toward the N terminus of a CDR3 sequence is regarded as distinct from the kmer sequence CARDR located toward the C terminus. In each patient sample, kmer frequencies are normalized and the 1,000 most frequent kmers are selected. Individual patient data are then merged into a single frequency matrix. Principal-component analysis (PCA) is used to reduce dimensionality while retaining major sources of variation, simplifying downstream computational steps. To classify samples, hierarchical clustering is applied to a subset of the principal components (PCs); this iteratively groups together samples forming a dendrogram. Samples for which the true underlying disease status is known are used to select optimal parameter sets, consisting of the value of k and the subsets of PCs, by means of a machine learning approach (i.e., to train the model). Selection of the value of k and the subsets of PCs essentially constitutes the machine learning component. The optimal parameters generate separate clusters for each immune state (i.e., SARS-CoV-2 recovered versus SARS-CoV-2 naive). For each kmer length, the first 10 PCs are considered in all possible combinations. To test the model, a leave-one-out-cross-validation approach is used, where each sample is iteratively removed and reintroduced. Upon reintroduction, the sample is blindly assessed as either a healthy or post-SARS-CoV-2 sample, based on which cluster it falls into. (B) Analyzing the TRB data, a kmer length of 5 achieved greatest accuracy, with a top accuracy score of 96.4% (54/56 samples classified correctly). Here, 2 PC combinations gave 96.4% accuracy, with PC subset 2, 3, 4, 7, and 8 giving the greatest separation between diagnostic groups, with the greatest vertical distance (mutual reachability distance) between branches on the cluster plot. A range of other PC combinations also gave training classification accuracies >90% (not shown), indicating the robustness of our approach. (C) Bar chart for TRB data, demonstrating training accuracy, sensitivity, and specificity compared with testing accuracy, sensitivity, and specificity, produced using the leave-one-out-cross-validation approach. (D) Accuracy of best performing cluster analyses for TRB kmers of length 5 for 100 randomly labeled permutations of the patient data, giving a mean best score of 40.6/56 or 72. 5 Similarly, we recently demonstrated that machine-learningbased analysis of TCR repertoires from duodenal gamma/delta T cells can separate patients with celiac disease from controls with R91% accuracy. 16 We chose to investigate whether a similar approach could identify individuals who had recovered from SARS-CoV-2 infection.

RESULTS
To investigate whether TCR/BCR analysis can identify patients with evidence of adaptive responses to SARS-CoV-2, we passed repertoire data from Schultheiß et al. 1 through our TCR/BCR classification algorithm and compared samples from SARS-CoV-2-recovered patients who had had low-severity disease (n = 17) with the SARS-CoV-2 infection-naive (control) cohort (n = 39). Our classification approach is based on the hypothesis that there are multiple related TCR/BCR sequences with similar specificities capable of binding SARS-CoV-2 antigens, permitting training of a machine learning algorithm to cluster these samples together by analyzing the amino acid sequence of the hypervariable part of the TCR/BCR complementarity determining region 3 (CDR3) ( Figure 1A). 17 To take account of closely related sequences, we break the CDR3 sequences into overlapping kmers (amino acid sequences of length k, range 3-9), label the kmers with their position within the CDR3 sequence (start/middle/end), and compile a matrix detailing frequency of each kmer in each sample ( Figure 1A). To focus on kmers most likely involved in immune responses, only the 1,000 most frequent kmers in each sample were analyzed. To decrease dimensionality of the data, we take principal components (PCs) and perform hierarchical clustering on the basis of these PCs, selecting the kmer length and PC combination that gives the greatest clustering accuracy.
We noted from the publication by Schultheiß et al. 1 that the samples could not be reliably separated by TRB clonality, Shannon diversity, or richness score. To further assess the robustness of our result, we performed a permutation test in which we randomly permuted the sample labels and attempted to separate the random groups using our methodology, testing the same range of parameters as we did for the true labels. In each of the 100 random groups, we considered all combinations of the first 10 PCs and recorded the maximum accuracy achieved for each random group. This gave a mean maximum accuracy score across all 100 permutations of 40.6/56 (72.5%; range = 63.3%-82.1%), compared with 54/56 (96.4%) for the training dataset (p < 0.01; permutation test; Figure 1D). We applied the same methodology to the B cell repertoire (IGH) datasets ( Figures 1E-1G) and were not able to separate the two groups by this means.

DISCUSSION
Here, we demonstrate successful application of a machine learning method to the analysis of peripheral blood TCR sequence data in order to separate a cohort on the basis of whether or not individuals have previously had low-severity SARS-CoV-2 infection. Our identification of a TCR/BCR signature of a SARS-CoV-2 adaptive immune response in patients who have recovered, comparing their samples with those from SARS-CoV-2 infection-naive (control) individuals, represents a first step toward identifying a signal that might indicate that an individual has protective immunity to SARS-CoV-2. We particularly focused on low severity, because it is individuals who have recovered from asymptomatic or mildly symptomatic SARS-CoV-2 infection who are least likely to undergo testing for viral infection and thus least likely to know their immune status.
Although our methodology was successful for the analysis of TRB repertoire data ( Figures 1A-1D), it could not separate the cohort into SARS-CoV-2 recovered and SARS-CoV-2 infection-naive on the basis of BCR (IGH) repertoire data ( Figures  1E-1G). This suggests a more stereotyped and possibly longer-lived T cell response to SARS-CoV-2. This result is also consistent with Schultheiß et al.'s observation of enriched shared TCR compared with BCR motifs between SARS-CoV-2 recovered patients. 1 Considering longevity of anti-coronavirus T cell responses 12 and anti-SARS-CoV-2 T cell, but not antibody responses, in individuals with previous mild COVID-19, 10 our data indicate that analysis of TCR sequences, rather than serological assays, shows greater promise for identifying long-lived SARS-CoV-2 adaptive immune responses. Although, in some studies, T cell analysis in COVID-19 has been complicated by cross-reactivity with T cell responses generated through exposure to ''common cold'' coronaviruses, 18,19 the ability of our method to correctly classify SARS-CoV-2 infection-naive individuals suggests that any pre-existing T cell immunity to endemic coronaviruses does not confound the SARS-CoV-2 specificity of our approach. Importantly, further studies of larger cohorts are required to validate our findings and to investigate the longevity of T cell immunity to SARS-CoV-2, as well as providing further insight into the relative importance of TCR and antibody-mediated immunity to SARS-CoV-2.
In summary, we describe a machine learning approach to TCR repertoire analysis that, when applied to a TRB dataset, 1 can accurately identify prior SARS-CoV-2 infection from long-lasting TRB profiles. The Biomed-2 primer sets used for TCR amplification in this study 1 are already in clinical use for the diagnosis of lymphoma and leukemia. Therefore, this method is amenable to existing diagnostic pathways in fully accredited clinical laboratories and could be rapidly scaled up, permitting the introduction of a novel test for immunity to SARS-CoV-2.

Limitations of study
This is a small and preliminary study, utilizing an analytical approach that we have previously successfully applied to the diagnosis of celiac disease using duodenal biopsy samples. 16 A larger dataset with separate training and test sets is required to corroborate our findings. Such a dataset will ideally need to have been generated using the same TCR/BCR repertoire sequencing methodology, preferably in one or more separate laboratories, to investigate the effect of laboratory-to-laboratory variation in sequencing methodology. A subsequent study to corroborate our findings using datasets produced with different TCR/BCR repertoire sequencing methods is ideally required to provide broader corroboration of the bioinformatic method. The methodology also requires validation on additional datasets drawn from different racial groups and/or individuals with different HLA types, as these may confound the analysis. Finally, the current study does not provide proof that the signal we identify is indicative of protective immunity, and individuals with a TCR signal indicative of a T cell immune response to SARS-CoV-2, as identified by our method, would need to be followed up to determine whether they can still become infected with SARS-CoV-2.

STAR+METHODS
Detailed methods are provided in the online version of this paper and include the following: