<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Immunol.</journal-id>
<journal-title>Frontiers in Immunology</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Immunol.</abbrev-journal-title>
<issn pub-type="epub">1664-3224</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/fimmu.2019.02533</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Immunology</subject>
<subj-group>
<subject>Technology and Code</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title><monospace>sumrep</monospace>: A Summary Statistic Framework for Immune Receptor Repertoire Comparison and Model Validation</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name><surname>Olson</surname> <given-names>Branden J.</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<xref ref-type="aff" rid="aff2"><sup>2</sup></xref>
<xref ref-type="corresp" rid="c001"><sup>&#x0002A;</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/753906/overview"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Moghimi</surname> <given-names>Pejvak</given-names></name>
<xref ref-type="aff" rid="aff3"><sup>3</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/776401/overview"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Schramm</surname> <given-names>Chaim A.</given-names></name>
<xref ref-type="aff" rid="aff4"><sup>4</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/375370/overview"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Obraztsova</surname> <given-names>Anna</given-names></name>
<xref ref-type="aff" rid="aff5"><sup>5</sup></xref>
<xref ref-type="aff" rid="aff6"><sup>6</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/556224/overview"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Ralph</surname> <given-names>Duncan</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/614430/overview"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Vander Heiden</surname> <given-names>Jason A.</given-names></name>
<xref ref-type="aff" rid="aff7"><sup>7</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/113039/overview"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Shugay</surname> <given-names>Mikhail</given-names></name>
<xref ref-type="aff" rid="aff5"><sup>5</sup></xref>
<xref ref-type="aff" rid="aff6"><sup>6</sup></xref>
<xref ref-type="aff" rid="aff8"><sup>8</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/104866/overview"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Shepherd</surname> <given-names>Adrian J.</given-names></name>
<xref ref-type="aff" rid="aff3"><sup>3</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/406312/overview"/>
</contrib>
<contrib contrib-type="author">
<name><surname>Lees</surname> <given-names>William</given-names></name>
<xref ref-type="aff" rid="aff3"><sup>3</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/394840/overview"/>
</contrib>
<contrib contrib-type="author" corresp="yes">
<name><surname>Matsen</surname> <given-names>Frederick A.</given-names> <suffix>IV</suffix></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<xref ref-type="corresp" rid="c002"><sup>&#x0002A;</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/799074/overview"/>
</contrib>
</contrib-group>
<aff id="aff1"><sup>1</sup><institution>Fred Hutchinson Cancer Research Center</institution>, <addr-line>Seattle, WA</addr-line>, <country>United States</country></aff>
<aff id="aff2"><sup>2</sup><institution>Department of Statistics, University of Washington</institution>, <addr-line>Seattle, WA</addr-line>, <country>United States</country></aff>
<aff id="aff3"><sup>3</sup><institution>Department of Biological Sciences, Institute of Structural and Molecular Biology, Birkbeck, University of London</institution>, <addr-line>London</addr-line>, <country>United Kingdom</country></aff>
<aff id="aff4"><sup>4</sup><institution>Vaccine Research Center, National Institute of Allergy and Infectious Diseases, National Institutes of Health</institution>, <addr-line>Bethesda, MD</addr-line>, <country>United States</country></aff>
<aff id="aff5"><sup>5</sup><institution>Center of Life Sciences, Skolkovo Institute of Science and Technology</institution>, <addr-line>Moscow</addr-line>, <country>Russia</country></aff>
<aff id="aff6"><sup>6</sup><institution>Genomics of Adaptive Immunity Department, Shemyakin and Ovchinnikov Institute of Bioorganic Chemistry</institution>, <addr-line>Moscow</addr-line>, <country>Russia</country></aff>
<aff id="aff7"><sup>7</sup><institution>Department of Bioinformatics and Computational Biology, Genentech, Inc.</institution>, <addr-line>South San Francisco, CA</addr-line>, <country>United States</country></aff>
<aff id="aff8"><sup>8</sup><institution>Department of Molecular Technologies, Pirogov Russian National Research Medical University</institution>, <addr-line>Moscow</addr-line>, <country>Russia</country></aff>
<author-notes>
<fn fn-type="edited-by"><p>Edited by: Patrick C. Wilson, University of Chicago, United States</p></fn>
<fn fn-type="edited-by"><p>Reviewed by: Sarah Cobey, University of Chicago, United States; Scott Dexter Boyd, Stanford University, United States</p></fn>
<corresp id="c001">&#x0002A;Correspondence: Branden J. Olson <email>branden.olson&#x00040;gmail.com</email></corresp>
<corresp id="c002">Frederick A. Matsen IV <email>ematsen&#x00040;gmail.com</email></corresp>
<fn fn-type="other" id="fn001"><p>This article was submitted to B Cell Biology, a section of the journal Frontiers in Immunology</p></fn></author-notes>
<pub-date pub-type="epub">
<day>01</day>
<month>11</month>
<year>2019</year>
</pub-date>
<pub-date pub-type="collection">
<year>2019</year>
</pub-date>
<volume>10</volume>
<elocation-id>2533</elocation-id>
<history>
<date date-type="received">
<day>19</day>
<month>07</month>
<year>2019</year>
</date>
<date date-type="accepted">
<day>11</day>
<month>10</month>
<year>2019</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2019 Olson, Moghimi, Schramm, Obraztsova, Ralph, Vander Heiden, Shugay, Shepherd, Lees and Matsen.</copyright-statement>
<copyright-year>2019</copyright-year>
<copyright-holder>Olson, Moghimi, Schramm, Obraztsova, Ralph, Vander Heiden, Shugay, Shepherd, Lees and Matsen</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p></license>
</permissions>
<abstract><p>The adaptive immune system generates an incredible diversity of antigen receptors for B and T cells to keep dangerous pathogens at bay. The DNA sequences coding for these receptors arise by a complex recombination process followed by a series of productivity-based filters, as well as affinity maturation for B cells, giving considerable diversity to the circulating pool of receptor sequences. Although these datasets hold considerable promise for medical and public health applications, the complex structure of the resulting adaptive immune receptor repertoire sequencing (AIRR-seq) datasets makes analysis difficult. In this paper we introduce <monospace>sumrep</monospace>, an R package that efficiently performs a wide variety of repertoire summaries and comparisons, and show how <monospace>sumrep</monospace> can be used to perform model validation. We find that summaries vary in their ability to differentiate between datasets, although many are able to distinguish between covariates such as donor, timepoint, and cell type for BCR and TCR repertoires. We show that deletion and insertion lengths resulting from V(D)J recombination tend to be more discriminative characterizations of a repertoire than summaries that describe the amino acid composition of the CDR3 region. We also find that state-of-the-art generative models excel at recapitulating gene usage and recombination statistics in a given experimental repertoire, but struggle to capture many physiochemical properties of real repertoires.</p></abstract> <kwd-group>
<kwd>repertoire comparison</kwd>
<kwd>model validation</kwd>
<kwd>rep-seq</kwd>
<kwd>B cell receptor</kwd>
<kwd>T cell receptor</kwd>
<kwd>summary statistics</kwd>
</kwd-group>
<contract-num rid="cn001">R01-AI120961</contract-num>
<contract-num rid="cn001">R01-AI138709</contract-num>
<contract-num rid="cn001">R01-GM113246</contract-num>
<contract-num rid="cn001">U19-AI117891</contract-num>
<contract-num rid="cn002">55108544</contract-num>
<contract-sponsor id="cn001">National Institutes of Health<named-content content-type="fundref-id">10.13039/100000002</named-content></contract-sponsor>
<contract-sponsor id="cn002">Howard Hughes Medical Institute<named-content content-type="fundref-id">10.13039/100000011</named-content></contract-sponsor>
<counts>
<fig-count count="9"/>
<table-count count="1"/>
<equation-count count="9"/>
<ref-count count="45"/>
<page-count count="19"/>
<word-count count="9862"/>
</counts>
</article-meta>
</front>
<body>
<sec sec-type="intro" id="s1">
<title>Introduction</title>
<p>B cells and T cells play critical roles in adaptive immunity through the cooperative identification of, and response to, antigens. The random rearrangement process of the genes that construct B cell receptors (BCRs) and T cell receptors (TCRs) allows for the recognition of a highly diverse set of antigen epitopes. We refer to the set of B and T cell receptors present in an individual&#x00027;s immune system as their immune receptor repertoire; this dynamic repertoire constantly changes over the course of an individual&#x00027;s lifetime due to antigen exposure and the effects of aging.</p>
<p>Although immune receptor repertoires are now accessible for scientific research and medical applications through high-throughput sequencing, it is not necessarily straightforward to gain insight from and to compare these datasets. Indeed, if these datasets are not processed, they are simply a list of DNA sequences. After annotation one can compare gene usage (<xref ref-type="bibr" rid="B1">1</xref>&#x02013;<xref ref-type="bibr" rid="B6">6</xref>) and CDR3 sequences. This can be a highly involved task, and so it is common to simply compare the gene usage frequencies and CDR3 length distributions of repertoire (<xref ref-type="bibr" rid="B7">7</xref>, <xref ref-type="bibr" rid="B8">8</xref>), leaving the full richness of the CDR3 sequence and potentially interesting aspects of the germline-encoded regions unanalyzed.</p>
<p>An alternative strategy is to transform a repertoire to a more convenient space and compare the transformed quantities according to some distance. For example, several studies reduce a set of nucleotide sequences to <italic>k</italic>mer distributions for classification of immunization status or disease exposure (<xref ref-type="bibr" rid="B9">9</xref>&#x02013;<xref ref-type="bibr" rid="B11">11</xref>), where a <italic>k</italic>mer is a nucleotide subsequence of size <italic>k</italic>. These <italic>k</italic>mer distributions can then be compared via sequence-based distances, but still comprise a large space and lose important information about where the <italic>k</italic>mer appears along the sequence. One can perform other dimension reduction techniques such as t-SNE to project repertoires down to an even smaller space (<xref ref-type="bibr" rid="B12">12</xref>), but these projections also discard a lot of information and can be difficult to interpret biologically.</p>
<p>While many biologically interpretable summaries such as physiochemical properties exist and have been widely applied (<xref ref-type="bibr" rid="B13">13</xref>&#x02013;<xref ref-type="bibr" rid="B16">16</xref>), these are often examined at the sequence level rather than the repertoire level.</p>
<p>We wish to facilitate the use of biologically interpretable summary statistics to capture many different aspects of AIRR-seq data. In addition to enabling comparison of different sequencing datasets, summary statistics can also be used to compare sequencing datasets to probabilistic models to which they have been fitted. Namely, one can use a form of model checking that is common in statistics: after fitting a model to data, one assesses the similarity of the model-generated data to the real data. In this case, we generate a repertoire of sequences from models and compare this collection to a real-data repertoire of sequences via summary statistics.</p>
<p>We are motivated to perform such comparison because these probabilistic models are used as part of inference, and because they are used for inferential tool benchmarking. Such generative models are used to simulate sequences as a &#x0201C;ground truth&#x0201D; for benchmarking inferential software (<xref ref-type="bibr" rid="B17">17</xref>&#x02013;<xref ref-type="bibr" rid="B19">19</xref>), and thus the accuracy of such benchmarks depends on the realism of the generated sequences. Simulation tools can also be used to generate a null distribution used to test for a specific effect, such as natural selection (<xref ref-type="bibr" rid="B20">20</xref>).</p>
<p>Currently, there are no unified packages dedicated to the task of calculating and comparing summary statistics for AIRR-seq datasets. While the Immcantation framework (which includes the <monospace>shazam</monospace> and <monospace>alakazam</monospace> R packages) contains many summary functions for AIRR-seq data (<xref ref-type="bibr" rid="B21">21</xref>), it does not have general functionality for retrieving, comparing, and plotting these summaries. Many summaries of interest are implemented in one package or another, but differences in functionality and data structures make it troublesome to compute and compare summaries across packages. Some summaries of interest, such as the distribution of positional distances between mutations, are not readily implemented in any package.</p>
<p>In this paper, we gather dozens of meaningful summary statistics on repertoires, derive efficient and robust summary implementations, and identify appropriate comparison methods for each summary. We present <monospace>sumrep</monospace>, an R package that computes these summary distributions for AIRR-seq datasets and performs repertoire comparisons based on these summaries. We investigate the effectiveness of various summary statistics in distinguishing between different experimental repertoires as well as between simulated and experimental data. We show that many summaries differentiate between various covariates by which the datasets are stratified. Further, we demonstrate how <monospace>sumrep</monospace> can be used for model validation through case studies of two state-of-the-art repertoire simulation tools: <monospace>IGoR</monospace> (<xref ref-type="bibr" rid="B19">19</xref>) applied to TRB sequences, and <monospace>partis</monospace> (<xref ref-type="bibr" rid="B17">17</xref>, <xref ref-type="bibr" rid="B22">22</xref>) applied to IGH sequences.</p></sec>
<sec sec-type="results" id="s2">
<title>Results</title>
<sec>
<title>Implementation</title>
<p>The full <monospace>sumrep</monospace> package along with the following analyses can be found at <ext-link ext-link-type="uri" xlink:href="https://github.com/matsengrp/sumrep">https://github.com/matsengrp/sumrep</ext-link>. It supports the IGH, IGK, and IGL loci for BCR datasets, and the TRA, TRB, TRD, and TRG loci for TCR datasets. It is open-source, unit-tested, and extensively documented, and uses default dataset fields and definitions that comply with the Adaptive Immune Receptor Repertoire (AIRR) Community Rearrangement schema (<xref ref-type="bibr" rid="B23">23</xref>). A reproducible installation procedure of <monospace>sumrep</monospace> is available using Docker (<xref ref-type="bibr" rid="B24">24</xref>).</p>
<p><xref ref-type="table" rid="T1">Table 1</xref> lists the summary statistics currently supported by <monospace>sumrep</monospace>, and includes the default assumed degree of annotation, clustering, and phylogenetic inference for each summary. The first group of statistics only requires the input or query sequences to be aligned to their inferred germline sequences (e.g., IMGT-aligned) and constrained to the variable region; this coincides with the presence of the <monospace>sequence_alignment</monospace> and <monospace>germline_alignment</monospace> fields in the AIRR schema (we note that some of these statistics, such as GC content, do not require an alignment in principle. However, we wished to encourage meaningful analyses and comparisons with our software, and thus require an alignment to avoid accidental comparison of non-corresponding sequence regions). The second group requires standard sequence annotations, such as inferred germline ancestor sequences for Ig loci, germline gene assignments, and indel statistics. The third group requires clonal family cluster assignments. The fourth group requires a inferred phylogeny for each clonal family of an Ig dataset. <monospace>sumrep</monospace> itself does not perform any annotation, clustering, or phylogenetic inference, but rather assumes such metadata are present in the given dataset; in principle, one can use any tool which performs these tasks as expected.</p>
<table-wrap position="float" id="T1">
<label>Table 1</label>
<caption><p>Currently supported summary statistics grouped by their respective degrees of assumed post-processing.</p></caption>
<table frame="hsides" rules="groups">
<thead><tr>
<th valign="top" align="left"><bold>Summary statistic</bold></th>
<th valign="top" align="left"><bold>Annotations</bold></th>
<th valign="top" align="left"><bold>Clustering</bold></th>
<th valign="top" align="left"><bold>Phylogeny</bold></th>
<th valign="top" align="left"><bold>Implementation</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Pairwise distance distribution</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>stringdist</monospace> (<xref ref-type="bibr" rid="B25">25</xref>)</td>
</tr>
<tr>
<td valign="top" align="left"><italic>k</italic>th nearest neighbor distribution</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>stringdist</monospace></td>
</tr>
<tr>
<td valign="top" align="left">GC-content distribution</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>ape</monospace> (<xref ref-type="bibr" rid="B26">26</xref>)</td>
</tr>
<tr>
<td valign="top" align="left">Hotspot motif count distribution</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>Biostrings</monospace> (<xref ref-type="bibr" rid="B27">27</xref>)</td>
</tr>
<tr style="border-bottom: thin solid #000000;">
<td valign="top" align="left">Coldspot motif count distribution</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>Biostrings</monospace> (<xref ref-type="bibr" rid="B27">27</xref>)</td>
</tr> <tr>
<td valign="top" align="left">CDR3 length distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided</td>
</tr>
<tr>
<td valign="top" align="left">Joint distribution of germline gene use</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>sumrep</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Pairwise CDR3 distance distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>stringdist</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Atchley factor distributions</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>HDMD</monospace> (<xref ref-type="bibr" rid="B28">28</xref>)</td>
</tr>
<tr>
<td valign="top" align="left">Kidera factor distributions</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>Peptides</monospace> (<xref ref-type="bibr" rid="B28">28</xref>)</td>
</tr>
<tr>
<td valign="top" align="left">Aliphatic index distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>Peptides</monospace></td>
</tr>
<tr>
<td valign="top" align="left">G.R.A.V.Y. index distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>alakazam</monospace> (<xref ref-type="bibr" rid="B21">21</xref>)</td>
</tr>
<tr>
<td valign="top" align="left">Polarity distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>alakazam</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Charge distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>alakazam</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Basicity distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>alakazam</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Acidity distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>alakazam</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Aromaticity distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>alakazam</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Bulkiness distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>alakazam</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Per-gene substitution rate</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided &#x0002B; <monospace>sumrep</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Per-gene-per-position substitution rate</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided &#x0002B; <monospace>sumrep</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Per-base substitution model</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>shazam</monospace> (<xref ref-type="bibr" rid="B21">21</xref>)</td>
</tr>
<tr>
<td valign="top" align="left">Per-base mutability model</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>shazam</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Positional distance between mutations distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>sumrep</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Distance from germline to sequence distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>stringdist</monospace></td>
</tr>
<tr>
<td valign="top" align="left">V gene 3&#x02032; deletion length distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided</td>
</tr>
<tr>
<td valign="top" align="left">V gene 5&#x02032; deletion length distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided</td>
</tr>
<tr>
<td valign="top" align="left">D gene 3&#x02032; deletion length distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided</td>
</tr>
<tr>
<td valign="top" align="left">D gene 5&#x02032; deletion length distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided</td>
</tr>
<tr>
<td valign="top" align="left">J gene 3&#x02032; deletion length distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided</td>
</tr>
<tr>
<td valign="top" align="left">J gene 5&#x02032; deletion length distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided</td>
</tr>
<tr>
<td valign="top" align="left">VD (or VJ) insertion length distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided</td>
</tr>
<tr>
<td valign="top" align="left">DJ insertion length distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided</td>
</tr>
<tr>
<td valign="top" align="left">VD (or VJ) insertion transition matrix</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>sumrep</monospace></td>
</tr>
<tr>
<td valign="top" align="left">DJ insertion transition matrix</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>sumrep</monospace></td>
</tr>
<tr style="border-bottom: thin solid #000000;">
<td valign="top" align="left">V/J in-frame percentage</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Tool-provided &#x0002B; <monospace>sumrep</monospace></td>
</tr> <tr>
<td valign="top" align="left">Cluster size distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left">Custom</td>
</tr>
<tr>
<td valign="top" align="left">Hill numbers (diversity indices)</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>alakazam</monospace></td>
</tr>
<tr style="border-bottom: thin solid #000000;">
<td valign="top" align="left">Selection estimates (using the BASELINe method)</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">No</td>
<td valign="top" align="left"><monospace>shazam</monospace></td>
</tr> <tr>
<td valign="top" align="left">Sackin index distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="left"><monospace>CollessLike</monospace> (<xref ref-type="bibr" rid="B29">29</xref>)</td>
</tr>
<tr>
<td valign="top" align="left">Colless-like index distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="left"><monospace>CollessLike</monospace></td>
</tr>
<tr>
<td valign="top" align="left">Cophenetic index distribution</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="center">Yes</td>
<td valign="top" align="left"><monospace>CollessLike</monospace></td>
</tr>
</tbody>
</table>
<table-wrap-foot>
<p><italic>Annotation denotes whether annotation of the V(D)J germline segment is required, Clustering denotes whether clonal clustering is required, and Phylogeny denotes whether lineage tree inference is required. &#x0201C;Tool-provided&#x0201D; means that the summary can be directly computed from the output of an annotation tool; for example, the CDR3 length distribution is exactly the frequencies of values in the <monospace>junction</monospace> column of the annotated dataset. Per-gene substitution rate is defined to be the number of observed mutations in sequences assigned to that gene, in the segment of the sequence assigned to that gene&#x00027;s region, divided by the length of the segment. Per-gene-per-position substitution rate is similarly defined, but separately computed for each position in the sequence</italic>.</p>
</table-wrap-foot>
</table-wrap>
<p><monospace>sumrep</monospace> contains many types of summaries, including nucleotide sequence-level summaries (pairwise distances, hotspot motif counts, etc.), rearrangement summaries like insertion and deletion lengths, and many physiochemical properties applicable to the amino acid sequences of particular receptor regions. The Atchley factors are a set of five numerical descriptions of amino acids derived using a statistical technique called factor analysis from a larger pool of 494 descriptors of amino acid biochemical properties (<xref ref-type="bibr" rid="B30">30</xref>). The Kidera factors are a similarly-constructed set of ten numerical descriptions of amino acids, which were derived using dimension reduction techniques (<xref ref-type="bibr" rid="B31">31</xref>). <monospace>sumrep</monospace> also includes summaries to be applied at the clonal family level (e.g., cluster size distribution) and the phylogenetic level in the case of BCR sequences (e.g., Sackin index distribution).</p>
<p><monospace>sumrep</monospace> makes it easy to compare summary statistics between two repertoires by equipping each summary with an appropriate divergence, or measure of dissimilarity, between instances of a summary. For example, the <monospace>getCDR3LengthDistribution</monospace> function returns a vector of each sequence&#x00027;s CDR3 length, and the corresponding <monospace>compareCDR3LengthDistributions</monospace> function takes two repertoires and returns a numerical summary of the dissimilarity between these two length distributions. The comparison method depends on the summary, which is discussed further in the Methods section. <monospace>sumrep</monospace> also includes a <monospace>compareRepertoires</monospace> function which takes two repertoires and returns as many summary comparisons as befit the data.</p>
<p><xref ref-type="fig" rid="F1">Figure 1</xref> illustrates the general framework of comparing summary statistics between two repertoires <italic>R</italic><sub>1</sub> and <italic>R</italic><sub>2</sub>. A given summary <italic>s</italic> is applied separately to <italic>R</italic><sub>1</sub> and <italic>R</italic><sub>2</sub>, which for most summaries yields a distribution of values (<xref ref-type="fig" rid="F1">Figure 1A</xref>). These two resultant distributions can be compared using a divergence <inline-formula><mml:math id="M2"><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow></mml:math></inline-formula> that is tailored to the nature of <italic>s</italic> (<xref ref-type="fig" rid="F1">Figure 1B</xref>). We use Jenson-Shannon (JS) divergence to compare scalar distributions (e.g., GC content, CDR3 length), which is a symmetrized version of KL-divergence, a weighted average log-ratio of frequencies widely-used in statistics and machine learning. We use the similarly popular &#x02113;<sub>1</sub> divergence to compare categorical distributions (e.g., gene call frequencies, amino acid frequencies), which is a sum of absolute differences of counts.</p>
<fig id="F1" position="float">
<label>Figure 1</label>
<caption><p>Cartoon of our summary statistic and divergence framework, and how this can be applied to validation of repertoire simulators. Steps <bold>(A,B)</bold> can be applied to compare arbitrary datasets, while <bold>(C,D)</bold> show how sumrep can be used for model validation. <bold>(A)</bold> Most summary statistics <italic>s</italic>, e.g., GC content, yield a distribution of values when applied to each of the sequences in a given repertoire <italic>R</italic>. <bold>(B)</bold> We can compare summary distributions using a statistical divergence <inline-formula><mml:math id="M1"><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow></mml:math></inline-formula>, which takes two distributions and outputs a nonnegative scalar. <bold>(C)</bold> For a given experimental dataset, we use simulator tools to generate a corresponding set of synthetic sequences. <bold>(D)</bold> We can compute many summaries of these repertoires yielding distributions for comparison.</p></caption>
<graphic xlink:href="fimmu-10-02533-g0001.tif"/>
</fig>
<p>We have designed <monospace>sumrep</monospace> to efficiently approximate computationally intensive summaries. When the target summary is a distribution, we can gain efficiency by repeatedly subsampling from the distribution until our estimate has stabilized. The result is an approximation to the full distribution; by introducing slight levels of noise, we can gain very substantial runtime performance improvements for large datasets. This in turn allows fast, accurate divergence estimates between dataset summaries. We outline a generic distribution approximation algorithm as well as a modified version for the nearest neighbor distance distribution in the Methods section, and conduct extensive empirical validation of these algorithms in <xref ref-type="supplementary-material" rid="SM1">Appendices A, B</xref>.</p>
<p><monospace>sumrep</monospace> additionally contains a plotting function for each univariate summary distribution. For example, the <monospace>getCDR3LengthDistribution</monospace> comes with a companion plotting function called <monospace>plotCDR3LengthDistribution</monospace>. <monospace>sumrep</monospace> also includes a master plotting function, <monospace>plotUnivariateDistributions</monospace>, which shows a gridded figure of all univariate distribution plots relevant to the locus in question which can be computed from the input dataset. Currently, these plotting functions support frequency polygons and empirical cumulative distribution functions (ECDFs). Examples of these plots can be found throughout later sections of this report.</p></sec>
<sec>
<title>Application of Summary Statistics to Experimental Data</title>
<p>To examine the ability of various summary statistics to distinguish among real repertoires, we applied <monospace>sumrep</monospace> to TCR and BCR datasets performed a multidimensional scaling (MDS) analysis of summary divergences. In particular, we computed divergences of each summary between each pair of repertoires, stratified by covariates such as individual, timepoint, and cell subset to form a dissimilarity matrix. We then mapped these dissimilarity matrices to an abstract Cartesian space using MDS.</p>
<p>For TCR repertoires, we used datasets from two individuals and five timepoints post-vaccination, with two replicate per donor-timepoint value, from Pogorelyy et al. (<xref ref-type="bibr" rid="B32">32</xref>). <xref ref-type="fig" rid="F2">Figure 2</xref> displays plots of the first two coordinates of each replicate grouped by donor and timepoint. We see that for almost all summaries, these points cluster according to donor identity, with the CDR3 pairwise distance distribution being the only summary that does not decisively cluster by donor. Many summaries additionally cluster according to timepoint in the second dimension, although the tightness of clustering varies by summary, with some summaries (e.g., DJ insertion length distribution) being tightly clustered by a given donor/timepoint value and some summaries (e.g., Kidera factor 4) not obviously clustering by donor/timepoint. Moreover, the D gene usage distribution for each individual splits into two distinct groups which do not correlate with timepoint, though the import of this is more difficult to assess. Although these patterns would require further exploration in a particular research context, these <monospace>sumrep</monospace> divergences show interesting patterns when TCR datasets are stratified by covariates.</p>
<fig id="F2" position="float">
<label>Figure 2</label>
<caption><p>Plots of summary divergence MDS coordinates for data from Pogorelyy et al. (<xref ref-type="bibr" rid="B32">32</xref>), grouped by donor and timepoint.</p></caption>
<graphic xlink:href="fimmu-10-02533-g0002.tif"/>
</fig>
<p>We performed a similar MDS analysis of summary divergences of BCR repertoires stratified by covariate, using data from Rubelt et al. (<xref ref-type="bibr" rid="B33">33</xref>). We computed divergences of each summary between each pair of a collection of datasets stratified by five pairs of twins as well as B cell classification as memory or naive to form a dissimilarity matrix. We then mapped these dissimilarity matrices to an abstract Cartesian space using MDS. <xref ref-type="fig" rid="F3">Figure 3</xref> displays plots of the first two coordinates of each donor grouped by twin pair identity and cell type. We see that for each summary, points can be separated according to cell subset, with some summaries (e.g., V gene usage, AA frequencies, acidity) clustering more tightly among cell subset, and others (e.g., GRAVY index, DJ insertion length) clustering more loosely. In addition, the naive repertoires appear to be more tightly clustered than the memory repertoires for each summary. Finally, for the gene usage statistics, there is a strong tendency for twins to have higher similarity than unrelated donors, although this tendency is not consistently observed for other statistics. For example, points for the amino acid 2mer frequency distribution divergences tend to have high similarity between twins, but the GRAVY index distribution divergences do not. Thus, there seem to also be interesting dynamics underlying <monospace>sumrep</monospace> divergences when BCR datasets are stratified by covariates, and the observed patterns merit further investigation.</p>
<fig id="F3" position="float">
<label>Figure 3</label>
<caption><p>Plots of summary divergence MDS coordinates for data from Rubelt et al. (<xref ref-type="bibr" rid="B33">33</xref>), grouped by twin pair identity and cell type (memory vs. naive).</p></caption>
<graphic xlink:href="fimmu-10-02533-g0003.tif"/>
</fig></sec>
<sec>
<title>Ranking Summary Statistic Informativeness</title>
<p>Due to the large number of summary statistics supported by <monospace>sumrep</monospace>, many of which are correlated, we sought an approach to identify a set of maximally-informative statistics that provide complimentary information to one another. To address this, we employed a lasso multinomial regression treating certain sequence-level summaries as covariates and dataset identity as the response. The basic idea is that this regression method cuts out all but a few predictor variables to find a smaller collection of informative summary statistics, as a coefficient is &#x0201C;allowed&#x0201D; to be nonzero only when the lasso deems it a relatively meaningful predictor. As the regularization parameter &#x003BB; is decreased, more and more coefficients become nonzero, leading to a natural ordering of summaries as the order in which their coefficient &#x0201C;branches off&#x0201D; from zero. Then a resultant maximally-informative set of <italic>k</italic> summaries is the set of summaries with the <italic>k</italic> best ranks. We formalize this approach in the Methods section (Algorithm 3).</p>
<p>One caveat to this approach is that we can only use sequence-level summary statistics as covariates in order to have a well-defined regression procedure. However, the majority of summaries considered in this report are applied at the sequence level. Thus, between the subset of informative sequence-level statistics and the remaining non-sequence-level statistics, we arrive at a considerably smaller set. Besides non-sequence-level summaries, we also omit Kidera Factors and Atchley factors from our analyses as these sets of statistics are orthogonal by construction according to particular measures of amino acid composition in their respective original contexts. This also leads to a much smaller design matrix and a substantially decreased runtime.</p>
<p><xref ref-type="fig" rid="F4">Figure 4A</xref> displays the results of applying Algorithm 3 to <monospace>IGoR</monospace> annotations of TRB sequences from datasets A4_i107, A4_i194, A5_S9, A5_S10, A5_S15, and A5_S22 from Britanova et al. (<xref ref-type="bibr" rid="B34">34</xref>). We see that recombination-based deletion lengths comprise four of the top five summaries, with recombination-based insertion lengths, CDR3 length, and various physiochemical CDR3 properties scattered over the remaining positions. There appears to be high variability throughout the range of rankings, with the bottom three statistics all having a ranking of one for at least one coefficient vector.</p>
<fig id="F4" position="float">
<label>Figure 4</label>
<caption><p>Boxplots of summary rank values taken over each dataset, in order of informativeness, as determined by the median order in which the summary branches off from the lasso paths in <xref ref-type="supplementary-material" rid="SM1">Figure S8</xref>, taken over each of the six paths. <bold>(A)</bold> Summary informativeness rank boxplots using six <monospace>IGoR</monospace>-annotated (<xref ref-type="bibr" rid="B34">34</xref>) datasets of TRB sequences. <bold>(B)</bold> Summary informativeness rank boxplots using six <monospace>partis</monospace>-annotated (<xref ref-type="bibr" rid="B18">18</xref>) datasets of IGH sequences.</p></caption>
<graphic xlink:href="fimmu-10-02533-g0004.tif"/>
</fig>
<p><xref ref-type="fig" rid="F4">Figure 4B</xref> displays the results of applying Algorithm 3 to <monospace>partis</monospace> annotations of IGH sequences from donors FV, GMC, and IB at timepoints &#x02212;8 days and &#x02212;1 h from Gupta et al. (<xref ref-type="bibr" rid="B18">18</xref>), downsampled to unique clonal families to avoid clonal abundance biases and decrease algorithmic runtime. We see that deletion lengths, insertion lengths, and CDR3 length comprise the top six summaries, with physiochemical CDR3 properties mostly in the bottom half of rankings. In contrast to the TCR result, there appears to be less overall variability throughout the range of rankings, with variability highest for the moderate ranking positions and notably lower for the top and bottom positions.</p>
<p>While it is difficult to say exactly the level of correlation of each summary by the lasso result alone, since the lasso is a regularized version of least-squares, our intuition is that the nice properties of least-squares combined with the lasso&#x00027;s ability to eliminate less relevant coefficients leads to a subset of covariates that are generally informative. To validate this intuition, we can examine distributions of particularly ranked summaries applied to a test set of annotated repertoires not used in the model fitting. <xref ref-type="fig" rid="F5">Figure 5</xref> displays ECDFs of the acidity (bottom-ranked), aromaticity (middle-ranked), and V 3&#x02032; deletion length (top-ranked) distributions for the FV, GMC, and IB donors at timepoints &#x0002B;1 h, &#x0002B;7 days, and &#x0002B;28 days following an influenza vaccination (which differ from the &#x02212;1 h and &#x02212;8 days timepoints used for fitting), where the ranks are as determined by <xref ref-type="fig" rid="F4">Figure 4B</xref> for <monospace>partis</monospace>-annotated IGH repertoires. Visually, we see that the acidity curves do not vary much among donors or timepoints; the aromaticity curves have slightly more variation but are still highly similar; and the V 3&#x02032; deletion length curves are more distinguished between some donors (e.g., FV and GMC) as well as some donor-timepoint interactions (e.g., &#x0002B;7 days and &#x0002B;28 days timepoints for IB). Thus, there is visual evidence that the lasso scores can identify some degree of informativeness among summaries.</p>
<fig id="F5" position="float">
<label>Figure 5</label>
<caption><p>Empirical cumulative distribution functions for the bottom-, middle-, and top-ranked statistics for a validation set of <monospace>partis</monospace>-annotated IGH repertoires, as determined by <xref ref-type="fig" rid="F4">Figure 4B</xref>.</p></caption>
<graphic xlink:href="fimmu-10-02533-g0005.tif"/>
</fig></sec>
<sec>
<title>Comparing Experimental Observations to Model Simulations</title>
<p><monospace>sumrep</monospace> can be used to validate BCR/TCR generative models, i.e., models from which one can generate (simulate) data, through the following approach. First, given a collection of AIRR-seq datasets, model parameters are inferred using the modeling software tool for each repertoire, and then these parameters are used to generate corresponding simulated datasets (<xref ref-type="fig" rid="F1">Figure 1C</xref>). Next, <monospace>sumrep</monospace> is used to compute the summary statistics listed in <xref ref-type="table" rid="T1">Table 1</xref> for each dataset and compare these summaries between each pair of datasets (<xref ref-type="fig" rid="F1">Figure 1D</xref>). Then, a score is calculated for how well the software&#x00027;s simulation replicates a given summary based on how small the divergences of observed/simulated dataset pairs are compared to divergences between arbitrary observed/observed or simulated/simulated pairs.</p>
<p>Applying this methodology using many datasets should give a clear view of which characteristics the model captures well, as well as areas for improvement. As described in the introduction, we are motivated to do this because models are often benchmarked on simulated data, and it is important to understand discrepancies between simulated and observed data in order to properly interpret and extrapolate benchmarking results. We emphasize that validating the model in this way is different than the usual means of benchmarking model performance: rather than benchmarking the inferential results of the model, we benchmark the model&#x00027;s ability to generate realistic sequences.</p>
<p>We illustrate this approach with two case studies: an analysis of <monospace>IGoR</monospace> (<xref ref-type="bibr" rid="B19">19</xref>) applied to TRB sequences, and an analysis of <monospace>partis</monospace> (<xref ref-type="bibr" rid="B17">17</xref>, <xref ref-type="bibr" rid="B22">22</xref>) simulations applied to IGH sequences. Both tools are applied to separate sets of experimental repertoires, yielding model-based annotations for each repertoire, as well as simulated datasets from the inferred model parameters for each experimental set. Summary divergences are applied to each dataset, allowing for scores for each summary to be computed for each tool.</p></sec>
<sec>
<title>Assessing Summary Statistic Replication for <monospace>IGoR</monospace></title>
<p>We apply the methodology discussed in the previous section to TRB sequences from datasets A4_i107, A4_i194, A5_S9, A5_S10, A5_S15, and A5_S22 from Britanova et al. (<xref ref-type="bibr" rid="B34">34</xref>). Although <monospace>IGoR</monospace> is typically applied to non-productive sequences in order to capture the pre-selection recombination process, for this example application we wished to understand <monospace>IGoR</monospace>&#x00027;s ability to fit the complete repertoire directly without the need for an additional selection model [e.g., (<xref ref-type="bibr" rid="B35">35</xref>)]. Thus, we fit the <monospace>IGoR</monospace> model with all sequences (which we expect to be dominated by productive sequences) and restricted the simulation to productive sequences. <xref ref-type="fig" rid="F6">Figure 6</xref> contains frequency polygons of each summary distribution for each experimental and simulated repertoire.</p>
<fig id="F6" position="float">
<label>Figure 6</label>
<caption><p>Frequency polygon plots of each univariate summary distribution for the IGoR datasets.</p></caption>
<graphic xlink:href="fimmu-10-02533-g0006.tif"/>
</fig>
<p>Observation-based summary scores are computed using a log ratio of average divergences (referred to as LRAD-data, and defined in Equation 8) for a variety of TRB-relevant summaries (<xref ref-type="fig" rid="F7">Figure 7A</xref>). The LRAD-data score of a summary will be high when simulations look like their corresponding observations with respect to that summary, and low when observations look more like other observations than their corresponding simulations. We exclude summaries based on <monospace>sequence_alignment</monospace> values (e.g., pairwise distance distributions) since <monospace>IGoR</monospace> does not currently have an option to output the full variable region nucleotide sequences for experimental reads.</p>
<fig id="F7" position="float">
<label>Figure 7</label>
<caption><p>Summary scores, denoted as &#x0201C;log(Relative average divergence)&#x0201D; or &#x0201C;LRAD,&#x0201D; for each statistic in the <monospace>IGoR</monospace> model validation experiment. For both cases, a high score indicates a well-replicated statistic by the simulations with respect to their corresponding experimental repertoires of functional TRB sequences. <bold>(A)</bold> LRAD-data values for each relevant TRB statistic available from <monospace>IGoR</monospace> or <monospace>IgBLAST</monospace> as determined by Equation (8). <bold>(B)</bold> LRAD-sim values for each relevant TRB statistic available from <monospace>IGoR</monospace> or <monospace>IgBLAST</monospace> as determined by Equation (9).</p></caption>
<graphic xlink:href="fimmu-10-02533-g0007.tif"/>
</fig>
<p><monospace>IGoR</monospace> simulations were able to recapitulate gene usage statistics of an empirical repertoire well, with J gene usage frequency being the most accurately replicated, followed by various recombination-based indel statistics. V, D, and joint VDJ gene usage are all also well-replicated, as well as both VD and DJ insertion matrices. Conversely, the CDR3 length distribution was the least accurately replicated statistic among rearrangement statistics. The Kidera factors of the CDR3 region were also replicated well, despite CDR3 length being one of the least accurately replicated statistics. Scores for other CDR3-based statistics besides Kidera factors ranged from mildly good to mildly bad, with the GRAVY index distribution being the best CDR3-based statistic (excluding Kidera factors) and charge distribution being the worst.</p>
<p>We also computed simulation-based summary scores (LRAD-sim, defined in Equation 9) for the same datasets and simulations (<xref ref-type="fig" rid="F7">Figure 7B</xref>). The LRAD-sim score of a summary will be high when simulations look like their corresponding observations with respect to that summary, and low when simulations look more like other simulations than their corresponding observations. We still saw high scores for gene usage and indel statistics, although the CDR3 length distribution and various Kidera factor and GRAVY index distributions had much lower scores. This suggests that while the average <monospace>IGoR</monospace> simulation yields Kidera factor and GRAVY index distributions that look more like the observed repertoire&#x00027;s distributions than other observed repertoires do, these simulated repertoires still tend to produce more similar distributions to each other than to their observed counterparts. In turn, this provides an avenue of future research for TCR generative models in which certain CDR3aa properties are incorporated and expressed in simulated data.</p></sec>
<sec>
<title>Assessing Summary Statistic Replication for <monospace>partis</monospace></title>
<p>We applied the same methodology to IGH sequences from Gupta et al. (<xref ref-type="bibr" rid="B18">18</xref>), using datasets corresponding to the &#x02212;1 h and &#x02212;8 d timepoints for each of the FV, GMC, and IB donors. <xref ref-type="fig" rid="F8">Figure 8</xref> displays frequency polygons of each summary distribution for each experimental and simulated repertoire.</p>
<fig id="F8" position="float">
<label>Figure 8</label>
<caption><p>Frequency polygon plots of each univariate summary distribution for the partis datasets.</p></caption>
<graphic xlink:href="fimmu-10-02533-g0008.tif"/>
</fig>
<p>Observation-based summary scores were computed using the LRAD-data Equation (8) for a variety of IGH relevant summaries (<xref ref-type="fig" rid="F9">Figure 9A</xref>).</p>
<fig id="F9" position="float">
<label>Figure 9</label>
<caption><p>Summary scores, denoted as &#x0201C;log(Relative average divergence)&#x0201D; or &#x0201C;LRAD,&#x0201D; for each statistic in the <monospace>partis</monospace> model validation experiment. For both cases, a high score indicates a well-replicated statistic by the simulations with respect to their corresponding experimental repertoires of productive IGH sequences. <bold>(A)</bold> LRAD-data values for each relevant IGH statistic available from partis as determined by Equation (8). <bold>(B)</bold> LRAD-sim values for each relevant IGH statistic available from partis as determined by Equation (9).</p></caption>
<graphic xlink:href="fimmu-10-02533-g0009.tif"/>
</fig>
<p>Like <monospace>IGoR</monospace>, we see that <monospace>partis</monospace> simulations also excelled at replicating gene usage and recombination statistics, while additionally replicating CDR3 length distributions well. However, <monospace>partis</monospace> struggled to recapitulate VD and DJ insertion matrices, which it does not explicitly include in its model. This contrasts with <monospace>IGoR</monospace> which incorporates these insertion matrices during model fitting, and thus recapitulates these matrices well. The other statistics yielded scores ranging from slightly to very negative, with many mutation-based summaries like positional distance between mutations and hot and cold spot counts being poorly captured. The low scores of mutation-based summaries may arise from the decision to select a single representative from each clonal family, which itself arises from the complications in matching clonal family abundance distributions of simulations to data. This makes it difficult to identify the exact contributions of these factors to the summary discrepancies. Nonetheless, this suggests that these sorts of quantities may need to be more explicitly accounted for in BCR generative models if more realistic simulations are desired.</p>
<p>We also computed simulation-based summary scores (LRAD-sim, defined in Equation 9) for the same datasets and simulations (<xref ref-type="fig" rid="F9">Figure 9B</xref>). The scores are highly similar to those seen in <xref ref-type="fig" rid="F9">Figure 9A</xref>, with some summaries seeing a moderate drop.</p></sec></sec>
<sec sec-type="methods" id="s3">
<title>Methods</title>
<sec>
<title>Divergence</title>
<p>We use the Jenson-Shannon (JS) divergence for comparing distributions of scalar quantities, which constitutes most summaries in <monospace>sumrep</monospace>. The Jenson-Shannon divergence of probability distributions <italic>P</italic> and <italic>Q</italic> with densities <italic>p</italic>(&#x000B7;) and <italic>q</italic>(&#x000B7;) is a symmetrized Kullbeck-Leiber divergence, defined as</p>
<disp-formula id="E1"><label>(1)</label><mml:math id="M3"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">JSD</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>P</mml:mi><mml:mtext>&#x000A0;</mml:mtext><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mtext>&#x000A0;</mml:mtext><mml:mi>Q</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>:</mml:mo><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mtext class="textrm" mathvariant="normal">KLD</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>P</mml:mi><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mi>M</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mtext class="textrm" mathvariant="normal">KLD</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>Q</mml:mi><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mi>M</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where <italic>M</italic>: &#x0003D; (<italic>P</italic> &#x0002B; <italic>Q</italic>)/2 and KLD(<italic>P</italic>||<italic>M</italic>) is the usual KL-divergence,</p>
<disp-formula id="E2"><label>(2)</label><mml:math id="M4"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">KLD</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mtext>&#x000A0;</mml:mtext><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mtext>&#x000A0;</mml:mtext><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>:</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mo class="qopname">E</mml:mo></mml:mrow><mml:mrow><mml:mtext>X</mml:mtext><mml:mo>&#x0007E;</mml:mo><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mo class="qopname">log</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mstyle mathvariant="bold"><mml:mtext>X</mml:mtext></mml:mstyle></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mstyle mathvariant="bold"><mml:mtext>X</mml:mtext></mml:mstyle></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>In the case where <italic>P</italic> and <italic>Q</italic> are both discrete distributions, this becomes</p>
<disp-formula id="E3"><label>(3)</label><mml:math id="M5"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">KLD</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mtext>&#x000A0;</mml:mtext><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mtext>&#x000A0;</mml:mtext><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mtext class="textrm" mathvariant="normal">supp</mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:munder></mml:mstyle><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo class="qopname">log</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where supp(<italic>P</italic>) is the countable support of distribution <italic>P</italic>. Because the discrete formulation has computational benefits over the continuous one, we discretize continuous samples and treat them as discrete data. By default, we use <inline-formula><mml:math id="M6"><mml:mi>B</mml:mi><mml:mo>=</mml:mo><mml:mo class="qopname">max</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mrow><mml:msqrt><mml:mrow><mml:mo class="qopname">min</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>m</mml:mi><mml:mo>,</mml:mo><mml:mi>n</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:msqrt></mml:mrow><mml:mo>,</mml:mo><mml:mn>2</mml:mn></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> bins of equal length, where <italic>m</italic> &#x0003D; |supp(<italic>P</italic>)| and <italic>n</italic> &#x0003D; |supp(<italic>Q</italic>)|, which is designed to scale with the complexity of <italic>m</italic> and <italic>n</italic> simultaneously. We also discard bins which would lead to an infinite KL divergence for numerical stability.</p>
<p>For counts of categorical data, we instead appeal to the sum of absolute differences, or &#x02113;<sub>1</sub> divergence, for comparison:</p>
<disp-formula id="E4"><label>(4)</label><mml:math id="M7"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>&#x02113;</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>;</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">S</mml:mi></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>s</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">S</mml:mi></mml:mrow></mml:mrow></mml:munder></mml:mstyle><mml:mo stretchy="true">|</mml:mo><mml:mi>c</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi><mml:mo>;</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>-</mml:mo><mml:mi>c</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>s</mml:mi><mml:mo>;</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo stretchy="true">|</mml:mo><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>In words, Equation (4) iterates over each element <italic>s</italic> in some set <inline-formula><mml:math id="M8"><mml:mrow><mml:mi mathvariant="-tex-caligraphic">S</mml:mi></mml:mrow></mml:math></inline-formula>, calculates the count <italic>c</italic> of <italic>s</italic> within repertoires <italic>R</italic><sub>1</sub> and <italic>R</italic><sub>2</sub>, respectively, takes the absolute difference of counts, and appends this to a rolling sum. This metric is well suited for comparing marginal or joint V/D/J-gene usage distributions. For example, if <inline-formula><mml:math id="M9"><mml:mrow><mml:mi mathvariant="-tex-caligraphic">V</mml:mi></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M10"><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="M11"><mml:mrow><mml:mi mathvariant="-tex-caligraphic">J</mml:mi></mml:mrow></mml:math></inline-formula> represent the germline sets of V, D, and J genes, respectively, define usage <italic>u</italic> of gene triple <inline-formula><mml:math id="M12"><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>v</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">V</mml:mi></mml:mrow><mml:mo>&#x000D7;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow><mml:mo>&#x000D7;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">J</mml:mi></mml:mrow></mml:math></inline-formula> for repertoire <italic>R</italic> as</p>
<disp-formula id="E5"><label>(5)</label><mml:math id="M13"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mi>u</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>R</mml:mi><mml:mo>;</mml:mo><mml:mi>v</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mi>&#x00023;</mml:mi><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:mi>s</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mi>R</mml:mi><mml:mo>:</mml:mo><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>v</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi>v</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi>j</mml:mi></mml:mrow><mml:mo>}</mml:mo></mml:mrow><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where e.g., <italic>s</italic><sub><italic>v</italic></sub> &#x0003D; the V gene of <italic>s</italic>. Then an appropriate divergence for the joint VDJ gene usage for repertoires <italic>R</italic><sub>1</sub> and <italic>R</italic><sub>2</sub> is</p>
<disp-formula id="E6"><label>(6)</label><mml:math id="M14"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mi>d</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>;</mml:mo><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">V</mml:mi></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">J</mml:mi></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>v</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">V</mml:mi></mml:mrow></mml:mrow></mml:munder></mml:mstyle><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow></mml:mrow></mml:munder></mml:mstyle><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mrow><mml:mi mathvariant="-tex-caligraphic">J</mml:mi></mml:mrow></mml:mrow></mml:munder></mml:mstyle><mml:mo stretchy="true">|</mml:mo><mml:mi>u</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>v</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>;</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>-</mml:mo><mml:mi>u</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>v</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:mi>j</mml:mi><mml:mo>;</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo stretchy="true">|</mml:mo><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>The &#x02113;<sub>1</sub> divergence is also relevant for computing amino acid frequency and 2mer frequency distributions. Note that we can normalize the counts to become relative frequencies and apply (4) on the resultant scale which may be better suited to the application, especially when dataset sizes differ notably.</p></sec>
<sec>
<title>Approximating Distributions via Subsampling and Averaging</title>
<p>Computing full summary distributions over large datasets can be intractable. However, we can compute a Monte Carlo distribution estimate by repeatedly subsampling and aggregating summary values until convergence. Algorithm 1 formalizes this idea, appending batch samples of the full distribution <italic>d</italic> to a rolling approximate distribution and terminating when successive distribution iterates have a JS divergence smaller than tolerance &#x003B5;. Note that continually appending values to a rolling vector is analogous to computing a rolling average, where the subject of the averaging is an empirical distribution rather than a scalar.</p>
<table-wrap position="float">
<label>Algorithm 1:</label>
<caption><p>Compute automatic approximate distribution</p></caption>
<table frame="hsides" rules="groups">
<tbody><tr>
<td valign="top" align="left"><bold>Input:</bold> repertoire <italic>R</italic>, summary <italic>s</italic>, batch size <italic>m</italic>, convergence tolerance &#x003B5;</td>
</tr>
<tr style="border-bottom: thin solid #000000;">
<td valign="top" align="left"><bold>Output:</bold> subsampled approximation to the full distribution <italic>d</italic> of <italic>R</italic></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>R</italic><sub>0</sub> &#x02190; subsample(<italic>R, m</italic>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>d</italic><sub>0</sub> &#x02190; <italic>s</italic>(<italic>R</italic><sub>0</sub>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>n</italic> &#x02190; 1</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;error &#x02190; &#x0221E;</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>while</bold> error &#x0003E; &#x003B5; <bold>do</bold>:</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>R</italic><sub>samp</sub> &#x02190; subsample(<italic>R, m</italic>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>d</italic><sub>samp</sub> &#x02190; <italic>s</italic>(<italic>R</italic><sub>samp</sub>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>d</italic><sub><italic>n</italic></sub> &#x02190; concatenate(<italic>d</italic><sub><italic>n</italic>&#x02212;1</sub>, <italic>d</italic><sub>samp</sub>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;error &#x02190; JSD(<italic>d</italic><sub><italic>n</italic>&#x02212;1</sub>, <italic>d</italic><sub><italic>n</italic></sub>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>n</italic> &#x02190; <italic>n</italic> &#x0002B; 1</td>
</tr>
<tr>
<td align="left" valign="top"><bold>return</bold> <italic>d</italic><sub><italic>n</italic></sub></td>
</tr> 
</tbody>
</table>
</table-wrap>
<p>An alternative would be to simply compute the distribution on one subsample of the data and use this as a proxy distribution. The main advantage of Algorithm 1 over such an approach is that it provides a sense of convergence to the full distribution via the tuning parameter &#x003B5;, while automatically determining the size of the necessary subsample. The algorithm can also be tuned according to batch size <italic>m</italic>, which <monospace>sumrep</monospace> takes to be 30 by default. We conduct a performance analysis of Algorithm 1 in <xref ref-type="supplementary-material" rid="SM1">Appendix A</xref> and empirically demonstrate efficiency gains in a variety of realistic settings without sacrificing much accuracy.</p>
<p>Some summaries induce distributions for which Algorithm 1 is inherently ill-suited. This occurs when a summary applied to a subset of a dataset does not follow the same distribution as the summary applied to the full dataset. For example, consider the nearest neighbor distance of a sequence <italic>s</italic><sub><italic>i</italic></sub> with respect to a multiset of sequences <italic>R</italic> (i.e., elements in <italic>R</italic> can have multiplicity &#x02265; 1),</p>
<disp-formula id="E7"><label>(7)</label><mml:math id="M15"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:mtext class="textrm" mathvariant="normal">NN</mml:mtext></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>R</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>:</mml:mo><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:munder class="msub"><mml:mrow><mml:mo class="qopname">min</mml:mo></mml:mrow><mml:mrow><mml:mi>s</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mi>R</mml:mi><mml:mo>\</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:munder></mml:mstyle><mml:mi>d</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where <italic>d</italic>(&#x000B7;, &#x000B7;) is a string metric (e.g., the Levenshtein distance). If we take any subset <italic>S</italic> of <italic>R</italic>, then <italic>d</italic><sub>NN</sub>(<italic>s</italic><sub><italic>i</italic></sub>, <italic>S</italic>) &#x02265; <italic>d</italic><sub>NN</sub>(<italic>s</italic><sub><italic>i</italic></sub>, <italic>R</italic>) &#x02200;<italic>i</italic>, since <italic>R</italic> will have the same sequences to iterate over, and possibly more sequences, which can only result in the same or a smaller minimum.</p>
<p>In this case, we can still obtain an unbiased approximate to the nearest neighbor distance distribution using the following modification of Algorithm 1. For each iteration, sample a small batch <italic>B</italic> &#x0003D; (<italic>s</italic><sub>1</sub>, &#x02026;, <italic>s</italic><sub><italic>b</italic></sub>) of <italic>b</italic> sequences, and compute <italic>d</italic><sub>NN</sub> of each <italic>s</italic><sub><italic>i</italic></sub> to the full repertoire <italic>R</italic>. Since each batch <italic>B</italic> computes the exact nearest neighbor with respect to <italic>R</italic>, we get the true value of <italic>d</italic><sub>NN</sub> for each <italic>s</italic>&#x02208;<italic>B</italic>. The gain in efficiency stems from the fact that we only compute this true <italic>d</italic><sub>NN</sub> for a subsample of the sequences of the full repertoire <italic>R</italic>. Thus, appending batches to a running distribution until convergence as in Algorithm 1 will produce increasingly refined, unbiased approximations as the tolerance decreases. Algorithm 2 explicates this procedure.</p>
<table-wrap position="float">
<label>Algorithm 2:</label>
<caption><p>Compute automatic approximate nearest neighbor distance distribution</p></caption>
<table frame="hsides" rules="groups">
<tbody><tr>
<td valign="top" align="left"><bold>Input:</bold> repertoire <italic>R</italic>, distance <italic>d</italic>, batch size <italic>m</italic>, convergence tolerance &#x003B5;</td>
</tr>
<tr style="border-bottom: thin solid #000000;">
<td valign="top" align="left"><bold>Output:</bold> subsampled approximation to the full nearest neighbor distribution <italic>d</italic><sub>NN</sub> of <italic>R</italic></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>d</italic><sub>0</sub> &#x02190; <sc>DOBATCHSTEP</sc>(<italic>R, m</italic>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>n</italic> &#x02190; 1 </td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;error &#x02190; &#x0221E;</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>while</bold> error &#x0003E; &#x003B5; <bold>do</bold>:</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>d</italic><sub>samp</sub> &#x02190; <sc>DOBATCHSTEP</sc>(<italic>R, m</italic>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>d</italic><sub><italic>n</italic></sub> &#x02190; concatenate(<italic>d</italic><sub><italic>n</italic>&#x02212;1</sub>, <italic>d</italic><sub>samp</sub>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;error &#x02190; JSD(<italic>d</italic><sub><italic>n</italic>&#x02212;1</sub>, <italic>d</italic><sub><italic>n</italic></sub>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>n</italic> &#x02190; <italic>n</italic> &#x0002B; 1</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>return</bold> <italic>d</italic><sub><italic>n</italic></sub></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>function</bold> <sc>DOBATCHSTEP</sc>(<italic>R, m</italic>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>for</bold> <italic>i</italic> &#x0003D; 1, &#x02026;, <italic>m</italic> <bold>do</bold>:</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>s</italic><sub><italic>i</italic></sub> &#x02190; subsample(<italic>R</italic>, 1)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>d</italic><sub><italic>i</italic></sub> &#x02190; <italic>d</italic><sub>NN</sub>(<italic>s</italic><sub><italic>i</italic></sub>; <italic>R</italic>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>return</bold> (<italic>d</italic><sub>1</sub>, &#x02026;, <italic>d<sub>m</sub></italic>)</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>Algorithm 2 may yield a high runtime if <italic>R</italic> is large, the sequences in <italic>R</italic> are long, or the tolerance &#x003B5; is small. Nonetheless, we empirically demonstrate in <xref ref-type="supplementary-material" rid="SM1">Appendix B</xref> that in the case of typical BCR sequence reads, even very small tolerances incur reasonable runtimes, and when <italic>R</italic> is large, the algorithm is orders of magnitude faster than computing the full distribution over <italic>R</italic>.</p>
<p>We show that the efficiency and accuracy of these algorithms vary by summary statistic in <xref ref-type="supplementary-material" rid="SM1">Appendix B</xref>, and identify appropriate defaults accordingly. Specifically, <monospace>sumrep</monospace> uses &#x003B5; &#x0003D; 0.001 for arbitrary summary approximation routines and &#x003B5; &#x0003D; 10<sup>&#x02212;4</sup> for <monospace>getNearestNeighborDistribution</monospace>. Moreover, <monospace>sumrep</monospace> retrieves approximate distributions by default only for <monospace>getPairwiseDistanceDistribution</monospace>, <monospace>getNearestNeighborDistribution</monospace>, and <monospace>getCDR3PairwiseDistanceDistribution</monospace>.</p>
</sec>
<sec>
<title>Summary Statistic Informativeness Ranking</title>
<p>To quantify the relative informativeness of various summary statistics in distinguishing between different datasets, we perform a multinomial lasso regression where covariates are sequence-level summaries and the response is dataset identity. Since &#x02113;<sub>1</sub> multinomial regression outputs a separate coefficient vector <bold>&#x003B2;</bold> for each response value, we aggregate by taking medians of each dataset-specific lasso ordering for each summary to get the final score. This also yields a range of rankings to assess the variation in scores by summary and by inferential model (e.g., <monospace>partis</monospace>, <monospace>IGoR</monospace>). In the case of ties, we randomize rankings to avoid alphabetization biases or other similar artifacts. Detailed pseudocode is provided in Algorithm 3.</p>
<table-wrap position="float">
<label>Algorithm 3:</label>
<caption><p>Rank summary statistics by informativeness</p></caption>
<table frame="hsides" rules="groups">
<tbody>
<tr >
<td valign="top" align="left"><bold>Input:</bold> annotations datasets <italic>d</italic><sub>1</sub>, &#x02026;, <italic>d</italic><sub><italic>D</italic></sub>, sequence-level summaries <bold>s</bold>(&#x000B7;) &#x0003D; [<italic>s</italic><sub>1</sub>(&#x000B7;), &#x02026;, <italic>s</italic><sub><italic>S</italic></sub>(&#x000B7;)], lasso parameters &#x003BB;<sub>1</sub>, &#x02026;, &#x003BB;<sub>&#x0039B;</sub></td>
</tr>
<tr style="border-bottom: thin solid #000000;">
<td valign="top" align="left"><bold>Output:</bold> A vector of ranks for the summaries</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>for</bold> <italic>d</italic> &#x0003D; <italic>d</italic><sub>1</sub>, &#x02026;, <italic>d</italic><sub><italic>D</italic></sub> <bold>do:</bold></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>X</bold><sub><italic>d</italic></sub> &#x02190; [<bold>s</bold>(<italic>d</italic><sub>1</sub>), &#x02026;, <bold>s</bold>(<italic>d</italic><sub><italic>D</italic></sub>)]</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<inline-formula><mml:math id="M16"><mml:mstyle mathvariant='bold' mathsize='normal'><mml:mi>X</mml:mi></mml:mstyle><mml:mtext>&#x02009;</mml:mtext><mml:mo>&#x02190;</mml:mo><mml:mtext>&#x02009;</mml:mtext><mml:mrow><mml:mo>[</mml:mo><mml:mtable columnalign='left'><mml:mtr><mml:mtd><mml:msub><mml:mstyle mathvariant='bold' mathsize='normal'><mml:mi>X</mml:mi></mml:mstyle><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mrow></mml:msub></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mtext>&#x02009;&#x02009;</mml:mtext><mml:mo>&#x022EE;</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:msub><mml:mstyle mathvariant='bold' mathsize='normal'><mml:mi>X</mml:mi></mml:mstyle><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mi>D</mml:mi></mml:msub></mml:mrow></mml:msub></mml:mtd></mml:mtr></mml:mtable><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<inline-formula><mml:math id="M17"><mml:mrow><mml:mstyle mathvariant='bold' mathsize='normal'><mml:mi>y</mml:mi></mml:mstyle><mml:mo>&#x02190;</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mtable><mml:mtr><mml:mtd><mml:mrow><mml:mtext>rep</mml:mtext><mml:msup><mml:mrow><mml:mo stretchy='false'>(</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mtext>rows</mml:mtext><mml:mo stretchy='false'>(</mml:mo><mml:msub><mml:mi>d</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo stretchy='false'>)</mml:mo><mml:mo stretchy='false'>)</mml:mo></mml:mrow><mml:mi>T</mml:mi></mml:msup></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>&#x022EE;</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mtext>rep</mml:mtext><mml:msup><mml:mrow><mml:mo stretchy='false'>(</mml:mo><mml:mi>D</mml:mi><mml:mo>,</mml:mo><mml:mtext>rows</mml:mtext><mml:mo stretchy='false'>(</mml:mo><mml:msub><mml:mi>d</mml:mi><mml:mi>D</mml:mi></mml:msub><mml:mo stretchy='false'>)</mml:mo><mml:mo stretchy='false'>)</mml:mo></mml:mrow><mml:mi>T</mml:mi></mml:msup></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x022B3; rows(<italic>d</italic><sub><italic>i</italic></sub>) is the number of sequences in the <italic>i</italic>th dataset</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>for</bold> &#x003BB; &#x0003D; &#x003BB;<sub>1</sub>, &#x02026;, &#x003BB;<sub>&#x0039B;</sub> <bold>do:</bold></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<inline-formula><mml:math id="M18"><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mstyle mathvariant="bold-italic"><mml:mo>&#x003B2;</mml:mo></mml:mstyle></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>&#x003BB;</mml:mi></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mo>&#x02026;</mml:mo><mml:mo>,</mml:mo><mml:msubsup><mml:mrow><mml:mstyle mathvariant="bold-italic"><mml:mo>&#x003B2;</mml:mo></mml:mstyle></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi>&#x003BB;</mml:mi></mml:mrow></mml:msubsup></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x02190;</mml:mo><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">MultinomialLasso</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mstyle mathvariant="bold"><mml:mtext>X</mml:mtext></mml:mstyle><mml:mo>,</mml:mo><mml:mstyle mathvariant="bold"><mml:mtext>y</mml:mtext></mml:mstyle><mml:mo>;</mml:mo><mml:mo>&#x003BB;</mml:mo></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>for</bold> <italic>d</italic> = <italic>d</italic><sub>1</sub>, &#x02026;, <italic>d<sub>D</sub></italic> <bold>do:</bold></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>for</bold> <italic>s</italic> &#x0003D; <italic>s</italic><sub>1</sub>, &#x02026;, <italic>s</italic><sub><italic>S</italic></sub> <bold>do:</bold></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<italic>t</italic><sub><italic>d, s</italic></sub> &#x02190; </td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<inline-formula><mml:math id="M19"><mml:mo class="qopname">min</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mo class="qopname">min</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mo>&#x003BB;</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>&#x02264;</mml:mo><mml:mo>&#x003BB;</mml:mo><mml:mo>&#x02264;</mml:mo><mml:msub><mml:mrow><mml:mo>&#x003BB;</mml:mo></mml:mrow><mml:mrow><mml:mo>&#x0039B;</mml:mo></mml:mrow></mml:msub><mml:mo>:</mml:mo><mml:msubsup><mml:mrow><mml:mi>&#x003B2;</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mo>&#x003BB;</mml:mo></mml:mrow></mml:msubsup><mml:mo>&#x0003E;</mml:mo><mml:mn>0</mml:mn><mml:mo>&#x02200;</mml:mo><mml:mi>t</mml:mi><mml:mo>&#x0003E;</mml:mo><mml:mo>&#x003BB;</mml:mo></mml:mrow><mml:mo>}</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:mi>&#x0221E;</mml:mi></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:math></inline-formula></td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>r</bold><italic><sub>d</sub></italic> &#x0003D; rank(<italic>t<sub>d</sub></italic>, <sub>s1</sub>, &#x02026;, <italic>t<sub>d, sS</sub></italic>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>R</bold> = (<bold>r</bold><italic>d</italic><sub>1, &#x02026;,</sub> <bold>r</bold><sub><italic>d</italic><italic><sub>D</sub></italic></sub>)</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;scores &#x0003D; rank(median<sub><italic>s</italic><sub>1</sub></sub>(<bold>R</bold>), &#x02026;, median<sub><italic>s</italic><italic><sub>S</sub></italic></sub>(<bold>R</bold>))</td>
</tr>
<tr>
<td align="left" valign="top">&#x000A0;&#x000A0;&#x000A0;&#x000A0;<bold>return</bold> scores</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>This approach only works for sequence-level summaries <italic>s</italic> &#x02208; &#x0211D;<sup><italic>n</italic></sup> for a dataset <italic>d</italic> of <italic>n</italic> &#x0003D; rows(<italic>d</italic>) sequences in order to form a well-defined design matrix <inline-formula><mml:math id="M20"><mml:mstyle mathvariant="bold"><mml:mtext>X</mml:mtext></mml:mstyle><mml:mo>&#x02208;</mml:mo><mml:msup><mml:mrow><mml:mi>&#x0211D;</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>D</mml:mi></mml:mrow></mml:munderover><mml:mstyle class="text"><mml:mtext class="textrm" mathvariant="normal">rows</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x000D7;</mml:mo><mml:mi>S</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula> over all datasets <italic>d</italic> &#x0003D; <italic>d</italic><sub>1</sub>, &#x02026;, <italic>d</italic><sub><italic>D</italic></sub> under consideration. For example, it is unclear how to incorporate the pairwise distance distribution, which is not a sequence-level summary, as a covariate, since this summary in general yields a column of a larger length than the number of sequences. Still, as most summaries considered above can be applied at the sequence level, this method greatly reduces the number of summaries the user needs to examine.</p></sec>
<sec>
<title>Model Validation of <monospace>IGoR</monospace></title>
<p>We used the <monospace>-infer</monospace> subcommand of <monospace>IGoR</monospace> to fit custom, dataset-specific models for each experimental dataset. Since we were interested in many CDR3-based statistics and <monospace>IGoR</monospace> does not currently include inferred CDR3 sequences with rearrangement scenarios, we used <monospace>IgBLAST</monospace> to extract CDR3s for each sequence. For each sequence, we considered only the rearrangement scenario with the highest likelihood as determined by <monospace>IGoR</monospace>. When a list of more than one potential genes was given as the gene call, we considered only the first gene in the list. Several fields were renamed to match the AIRR specification when the definitions align without ambiguity. As described in Results, we trained on productive sequences and restricted the simulation to productive sequences.</p>
<p>We applied <monospace>IGoR</monospace> in this way to six datasets of TRB sequences from Britanova et al. (<xref ref-type="bibr" rid="B34">34</xref>), which studied T cell repertoires from donors ranging from newborn children to centenarians.</p></sec>
<sec>
<title>Model Validation of <monospace>partis</monospace></title>
<p>We used <monospace>partis</monospace> to infer custom generative models for each experimental dataset. We ran the <monospace>partition</monospace> subcommand to incorporate underlying clonal family clustering among sequences during inference, and then downsampled each observed and simulated dataset so that each clonal family is represented by one sequence. Since <monospace>partis</monospace> returns a list of the top most likely annotations scenarios for each rearrangement event, we considered only the scenario with the highest model likelihood for each sequence. We denote the <monospace>indel_reversed_seqs</monospace> field as <monospace>sequence_alignment</monospace> and <monospace>naive_seq</monospace> as <monospace>germline_alignment</monospace> as they satisfy these definitions from the AIRR Rearrangement schema. Several other fields are renamed to match the AIRR specification when the definitions align without ambiguity.</p>
<p>Before running summary comparisons, we randomly downsample to one receptor per clonal family to get a dataset consisting of unique clonotypes for both the observed and simulated datasets. We do this since <monospace>partis simulate</monospace> draws from distributions over clonal families for each rearrangement event as inferred from <monospace>partis partition</monospace>. While it is possible to simulate multiple leaves for each rearrangement, it is not obvious how to best synchronize this with the observed clonal family distributions. A more involved analysis would attempt to mimic the clone size distribution in data as closely as possible, potentially with correlations between clone size and other rearrangement parameters, and assess sequence-level statistics within each clonal family. Here we opt to subsample to unique clones and avoid abundance biases altogether.</p>
<p>We applied <monospace>partis</monospace> in this way to six datasets of IgH sequences from Gupta et al. (<xref ref-type="bibr" rid="B18">18</xref>), which studied B cell repertoires from donors prior to and following an influenza vaccination.</p></sec>
<sec>
<title>Scoring Summary Statistic Replication by Model</title>
<p>We wish to measure how well a given statistic is replicated when a model performs simulations using parameters inferred from an observed repertoire dataset. One approach is to score the statistic <italic>s</italic> based on the average divergence of observations to their simulated counterparts when applying <italic>s</italic>(&#x000B7;), and the average divergence of observations to other observations when applying <italic>s</italic>(&#x000B7;). Suppose we have <italic>k</italic> experimental repertoires of immune receptor sequences, and let <italic>R</italic><sub><italic>i</italic>, obs</sub> and <italic>R</italic><sub><italic>i</italic>, sim</sub>, 1 &#x02264; <italic>i</italic> &#x02264; <italic>k</italic>, denote the <italic>i</italic>th observed and simulated repertoire, respectively. For a given statistic <italic>s</italic>, let <inline-formula><mml:math id="M21"><mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> be the divergence of repertoires <italic>R</italic><sub>1</sub> and <italic>R</italic><sub>2</sub> with respect to <italic>s</italic>. We can score a simulator&#x00027;s ability to recapitulate <italic>s</italic> from the observed repertoire to the simulated via the following log relative average divergence (LRAD):</p>
<disp-formula id="E8"><label>(8)</label><mml:math id="M22"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">LRAD-data</mml:mtext><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow><mml:mo>:</mml:mo><mml:mtext>&#x000A0;</mml:mtext><mml:mo>=</mml:mo><mml:mo class="qopname">log</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac><mml:mi>k</mml:mi><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mi>k</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:msubsup><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msubsup></mml:mstyle><mml:mstyle displaystyle="true"><mml:msub><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>&#x02260;</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mstyle><mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mtext class="textrm" mathvariant="normal">obs</mml:mtext></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mtext class="textrm" mathvariant="normal">obs</mml:mtext></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:msubsup><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msubsup></mml:mstyle><mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mtext class="textrm" mathvariant="normal">obs</mml:mtext></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mtext class="textrm" mathvariant="normal">sim</mml:mtext></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>For a given summary <italic>s</italic>, LRAD-data will be positive if the simulated repertoires tend to look more like their experimental counterparts in terms of this summary than experimental repertoires look like other experimental repertoires, and negative if experimental repertoires tend to look more like other experimental repertoires than they do their simulated counterparts. In other words, LRAD-data scores how well a simulator can differentiate <italic>s</italic> from an experimental repertoire among other repertoires, and recapitulate <italic>s</italic> into its simulation. Applying the log to the ratio allows for the magnitudes of scores to be directly comparable (so that a summary with score <italic>a</italic>&#x0003E; 0 performs as well as a summary with score &#x02212;<italic>a</italic> &#x0003C; 0 performs poorly).</p>
<p>Another related score compares the average divergence of observations to their simulated counterparts, and the average divergence of simulations to other simulations. Formally, this becomes</p>
<disp-formula id="E9"><label>(9)</label><mml:math id="M23"><mml:mtable class="eqnarray" columnalign="right center left"><mml:mtr><mml:mtd><mml:mtext class="textrm" mathvariant="normal">LRAD-sim</mml:mtext><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow><mml:mo>:</mml:mo><mml:mtext>&#x000A0;</mml:mtext><mml:mo>=</mml:mo><mml:mo class="qopname">log</mml:mo><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac><mml:mi>k</mml:mi><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:mi>k</mml:mi><mml:mo>-</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:msubsup><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msubsup></mml:mstyle><mml:mstyle displaystyle="true"><mml:msub><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>&#x02260;</mml:mo><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mstyle><mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mtext class="textrm" mathvariant="normal">sim</mml:mtext></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mtext class="textrm" mathvariant="normal">sim</mml:mtext></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:msubsup><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msubsup></mml:mstyle><mml:msub><mml:mrow><mml:mrow><mml:mi mathvariant="-tex-caligraphic">D</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="true">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mtext class="textrm" mathvariant="normal">obs</mml:mtext></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mtext class="textrm" mathvariant="normal">sim</mml:mtext></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:mrow><mml:mo stretchy="true">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where the difference from (8) is that the divergences in the numerator are applied to simulated-simulated dataset pairs rather than observed-observed dataset pairs. LRAD-sim for a given summary will be positive if simulated repertoires tend to look more like their experimental counterparts in terms of this summary than simulated repertoires look like other simulated repertoires, and negative if the simulated repertoires tend to look more alike.</p>
<p>These scores underlie the model validation analyses of <monospace>partis</monospace> and <monospace>IGoR</monospace> simulations in the Results section, and comprise the values displayed in <xref ref-type="fig" rid="F7">Figures 7</xref>, <xref ref-type="fig" rid="F9">9</xref>. However, this framework can be used to validate any immune receptor repertoire simulator which outputs the fields compatible with the summaries in <xref ref-type="table" rid="T1">Table 1</xref>, or more generally any set of summaries generated by a model-based simulator that is not supported directly by <monospace>sumrep</monospace>.</p>
<p>A feature of our methodology is that we use the same tool to produce simulations that we used to produce the annotations. To examine the sensitivity of this method, we performed a separate analysis by obtaining dataset annotations from standalone <monospace>IgBLAST</monospace> (<xref ref-type="bibr" rid="B36">36</xref>), and comparing these to simulations based on <monospace>partis</monospace> annotations using IMGT germline databases. This is discussed in detail in <xref ref-type="supplementary-material" rid="SM1">Appendix E</xref>; in particular, we find that scores differ to varying extents between the tools, and argue that while there are probably some biases when using a common tool for annotations and simulations, this is also driven by the differences in the nature of the tools&#x00027; specifications. We did not perform a similar analysis for <monospace>IGoR</monospace> annotations since <monospace>IgBLAST</monospace> was used to infer CDR3s within the <monospace>IGoR</monospace> workflow.</p></sec>
<sec>
<title>Materials</title>
<p>The raw data for the TCR summary divergence MDS analysis comes from Pogorelyy et al. (<xref ref-type="bibr" rid="B32">32</xref>), which was postprocessed into a suitable format for analysis. For each donor-timepoint combination, a single blood draw was split in replicas at the level of cell mixture.</p>
<p>The raw data for the BCR summary divergence MDS analysis comes from Rubelt et al. (<xref ref-type="bibr" rid="B33">33</xref>); <monospace>IgBLAST</monospace>-preprocessed data was downloaded from VDJServer in the AIRR format. For quality control, sequences with a run of 3 or more <monospace>N</monospace> bases in the raw sequence were discarded.</p>
<p>For the TCR model validation analysis, we use six datasets from Britanova et al. (<xref ref-type="bibr" rid="B34">34</xref>), corresponding to labels A4_i107, A4_i194, A5_S9, A5_S10, A5_S15, and A5_S22. For tractability purposes, we chose the six datasets with the fewest number of sequence reads; the number of reads from these six datasets used in the analysis ranged from 37,363 sequences to 243,903 sequences. These datasets consist of consensus RNA sequences assembled using UMIs. Most of these sequences are productive; as previously described, for this example application we are benchmarking <monospace>IGoR</monospace>&#x00027;s ability to fit complete repertoires rather than only non-productive repertoires.</p>
<p>The data for the BCR model validation analyses originated from samples first sequenced and published in Laserson et al. (<xref ref-type="bibr" rid="B37">37</xref>), although we used the Illumina MiSeq data published in Gupta et al. (<xref ref-type="bibr" rid="B18">18</xref>) for our analyses. These datasets represent repertoires of three human donors from multiple time points following an influenza vaccination. We use datasets from time points &#x02212;1h and &#x02212;8d for the FV, GMC, and IB donors for the summary informativeness and <monospace>partis</monospace> model validation analyses; the &#x0002B;1h, &#x0002B;7d, and &#x0002B;28d datasets for the FV, GMC, and IB donors for the summary informativeness validation; and the FV -1 h dataset for the approximation routine performance analyses in <xref ref-type="supplementary-material" rid="SM1">Appendices A, B</xref>.</p></sec></sec>
<sec sec-type="conclusions" id="s4">
<title>Conclusions</title>
<p>We have presented a general framework for efficiently summarizing, comparing, and visualizing AIRR-seq datasets, and applied it to several questions of scientific interest. One can imagine many further applications of <monospace>sumrep</monospace>, as well as promising avenues of research: contrasting repertoires in the context of antigen response or vaccination design and evaluation may shed some light on which summaries can distinguish between such covariates; and comparing the summary distributions of naive repertoires from multiple healthy individuals is likely to aid our understanding of the patterns of variability exhibited by &#x0201C;normal&#x0201D; repertoires, which in turn may aid the detection of repertoire abnormalities. <monospace>sumrep</monospace> could also be used to evaluate the extent to which artificial lymphocyte repertoires look like natural ones (<xref ref-type="bibr" rid="B38">38</xref>).</p>
<p>There are several other packages dedicated to detailed summaries and visualization of immune receptor repertoires. The <monospace>tcR</monospace> (<xref ref-type="bibr" rid="B39">39</xref>) and <monospace>bcRep</monospace> (<xref ref-type="bibr" rid="B40">40</xref>) packages for R include methods for retrieving and comparing gene usage summaries, computing clonotype diversity indices, and visualizing various repertoire summaries. <monospace>VDJtools</monospace> (<xref ref-type="bibr" rid="B41">41</xref>) is a command line tool which performs similar repertoire summarization, comparison, and visualization tasks for TCR data. Desktop GUI-based programs include <monospace>ImmunExplorer</monospace> (<xref ref-type="bibr" rid="B42">42</xref>) and <monospace>Vidjil</monospace> (<xref ref-type="bibr" rid="B43">43</xref>). <monospace>Vidjil</monospace> is also available as a webserver, as is <monospace>ASAP</monospace> (<xref ref-type="bibr" rid="B44">44</xref>). <monospace>Antigen Receptor Galaxy</monospace> (<xref ref-type="bibr" rid="B45">45</xref>) offers online access to many analysis tools. These tools have a subset of the summary statistics described here, and do not have the comparative analysis features of <monospace>sumrep</monospace>. The <monospace>IGoR</monospace> (<xref ref-type="bibr" rid="B19">19</xref>) software features an algorithm for summarizing statistics of the V(D)J rearrangement process; however, its main focus is on learning the basic model for non-productive T- and B-cell repertoire and it does not provide any built-in methods for comparing inferred models between datasets.</p>
<p>A natural extension of the model validation in this report would be to assess the performance of many competing repertoire analysis tools over a larger group of datasets. <monospace>sumrep</monospace> can be also used to detect systemic biases between different library preparation protocols and control for batch effects that can confound meta-analysis of AIRR-Seq data. Moreover, while many of the summaries are applied to the CDR3 region by default, it would be interesting to perform separate analyses restricted to different CDRs and framework regions, as physiochemical characteristics of these regions can differ greatly.</p>
<p>Finally, although <monospace>sumrep</monospace> already supports the AIRR rearrangement schema by default, we plan to thoroughly integrate <monospace>sumrep</monospace> as a downstream analysis tool for any AIRR-compliant software or workflow.</p></sec>
<sec sec-type="data-availability" id="s5">
<title>Data Availability Statement</title>
<p>Publicly available datasets were analyzed in this study. This data can be found here: PRJNA316572, PRJNA349143, PRJNA493983, SRP065626.</p></sec>
<sec id="s6">
<title>Author Contributions</title>
<p>BO, PM, CS, DR, JV, MS, AS, WL, and FM conceived of the project and guided the overall design of the software and analyses. BO designed and implemented the main software package. BO, PM, CS, and AO performed computational analyses. BO and FM wrote the first draft of the manuscript. All authors contributed to manuscript revision, read, and approved the submitted version.</p>
<sec>
<title>Conflict of Interest</title>
<p>JV is employed by Genentech Inc. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest. The reviewer SC and handling editor declared their shared affiliation.</p></sec></sec>
</body>
<back>
<ack><p>We thank Misha Pogorelyy for kindly providing post-processed data from (<xref ref-type="bibr" rid="B32">32</xref>) and Quentin Marcou for help running <monospace>IGoR</monospace>. We also thank the other members of the Software WG for early stage discussion, especially Christian Busse, Enkelejda Miho, Inimary Toby, and Jian Ye.</p>
</ack><sec sec-type="supplementary-material" id="s8">
<title>Supplementary Material</title>
<p>The Supplementary Material for this article can be found online at: <ext-link ext-link-type="uri" xlink:href="https://www.frontiersin.org/articles/10.3389/fimmu.2019.02533/full#supplementary-material">https://www.frontiersin.org/articles/10.3389/fimmu.2019.02533/full#supplementary-material</ext-link></p>
<supplementary-material xlink:href="Data_Sheet_1.pdf" id="SM1" mimetype="application/pdf" xmlns:xlink="http://www.w3.org/1999/xlink"/></sec>
<ref-list>
<title>References</title>
<ref id="B1">
<label>1.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Hou</surname> <given-names>D</given-names></name> <name><surname>Ying</surname> <given-names>T</given-names></name> <name><surname>Wang</surname> <given-names>L</given-names></name> <name><surname>Chen</surname> <given-names>C</given-names></name> <name><surname>Lu</surname> <given-names>S</given-names></name> <name><surname>Wang</surname> <given-names>Q</given-names></name> <etal/></person-group>. <article-title>Immune repertoire diversity correlated with mortality in avian influenza A (H7N9) virus infected patients</article-title>. <source>Sci Rep.</source> (<year>2016</year>) <volume>6</volume>:<fpage>33843</fpage>. <pub-id pub-id-type="doi">10.1038/srep33843</pub-id><pub-id pub-id-type="pmid">27669665</pub-id></citation></ref>
<ref id="B2">
<label>2.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Martin</surname> <given-names>V</given-names></name> <name><surname>Bryan Wu</surname> <given-names>Y</given-names></name> <name><surname>Kipling</surname> <given-names>D</given-names></name> <name><surname>Dunn-Walters</surname> <given-names>D</given-names></name></person-group>. <article-title>Ageing of the B-cell repertoire</article-title>. <source>Philos Trans R Soc Lond B Biol Sci.</source> (<year>2015</year>) <volume>370</volume>:<fpage>20140237</fpage>. <pub-id pub-id-type="doi">10.1098/rstb.2014.0237</pub-id><pub-id pub-id-type="pmid">26194751</pub-id></citation></ref>
<ref id="B3">
<label>3.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Corcoran</surname> <given-names>M</given-names></name> <name><surname>Phad</surname> <given-names>G</given-names></name> <name><surname>Vzquez</surname> <given-names>BN</given-names></name> <name><surname>Stahl-Henning</surname> <given-names>C</given-names></name> <name><surname>Sumida</surname> <given-names>N</given-names></name> <name><surname>Persson</surname> <given-names>M</given-names></name> <etal/></person-group>. <article-title>Production of individualized V gene databases reveals high levels of immunoglobulin genetic diversity</article-title>. <source>Nat Commun.</source> (<year>2016</year>) <volume>7</volume>:<fpage>13642</fpage>. <pub-id pub-id-type="doi">10.1038/ncomms13642</pub-id><pub-id pub-id-type="pmid">27995928</pub-id></citation></ref>
<ref id="B4">
<label>4.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Gadala-Maria</surname> <given-names>D</given-names></name> <name><surname>Yaari</surname> <given-names>G</given-names></name> <name><surname>Uduman</surname> <given-names>M</given-names></name> <name><surname>Kleinstein</surname> <given-names>S</given-names></name></person-group>. <article-title>Automated analysis of high-throughput B-cell sequencing data reveals a high frequency of novel immunoglobulin V gene segment alleles</article-title>. <source>Proc Natl Acad Sci USA.</source> (<year>2015</year>) <volume>112</volume>:<fpage>E862</fpage>&#x02013;<lpage>70</lpage>. <pub-id pub-id-type="doi">10.1073/pnas.1417683112</pub-id><pub-id pub-id-type="pmid">25675496</pub-id></citation></ref>
<ref id="B5">
<label>5.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Boyd</surname> <given-names>S</given-names></name> <name><surname>Ga&#x000EB;ta</surname> <given-names>BA</given-names></name> <name><surname>Jackson</surname> <given-names>KJ</given-names></name> <name><surname>Fire</surname> <given-names>AZ</given-names></name> <name><surname>Marshall</surname> <given-names>EL</given-names></name> <name><surname>Merker</surname> <given-names>JD</given-names></name> <etal/></person-group>. <article-title>Individual variation in the germline Ig gene repertoire inferred from variable region gene rearrangements</article-title>. <source>J Immunol.</source> (<year>2010</year>) <volume>184</volume>:<fpage>6986</fpage>&#x02013;<lpage>92</lpage>. <pub-id pub-id-type="doi">10.4049/jimmunol.1000445</pub-id><pub-id pub-id-type="pmid">20495067</pub-id></citation></ref>
<ref id="B6">
<label>6.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bolen</surname> <given-names>C</given-names></name> <name><surname>Rubelt</surname> <given-names>F</given-names></name> <name><surname>Vander Heiden</surname> <given-names>J</given-names></name> <name><surname>Davis</surname> <given-names>M</given-names></name></person-group>. <article-title>The repertoire dissimilarity index as a method to compare lymphocyte receptor repertoires</article-title>. <source>BMC Bioinformatics.</source> (<year>2017</year>) <volume>18</volume>:<fpage>155</fpage>. <pub-id pub-id-type="doi">10.1186/s12859-017-1556-5</pub-id><pub-id pub-id-type="pmid">28264647</pub-id></citation></ref>
<ref id="B7">
<label>7.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Miqueu</surname> <given-names>P</given-names></name> <name><surname>Guillet</surname> <given-names>M</given-names></name> <name><surname>Degauque</surname> <given-names>N</given-names></name> <name><surname>Dor&#x000E9;</surname> <given-names>J</given-names></name> <name><surname>Soulillou</surname> <given-names>J</given-names></name> <name><surname>Brouard</surname> <given-names>S</given-names></name></person-group>. <article-title>Statistical analysis of CDR3 length distributions for the assessment of T and B cell repertoire biases</article-title>. <source>Mol Immunol.</source> (<year>2007</year>) <volume>44</volume>:<fpage>1057</fpage>&#x02013;<lpage>64</lpage>. <pub-id pub-id-type="doi">10.1016/j.molimm.2006.06.026</pub-id><pub-id pub-id-type="pmid">16930714</pub-id></citation></ref>
<ref id="B8">
<label>8.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Larimore</surname> <given-names>K</given-names></name> <name><surname>McCormick</surname> <given-names>MW</given-names></name> <name><surname>Robins</surname> <given-names>HS</given-names></name> <name><surname>Greenberg</surname> <given-names>PD</given-names></name></person-group>. <article-title>Shaping of human germline IgH repertoires revealed by deep sequencing</article-title>. <source>J Immunol.</source> (<year>2012</year>) <volume>189</volume>:<fpage>3221</fpage>&#x02013;<lpage>30</lpage>. <pub-id pub-id-type="doi">10.4049/jimmunol.1201303</pub-id><pub-id pub-id-type="pmid">22865917</pub-id></citation></ref>
<ref id="B9">
<label>9.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Madi</surname> <given-names>A</given-names></name> <name><surname>Chain</surname> <given-names>B</given-names></name> <name><surname>Shifrut</surname> <given-names>E</given-names></name> <name><surname>Gal</surname> <given-names>H</given-names></name> <name><surname>Shawe-Taylor</surname> <given-names>J</given-names></name> <name><surname>Best</surname> <given-names>K</given-names></name> <etal/></person-group>. <article-title>Tracking global changes induced in the CD4 T-cell receptor repertoire by immunization with a complex antigen using short stretches of CDR3 protein sequence</article-title>. <source>Bioinformatics.</source> (<year>2014</year>) <volume>30</volume>:<fpage>3181</fpage>&#x02013;<lpage>8</lpage>. <pub-id pub-id-type="doi">10.1093/bioinformatics/btu523</pub-id><pub-id pub-id-type="pmid">25095879</pub-id></citation></ref>
<ref id="B10">
<label>10.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ostmeyer</surname> <given-names>J</given-names></name> <name><surname>Christley</surname> <given-names>S</given-names></name> <name><surname>Rounds</surname> <given-names>WH</given-names></name> <name><surname>Toby</surname> <given-names>I</given-names></name> <name><surname>Greenberg</surname> <given-names>BM</given-names></name> <name><surname>Monson</surname> <given-names>NL</given-names></name> <etal/></person-group>. <article-title>Statistical classifiers for diagnosing disease from immune repertoires: a case study using multiple sclerosis</article-title>. <source>BMC Bioinformatics.</source> (<year>2017</year>) <volume>18</volume>:<fpage>401</fpage>. <pub-id pub-id-type="doi">10.1186/s12859-017-1814-6</pub-id><pub-id pub-id-type="pmid">28882107</pub-id></citation></ref>
<ref id="B11">
<label>11.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Heather</surname> <given-names>JM</given-names></name> <name><surname>Cinelli</surname> <given-names>M</given-names></name> <name><surname>Chain</surname> <given-names>B</given-names></name> <name><surname>Best</surname> <given-names>K</given-names></name> <name><surname>Sun</surname> <given-names>Y</given-names></name> <name><surname>Shawe-Taylor</surname> <given-names>J</given-names></name> <etal/></person-group>. <article-title>Feature selection using a one dimensional naive Bayes classifier increases the accuracy of support vector machine classification of CDR3 repertoires</article-title> <source>Bioinformatics.</source> (<year>2017</year>) <volume>33</volume>:<fpage>951</fpage>&#x02013;<lpage>5</lpage>. <pub-id pub-id-type="doi">10.1093/bioinformatics/btw771</pub-id><pub-id pub-id-type="pmid">28073756</pub-id></citation></ref>
<ref id="B12">
<label>12.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yokota</surname> <given-names>R</given-names></name> <name><surname>Kaminaga</surname> <given-names>Y</given-names></name> <name><surname>Kobayashi</surname> <given-names>TJ</given-names></name></person-group>. <article-title>Quantification of inter-sample differences in T-cell receptor repertoires using sequence-based information</article-title>. <source>Front Immunol.</source> (<year>2017</year>) <volume>8</volume>:<fpage>1500</fpage>. <pub-id pub-id-type="doi">10.3389/fimmu.2017.01500</pub-id><pub-id pub-id-type="pmid">29187849</pub-id></citation></ref>
<ref id="B13">
<label>13.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Chowell</surname> <given-names>D</given-names></name> <name><surname>Krishna</surname> <given-names>S</given-names></name> <name><surname>Becker</surname> <given-names>PD</given-names></name> <name><surname>Cocita</surname> <given-names>C</given-names></name> <name><surname>Shu</surname> <given-names>J</given-names></name> <name><surname>Tan</surname> <given-names>X</given-names></name> <etal/></person-group>. <article-title>TCR contact residue hydrophobicity is a hallmark of immunogenic cd8&#x0002B; t cell epitopes</article-title>. <source>Proc Natl Acad Sci U.S.A.</source> (<year>2015</year>) <volume>112</volume>:<fpage>E1754</fpage>&#x02013;<lpage>62</lpage>. <pub-id pub-id-type="doi">10.1073/pnas.1500973112</pub-id><pub-id pub-id-type="pmid">25831525</pub-id></citation></ref>
<ref id="B14">
<label>14.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ostmeyer</surname> <given-names>J</given-names></name> <name><surname>Christley</surname> <given-names>S</given-names></name> <name><surname>Toby</surname> <given-names>IT</given-names></name> <name><surname>Cowell</surname> <given-names>LG</given-names></name></person-group>. <article-title>Biophysicochemical motifs in t-cell receptor sequences distinguish repertoires from tumor-infiltrating lymphocyte and adjacent healthy tissue</article-title>. <source>Cancer Res.</source> (<year>2019</year>) <volume>79</volume>:<fpage>1671</fpage>&#x02013;<lpage>80</lpage>. <pub-id pub-id-type="doi">10.1158/0008-5472.CAN-18-2292</pub-id><pub-id pub-id-type="pmid">30622114</pub-id></citation></ref>
<ref id="B15">
<label>15.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Wu</surname> <given-names>YCB</given-names></name> <name><surname>Kipling</surname> <given-names>D</given-names></name> <name><surname>Dunn-Walters</surname> <given-names>DK</given-names></name></person-group>. <article-title>The relationship between cd27 negative and positive b cell populations in human peripheral blood</article-title>. <source>Front Immunol.</source> (<year>2011</year>) <volume>2</volume>:<fpage>81</fpage>. <pub-id pub-id-type="doi">10.3389/fimmu.2011.00081</pub-id><pub-id pub-id-type="pmid">22566870</pub-id></citation></ref>
<ref id="B16">
<label>16.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Wu</surname> <given-names>YC</given-names></name> <name><surname>Kipling</surname> <given-names>D</given-names></name> <name><surname>Leong</surname> <given-names>HS</given-names></name> <name><surname>Martin</surname> <given-names>V</given-names></name> <name><surname>Ademokun</surname> <given-names>AA</given-names></name> <name><surname>Dunn-Walters</surname> <given-names>DK</given-names></name></person-group>. <article-title>High-throughput immunoglobulin repertoire analysis distinguishes between human igm memory and switched memory b-cell populations</article-title>. <source>Blood.</source> (<year>2010</year>) <volume>116</volume>:<fpage>1070</fpage>&#x02013;<lpage>8</lpage>. <pub-id pub-id-type="doi">10.1182/blood-2010-03-275859</pub-id><pub-id pub-id-type="pmid">20457872</pub-id></citation></ref>
<ref id="B17">
<label>17.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ralph</surname> <given-names>DK</given-names></name> <name><surname>Matsen</surname> <given-names>FA</given-names> <suffix>IV</suffix></name></person-group>. <article-title>Likelihood-based inference of B cell clonal families</article-title>. <source>PLoS Comput Biol.</source> (<year>2016</year>) <volume>12</volume>:<fpage>e1005086</fpage>. <pub-id pub-id-type="doi">10.1371/journal.pcbi.1005086</pub-id><pub-id pub-id-type="pmid">27749910</pub-id></citation></ref>
<ref id="B18">
<label>18.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Gupta</surname> <given-names>NT</given-names></name> <name><surname>Adams</surname> <given-names>KD</given-names></name> <name><surname>Briggs</surname> <given-names>AW</given-names></name> <name><surname>Timberlake</surname> <given-names>SC</given-names></name> <name><surname>Vigneault</surname> <given-names>F</given-names></name> <name><surname>Kleinstein</surname> <given-names>SH</given-names></name></person-group>. <article-title>Hierarchical clustering can identify b cell clones with high confidence in ig repertoire sequencing data</article-title>. <source>J Immunol.</source> (<year>2017</year>) <volume>198</volume>:<fpage>2489</fpage>&#x02013;<lpage>99</lpage>. <pub-id pub-id-type="doi">10.4049/jimmunol.1601850</pub-id><pub-id pub-id-type="pmid">28179494</pub-id></citation></ref>
<ref id="B19">
<label>19.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Marcou</surname> <given-names>Q</given-names></name> <name><surname>Mora</surname> <given-names>T</given-names></name> <name><surname>Walczak</surname> <given-names>AM</given-names></name></person-group>. <article-title>High-throughput immune repertoire analysis with IGoR</article-title>. <source>Nat Commun.</source> (<year>2018</year>) <volume>9</volume>:<fpage>561</fpage>. <pub-id pub-id-type="doi">10.1038/s41467-018-02832-w</pub-id><pub-id pub-id-type="pmid">29422654</pub-id></citation></ref>
<ref id="B20">
<label>20.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yaari</surname> <given-names>G</given-names></name> <name><surname>Uduman</surname> <given-names>M</given-names></name> <name><surname>Kleinstein</surname> <given-names>SH</given-names></name></person-group>. <article-title>Quantifying selection in high-throughput immunoglobulin sequencing data sets</article-title>. <source>Nucleic Acids Res.</source> (<year>2012</year>) <volume>40</volume>:<fpage>e134</fpage>. <pub-id pub-id-type="doi">10.1093/nar/gks457</pub-id><pub-id pub-id-type="pmid">22641856</pub-id></citation></ref>
<ref id="B21">
<label>21.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Gupta</surname> <given-names>NT</given-names></name> <name><surname>Vander Heiden</surname> <given-names>JA</given-names></name> <name><surname>Uduman</surname> <given-names>M</given-names></name> <name><surname>Gadala-Maria</surname> <given-names>D</given-names></name> <name><surname>Yaari</surname> <given-names>G</given-names></name> <name><surname>Kleinstein</surname> <given-names>SH</given-names></name></person-group>. <article-title>Change-O: a toolkit for analyzing large-scale B cell immunoglobulin repertoire sequencing data</article-title>. <source>Bioinformatics.</source> (<year>2015</year>) <volume>31</volume>:<fpage>3356</fpage>&#x02013;<lpage>8</lpage>. <pub-id pub-id-type="doi">10.1093/bioinformatics/btv359</pub-id><pub-id pub-id-type="pmid">26069265</pub-id></citation></ref>
<ref id="B22">
<label>22.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ralph</surname> <given-names>DK</given-names></name> <name><surname>Matsen</surname> <given-names>FA</given-names> <suffix>IV</suffix></name></person-group>. <article-title>Consistency of VDJ rearrangement and substitution parameters enables accurate B cell receptor sequence annotation</article-title>. <source>PLoS Comput Biol.</source> (<year>2016</year>) <volume>12</volume>:<fpage>e1004409</fpage>. <pub-id pub-id-type="doi">10.1371/journal.pcbi.1004409</pub-id><pub-id pub-id-type="pmid">26751373</pub-id></citation></ref>
<ref id="B23">
<label>23.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Vander Heiden</surname> <given-names>JA</given-names></name> <name><surname>Marquez</surname> <given-names>S</given-names></name> <name><surname>Marthandan</surname> <given-names>N</given-names></name> <name><surname>Bukhari</surname> <given-names>SAC</given-names></name> <name><surname>Busse</surname> <given-names>CE</given-names></name> <name><surname>Corrie</surname> <given-names>B</given-names></name> <etal/></person-group>. <article-title>AIRR community standardized representations for annotated immune repertoires</article-title>. <source>Front Immunol.</source> (<year>2018</year>) <volume>9</volume>:<fpage>2206</fpage>. <pub-id pub-id-type="doi">10.3389/fimmu.2018.02206</pub-id><pub-id pub-id-type="pmid">30323809</pub-id></citation></ref>
<ref id="B24">
<label>24.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Boettiger</surname> <given-names>C</given-names></name></person-group>. <article-title>An introduction to docker for reproducible research</article-title>. <source>SIGOPS Oper Syst Rev.</source> (<year>2015</year>) <volume>49</volume>:<fpage>71</fpage>&#x02013;<lpage>9</lpage>. <pub-id pub-id-type="doi">10.1145/2723872.2723882</pub-id></citation></ref>
<ref id="B25">
<label>25.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>van der Loo</surname> <given-names>MP</given-names></name></person-group>. <article-title>The stringdist package for approximate string matching</article-title>. <source>R J.</source> (<year>2014</year>) <volume>6</volume>:<fpage>111</fpage>&#x02013;<lpage>22</lpage>. <pub-id pub-id-type="doi">10.32614/RJ-2014-011</pub-id></citation></ref>
<ref id="B26">
<label>26.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Paradis</surname> <given-names>E</given-names></name> <name><surname>Claude</surname> <given-names>J</given-names></name> <name><surname>Strimmer</surname> <given-names>K</given-names></name></person-group>. <article-title>APE: analyses of phylogenetics and evolution in R lanugage</article-title>. <source>Bioinformatics.</source> (<year>2004</year>) <volume>20</volume>:<fpage>289</fpage>&#x02013;<lpage>90</lpage>. <pub-id pub-id-type="doi">10.1093/bioinformatics/btg412</pub-id><pub-id pub-id-type="pmid">14734327</pub-id></citation></ref>
<ref id="B27">
<label>27.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Pag&#x000E1;s</surname> <given-names>H</given-names></name> <name><surname>Aboyoun</surname> <given-names>P</given-names></name> <name><surname>Gentleman</surname> <given-names>R</given-names></name> <name><surname>DebRoy</surname> <given-names>S</given-names></name></person-group>. <source>Biostrings: String Objects Representing Biological Sequences, and Matching Algorithms</source>. R package version 2.44.2 (<year>2017</year>).</citation></ref>
<ref id="B28">
<label>28.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>McFerrin</surname> <given-names>L</given-names></name></person-group>. <source>HDMD: Statistical Analysis Tools for High Dimension Molecular Data DMD</source>. R package version 1.2 (<year>2013</year>).</citation></ref>
<ref id="B29">
<label>29.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Mir</surname> <given-names>A</given-names></name> <name><surname>Rossello</surname> <given-names>F</given-names></name> <name><surname>Rotger</surname> <given-names>L</given-names></name></person-group>. <source>CollessLike: Distribution and Percentile of Sackin, Cophenetic and Colless-Like Balance Indices of Phylogenetic Trees</source>. R package version 1.0 (<year>2018</year>).</citation></ref>
<ref id="B30">
<label>30.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Atchley</surname> <given-names>WR</given-names></name> <name><surname>Zhao</surname> <given-names>J</given-names></name> <name><surname>Fernandes</surname> <given-names>AD</given-names></name> <name><surname>Dr&#x000FC;ke</surname> <given-names>T</given-names></name></person-group>. <article-title>Solving the protein sequence metric problem</article-title>. <source>Proc Natl Acad Sci USA.</source> (<year>2005</year>) <volume>102</volume>:<fpage>6395</fpage>&#x02013;<lpage>400</lpage>. <pub-id pub-id-type="doi">10.1073/pnas.0408677102</pub-id><pub-id pub-id-type="pmid">15851683</pub-id></citation></ref>
<ref id="B31">
<label>31.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kidera</surname> <given-names>A</given-names></name> <name><surname>Konishi</surname> <given-names>Y</given-names></name> <name><surname>Oka</surname> <given-names>M</given-names></name> <name><surname>Ooi</surname> <given-names>T</given-names></name> <name><surname>Scheraga</surname> <given-names>AH</given-names></name></person-group>. <article-title>Statistical analysis of the physical properties of the 20 naturally occurring amino acids</article-title>. <source>J Protein Chem.</source> (<year>1985</year>) <volume>4</volume>:<fpage>23</fpage>&#x02013;<lpage>55</lpage>. <pub-id pub-id-type="doi">10.1007/BF01025492</pub-id></citation></ref>
<ref id="B32">
<label>32.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Pogorelyy</surname> <given-names>MV</given-names></name> <name><surname>Minervina</surname> <given-names>AA</given-names></name> <name><surname>Touzel</surname> <given-names>MP</given-names></name> <name><surname>Sycheva</surname> <given-names>AL</given-names></name> <name><surname>Komech</surname> <given-names>EA</given-names></name> <name><surname>Kovalenko</surname> <given-names>EI</given-names></name> <etal/></person-group>. <article-title>Precise tracking of vaccine-responding t cell clones reveals convergent and personalized response in identical twins</article-title>. <source>Proc Natl Acad Sci USA.</source> (<year>2018</year>) <volume>115</volume>:<fpage>12704</fpage>&#x02013;<lpage>9</lpage>. <pub-id pub-id-type="doi">10.1073/pnas.1809642115</pub-id><pub-id pub-id-type="pmid">30459272</pub-id></citation></ref>
<ref id="B33">
<label>33.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Rubelt</surname> <given-names>F</given-names></name> <name><surname>Bolen</surname> <given-names>CR</given-names></name> <name><surname>McGuire</surname> <given-names>HM</given-names></name> <name><surname>Heiden</surname> <given-names>JAV</given-names></name> <name><surname>Gadala-Maria</surname> <given-names>D</given-names></name> <name><surname>Levin</surname> <given-names>M</given-names></name> <etal/></person-group>. <article-title>Individual heritable differences result in unique cell lymphocyte receptor repertoires of na&#x000EF;ve and antigen-experienced cells</article-title>. <source>Nat Commun.</source> (<year>2016</year>) <volume>7</volume>:<fpage>11112 EP</fpage>. <pub-id pub-id-type="doi">10.1038/ncomms11112</pub-id><pub-id pub-id-type="pmid">27005435</pub-id></citation></ref>
<ref id="B34">
<label>34.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Britanova</surname> <given-names>OV</given-names></name> <name><surname>Shugay</surname> <given-names>M</given-names></name> <name><surname>Merzlyak</surname> <given-names>EM</given-names></name> <name><surname>Staroverov</surname> <given-names>DB</given-names></name> <name><surname>Putintseva</surname> <given-names>EV</given-names></name> <name><surname>Turchaninova</surname> <given-names>MA</given-names></name> <etal/></person-group>. <article-title>Dynamics of individual T cell repertoires: from cord blood to centenarians</article-title>. <source>J Immunol.</source> (<year>2016</year>) <volume>196</volume>:<fpage>5005</fpage>&#x02013;<lpage>13</lpage>. <pub-id pub-id-type="doi">10.4049/jimmunol.1600005</pub-id><pub-id pub-id-type="pmid">27183615</pub-id></citation></ref>
<ref id="B35">
<label>35.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Elhanati</surname> <given-names>Y</given-names></name> <name><surname>Murugan</surname> <given-names>A</given-names></name> <name><surname>Callan</surname> <given-names>CG</given-names> <suffix>Jr</suffix></name> <name><surname>Mora</surname> <given-names>T</given-names></name> <name><surname>Walczak</surname> <given-names>AM</given-names></name></person-group>. <article-title>Quantifying selection in immune receptor repertoires</article-title>. <source>Proc Natl Acad Sci USA.</source> (<year>2014</year>) <volume>111</volume>:<fpage>9875</fpage>&#x02013;<lpage>80</lpage>. <pub-id pub-id-type="doi">10.1073/pnas.1409572111</pub-id><pub-id pub-id-type="pmid">24941953</pub-id></citation></ref>
<ref id="B36">
<label>36.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ye</surname> <given-names>J</given-names></name> <name><surname>Ma</surname> <given-names>N</given-names></name> <name><surname>Madden</surname> <given-names>TL</given-names></name> <name><surname>Ostell</surname> <given-names>JM</given-names></name></person-group>. <article-title>IgBLAST: an immunoglobulin variable domain sequence analysis tool</article-title>. <source>Nucleic Acids Res.</source> <volume>41</volume>:<fpage>W34</fpage>&#x02013;<lpage>40</lpage>. <pub-id pub-id-type="doi">10.1093/nar/gkt382</pub-id><pub-id pub-id-type="pmid">23671333</pub-id></citation></ref>
<ref id="B37">
<label>37.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Laserson</surname> <given-names>U</given-names></name> <name><surname>Vigneault</surname> <given-names>F</given-names></name> <name><surname>Gadala-Maria</surname> <given-names>D</given-names></name> <name><surname>Yaari</surname> <given-names>G</given-names></name> <name><surname>Uduman</surname> <given-names>M</given-names></name> <name><surname>Vander Heiden</surname> <given-names>JA</given-names></name> <etal/></person-group>. <article-title>High-resolution antibody dynamics of vaccine-induced immune responses</article-title>. <source>Proc Natl Acad Sci USA.</source> (<year>2014</year>) <volume>111</volume>:<fpage>4928</fpage>&#x02013;<lpage>33</lpage>. <pub-id pub-id-type="doi">10.1073/pnas.1323862111</pub-id><pub-id pub-id-type="pmid">24639495</pub-id></citation></ref>
<ref id="B38">
<label>38.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Finlay</surname> <given-names>WJJ</given-names></name> <name><surname>Almagro</surname> <given-names>JC</given-names></name></person-group>. <article-title>Natural and man-made V-gene repertoires for antibody discovery</article-title>. <source>Front Immunol.</source> (<year>2012</year>) <volume>3</volume>:<fpage>342</fpage>. <pub-id pub-id-type="doi">10.3389/fimmu.2012.00342</pub-id><pub-id pub-id-type="pmid">23162556</pub-id></citation></ref>
<ref id="B39">
<label>39.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Nazarov</surname> <given-names>VI</given-names></name> <name><surname>Pogorelyy</surname> <given-names>MV</given-names></name> <name><surname>Komech</surname> <given-names>EA</given-names></name> <name><surname>Zvyagin</surname> <given-names>IV</given-names></name> <name><surname>Bolotin</surname> <given-names>DA</given-names></name> <name><surname>Shugay</surname> <given-names>M</given-names></name> <etal/></person-group>. <article-title>tcr: an R package for T cell receptor repertoire advanced data analysis</article-title>. <source>BMC Bioinformatics.</source> (<year>2015</year>) <volume>16</volume>:<fpage>175</fpage>. <pub-id pub-id-type="doi">10.1186/s12859-015-0613-1</pub-id><pub-id pub-id-type="pmid">26017500</pub-id></citation></ref>
<ref id="B40">
<label>40.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bischof</surname> <given-names>J</given-names></name> <name><surname>Ibrahim</surname> <given-names>SM</given-names></name></person-group>. <article-title>bcRep: R package for comprehensive analysis of B cell receptor repertoire data</article-title>. <source>PLoS ONE.</source> (<year>2016</year>) <volume>11</volume>:<fpage>e0161569</fpage>. <pub-id pub-id-type="doi">10.1371/journal.pone.0161569</pub-id><pub-id pub-id-type="pmid">27551775</pub-id></citation></ref>
<ref id="B41">
<label>41.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Shugay</surname> <given-names>M</given-names></name> <name><surname>Bagaev</surname> <given-names>DV</given-names></name> <name><surname>Turchaninova</surname> <given-names>MA</given-names></name> <name><surname>Bolotin</surname> <given-names>DA</given-names></name> <name><surname>Britanova</surname> <given-names>OV</given-names></name> <name><surname>Putintseva</surname> <given-names>EV</given-names></name> <etal/></person-group>. <article-title>VDJtools: unifying post-analysis of T cell receptor repertoires</article-title>. <source>PLoS Comput Biol.</source> (<year>2015</year>) <volume>11</volume>:<fpage>e1004503</fpage>. <pub-id pub-id-type="doi">10.1371/journal.pcbi.1004503</pub-id><pub-id pub-id-type="pmid">26606115</pub-id></citation></ref>
<ref id="B42">
<label>42.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Schaller</surname> <given-names>S</given-names></name> <name><surname>Weinberger</surname> <given-names>J</given-names></name> <name><surname>Jimenez-Heredia</surname> <given-names>R</given-names></name> <name><surname>Danzer</surname> <given-names>M</given-names></name> <name><surname>Oberbauer</surname> <given-names>R</given-names></name> <name><surname>Gabriel</surname> <given-names>C</given-names></name> <etal/></person-group>. <article-title>Immunexplorer (imex): a software framework for diversity and clonality analyses of immunoglobulins and t cell receptors on the basis of imgt/highv-quest preprocessed ngs data</article-title>. <source>PLoS ONE.</source> (<year>2015</year>) <volume>16</volume>:<fpage>252</fpage>. <pub-id pub-id-type="doi">10.1186/s12859-015-0687-9</pub-id><pub-id pub-id-type="pmid">26264428</pub-id></citation></ref>
<ref id="B43">
<label>43.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Duez</surname> <given-names>M</given-names></name> <name><surname>Giraud</surname> <given-names>M</given-names></name> <name><surname>Herbert</surname> <given-names>R</given-names></name> <name><surname>Rocher</surname> <given-names>T</given-names></name> <name><surname>Salson</surname> <given-names>M</given-names></name> <name><surname>Thonier</surname> <given-names>F</given-names></name></person-group>. <article-title>Vidjil: a web platform for analysis of high-throughput repertoire sequencing</article-title>. <source>PLoS ONE.</source> (<year>2016</year>) <volume>11</volume>:<fpage>e0166126</fpage>. <pub-id pub-id-type="doi">10.1371/journal.pone.0166126</pub-id><pub-id pub-id-type="pmid">27835690</pub-id></citation></ref>
<ref id="B44">
<label>44.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Avram</surname> <given-names>O</given-names></name> <name><surname>Vaisman-Mentesh</surname> <given-names>A</given-names></name> <name><surname>Yehezkel</surname> <given-names>D</given-names></name> <name><surname>Ashkenazy</surname> <given-names>H</given-names></name> <name><surname>Pupko</surname> <given-names>T</given-names></name> <name><surname>Wine</surname> <given-names>Y</given-names></name></person-group>. <article-title>Asap - a webserver for immunoglobulin-sequencing analysis pipeline</article-title>. <source>Front Immunol.</source> (<year>2018</year>) <volume>9</volume>:<fpage>1686</fpage>. <pub-id pub-id-type="doi">10.3389/fimmu.2018.01686</pub-id><pub-id pub-id-type="pmid">30105017</pub-id></citation></ref>
<ref id="B45">
<label>45.</label>
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>IJspeert</surname> <given-names>H</given-names></name> <name><surname>van Schouwenburg</surname> <given-names>PA</given-names></name> <name><surname>van Zessen</surname> <given-names>D</given-names></name> <name><surname>Pico-Knijnenburg</surname> <given-names>I</given-names></name> <name><surname>Stubbs</surname> <given-names>AP</given-names></name> <name><surname>van der Burg</surname> <given-names>M</given-names></name></person-group>. <article-title>Antigen receptor galaxy: a user-friendly, web-based tool for analysis and visualization of t and b cell receptor repertoire data</article-title>. <source>J Immunol.</source> (<year>2017</year>) <volume>198</volume>:<fpage>4156</fpage>&#x02013;<lpage>4165</lpage>. <pub-id pub-id-type="doi">10.4049/jimmunol.1601921</pub-id><pub-id pub-id-type="pmid">28416602</pub-id></citation></ref>
</ref-list>
<fn-group>
<fn fn-type="financial-disclosure"><p><bold>Funding.</bold> This research was supported by NIH grants R01 GM113246, R01 AI146028, and U19 AI128914. MS was supported by RFBR grant No. 19-34-70011. The research of FM was supported in part by a Faculty Scholar grant from the Howard Hughes Medical Institute and the Simons Foundation.</p>
</fn>
</fn-group>
</back>
</article> 