<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD with MathML3 v1.2 20190208//EN"  "JATS-archivearticle1-mathml3.dtd"><article xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article" dtd-version="1.2"><front><journal-meta><journal-id journal-id-type="nlm-ta">elife</journal-id><journal-id journal-id-type="publisher-id">eLife</journal-id><journal-title-group><journal-title>eLife</journal-title></journal-title-group><issn publication-format="electronic" pub-type="epub">2050-084X</issn><publisher><publisher-name>eLife Sciences Publications, Ltd</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">85145</article-id><article-id pub-id-type="doi">10.7554/eLife.85145</article-id><article-categories><subj-group subj-group-type="display-channel"><subject>Research Article</subject></subj-group><subj-group subj-group-type="heading"><subject>Computational and Systems Biology</subject></subj-group><subj-group subj-group-type="heading"><subject>Immunology and Inflammation</subject></subj-group></article-categories><title-group><article-title>Statistical inference reveals the role of length, GC content, and local sequence in V(D)J nucleotide trimming</article-title></title-group><contrib-group><contrib contrib-type="author" corresp="yes" id="author-251663"><name><surname>Russell</surname><given-names>Magdalena L</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0002-1068-1968</contrib-id><email>magruss@uw.edu</email><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref><xref ref-type="other" rid="fund1"/><xref ref-type="fn" rid="con1"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author" id="author-136350"><name><surname>Simon</surname><given-names>Noah</given-names></name><xref ref-type="aff" rid="aff3">3</xref><xref ref-type="other" rid="fund1"/><xref ref-type="fn" rid="con2"/><xref ref-type="fn" rid="conf2"/></contrib><contrib contrib-type="author" corresp="yes" equal-contrib="yes" id="author-174735"><name><surname>Bradley</surname><given-names>Philip</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0002-0224-6464</contrib-id><email>pbradley@fredhutch.org</email><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff4">4</xref><xref ref-type="fn" rid="equal-contrib1">†</xref><xref ref-type="other" rid="fund2"/><xref ref-type="other" rid="fund3"/><xref ref-type="other" rid="fund1"/><xref ref-type="fn" rid="con3"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author" corresp="yes" equal-contrib="yes" id="author-113042"><name><surname>Matsen</surname><given-names>Frederick A</given-names><suffix>IV</suffix></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0003-0607-6025</contrib-id><email>matsen@fredhutch.org</email><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff5">5</xref><xref ref-type="aff" rid="aff6">6</xref><xref ref-type="aff" rid="aff7">7</xref><xref ref-type="fn" rid="equal-contrib1">†</xref><xref ref-type="other" rid="fund4"/><xref ref-type="other" rid="fund1"/><xref ref-type="fn" rid="con4"/><xref ref-type="fn" rid="conf1"/></contrib><aff id="aff1"><label>1</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/007ps6h72</institution-id><institution>Computational Biology Program, Fred Hutchinson Cancer Center</institution></institution-wrap><addr-line><named-content content-type="city">Seattle</named-content></addr-line><country>United States</country></aff><aff id="aff2"><label>2</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/00cvxb145</institution-id><institution>Molecular and Cellular Biology Program, University of Washington</institution></institution-wrap><addr-line><named-content content-type="city">Seattle</named-content></addr-line><country>United States</country></aff><aff id="aff3"><label>3</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/00cvxb145</institution-id><institution>Department of Biostatistics, University of Washington</institution></institution-wrap><addr-line><named-content content-type="city">Seattle</named-content></addr-line><country>United States</country></aff><aff id="aff4"><label>4</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/00cvxb145</institution-id><institution>Institute for Protein Design, Department of Biochemistry, University of Washington</institution></institution-wrap><addr-line><named-content content-type="city">Seattle</named-content></addr-line><country>United States</country></aff><aff id="aff5"><label>5</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/00cvxb145</institution-id><institution>Department of Genome Sciences, University of Washington</institution></institution-wrap><addr-line><named-content content-type="city">Seattle</named-content></addr-line><country>United States</country></aff><aff id="aff6"><label>6</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/00cvxb145</institution-id><institution>Department of Statistics, University of Washington</institution></institution-wrap><addr-line><named-content content-type="city">Seattle</named-content></addr-line><country>United States</country></aff><aff id="aff7"><label>7</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/006w34k90</institution-id><institution>Howard Hughes Medical Institute</institution></institution-wrap><addr-line><named-content content-type="city">Seattle</named-content></addr-line><country>United States</country></aff></contrib-group><contrib-group content-type="section"><contrib contrib-type="editor"><name><surname>Graw</surname><given-names>Frederik</given-names></name><role>Reviewing Editor</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/00f7hpc57</institution-id><institution>Friedrich-Alexander-University Erlangen-Nürnberg</institution></institution-wrap><country>Germany</country></aff></contrib><contrib contrib-type="senior_editor"><name><surname>Diamond</surname><given-names>Betty</given-names></name><role>Senior Editor</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/05dnene97</institution-id><institution>The Feinstein Institute for Medical Research</institution></institution-wrap><country>United States</country></aff></contrib></contrib-group><author-notes><fn fn-type="con" id="equal-contrib1"><label>†</label><p>These authors contributed equally to this work</p></fn></author-notes><pub-date publication-format="electronic" date-type="publication"><day>25</day><month>05</month><year>2023</year></pub-date><pub-date pub-type="collection"><year>2023</year></pub-date><volume>12</volume><elocation-id>e85145</elocation-id><history><date date-type="received" iso-8601-date="2022-11-24"><day>24</day><month>11</month><year>2022</year></date><date date-type="accepted" iso-8601-date="2023-04-11"><day>11</day><month>04</month><year>2023</year></date></history><pub-history><event><event-desc>This manuscript was published as a preprint at bioRxiv.</event-desc><date date-type="preprint" iso-8601-date="2022-12-12"><day>12</day><month>12</month><year>2022</year></date><self-uri content-type="preprint" xlink:href="https://doi.org/10.1101/2022.12.08.519635"/></event></pub-history><permissions><copyright-statement>© 2023, Russell et al</copyright-statement><copyright-year>2023</copyright-year><copyright-holder>Russell et al</copyright-holder><ali:free_to_read/><license xlink:href="http://creativecommons.org/licenses/by/4.0/"><ali:license_ref>http://creativecommons.org/licenses/by/4.0/</ali:license_ref><license-p>This article is distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution License</ext-link>, which permits unrestricted use and redistribution provided that the original author and source are credited.</license-p></license></permissions><self-uri content-type="pdf" xlink:href="elife-85145-v1.pdf"/><self-uri content-type="figures-pdf" xlink:href="elife-85145-figures-v1.pdf"/><abstract><p>To appropriately defend against a wide array of pathogens, humans somatically generate highly diverse repertoires of B cell and T cell receptors (BCRs and TCRs) through a random process called V(D)J recombination. Receptor diversity is achieved during this process through both the combinatorial assembly of V(D)J-genes and the junctional deletion and insertion of nucleotides. While the Artemis protein is often regarded as the main nuclease involved in V(D)J recombination, the exact mechanism of nucleotide trimming is not understood. Using a previously published TCRβ repertoire sequencing data set, we have designed a flexible probabilistic model of nucleotide trimming that allows us to explore various mechanistically interpretable sequence-level features. We show that local sequence context, length, and GC nucleotide content in both directions of the wider sequence, together, can most accurately predict the trimming probabilities of a given V-gene sequence. Because GC nucleotide content is predictive of sequence-breathing, this model provides quantitative statistical evidence regarding the extent to which double-stranded DNA may need to be able to breathe for trimming to occur. We also see evidence of a sequence motif that appears to get preferentially trimmed, independent of GC-content-related effects. Further, we find that the inferred coefficients from this model provide accurate prediction for V- and J-gene sequences from other adaptive immune receptor loci. These results refine our understanding of how the Artemis nuclease may function to trim nucleotides during V(D)J recombination and provide another step toward understanding how V(D)J recombination generates diverse receptors and supports a powerful, unique immune response in healthy humans.</p></abstract><kwd-group kwd-group-type="author-keywords"><kwd>V(D)J recombination</kwd><kwd>trimming profiles</kwd><kwd>Artemis</kwd><kwd>adaptive immune receptor repertoires</kwd></kwd-group><kwd-group kwd-group-type="research-organism"><title>Research organism</title><kwd>Human</kwd></kwd-group><funding-group><award-group id="fund1"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100000002</institution-id><institution>National Institutes of Health</institution></institution-wrap></funding-source><award-id>R01 AI146028</award-id><principal-award-recipient><name><surname>Russell</surname><given-names>Magdalena L</given-names></name><name><surname>Bradley</surname><given-names>Philip</given-names></name><name><surname>Simon</surname><given-names>Noah</given-names></name><name><surname>Matsen</surname><given-names>Frederick A</given-names><suffix>IV</suffix></name></principal-award-recipient></award-group><award-group id="fund2"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100000002</institution-id><institution>National Institutes of Health</institution></institution-wrap></funding-source><award-id>R01 AI136514</award-id><principal-award-recipient><name><surname>Bradley</surname><given-names>Philip</given-names></name></principal-award-recipient></award-group><award-group id="fund3"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100000002</institution-id><institution>National Institutes of Health</institution></institution-wrap></funding-source><award-id>R35 GM141457</award-id><principal-award-recipient><name><surname>Bradley</surname><given-names>Philip</given-names></name></principal-award-recipient></award-group><award-group id="fund4"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100000011</institution-id><institution>Howard Hughes Medical Institute</institution></institution-wrap></funding-source><award-id>Investigator</award-id><principal-award-recipient><name><surname>Matsen</surname><given-names>Frederick A</given-names><suffix>IV</suffix></name></principal-award-recipient></award-group><funding-statement>The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.</funding-statement></funding-group><custom-meta-group><custom-meta specific-use="meta-only"><meta-name>Author impact statement</meta-name><meta-value>Local sequence context, length, and GC nucleotide content in both directions of the trimming site, together, are highly predictive of V(D)J trimming probabilities for both TR and IG adaptive immune receptor loci.</meta-value></custom-meta></custom-meta-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><p>Cells throughout the body regularly present protein fragments, known as antigens, on cell-surface molecules called major histocompatibility complex (MHC). Receptors on the surface of T cells can bind to these MHC-bound antigens, recognize them, and, if necessary, initiate an immune response. For an individual to be capable of defending against a wide array of potential foreign pathogens, they somatically generate a massive diversity of T cell receptors (TCRs) through a random process called V(D)J recombination. After generation, TCRs undergo a selection process to ensure proper expression, MHC recognition, and limited autoreactivity. The collection of TCRs in an individual comprises their TCR repertoire.</p><p>The majority of human T cells express α-β receptors that consist of an α and a β protein chain. During the V(D)J recombination process of the β chain, a single V-, D-, and J-gene are randomly chosen from a pool of V-gene, D-gene, and J-gene segments within the germline TCRβ locus over a series of steps. To begin this process, the recombination activating gene protein complex aligns a randomly chosen D- and J-gene, removes the intervening chromosomal DNA between the two genes, and forms a hairpin loop at the end of each gene (<xref ref-type="bibr" rid="bib17">Gellert, 1994</xref>; <xref ref-type="bibr" rid="bib15">Fugmann et al., 2000</xref>; <xref ref-type="bibr" rid="bib44">Schatz and Swanson, 2011</xref>). Each hairpin loop is then nicked open, typically in an asymmetrical fashion, by the Artemis:DNA-PKcs protein complex (<xref ref-type="bibr" rid="bib29">Ma et al., 2002</xref>; <xref ref-type="bibr" rid="bib27">Lu et al., 2007</xref>). This asymmetrical hairpin opening creates a single-stranded DNA overhang at the end of both genes that, depending on the location of the hairpin nick, may contain P-nucleotides (short palindromes of gene terminal sequence) (<xref ref-type="bibr" rid="bib16">Gauss and Lieber, 1996</xref>; <xref ref-type="bibr" rid="bib36">Nadel and Feeney, 1997</xref>; <xref ref-type="bibr" rid="bib29">Ma et al., 2002</xref>; <xref ref-type="bibr" rid="bib21">Jackson et al., 2004</xref>; <xref ref-type="bibr" rid="bib27">Lu et al., 2007</xref>). The most dominant hairpin opening position leads to a single-stranded 3’ overhang that is 4 nucleotides in length (2 nucleotides of which are P-nucleotides) (<xref ref-type="bibr" rid="bib27">Lu et al., 2007</xref>). From here, nucleotides may be deleted from each gene end through an incompletely understood mechanism suggested to involve Artemis (<xref ref-type="bibr" rid="bib13">Feeney et al., 1994</xref>; <xref ref-type="bibr" rid="bib35">Nadel and Feeney, 1995</xref>; <xref ref-type="bibr" rid="bib36">Nadel and Feeney, 1997</xref>; <xref ref-type="bibr" rid="bib21">Jackson et al., 2004</xref>; <xref ref-type="bibr" rid="bib20">Gu et al., 2010</xref>; <xref ref-type="bibr" rid="bib2">Chang et al., 2015</xref>; <xref ref-type="bibr" rid="bib3">Chang and Lieber, 2016</xref>; <xref ref-type="bibr" rid="bib56">Zhao et al., 2020</xref>; <xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>). This nucleotide trimming can remove traces of P-nucleotides (<xref ref-type="bibr" rid="bib16">Gauss and Lieber, 1996</xref>; <xref ref-type="bibr" rid="bib49">Srivastava and Robins, 2012</xref>). Non-template-encoded nucleotides, known as N-insertions, can also be added to each gene end by the enzyme terminal deoxynucleotidyl transferase (<xref ref-type="bibr" rid="bib24">Kallenbach et al., 1992</xref>; <xref ref-type="bibr" rid="bib19">Gilfillan et al., 1993</xref>; <xref ref-type="bibr" rid="bib25">Komori et al., 1993</xref>). Once the nucleotide addition and deletion steps are completed, the gene segments are paired and ligated together (<xref ref-type="bibr" rid="bib56">Zhao et al., 2020</xref>). From here, the process is repeated between a random V-gene and this combined D-J junction to complete the TCRβ chain. A similar TCR chain recombination then proceeds, though without a D-gene, to complete the α-β TCR. Other adaptive immune receptor loci, such as <italic>TRG</italic>, <italic>TRD</italic>, and all <italic>IG</italic> loci, also undergo V(D)J recombination during the development of γ-δ T cells and B cells, respectively.</p><p>Junctional diversity created by the deletion and non-templated insertion of nucleotides during V(D)J recombination contributes substantially to the resulting diversity of the TCR repertoire. Small variations in gene sequence have been shown to lead to large changes in the extent of nucleotide deletion (<xref ref-type="bibr" rid="bib35">Nadel and Feeney, 1995</xref>; <xref ref-type="bibr" rid="bib16">Gauss and Lieber, 1996</xref>; <xref ref-type="bibr" rid="bib36">Nadel and Feeney, 1997</xref>; <xref ref-type="bibr" rid="bib21">Jackson et al., 2004</xref>). For example, sequences with high AT content suffer greater nucleotide loss than sequences with high GC content (<xref ref-type="bibr" rid="bib16">Gauss and Lieber, 1996</xref>). These findings are suggestive of a nuclease that either binds an AT-rich sequence motif or requires an AT-specific structure (e.g. a sequence that breathes, <xref ref-type="bibr" rid="bib50">Tsai et al., 2009</xref>), however, further work is required to quantify this mechanistic preference.</p><p>The Artemis protein is often regarded as the main nuclease involved in V(D)J recombination (<xref ref-type="bibr" rid="bib2">Chang et al., 2015</xref>; <xref ref-type="bibr" rid="bib3">Chang and Lieber, 2016</xref>; <xref ref-type="bibr" rid="bib56">Zhao et al., 2020</xref>). Artemis is a member of the metallo-<inline-formula><mml:math id="inf1"><mml:mi mathsize="90%">β</mml:mi></mml:math></inline-formula>-lactamase family of nucleases (<xref ref-type="bibr" rid="bib33">Moshous et al., 2001</xref>) and is widely regarded as a structure-specific nuclease as opposed to a nuclease that binds specific DNA sequences (<xref ref-type="bibr" rid="bib30">Ma et al., 2005</xref>; <xref ref-type="bibr" rid="bib2">Chang et al., 2015</xref>; <xref ref-type="bibr" rid="bib3">Chang and Lieber, 2016</xref>; <xref ref-type="bibr" rid="bib55">Yosaatmadja et al., 2021</xref>). Members of this family are characterized by their conserved metallo-β-lactamase and β-CASP domains and their ability to nick DNA or RNA in various configurations (<xref ref-type="bibr" rid="bib9">Dominski, 2007</xref>; <xref ref-type="bibr" rid="bib37">Pettinati et al., 2016</xref>). Alone, Artemis possesses intrinsic 5’-to-3’ exonuclease activity on single-stranded DNA (<xref ref-type="bibr" rid="bib26">Li et al., 2014</xref>). On double-stranded DNA, Artemis, in complex with DNA-PKcs, has endonuclease activity on 5’ and 3’ DNA overhangs and on DNA hairpins (<xref ref-type="bibr" rid="bib29">Ma et al., 2002</xref>; <xref ref-type="bibr" rid="bib27">Lu et al., 2007</xref>; <xref ref-type="bibr" rid="bib28">Lu et al., 2008</xref>). It has been proposed that the Artemis:DNA-PKcs complex binds single-stranded-to-double-stranded DNA boundaries prior to nicking (<xref ref-type="bibr" rid="bib29">Ma et al., 2002</xref>; <xref ref-type="bibr" rid="bib30">Ma et al., 2005</xref>; <xref ref-type="bibr" rid="bib27">Lu et al., 2007</xref>; <xref ref-type="bibr" rid="bib3">Chang and Lieber, 2016</xref>); for blunt DNA ends, previous work has concluded that sequence-breathing is required to achieve this structural configuration prior to Artemis action (<xref ref-type="bibr" rid="bib2">Chang et al., 2015</xref>). Further, Artemis, in complex with XRCC4-DNA ligase IV, has additional endonuclease activity on 3’ DNA overhangs and preferentially nicks one nucleotide at a time from the single-stranded 3’ end (<xref ref-type="bibr" rid="bib4">Chang et al., 2016</xref>; <xref ref-type="bibr" rid="bib18">Gerodimos et al., 2017</xref>). Despite these diverse nucleolytic functions, the extent of involvement and exact mechanism of action for the Artemis protein during the nucleotide trimming step of V(D)J recombination, and how it relates to observed sequence-dependent changes in trimming (<xref ref-type="bibr" rid="bib35">Nadel and Feeney, 1995</xref>; <xref ref-type="bibr" rid="bib16">Gauss and Lieber, 1996</xref>; <xref ref-type="bibr" rid="bib36">Nadel and Feeney, 1997</xref>; <xref ref-type="bibr" rid="bib21">Jackson et al., 2004</xref>), has yet to be fully understood.</p><p>While molecular experiments using model organisms have been essential for establishing the current mechanistic understanding of the nucleotide trimming process, studies in humans have been limited. Statistical inference on high-throughput repertoire sequencing data sets allows for exploration of the in vivo V(D)J recombination mechanism outside of model organisms. In particular, analysis of trimming in high-throughput data sets should lead to insights about the natural underlying process, in the same way that analysis of large data sets has led to insight into the process of somatic hypermutation. There, researchers have found quite significant connections between local sequence identity and mutation patterns, leading to a rich literature (<xref ref-type="bibr" rid="bib41">Rogozin and Kolchanov, 1992</xref>; <xref ref-type="bibr" rid="bib10">Dunn-Walters et al., 1998</xref>; <xref ref-type="bibr" rid="bib6">Cohen et al., 2011</xref>; <xref ref-type="bibr" rid="bib53">Yaari et al., 2013</xref>; <xref ref-type="bibr" rid="bib11">Elhanati et al., 2015</xref>; <xref ref-type="bibr" rid="bib52">Wei et al., 2015</xref>; <xref ref-type="bibr" rid="bib7">Cui et al., 2016</xref>; <xref ref-type="bibr" rid="bib14">Feng et al., 2019</xref>; <xref ref-type="bibr" rid="bib48">Spisak et al., 2020</xref>).</p><p>In contrast, we are only aware of one statistical analysis connecting sequence identity to trimming lengths (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>). This one existing analysis (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>) has shown that a simple position-weight-matrix style (PWM) model does a surprisingly good job of predicting the distribution of trimming lengths for a variety of V-genes. However, while this trimming model has good model fit and predictive accuracy, it is limited by the assumption that the trimming mechanism relies solely on a sequence motif and, as such, is not designed in a way that allows us to explore alternative hypotheses.</p><p>In this paper, we explore the sequence-level determinants of nucleotide trimming during V(D)J recombination using statistical inference on high-throughput TCRβ repertoire sequencing data (<xref ref-type="bibr" rid="bib12">Emerson et al., 2017</xref>). With the goal of informing our mechanistic understanding in a quantitative way, we have designed a flexible probabilistic model of nucleotide trimming that allows us to explore various sequence-level features. Our results show that trimming probabilities are highest for DNA positions near the end of the sequence that contain high GC content upstream, quantifying the role of sequence-breathing dynamics in the trimming process. We also see evidence of a sequence motif that appears to get preferentially trimmed, independent of possible sequence-breathing effects. As such, we can predict trimming probabilities most accurately using a model that includes features for local sequence context, length, and GC nucleotide content in both directions of the wider sequence. We show that this model has high predictive accuracy for V- and J-gene sequences from an independent TCRβ-sequencing data set, and also extends well to TCRα, TCRγ, and IGH sequences. Further, we demonstrate that genetic variations within the gene encoding the Artemis protein that were previously identified as being associated with increasing the extent of trimming (<xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>) are also associated with changes in several model coefficients.</p></sec><sec id="s2" sec-type="results"><title>Results</title><sec id="s2-1"><title>Training data description</title><p>We worked with TCRβ-immunosequencing data representing 666 individuals (<xref ref-type="bibr" rid="bib12">Emerson et al., 2017</xref>). V(D)J recombination scenarios were assigned to each sequence from each individual using the IGoR software which is designed to learn unbiased V(D)J recombination statistics from immune sequence reads (<xref ref-type="bibr" rid="bib31">Marcou et al., 2018</xref>). Using these V(D)J recombination statistics, IGoR output a list of potential recombination scenarios with their corresponding likelihoods for each TCRβ-chain sequence in the training data set. We annotated each sequence with a single V(D)J recombination scenario by sampling from these potential scenarios according to the posterior probability of each scenario (see Materials and methods for further details).</p><p>Annotated TCR sequences can be separated into two categories: ‘productive’ rearrangements which code for a complete, full-length protein and ‘non-productive’ rearrangements which do not. Non-productive sequences are generated when the V(D)J recombination process produces a sequence that is either out-of-frame or contains a stop codon. Each T cell contains two loci which can undergo the V(D)J recombination process. When the first recombination fails to generate a functional receptor (creating a non-productive sequence), followed by a successful rearrangement on the T cell’s second chromosome (a productive sequence), the non-productive rearrangement can be sequenced as part of the repertoire. Non-productive sequences do not generate proteins that undergo functional selection in the thymus, and their recombination statistics should reflect only the V(D)J recombination generation process (<xref ref-type="bibr" rid="bib39">Robins et al., 2010</xref>; <xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>; <xref ref-type="bibr" rid="bib45">Sethna et al., 2019</xref>). In contrast, the recombination statistics of productive sequences should reflect both V(D)J recombination generation and functional selection. Because we are interested in nucleotide trimming during the V(D)J recombination generation process, prior to selection, we only include non-productive sequences in our training data set. Further, because V-gene sequences within the <italic>TRB</italic> locus contain more sequence variation than D- and/or J-genes, we only include V-gene sequences in our training data set.</p></sec><sec id="s2-2"><title>Replicating a previous model of nucleotide trimming</title><p>The extent of nucleotide trimming varies substantially from gene to gene (<xref ref-type="bibr" rid="bib35">Nadel and Feeney, 1995</xref>; <xref ref-type="bibr" rid="bib36">Nadel and Feeney, 1997</xref>; <xref ref-type="bibr" rid="bib21">Jackson et al., 2004</xref>; <xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>). Previous work has identified an interesting impact of sequence features, such as sequence nucleotide context, on trimming probabilities using a PWM model (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>). To our knowledge, this is the only model that takes nucleotide sequence identity into account when predicting trimming probabilities. Specifically, this model leverages a ‘trimming motif’ containing 2 nucleotides 5’ of the trimming site and 4 nucleotides 3’ of the trimming site to predict the probability of trimming at a given site. It was designed and trained using sequencing data from just nine individuals (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>), and has surprisingly good model fit and predictive accuracy across many V-genes despite its simplicity. Using a different, and much larger, repertoire sequencing data set, we have trained this PWM model and replicated previous work (<xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref>). We will refer to this model as the <italic>2×4 motif</italic> model. It is important to note that this PWM model is not the primary model described in <xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>, but again is the only one that relates nucleotide identity to trimming.</p></sec><sec id="s2-3"><title>Model set-up overview</title><p>While the <italic>2×4 motif</italic> model has good predictive accuracy and model fit (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>), it is limited by its assumption that the trimming mechanism relies solely on a sequence motif. Here, we have generalized this PWM model to a model that allows for arbitrary sequence features, and trained each new model using conditional logistic regression (see Materials and methods). With this set-up, we were able to evaluate the relative importance of new mechanistically interpretable features for predicting trimming probabilities. Specifically, we designed features to measure the effects of DNA-shape, length, and GC nucleotide content in both directions of the wider sequence on the probability of trimming at a given position in a gene sequence.</p><p>We parameterize each of these features as follows. An example of how an arbitrary V-gene sequence is transformed into features for modeling is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>. To parameterize DNA-shape, we used previously developed methods (<xref ref-type="bibr" rid="bib57">Zhou et al., 2013</xref>; <xref ref-type="bibr" rid="bib5">Chiu et al., 2016</xref>) to estimate various DNA-shape values (i.e. roll, twist, electrostatic potential, minor groove width, etc.) for each single-nucleotide position within a sequence window surrounding the trimming site. To parameterize length, we measure the sequence-independent distance from the end of the gene (i.e. the number of nucleotides from the 3’-end of the sequence) as an integer-valued variable. We parameterize GC nucleotide content using the raw counts of AT and GC nucleotides on both sides of the trimming site (the <italic>two-side base-count</italic>). By using raw nucleotide counts, this measure also serves to parameterize length. Because AT nucleotides have a greater potential for sequence-breathing compared to GC nucleotides within a sequence (<xref ref-type="bibr" rid="bib23">Jose et al., 2009</xref>), these <italic>two-side base-count</italic> terms may be serving as a proxy for the capacity of a sequence to breathe. As such, because sequence-breathing potential is only relevant for nucleotides that are paired, we do not include the nucleotides within the 3’ single-stranded-overhang when counting 3’ AT and GC nucleotides (see Appendix 2).</p><fig id="fig1" position="float"><label>Figure 1.</label><caption><title>Overview of how a sequence is transformed into features for regression.</title><p>(<bold>A</bold>) As described, during the early stages of V(D)J recombination between two genes, the hairpin of each gene is opened; here, we are showing this hairpin-opening step for a single arbitrary V-gene. The most common hairpin-opening position leads to a 4-nucleotide-long single-stranded overhang (2 nucleotides of which are considered P-nucleotides, as shown in purple). From here, each gene can undergo nucleotide trimming. In this example, the V-gene is trimmed back 6 nucleotides. (<bold>B</bold>) All models were trained with non-productive V-gene sequences whose trimming positions were inferred during a sequence annotation step. For our model parameterization, we only consider the top strand (5’-to-3’) of the observed sequence. Here, the sequence features parameterized for each model type are shown for the example sequence from (<bold>A</bold>). The pink boxes surround nucleotides included in the matrix representation of <italic>motif</italic> features. The turquoise boxes surround nucleotides used to estimate and parameterize <italic>DNA-shape</italic> features (see Appendix 2 for further details). The green boxes surround nucleotides included in the counts of GC nucleotides 5’ of the trimming site; in our actual models, we count nucleotides within a 10-nucleotide window (a 5-nucleotide window is shown in the figure). Because this window size is fixed, we do not need to include an additional parameter for AT nucleotide count 5’ of the trimming site (since it is already indirectly modeled). The yellow boxes surround double-stranded nucleotides included in the counts of AT and GC nucleotides 3’ of the trimming site. These raw 3’-nucleotide counts also indirectly parameterize length; as such, we never include both <italic>length</italic> and <italic>two-side base-count</italic> parameters in the same model. In addition to the models shown in the figure, we also evaluated a <italic>null</italic> model which does not contain any parameters.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig1-v1.tif"/></fig><p>With these features, we designed models containing various feature combinations (<xref ref-type="fig" rid="fig1">Figure 1B</xref>). Collectively, these models allow us to explore other possible sequence-level determinants of nucleotide trimming, in addition to the previously proposed (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>) “trimming motif” hypothesis. We trained each model using the V-gene training data set described above (see Materials and methods for further model training details), and evaluated performance using a suite of different held-out data groups (<xref ref-type="fig" rid="fig2">Figure 2</xref>). Specifically, to evaluate model fit, we computed the expected per-sequence conditional log loss of each model using the full V-gene training data set.</p><fig-group><fig id="fig2" position="float"><label>Figure 2.</label><caption><title>Overview of analysis strategy.</title><p>The T cell receptor (TCR)β V-gene training data was used to train each trimming model containing various combinations of sequence-level features (<xref ref-type="fig" rid="fig1">Figure 1</xref>) by minimizing the associated loss function. The loss function is given by a sum across individuals <inline-formula><mml:math id="inf2"><mml:mi>i</mml:mi></mml:math></inline-formula>, genes <inline-formula><mml:math id="inf3"><mml:mi>σ</mml:mi></mml:math></inline-formula>, and trimming lengths <inline-formula><mml:math id="inf4"><mml:mi>n</mml:mi></mml:math></inline-formula> of the sampling probability of each observation <inline-formula><mml:math id="inf5"><mml:msub><mml:mi>P</mml:mi><mml:mi>s</mml:mi></mml:msub></mml:math></inline-formula> multiplied by the gene-specific trimming probability predicted by a model with β parameters (see Materials and methods for further details). Each potential model first underwent a ‘model evaluation’ stage (shown by the dashed lines) during which the model performance was evaluated using various subsets of the training TCRβ V-gene data set. Once all models were evaluated, a subset of the potential models continued on to the ‘model validation’ stage (shown by the solid lines) during which the performance of the model coefficients from the previous TCRβ V-gene training run were validated using several independent testing data sets including TCRβ, TCRα, TCRγ, and IGH sequences. At each stage, the performance of each model was compared to a null model (containing zero parameters, see Materials and methods).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig2-v1.tif"/></fig><fig id="fig2s1" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 1.</label><caption><title>Using a different, and much larger, repertoire sequencing data set, we have closely replicated previous work (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>) which illustrated that a simple position-weight-matrix-style model has good predictive accuracy for many T cell receptor β V-genes.</title><p>(<bold>A</bold>) Inferred trimming profiles (shown in blue) using this model have good predictive accuracy for the same V-genes highlighted in previous work (compare Figure 4A in <xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>). Gene-specific trimming profiles for each individual in the training data set are shown in gray. (<bold>B</bold>) Position-weight-matrix of the local sequence context dependence of V-gene trimming probabilities consisting of 2 nucleotides 5’ of the trimming site and 4 nucleotides 3’ of the trimming site. (Note: the positions in this figure are flipped relative to the rest of the corresponding figures in this paper in order to correspond to the original figure in <xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>.) Positions 3’ of the trimming site have a stronger effect on the probability of trimming compared to positions 5’ of the trimming site. Specifically, A and T nucleotides 3’ of the trimming site have a strong positive effect on the trimming probability whereas C nucleotides have a strong negative effect. The black vertical line corresponds to the trimming site. Each inferred coefficient is given as the change in log10 odds of trimming at a given site resulting from an increase in the feature value, given that all other features are held constant. The inferred coefficients show here closely resemble the previously reported model (see Figure S11 in <xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig2-figsupp1-v1.tif"/></fig></fig-group><p>To evaluate model generalizability, we computed the expected per-sequence conditional log loss using the following held-out groups:</p><list list-type="bullet"><list-item><p>many random, held-out subsets of the V-gene training data set;</p></list-item><list-item><p>held-out subsets of the V-gene training data set containing groups of V-genes defined to be the ‘most-different’ from all other genes using either the terminal sequences (last 25 nucleotides of each sequence) or the full gene sequences;</p></list-item><list-item><p>the full J-gene data set.</p></list-item></list><p>For each of these held-out group analyses, each model was re-trained using the full V-gene training data set with the held-out group-of-interest removed (see Materials and methods and Appendix 3 for further details) prior to computing the loss. A lower expected per-sequence conditional log loss indicated better model fit and/or model generalizability. Following this model evaluation, we validated a subset of the models by using the model coefficients from the previous TCRβ V-gene training run and computing the expected per-sequence conditional log loss of the model using several independent testing data sets (<xref ref-type="fig" rid="fig2">Figure 2</xref>).</p></sec><sec id="s2-4"><title>Local sequence context, length, and GC nucleotide content in both directions of the wider sequence, together, accurately predict the trimming probabilities of a given V-gene sequence</title><p>In an effort to capture the complex underlying biochemistry of the deletion process, we trained models containing various combinations of sequence-level feature types (<xref ref-type="fig" rid="fig1">Figure 1B</xref>) and evaluated their ability to accurately predict V-gene trimming probabilities. With this approach, we found that a model containing parameterizations of local sequence context, length, and GC nucleotide content in both directions of the wider sequence (the <italic>1×2 motif + two-side base-count beyond</italic> model) had the best model fit and generalizability across different data sets (<xref ref-type="fig" rid="fig3">Figure 3</xref> and <xref ref-type="fig" rid="fig3s1">Figure 3—figure supplement 1</xref>). This model contains a <italic>1×2 motif</italic>, including 1-nucleotide position 5’ of the trimming site and 2-nucleotide positions 3’ of the trimming site within the trimming window, and includes only bases beyond this trimming window in the AT and GC <italic>two-side base-count</italic> terms (<xref ref-type="fig" rid="fig1">Figure 1</xref>). Despite containing fewer total parameters than the original <italic>2×4 motif</italic> model (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>) (12 parameters compared to 18 parameters), the <italic>1×2 motif + two-side base-count beyond</italic> model had better predictive accuracy (<xref ref-type="fig" rid="fig4">Figure 4</xref> and <xref ref-type="fig" rid="fig4s1">Figure 4—figure supplement 1</xref>).</p><fig-group><fig id="fig3" position="float"><label>Figure 3.</label><caption><title>Expected per-sequence conditional log loss computed for various models using the full V-gene training data set, many random, held-out subsets of the V-gene training data set, a held-out subset of the V-gene training data set containing a group of V-genes defined to be the ‘most-different’ using the terminal sequences (last 25 nucleotides of each sequence), a held-out subset of the V-gene training data set containing a group of V-genes defined to be the ‘most-different’ using the full gene sequences, and the full J-gene data set.</title><p>Each model was trained using the full V-gene training data set with the held-out group or ‘most-different’ group (if applicable) removed (see Materials and methods and Appendix 3). Lower expected per-sequence log loss corresponds to better a model fit. The <italic>1×2 motif + two-side base-count beyond</italic> model has the best model fit and generalizability across all data sets.</p><p><supplementary-material id="fig3sdata1"><label>Figure 3—source data 1.</label><caption><title>Expected per-sequence conditional log loss reported for each model and validation data set.</title></caption><media mimetype="text" mime-subtype="tab-separated-values" xlink:href="elife-85145-fig3-data1-v1.tsv"/></supplementary-material></p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig3-v1.tif"/></fig><fig id="fig3s1" position="float" specific-use="child-fig"><label>Figure 3—figure supplement 1.</label><caption><title>For each model, there was some variation in the expected per-sequence conditional log loss values computed across the 20 random, held-out subsets of the V-gene training data set.</title><p>The average expected per-sequence conditional log loss values are shown as vertical lines. For each model, there was some variation in the expected per-sequence conditional log loss values computed across the 20 random, held-out subsets of the V-gene training data set. The average expected per-sequence conditional log loss values are shown as vertical lines.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig3-figsupp1-v1.tif"/></fig></fig-group><fig-group><fig id="fig4" position="float"><label>Figure 4.</label><caption><title>Performance of the <italic>1×2 motif + two-side base-count beyond</italic> model.</title><p>(<bold>A</bold>) Inferred trimming profiles using the <italic>1×2 motif + two-side base-count beyond</italic> model have good predictive accuracy overall; here, we show the inferred trimming profiles (in blue) for the most frequently used V-genes. Gene-specific trimming profiles for each individual in the training data set are shown in gray. The sequence context with the highest probability of trimming (3’-TTC-5’ or 3’-TGC-5’) from (<bold>B and C</bold>) is highlighted in orange. (<bold>B</bold>) Position-weight-matrix of the local sequence context dependence of V-gene trimming probabilities consisting of 1 nucleotide 5’ of the trimming site and 2 nucleotide 3’ of the trimming site from fitting the <italic>1×2 motif + two-side base-count beyond</italic> model. Positions 5’ and 3’ of the trimming site have a strong effect on the probability of trimming. (<bold>C</bold>) Inferred <italic>two-side base-count beyond</italic> model coefficients from fitting the <italic>1×2 motif + two-side base-count beyond</italic> model suggest that the count of GC bases 5’ of the motif has a strong positive effect on the trimming probability whereas the count of GC and/or AT bases 3’ of the motif has a negative effect. The count of AT nucleotides 5’ of the motif (shown in gray) was not included in this model. The black vertical line corresponds to the trimming site. Each inferred coefficient is given as the change in log10 odds of trimming at a given site resulting from an increase in the feature value, given that all other features are held constant.</p><p><supplementary-material id="fig4sdata1"><label>Figure 4—source data 1.</label><caption><title>Inferred and observed trimming profiles for the most frequently used V-genes in the V-gene training data set.</title></caption><media mimetype="text" mime-subtype="tab-separated-values" xlink:href="elife-85145-fig4-data1-v1.tsv"/></supplementary-material></p><p><supplementary-material id="fig4sdata2"><label>Figure 4—source data 2.</label><caption><title>Inferred 1x2 motif + two-side base-count beyond model coefficients.</title></caption><media mimetype="text" mime-subtype="tab-separated-values" xlink:href="elife-85145-fig4-data2-v1.tsv"/></supplementary-material></p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig4-v1.tif"/></fig><fig id="fig4s1" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 1.</label><caption><title>Performance of the <italic>1×2 motif + two-side base-count beyond</italic> model across all TRB V-genes, ordered by the frequency of usage in the training data set.</title><p>Inferred trimming profiles (shown in blue) using the <italic>1×2 motif + two-side base-count beyond</italic> model have good predictive accuracy for most V-genes. Gene-specific trimming profiles for each individual in the training data set are shown in gray. The sequence context with the highest probability of trimming (3’-TTC-5’ or 3’-TGC-5’ from <xref ref-type="fig" rid="fig4">Figure 4B</xref>) is highlighted in orange. The black vertical line corresponds to the trimming site.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig4-figsupp1-v1.tif"/></fig><fig id="fig4s2" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 2.</label><caption><title>Including all gene sequence nucleotides in the <italic>two-side base-count</italic> terms, instead of restricting to double-stranded nucleotides, leads to very similar inferred coefficients and model fit.</title><p>(<bold>A</bold>) Inferred trimming profiles (shown in blue) from a <italic>1×2 motif + two-side base-count beyond</italic> model which includes all nucleotides 3’ of the motif (regardless of double-stranded status) in the 3’-base-count term show good predictive accuracy for the most frequently used V-genes. The fit for this model is very similar to the original <italic>1×2 motif + two-side base-count beyond</italic> model which only includes double-stranded nucleotides in the base-count terms. Gene-specific trimming profiles for each individual in the training data set are shown in gray. (<bold>B</bold>) Position-weight-matrix of the local sequence context dependence of V-gene trimming probabilities consisting of 1 nucleotide 5’ of the trimming site and 2 nucleotides 3’ of the trimming site from fitting a <italic>1×2 motif + two-side base-count beyond</italic> model which uses all nucleotides 3’ of the motif in the 3’-base-count term. (<bold>C</bold>) Inferred <italic>two-side base-count beyond</italic> model coefficients from fitting a <italic>1×2 motif + two-side base-count beyond</italic> model which uses all nucleotides 3’ of the motif in the 3’-base-count term. All inferred coefficients from this model are similar to the original <italic>1×2 motif + two-side base-count beyond</italic> model which only includes double-stranded nucleotides in the base-count terms. The count of AT nucleotides 5’ of the motif (shown in gray) was not included in this model. The black vertical line corresponds to the trimming site. Each inferred coefficient is given as the change in log10 odds of trimming at a given site resulting from an increase in the feature value, given that all other features are held constant.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig4-figsupp2-v1.tif"/></fig><fig id="fig4s3" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 3.</label><caption><title>The assumed position of the initial hairpin-opening nick during the early stages of V(D)J recombination has little effect on the inferred coefficients and model fit.</title><p>Expected per-sequence conditional log loss computed for the <italic>1×2 motif + two-side base-count beyond</italic> model, using the full V-gene training data set, many random, held-out subsets of the V-gene training data set, a held-out subset of the V-gene training data set containing a group of V-genes defined to be the ‘most-different’ using the terminal sequences (last 25 nucleotides of each sequence), a held-out subset of the V-gene training data set containing a group of V-genes defined to be the ‘most-different’ using the full gene sequences, and the full J-gene data set. Each model was trained using the designated hairpin-opening-position assumption (see Appendix 4 for hairpin-opening-position definitions). Each model was trained using the full V-gene training data set with the held-out group or ‘most-different’ group (if applicable) removed. Lower log loss corresponds to better a model fit.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig4-figsupp3-v1.tif"/></fig><fig id="fig4s4" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 4.</label><caption><title>Models containing a small motif (e.g.a <italic>1×2 motif</italic>) achieve similar predictive accuracy and are more generalizable compared to models containing a larger motif.</title><p>(<bold>A</bold>) Log loss computed using the full V-gene training data set for <italic>motif + two-side base-count beyond</italic> models containing a varying number of bases 3’ and 5’ of the trimming site within the motif. (<bold>B</bold>) Log loss computed using the full J-gene data set for <italic>motif + two-side base-count beyond</italic> models containing a varying number of bases 3’ and 5’ of the trimming site within the motif. Each model was trained using the full V-gene training data set as described in the Materials and methods. Lower log loss corresponds to better a model fit. Models containing small motifs have worse model fit when evaluating log loss using the full V-gene training data set (<bold>A</bold>), but have better model fit when evaluating log loss using the full J-gene data set (<bold>B</bold>).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig4-figsupp4-v1.tif"/></fig><fig id="fig4s5" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 5.</label><caption><title>Inferred coefficients from a <italic>1×2 motif + two-side base-count beyond</italic> model trained using only J-gene sequences are highly similar to those from the model trained using the V-gene training data set.</title><p>(<bold>A</bold>) Inferred trimming profiles (shown in blue) using the <italic>1×2 motif + two-side base-count beyond</italic> model trained using J-gene sequences have good predictive accuracy for the most frequently used J-genes. Gene-specific trimming profiles for each individual in the training data set are shown in gray. (<bold>B</bold>) Position-weight-matrix of the local sequence context dependence of J-gene trimming probabilities consisting of 1 nucleotide 5’ of the trimming site and 2 nucleotides 3’ of the trimming site from fitting the <italic>1×2 motif + two-side base-count beyond</italic> model using J-gene sequences. Positions 5’ and 3’ of the trimming site have a strong effect on the probability of trimming. (<bold>C</bold>) Inferred <italic>two-side base-count beyond</italic> model coefficients from fitting the <italic>1×2 motif + two-side base-count beyond</italic> model using J-gene sequences suggest that the count of GC bases 5’ of the motif has a strong positive effect on the trimming probability whereas the count of GC and/or AT bases 3’ of the motif has a negative effect. The count of AT nucleotides 5’ of the motif (shown in gray) was not included in this model. The black vertical line corresponds to the trimming site. Each inferred coefficient is given as the change in log10 odds of trimming at a given site resulting from an increase in the feature value, given that all other features are held constant.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig4-figsupp5-v1.tif"/></fig><fig id="fig4s6" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 6.</label><caption><title>Inferred coefficients from a <italic>1×2 motif + two-side base-count beyond</italic> model trained using only productive V-gene sequences are highly similar to those from the model trained using the non-productive V-gene training data set.</title><p>(<bold>A</bold>) Inferred trimming profiles (shown in blue) using the <italic>1×2 motif + two-side base-count beyond</italic> model trained using productive V-gene sequences have good predictive accuracy for the most frequently used V-genes. Gene-specific trimming profiles for each individual in the training data set are shown in gray. (<bold>B</bold>) Position-weight-matrix of the local sequence context dependence of V-gene trimming probabilities consisting of 1 nucleotide 5’ of the trimming site and 2 nucleotides 3’ of the trimming site from fitting the <italic>1×2 motif + two-side base-count beyond</italic> model using productive V-gene sequences. Positions 5’ and 3’ of the trimming site have a strong effect on the probability of trimming. (<bold>C</bold>) Inferred <italic>two-side base-count beyond</italic> model coefficients from fitting the <italic>1×2 motif + two-side base-count beyond</italic> model using productive V-gene sequences suggest that the count of GC bases 5’ of the motif has a strong positive effect on the trimming probability whereas the count of GC and/or AT bases 3’ of the motif has a negative effect. The count of AT nucleotides 5’ of the motif (shown in gray) was not included in this model. The black vertical line corresponds to the trimming site. Each inferred coefficient is given as the change in log10 odds of trimming at a given site resulting from an increase in the feature value, given that all other features are held constant.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig4-figsupp6-v1.tif"/></fig><fig id="fig4s7" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 7.</label><caption><title>The magnitudes of the inferred coefficients from the <italic>1×2 motif + two-side base-count beyond</italic> model have minimal variance when changing the number of sequences included in the training data set.</title><p>The magnitudes of the inferred coefficients from the <italic>1×2 motif + two-side base-count beyond</italic> model have minimal variance when changing the number of sequences included in the training data set. The original V-gene training data set contains 21,193,153 sequences. When sub-sampling the original V-gene training data set and re-training the model, the inferred coefficients are stable until the size of the training data set reaches around 82,800 sequences (e.g. log2(proportion of the full training data set) is equal to – 8) or below.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig4-figsupp7-v1.tif"/></fig></fig-group><p>We considered the significance of the inferred model coefficients using a Bonferroni-corrected significance threshold of 0.0033 (corrected for the total number of model coefficients). With this threshold, we found that many of the inferred model coefficients were significant and quantified mechanistic patterns. Each coefficient represents the change in log10 odds of trimming at a given site resulting from an increase in the feature value, given that all other features are held constant. Within the nucleotides immediately surrounding the trimming site, bases 5’ of the trimming site have a slightly stronger effect on the trimming probability than bases 3’ of the trimming site (<xref ref-type="fig" rid="fig4">Figure 4B</xref>). Specifically, 5’ of the trimming site, C nucleotides have a strong positive effect on the trimming probability (<inline-formula><mml:math id="inf6"><mml:mrow><mml:mrow><mml:msub><mml:mi mathsize="90%">log</mml:mi><mml:mn mathsize="90%">10</mml:mn></mml:msub><mml:mo>⁡</mml:mo><mml:mtext mathsize="90%">coefficient</mml:mtext></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.2388</mml:mn></mml:mrow></mml:math></inline-formula>) whereas A and T nucleotides have a negative effect (<inline-formula><mml:math id="inf7"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>log</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub><mml:mo>⁡</mml:mo><mml:msub><mml:mtext>coefficient</mml:mtext><mml:mrow><mml:mi mathvariant="normal">A</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:mn>0.108</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> and <inline-formula><mml:math id="inf8"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>log</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub><mml:mo>⁡</mml:mo><mml:msub><mml:mtext>coefficient</mml:mtext><mml:mrow><mml:mi mathvariant="normal">T</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:mn>0.137</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>). In contrast, immediately 3’ of the trimming site, G and T nucleotides have a positive effect on the trimming probability (<inline-formula><mml:math id="inf9"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>log</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub><mml:mo>⁡</mml:mo><mml:msub><mml:mtext>coefficient</mml:mtext><mml:mrow><mml:mi mathvariant="normal">G</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0.093</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> and <inline-formula><mml:math id="inf10"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>log</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub><mml:mo>⁡</mml:mo><mml:msub><mml:mtext>coefficient</mml:mtext><mml:mrow><mml:mi mathvariant="normal">T</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0.125</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>) whereas C nucleotides have a negative effect (<inline-formula><mml:math id="inf11"><mml:mrow><mml:mrow><mml:msub><mml:mi mathsize="90%">log</mml:mi><mml:mn mathsize="90%">10</mml:mn></mml:msub><mml:mo>⁡</mml:mo><mml:mtext mathsize="90%">coefficient</mml:mtext></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">0.174</mml:mn></mml:mrow></mml:mrow></mml:math></inline-formula>). These results suggest a different possible mechanistic pattern than previous <italic>motif</italic>-only models (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>; <xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1B</xref>). Further, beyond the <italic>1×2 motif</italic> sequence window, the count of GC nucleotides 5’ of the motif (within a 10-nucleotide window) has a strong positive effect on the trimming probability (<inline-formula><mml:math id="inf12"><mml:mrow><mml:mrow><mml:msub><mml:mi mathsize="90%">log</mml:mi><mml:mn mathsize="90%">10</mml:mn></mml:msub><mml:mo>⁡</mml:mo><mml:mtext mathsize="90%">coefficient</mml:mtext></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.164</mml:mn></mml:mrow></mml:math></inline-formula>) (<xref ref-type="fig" rid="fig4">Figure 4C</xref>). The counts of both AT and GC nucleotides 3’ of the motif have a strong negative effect on the trimming probability (<inline-formula><mml:math id="inf13"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>log</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub><mml:mo>⁡</mml:mo><mml:msub><mml:mtext>coefficient</mml:mtext><mml:mrow><mml:mi mathvariant="normal">A</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:mn>0.123</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> and <inline-formula><mml:math id="inf14"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>log</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub><mml:mo>⁡</mml:mo><mml:msub><mml:mtext>coefficient</mml:mtext><mml:mrow><mml:mi mathvariant="normal">G</mml:mi><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:mn>0.126</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>). Interestingly, the magnitude of these negative effects are very similar between AT and GC counts. This suggests that the raw number of nucleotides 3’ of the motif (e.g. the length) is more important for predicting the trimming probability at a given site compared to the identity of the nucleotides. p-values for each of these coefficients were reported to be smaller than machine tolerance (<inline-formula><mml:math id="inf15"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mn>2.23</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn>10</mml:mn><mml:mrow><mml:mo>−</mml:mo><mml:mn>308</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math></inline-formula>). We noted minimal variation in the magnitude of each inferred coefficient even when changing the number of sequences included in the training data set (<xref ref-type="fig" rid="fig4s7">Figure 4—figure supplement 7</xref>).</p><p>Because we were interested in parameterizing sequence-breathing effects using the <italic>two-side base-count</italic> terms, we only included nucleotides that are considered to be double-stranded after hairpin-opening within each count. In our modeling, we assume that the DNA hairpin is opened at the +2 position, leading to a 4-nucleotide-long 3’-single-stranded-overhang (the 2 nucleotides furthest 3’ are considered P-nucleotides) (<xref ref-type="bibr" rid="bib29">Ma et al., 2002</xref>; <xref ref-type="bibr" rid="bib27">Lu et al., 2007</xref>). As such, the first 2 nucleotides of the gene sequence can be considered single-stranded, and we do not include them in the <italic>two-side base-count</italic> terms. When we train a model that ignores this distinction, and include all gene sequence nucleotides in the <italic>two-side base-count</italic> terms, we note very similar inferred coefficients and model fit (<xref ref-type="fig" rid="fig4s2">Figure 4—figure supplement 2</xref>). We acknowledge that other hairpin-opening positions may be possible. To explore whether the +2-hairpin-opening-position assumption could be affecting our inferences, we trained the <italic>1×2 motif + two-side base-count beyond</italic> model with other possible hairpin-opening-position assumptions and noted minimal variation in model fit (<xref ref-type="fig" rid="fig4s3">Figure 4—figure supplement 3</xref>).</p><p>We also evaluated the predictive accuracy of <italic>motif + two-side base-count beyond</italic> models containing different ‘trimming motif’ sizes. We find that models containing a small motif (e.g. a <italic>1×2 motif</italic>) achieve similar predictive accuracy and are more generalizable compared to models containing a larger motif (<xref ref-type="fig" rid="fig4s4">Figure 4—figure supplement 4</xref>).</p><p>Because the trimming mechanism is thought to be consistent across V-, D-, and J-genes from both productive and non-productive sequences, we were also interested in whether the inferred coefficients for the <italic>1×2 motif + two-side base-count beyond</italic> model would be consistent between the model trained using the non-productive V-gene training data set, a model trained using a non-productive J-gene data set, and a model trained using a productive V-gene data set. As such, we trained a new <italic>1×2 motif + two-side base-count beyond</italic> model using only non-productive J-gene sequences and a separate, new <italic>1×2 motif + two-side base-count beyond</italic> model using only productive V-gene sequences (both sequence sets were from the same cohort of individuals as the V-gene training data set). We found that the inferred coefficients were highly similar between the three models (<xref ref-type="fig" rid="fig4s5">Figure 4—figure supplement 5</xref> and <xref ref-type="fig" rid="fig4s6">Figure 4—figure supplement 6</xref>).</p><p>When evaluating models containing only a single feature type, we find that the <italic>two-side base-count</italic> model which parameterizes GC nucleotide content on both sides of the trimming site (and, indirectly, length) has the best model fit and generalizability across all held-out groups tested (<xref ref-type="fig" rid="fig3">Figure 3</xref>). As such, these GC-content features, which are likely parameterizing the capacity for the sequence to breathe, are more predictive of V-gene trimming probabilities than local sequence context or DNA-shape alone. This finding supports previous observations that Artemis may act as a structure-specific nuclease as opposed to a nuclease that binds specific DNA sequences (<xref ref-type="bibr" rid="bib30">Ma et al., 2005</xref>; <xref ref-type="bibr" rid="bib2">Chang et al., 2015</xref>; <xref ref-type="bibr" rid="bib3">Chang and Lieber, 2016</xref>; <xref ref-type="bibr" rid="bib55">Yosaatmadja et al., 2021</xref>).</p></sec><sec id="s2-5"><title>Inferred local sequence context coefficients suggest a biological trimming motif</title><p>A persistent concern with the <italic>1×2 motif + two-side base-count beyond</italic> model was that the <italic>motif</italic> coefficients could be driven by certain genes, instead of representing an actual gene-segment-wide signal. When comparing the inferred trimming profiles from the <italic>two-side base-count</italic> model to those from the <italic>1×2 motif + two-side base-count beyond</italic> model, we identified a group of V-genes which had drastically lower prediction error when the <italic>1×2 motif</italic> terms were included. These V-genes had a difference in per-gene root mean squared error between the two models that was greater than –0.13 (<xref ref-type="fig" rid="fig5">Figure 5A</xref>). The genes included in this group were <italic>TRBV5-3</italic>, <italic>TRBV7-3*01</italic>, <italic>TRBV7-3*04</italic>, <italic>TRBV7-4</italic>, <italic>TRBV9</italic>, <italic>TRBV11</italic>, and <italic>TRBV13</italic>. To evaluate whether these genes could be driving the observed <italic>motif</italic> signal, we explored whether the prediction error for these genes changed when they were removed from the model training data set.</p><fig id="fig5" position="float"><label>Figure 5.</label><caption><title>The <italic>1×2 motif</italic> coefficients represent a gene-segment-wide trimming motif.</title><p>(<bold>A</bold>) Distribution of the difference in per-gene root mean squared error (RMSE) between the <italic>1×2 motif + two-side base-count beyond</italic> model and the <italic>two-side base-count</italic> model. V-genes with an RMSE difference less than –0.127 (gray vertical line) were in the lowest 10% of all RMSE differences. These ‘improved genes’ showed a large RMSE improvement when including motif terms in the model. (<bold>B</bold>) Inferred trimming profiles for <italic>TRBV9</italic>, the gene which showed the largest RMSE improvement in (<bold>A</bold>). <italic>TRBV9</italic> had an RMSE difference of –0.31. (<bold>C</bold>) Inferred trimming profiles for <italic>TRBV13</italic>, the gene which showed the second largest RMSE improvement in (<bold>A</bold>). <italic>TRBV13</italic> had an RMSE difference of –0.15. The inferred trimming profiles for <italic>TRBV9</italic> and <italic>TRBV13</italic> using models which contain motif terms have very low prediction error even when the genes are not included in the model training data set. Gene-specific trimming profiles for each individual in the training data set are shown in gray. The sequence context with the highest probability of trimming (3’-TTC-5’ or 3’-TGC-5’ from <xref ref-type="fig" rid="fig4">Figure 4B</xref>) are highlighted in orange.</p><p><supplementary-material id="fig5sdata1"><label>Figure 5—source data 1.</label><caption><title>Per-gene mean squared error difference between the <italic>1×2 motif + two-side base-count beyond</italic> model and the <italic>two-side base-count</italic> model.</title></caption><media mimetype="text" mime-subtype="tab-separated-values" xlink:href="elife-85145-fig5-data1-v1.tsv"/></supplementary-material></p><p><supplementary-material id="fig5sdata2"><label>Figure 5—source data 2.</label><caption><title>Inferred and observed trimming profiles for the genes with largest root mean squared error (RMSE) improvement.</title></caption><media mimetype="text" mime-subtype="tab-separated-values" xlink:href="elife-85145-fig5-data2-v1.tsv"/></supplementary-material></p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig5-v1.tif"/></fig><p>In fact, we found that the inferred trimming profiles for these genes still had very low prediction error despite the genes not being included in the model training data set (<xref ref-type="fig" rid="fig5">Figure 5B and C</xref>), showing the generalizability of these features. The inferred model coefficients from this <italic>1×2 motif + two-side base-count beyond</italic> model fit using the subsetted training data set were highly similar to those from the original model fit using the full training data set. Because genes which are highly similar sequence-wise to the group of held-out genes could still be present in the training data set and be driving these similarities, we defined a new data set that excluded this larger group of genes. When we repeated the same experiment with this new, more-restricted training data set, we observed similar results (<xref ref-type="fig" rid="fig5">Figure 5B and C</xref>). As such, both of these experiments provided evidence that the <italic>motif</italic> signal may actually represent a gene-segment-wide sequence motif that appears to get preferentially trimmed, independent of GC-content-related effects.</p></sec><sec id="s2-6"><title>Trimming-associated variation within the Artemis locus is associated with a change in model coefficients</title><p>Using a subset of the V-gene training data set used here, we previously identified a set of single nucleotide polymorphisms (SNPs) within the gene encoding the Artemis protein that are associated with increasing the extent of V- and J-gene trimming (<xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>). This result suggested that trimming profiles may subtly vary in the context of these SNPs. As such, we were interested in whether these SNPs could be mediating (or serving as a proxy for) a change in the trimming mechanism. To explore this, we worked with paired SNP array and TCRβ-immunosequencing data representing 611 of the original 666 individuals in the V-gene training data set used here. Our previous work <xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref> used data from only 398 of these individuals, however, the conclusions of that paper held when using this expanded group of 611 individuals in the analysis. With these data, we asked whether the inferred coefficients from the V-gene-specific <italic>1×2 motif + two-side base-count beyond</italic> model varied significantly in the context of the non-coding Artemis-locus SNP (rs41298872) that was found to be most strongly associated with increasing the extent of V-gene trimming in our previous work (<xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>). As such, we re-defined the model to include an interaction coefficient between the SNP genotype and each model parameter (see Materials and methods). We then used a Bonferroni-corrected significance threshold of 0.0033 (corrected for the total number of interaction coefficients) to evaluate the significance of each interaction coefficient. For each significant interaction coefficient, we concluded that the corresponding model coefficient varied significantly in the context of the SNP genotype.</p><p>Using these methods, we found that several of the <italic>1×2 motif + two-side base-count beyond</italic> model coefficients varied significantly in the context of the Artemis-locus SNP rs41298872 (<xref ref-type="fig" rid="fig6">Figure 6</xref>). Specifically, we found that 3’ of the trimming site, the negative effect of A nucleotides on the trimming odds varied in the context of the SNP for the position immediately 3’ of the trimming site (<inline-formula><mml:math id="inf16"><mml:mrow><mml:mrow><mml:msub><mml:mi mathsize="90%">log</mml:mi><mml:mn mathsize="90%">10</mml:mn></mml:msub><mml:mo>⁡</mml:mo><mml:mtext mathsize="90%">interaction coefficient</mml:mtext></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.006</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="inf17"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi mathvariant="normal">p</mml:mi><mml:mo>=</mml:mo><mml:mn>0.0006</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>) and one position away (<inline-formula><mml:math id="inf18"><mml:mrow><mml:mrow><mml:msub><mml:mi mathsize="90%">log</mml:mi><mml:mn mathsize="90%">10</mml:mn></mml:msub><mml:mo>⁡</mml:mo><mml:mtext mathsize="90%">interaction coefficient</mml:mtext></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.007</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="inf19"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi mathvariant="normal">p</mml:mi><mml:mo>=</mml:mo><mml:mn>0.0006</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>). Further, we found that the negative effect of the count of AT nucleotides 3’ of the motif varied strongly in the context of the SNP (<inline-formula><mml:math id="inf20"><mml:mrow><mml:mrow><mml:msub><mml:mi mathsize="90%">log</mml:mi><mml:mn mathsize="90%">10</mml:mn></mml:msub><mml:mo>⁡</mml:mo><mml:mtext mathsize="90%">interaction coefficient</mml:mtext></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.010</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="inf21"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi mathvariant="normal">p</mml:mi><mml:mo>=</mml:mo><mml:mn>1.47</mml:mn><mml:mrow><mml:mo>×</mml:mo></mml:mrow><mml:msup><mml:mrow><mml:mn>10</mml:mn></mml:mrow><mml:mrow><mml:mo>−</mml:mo><mml:mn>12</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math></inline-formula>). No other <italic>motif</italic> or <italic>two-side base-count</italic> coefficients were found to significantly vary.</p><fig-group><fig id="fig6" position="float"><label>Figure 6.</label><caption><title>Inferred single nucleotide polymorphism (SNP)-parameter-interaction coefficients from fitting the <italic>1×2 motif + two-side base-count beyond</italic> SNP-interaction model.</title><p>Note that the inferred coefficients for each main parameter (as shown in <xref ref-type="fig" rid="fig4">Figure 4</xref>) are not displayed here; only the inferred interaction coefficients between the SNP and each parameter are shown. (<bold>A</bold>) Inferred interaction coefficients between rs41298872 SNP genotype and <italic>motif</italic> parameters for 1-nucleotide position 5’ of the trimming site and 2-nucleotide positions 3’ of the trimming site. The interaction coefficients between the SNP genotype and the presence of A nucleotides (at all positions 3’ of the motif) are significant. This figure is a different representation of the information shown in (<bold>A</bold>). (<bold>B</bold>) Inferred interaction coefficients between rs41298872 SNP genotype and <italic>two-side base-count beyond</italic> model coefficients. The interaction coefficients between the SNP genotype and the count of AT nucleotides 3’ of the motif are significant. The interaction coefficient between the SNP genotype and the count of AT nucleotides 5’ of the motif (shown in gray) was not included in this model. The black vertical line corresponds to the trimming site. Each inferred interaction coefficient is given as the change in log10 odds of trimming at a given site resulting from an increase in the feature value and a change in genotype, given that all other features are held constant.</p><p><supplementary-material id="fig6sdata1"><label>Figure 6—source data 1.</label><caption><title>Inferred <italic>1×2 motif + two-side base-count beyond,</italic> single nucleotide polymorphism (SNP) interaction model coefficients.</title></caption><media mimetype="text" mime-subtype="tab-separated-values" xlink:href="elife-85145-fig6-data1-v1.tsv"/></supplementary-material></p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig6-v1.tif"/></fig><fig id="fig6s1" position="float" specific-use="child-fig"><label>Figure 6—figure supplement 1.</label><caption><title>The significance of the 3’-AT-nucleotide count single nucleotide polymorphism (SNP)-interaction coefficient appears to be related to length effects rather than nucleotide content.</title><p>Inferred SNP-interaction coefficients from fitting the <italic>1×2 motif + two-side base-count beyond proportion + length</italic> SNP interaction model. (<bold>A</bold>) Inferred interaction coefficients between rs41298872 SNP genotype and <italic>motif</italic> parameters for 1-nucleotide position 5’ of the trimming site and 2-nucleotide positions 3’ of the trimming site. The interaction coefficients between the SNP genotype and the presence of T nucleotides (at all positions in the motif) are significant. (<bold>B</bold>) Inferred interaction coefficients between rs41298872 SNP genotype and <italic>two-side base-count beyond</italic> model coefficients. The interaction coefficient between the SNP genotype and the count of AT nucleotides 5’ of the motif (shown in gray) was not included in this model. None of the interaction coefficients are significant. (<bold>C</bold>) Inferred interaction coefficients between rs41298872 SNP genotype and the <italic>length</italic> coefficient. The black vertical line corresponds to the trimming site. Each inferred coefficient is given as the change in log10 odds of trimming at a given site resulting from an increase in the feature value, given that all other features are held constant.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig6-figsupp1-v1.tif"/></fig></fig-group><p>Because the 3’-side <italic>base-count-beyond</italic> terms parameterize both GC nucleotide content and length in their definition, we were interested in whether the significance of the 3’-AT-nucleotide count SNP variation effect was related to GC nucleotide content, length, or both. To do this, we re-defined the 3’-side <italic>base-count-beyond</italic> parameters to be a proportion instead of raw AT/GC nucleotide counts and included an additional <italic>length</italic> term in the model to remove length-related effects from the inferred 3’-side <italic>base-count-beyond</italic> coefficients. Using this new model, we repeated the analysis and found that the <italic>length</italic> coefficient varied significantly in the context of the SNP (<inline-formula><mml:math id="inf22"><mml:mrow><mml:mrow><mml:msub><mml:mi mathsize="90%">log</mml:mi><mml:mn mathsize="90%">10</mml:mn></mml:msub><mml:mo>⁡</mml:mo><mml:mtext mathsize="90%">interaction coefficient</mml:mtext></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.005</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="inf23"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi mathvariant="normal">p</mml:mi><mml:mo>=</mml:mo><mml:mn>6.24</mml:mn><mml:mrow><mml:mo>×</mml:mo></mml:mrow><mml:msup><mml:mrow><mml:mn>10</mml:mn></mml:mrow><mml:mrow><mml:mo>−</mml:mo><mml:mn>23</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math></inline-formula>), but the 3’-AT-nucleotide-proportion term did not (<xref ref-type="fig" rid="fig6s1">Figure 6—figure supplement 1</xref>). This result is fully consistent with the fact that the Artemis-locus SNP is known to be associated with increasing the extent of trimming (a proxy for length).</p></sec><sec id="s2-7"><title>Local sequence context, length, and GC nucleotide content in both directions of the wider sequence can also accurately predict the trimming probabilities of a given sequence from other receptor loci</title><p>To validate our previously trained models, we worked with TCRα- and TCRβ-immunosequencing data representing 150 individuals, TCRγ-immunosequencing data representing 23 individuals, and IGH-immunosequencing data representing 9 individuals from three independent validation cohorts. Before analyzing these data, we ‘froze’ our trained model coefficients in git commit 093610a on our repository. In contrast to the training data cohort, these validation cohorts contain different demographics and were each processed using different sequence annotation methods (see Materials and methods). To explore the potential effects of using a different sequence annotation method, we re-annotated the TCRβ training data set using the same annotation method as the TCRα-β testing data and found that it had little to no effect on the model fit or performance (<xref ref-type="fig" rid="fig7s1">Figure 7—figure supplement 1</xref>).</p><p>To evaluate the performance of the <italic>1×2 motif + two-side base-count beyond</italic> model using these testing data, we used the model coefficients from the previous TCRβ V-gene training run and computed the expected per-sequence conditional log loss of the model using each testing data set (TCRβ V-gene sequences, TCRα V-gene sequences, TCRγ V-gene sequences, IGH V-gene sequences, TCRβ J-gene sequences, etc.). We found that the model has high predictive accuracy (i.e. low expected per-sequence conditional log loss) for both non-productive V- and J-gene sequences from the TCRβ testing data set (<xref ref-type="fig" rid="fig7">Figure 7</xref>). The model also extends well to non-productive V- and J-gene sequences from the TCRα and TCRγ testing data sets and to non-productive V-gene sequences from the IGH testing data set. The model has relatively poor predictive accuracy for non-productive IGH J-gene sequences, however. We noted very similar results when validating model performance using productive V- and J-gene sequences from each testing data set (<xref ref-type="fig" rid="fig7s2">Figure 7—figure supplement 2</xref>).</p><fig-group><fig id="fig7" position="float"><label>Figure 7.</label><caption><title>Expected per-sequence conditional log loss computed for various models using the T cell receptor β V-gene training data set and non-productive V- and J-gene sequences from several independent testing data sets.</title><p>Each model was trained using the full non-productive TCRβ V-gene training data set. Lower expected per-sequence log loss corresponds to a better model fit. The <italic>1×2 motif + two-side base-count beyond</italic> model has the best model fit and generalizability across all testing data sets. The horizontal dashed line corresponds to the expected per-sequence log loss of the <italic>1×2 motif + two-side base-count beyond</italic> model computed for V-gene trimming using the non-productive TCRβ V-gene training data set.</p><p><supplementary-material id="fig7sdata1"><label>Figure 7—source data 1.</label><caption><title>Expected per-sequence conditional log loss reported for each model and testing data set.</title></caption><media mimetype="text" mime-subtype="tab-separated-values" xlink:href="elife-85145-fig7-data1-v1.tsv"/></supplementary-material></p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig7-v1.tif"/></fig><fig id="fig7s1" position="float" specific-use="child-fig"><label>Figure 7—figure supplement 1.</label><caption><title>Differing methods of sequence annotation have little to no effect on the model fit or performance.</title><p>(<bold>A</bold>) Position-weight-matrix of the local sequence context dependence of V-gene trimming probabilities consisting of 1 nucleotide 5’ of the trimming site and 2 nucleotides 3’ of the trimming site from fitting the <italic>1×2 motif + two-side base-count beyond</italic> model using parsimony-annotated sequences. (<bold>B</bold>) Inferred <italic>two-side base-count beyond</italic> model coefficients from fitting the <italic>1×2 motif + two-side base-count beyond</italic> model using parsimony-annotated sequences. These inferred coefficients are highly similar to the original <italic>1×2 motif + two-side base-count beyond</italic> model trained using IGoR-annotated sequences (<xref ref-type="fig" rid="fig4">Figure 4</xref>). The count of AT nucleotides 5’ of the motif (shown in gray) was not included in this model. The black vertical line corresponds to the trimming site. Each inferred coefficient is given as the change in log10 odds of trimming at a given site resulting from an increase in the feature value, given that all other features are held constant.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig7-figsupp1-v1.tif"/></fig><fig id="fig7s2" position="float" specific-use="child-fig"><label>Figure 7—figure supplement 2.</label><caption><title>Model performance is similar for productive sequences compared to non-productive sequences from each testing data set.</title><p>Expected per-sequence conditional log loss computed for various models using the T cell receptor β V-gene training data set and productive V- and J-gene sequences from several independent testing data sets. Each model was trained using the full non-productive TCRβ V-gene training data set. Lower expected per-sequence log loss corresponds to a better model fit. The <italic>1×2 motif + two-side base-count beyond</italic> model has the best model fit and generalizability across all testing data sets. The horizontal dashed line corresponds to the expected per-sequence log loss of the <italic>1×2 motif + two-side base-count beyond</italic> model computed for V-gene trimming using the non-productive TCRβ V-gene training data set.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig7-figsupp2-v1.tif"/></fig><fig id="fig7s3" position="float" specific-use="child-fig"><label>Figure 7—figure supplement 3.</label><caption><title>Using the <italic>1×2 motif + two-side base-count beyond</italic> model, the weight of the <italic>two-side base-count beyond</italic> terms are dominant relative to the <italic>1×2 motif</italic> terms for every testing data set.</title><p>The weight of the <italic>1×2 motif</italic> and <italic>two-side base-count beyond</italic> model terms varies by data set. (<bold>A</bold>) The scale coefficient for the <italic>two-side base-count beyond</italic> model terms is larger than the <italic>motif</italic> scale coefficient for every data set. (<bold>B</bold>) The expected per-sequence conditional log loss of each of these new models is only slightly better compared to the original <italic>1×2 motif + two-side base-count beyond</italic> model. Horizontal and vertical dashed gray lines correspond to the TCRβ V-gene training data set. The black solid line corresponds to the <inline-formula><mml:math id="inf24"><mml:mrow><mml:mi mathsize="90%">y</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mi mathsize="90%">x</mml:mi></mml:mrow></mml:math></inline-formula> line.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig7-figsupp3-v1.tif"/></fig><fig id="fig7s4" position="float" specific-use="child-fig"><label>Figure 7—figure supplement 4.</label><caption><title>Sequence motifs appear at varying frequencies within the germline <italic>TRB</italic> and <italic>IGH</italic> genes.</title><p>Germline frequency of sequence motifs in <italic>IGH</italic> and <italic>TRB</italic> loci. Sequence motifs that lead to a large increase in trimming probabilities in the model (e.g. a large, positive position-weight-matrix-style motif score) appear at relatively low frequencies within the germline IGH genes. This may explain the weakness of the motif-related signal within <italic>IGH</italic> data sets (<xref ref-type="fig" rid="fig7s3">Figure 7—figure supplement 3</xref>).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-fig7-figsupp4-v1.tif"/></fig></fig-group><p>We hypothesized that the weight of the <italic>1×2 motif</italic> and <italic>two-side base-count beyond</italic> model terms may vary across each testing data set. To explore this for each data set, we again used the model coefficients from the previous TCRβ V-gene training run and trained a new two-parameter model containing one coefficient scaling the <italic>1×2 motif</italic> terms and a second coefficient scaling the <italic>two-side base-count beyond</italic> terms (see Materials and methods). With this approach, we found that the <italic>two-side base-count beyond</italic> terms were dominant compared to the <italic>1×2 motif</italic> terms for every data set (<xref ref-type="fig" rid="fig7s3">Figure 7—figure supplement 3A</xref>). The scale coefficient for the <italic>1×2 motif</italic> terms was very small for several of the data sets, especially the IGH data set, indicating only a weak motif-related signal. The sequence motifs that lead to a large increase in trimming probabilities in the model appear at relatively low frequencies within the germline <italic>IGH</italic> genes (<xref ref-type="fig" rid="fig7s4">Figure 7—figure supplement 4</xref>), perhaps explaining the weakness of the motif-related signal. When evaluating the expected per-sequence conditional log loss of these partially re-trained models, we note a small improvement in model fit for each re-trained model compared to the original model (<xref ref-type="fig" rid="fig7s3">Figure 7—figure supplement 3B</xref>).</p></sec></sec><sec id="s3" sec-type="discussion"><title>Discussion</title><p>The junctional deletion and insertion steps of the V(D)J recombination process are essential for creating diversity within the TCR repertoire. While the Artemis protein is often regarded as the main nuclease involved in V(D)J recombination, the exact mechanism of nucleotide trimming has yet to be understood in a human system. Using a previously published high-throughput TCRβ sequencing data set, we designed a flexible probabilistic model of nucleotide trimming that allowed us to explore the relative importance of various sequence-level features. While we recognize that these general model features may not capture the full complexity of the trimming mechanism and establish causation, we were primarily interested in identifying mechanistically interpretable features which could confirm and extend our current understanding of the nucleotide trimming process. With this framework, we have (1) revealed a set of sequence-level features which can be used to accurately predict trimming probabilities across various adaptive immune receptor loci, (2) shown that length and GC nucleotide content in both directions of the wider sequence are highly predictive of trimming probabilities, quantifying how double-stranded DNA needs to be able to breathe for trimming to occur, (3) identified a sequence motif that appears to get preferentially trimmed, independent of length- and GC-content-related effects, and (4) demonstrated that a genetic variant within the gene encoding the Artemis protein is associated with changes in several model coefficients.</p><p>Specifically, we find that a model containing parameterizations of both local sequence context, length, and GC nucleotide content in both directions of the wider sequence can most accurately predict the trimming probabilities of a given TCRβ gene sequence. In addition to having fewer parameters, this model also had better predictive accuracy than a previously proposed sequence context model (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>). Models containing other sequence-level parameters such as DNA-shape and length also had relatively worse predictive accuracy. The <italic>TR</italic> and <italic>IG</italic> V(D)J recombination processes, including trimming profiles, have previously been suggested to vary substantially across individuals (<xref ref-type="bibr" rid="bib47">Slabodkin et al., 2021</xref>; <xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>). Here, our results support a universal, sequence-based trimming mechanism underlying this variation across <italic>TR</italic> and <italic>IG</italic> loci in humans. Specifically, in addition to TCRβ sequences, we find that local sequence context, length, and GC nucleotide content in both directions of the wider sequence can be used to accurately predict trimming probabilities across TCRα, TCRγ, and IGH sequences. For all of these loci, we find that length and GC nucleotide content are relatively more important than local sequence context terms for making accurate model predictions.</p><p>The Artemis protein, in complex with DNA-PKcs, is responsible for opening the DNA hairpin during the early steps of V(D)J recombination to generate a 4-nucleotide-long 3’-single-stranded overhang at the end of each gene, and has been suggested to continue on to trim nucleotides from this resulting DNA structure (<xref ref-type="bibr" rid="bib13">Feeney et al., 1994</xref>; <xref ref-type="bibr" rid="bib35">Nadel and Feeney, 1995</xref>; <xref ref-type="bibr" rid="bib36">Nadel and Feeney, 1997</xref>; <xref ref-type="bibr" rid="bib21">Jackson et al., 2004</xref>; <xref ref-type="bibr" rid="bib20">Gu et al., 2010</xref>; <xref ref-type="bibr" rid="bib2">Chang et al., 2015</xref>; <xref ref-type="bibr" rid="bib3">Chang and Lieber, 2016</xref>; <xref ref-type="bibr" rid="bib56">Zhao et al., 2020</xref>; <xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>). The Artemis protein, with and without DNA-PKcs, has been shown to bind single-stranded-to-double-stranded DNA boundaries prior to nicking DNA (<xref ref-type="bibr" rid="bib29">Ma et al., 2002</xref>; <xref ref-type="bibr" rid="bib30">Ma et al., 2005</xref>; <xref ref-type="bibr" rid="bib2">Chang et al., 2015</xref>; <xref ref-type="bibr" rid="bib3">Chang and Lieber, 2016</xref>). While the single-stranded overhang created during hairpin-opening may create a natural single-stranded-to-double-stranded DNA substrate for Artemis binding near the end of the gene sequence, we find that many trimming events occur further into the double-stranded gene sequence. Indeed, previous in vitro DNA nuclease assays involving Artemis have shown that sequence-breathing dynamics are often required to generate a transient single-stranded-to-double-stranded DNA substrate prior to Artemis action (<xref ref-type="bibr" rid="bib2">Chang et al., 2015</xref>). Using our model of nucleotide trimming, we have shown that trimming probabilities are highest for DNA positions closer to the end of the sequence. Because these DNA positions have fewer double-stranded nucleotides on the 3’-side of the trimming site, they may have more capacity for sequence-breathing. On the 5’-side of the trimming site, we find that having a larger number of G-C nucleotides, and perhaps less sequence-breathing capacity, increases the trimming probability. Perhaps this breathing transition can create a transient single-stranded-to-double-stranded DNA substrate that is suitable for Artemis to bind and trim. As such, this finding quantifies sequence-breathing effects that were previously identified through in vitro DNA nuclease assay studies involving Artemis (<xref ref-type="bibr" rid="bib2">Chang et al., 2015</xref>).</p><p>Independent of GC-content-related effects, we have also identified a gene-segment-wide sequence motif that appears to get preferentially trimmed. This motif is suggestive of sequence-specific nucleolytic activity, however, Artemis is widely regarded as a structure-specific nuclease as opposed to a nuclease that binds specific DNA sequences (<xref ref-type="bibr" rid="bib30">Ma et al., 2005</xref>; <xref ref-type="bibr" rid="bib2">Chang et al., 2015</xref>; <xref ref-type="bibr" rid="bib3">Chang and Lieber, 2016</xref>; <xref ref-type="bibr" rid="bib55">Yosaatmadja et al., 2021</xref>). This suggests that either (1) Artemis actually does possess some ability to recognize specific nucleotides, (2) the observed sequence motif is serving as a proxy for DNA structure induced by the motif, or (3) another nuclease, in addition to Artemis, is responsible for the sequence-specific trimming we observe. However, because the strength of this sequence motif signal varied across receptor loci, further work will be required to explore its mechanistic basis and presence.</p><p>We found that several model coefficients related to local sequence context, length, and GC nucleotide content in both directions of the wider sequence varied significantly in the context of the non-coding Artemis-locus SNP rs41298872. We previously identified this Artemis-locus SNP as being associated with increasing the extent of TCRβ V- and J-gene trimming (<xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>). While many previous studies have reported a high consistency of TCRβ trimming profiles across individuals (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>; <xref ref-type="bibr" rid="bib31">Marcou et al., 2018</xref>; <xref ref-type="bibr" rid="bib46">Sethna et al., 2020</xref>), our results begin to explore how the trimming mechanism may vary across individuals in the context of Artemis genetic variation. We reported that trimming probabilities decrease as the number of double-stranded nucleotides 3’ of the trimming site increases. In the context of the SNP rs41298872, we found that as the number of double-stranded AT nucleotides 3’ of the trimming site increases, the trimming probabilities do not decrease as quickly. This suggests that individuals homozygous (or heterozygous) for rs41298872 may be more capable of trimming at positions that have a larger number of double-stranded nucleotides 3’ of the trimming site, especially if the additional nucleotides are AT bases. This may be possible if, for example, rs41298872 increases Artemis expression. If there is more Artemis available, then trimming at less optimal positions (i.e. positions further into the sequence which have less breathing) may be possible. Additional work will be required to define the relationship between rs41298872 genotype and Artemis expression.</p><p>We also identified several local sequence context coefficients that varied in the context of rs41298872, however, their mechanistic interpretation remains unclear. Earlier, we noted that A nucleotides 3’ of the trimming site have a negative effect on the trimming probability while T nucleotides have a strong positive effect. In the context of rs41298872, we found that the magnitude of the negative effect of 3’ A nucleotides on the trimming probability was reduced. This may suggest that individuals homozygous (or heterozygous) for rs41298872 may trim in a less motif-dependent fashion, and are instead more reliant on sequence openness 3’ of the trimming site. In this way, having A or T nucleotides 3’ of the trimming site would create a more open local sequence for trimming.</p><p>There are several key limitations of our approach which are intrinsic to the use of adaptive immune receptor repertoire data. First, we have used trimming statistics from non-productive rearrangements as a means of studying the nucleotide trimming process in the absence of selection. Non-productive sequences can be sequenced as part of the repertoire when they are present within a cell expressing a productive rearrangement that survived the selection process. While we are not aware of a mechanism through which non-productive and productive rearrangements within a single cell could be correlated, we also acknowledge that the repertoire of non-productive rearrangements may be an imperfect proxy for a pre-selection repertoire. However, as is common in the literature (<xref ref-type="bibr" rid="bib39">Robins et al., 2010</xref>; <xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>; <xref ref-type="bibr" rid="bib31">Marcou et al., 2018</xref>; <xref ref-type="bibr" rid="bib45">Sethna et al., 2019</xref>; <xref ref-type="bibr" rid="bib46">Sethna et al., 2020</xref>), we assume that the two recombination events are independent and that the non-productive rearrangements reflect the statistics of the repertoire prior to selection. Next, because many V(D)J rearrangement scenarios can give rise to the same final nucleotide sequence, possible error related to the annotation of each sequence may have restricted our ability to model the actual trimming distributions of each gene. Although we cannot rule out some effect of incorrect sequence annotation on our model inferences, we found that the exact sequence annotation method used, including sampling from the posterior distribution of rearrangement events, had little to no effect on the model fit or performance.</p><p>In summary, we have found that local sequence context, length, and the GC nucleotide content in both directions of the wider sequence can accurately predict the trimming probabilities of <italic>TR</italic> and <italic>IG</italic> gene sequences. These results refine our understanding of how nucleotides are trimmed during V(D)J recombination. The sequence-level features identified here lay the groundwork for further exploration into the trimming mechanism and how it may vary across individuals. Such insights will provide another step toward understanding how V(D)J recombination generates diverse receptors and supports a powerful, unique immune response in humans.</p></sec><sec id="s4" sec-type="materials|methods"><title>Materials and methods</title><sec id="s4-1"><title>Training data set</title><p>TCRβ repertoire sequence data for 666 healthy bone marrow donor subjects was downloaded from the Adaptive Biotechnologies immuneACCESS database using the link provided in the original publication (<xref ref-type="bibr" rid="bib12">Emerson et al., 2017</xref>). V(D)J recombination scenarios were assigned to each sequence for each individual using the IGoR software (version 1.4.0) (<xref ref-type="bibr" rid="bib31">Marcou et al., 2018</xref>) as follows. The IGoR software can learn unbiased V(D)J recombination statistics from immune sequence reads. Using these statistics, IGoR can output a list of potential recombination scenarios with their corresponding likelihoods for each sequence. As such, using the default IGoR V(D)J recombination statistics, the 10 highest probability V(D)J recombination scenarios were inferred for each TCRβ-chain sequence in the training data set (<xref ref-type="bibr" rid="bib31">Marcou et al., 2018</xref>). We then annotated each TCRβ-chain sequence with a single V(D)J recombination scenario by sampling from these 10 scenarios according to the posterior probability of each scenario. We filtered these sequences for rearrangements which contained more than 1 trimmed nucleotide and less than 15 trimmed nucleotides (see the ‘Notation’ section for further details). We further subset the data to include only non-productive sequences, and used these data for all subsequent model training. After these processing and filtering steps, we used V-gene trimming length distributions from 21,193,153 non-productive sequences for all model training. To test each trained model, we used V-gene trimming length distributions from the remaining 107,121,841 productive sequences (as described in Appendix 3). From this same data set, we also used J-gene trimming length distributions from 107,255,406 productive sequences and 20,204,801 non-productive sequences to test each model.</p></sec><sec id="s4-2"><title>Testing data sets</title><sec id="s4-2-1"><title>TCRα and TCRβ testing data sets</title><p>Annotated TCRα and TCRβ repertoire sequence data for 150 healthy subjects was downloaded using the link provided in the original publication (<xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>). In contrast to the training data cohort, this cohort contains different demographics, shallower RNA-seq-based TCR sequencing, and was processed using a different sequence annotation methods (i.e. TCRdist [version 0.0.2] [<xref ref-type="bibr" rid="bib8">Dash et al., 2017</xref>] as described in a previous publication [<xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>]). Sequences were split into non-productive and productive groups for model validation. From the TCRα data set, we used V-gene trimming length distributions from 123,496 non-productive sequences and 862,096 productive sequences and J-gene trimming length distributions from 141,451 non-productive sequences and 1,101,114 productive sequences to test each model. From the TCRβ data set, we used V-gene trimming length distributions from 64,738 non-productive sequences and 1,435,153 productive sequences and J-gene trimming length distributions from 59,608 non-productive sequences and 1,496,953 productive sequences to test each model.</p></sec><sec id="s4-2-2"><title>TCRγ testing data set</title><p>Annotated TCRγ repertoire sequence data for 23 healthy bone marrow donor subjects was downloaded from the Adaptive Biotechnologies immuneACCESS database (<xref ref-type="bibr" rid="bib40">Robins and Pearson, 2015</xref>). Sequences were split into non-productive and productive groups for model validation. We used V-gene trimming length distributions from 2,403,293 non-productive sequences and 1,002,662 productive sequences and J-gene trimming length distributions from 568,824 non-productive sequences and 250,493 productive sequences to test each model.</p></sec><sec id="s4-2-3"><title>IGH testing data sets</title><p>Annotated IgG class non-productive IGH repertoire sequence data for nine healthy subjects was obtained from the authors of a previous publication (<xref ref-type="bibr" rid="bib48">Spisak et al., 2020</xref>). The raw sequence data is available using the link provided in the original publication (<xref ref-type="bibr" rid="bib1">Briney et al., 2019</xref>). In contrast to the training data cohort, this cohort contains different demographics, shallower RNA-seq based IGH-sequencing, and was processed using a different sequence annotation method (i.e. a combination of Immcantation [<xref ref-type="bibr" rid="bib51">Vander Heiden et al., 2014</xref>] and IgBlast [<xref ref-type="bibr" rid="bib54">Ye et al., 2013</xref>] as described in a previous publication [<xref ref-type="bibr" rid="bib48">Spisak et al., 2020</xref>]). Further, these data are restricted to rearrangements that lead to a clonal family with at least six members.</p><p>Likewise, productive IGH repertoire sequence data for four healthy subjects was downloaded using the link provided in the original publication (<xref ref-type="bibr" rid="bib22">Jaffe et al., 2022</xref>) and the sequences were annotated using partis (version 0.16.0) (<xref ref-type="bibr" rid="bib38">Ralph and Matsen, 2016</xref>). Due to the large size of this data set, 100k sequences were randomly sampled from the original data set prior to model validation. For both IGH data sets, only a single sequence from each inferred clonal family was included in each model testing data set. From these data sets, we used V-gene trimming length distributions from 160,714 non-productive sequences and 32,245 productive sequences and J-gene trimming length distributions from 297,298 non-productive sequences and 74,884 productive sequences to test each model.</p></sec></sec><sec id="s4-3"><title>Artemis-locus SNP data set</title><p>Genome-wide SNP array data corresponding to 611 of the training data set individuals was downloaded from The database of Genotypes and Phenotypes (accession number: phs001918). Details of the SNP array data set, genotype imputation, and quality control have been described previously (<xref ref-type="bibr" rid="bib32">Martin et al., 2020</xref>). We only used SNP data corresponding to the Artemis locus (rs41298872) which we previously found to be strongly associated with increasing the extent of V-gene trimming (<xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>).</p></sec><sec id="s4-4"><title>Notation</title><p>Let <inline-formula><mml:math id="inf25"><mml:mi mathsize="90%">I</mml:mi></mml:math></inline-formula> be a set of individuals. For each subject <inline-formula><mml:math id="inf26"><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mi mathsize="90%">I</mml:mi></mml:mrow></mml:math></inline-formula>, assume we have a TCR repertoire consisting of sequences indexed by <inline-formula><mml:math id="inf27"><mml:mi mathsize="90%">k</mml:mi></mml:math></inline-formula> such that <inline-formula><mml:math id="inf28"><mml:mrow><mml:mi mathsize="90%">k</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mn mathsize="90%">1</mml:mn><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msub><mml:mi mathsize="90%">K</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub></mml:mrow></mml:mrow></mml:math></inline-formula>. We assume that each sequence can be unambiguously annotated with being from a specific V-gene and J-gene sequence, and having a number of deleted nucleotides from each gene. For modeling purposes, we combine <italic>TRB</italic> V-gene or J-gene alleles that have identical terminal nucleotide sequences (last 24 nucleotides of each sequence) into <italic>TRB</italic> V-gene allele groups and <italic>TRB</italic> J-gene allele groups. As such, each TCR sequence is annotated with being from a V-gene allele group and J-gene allele group. Because we are requiring that each gene allele group originates from the same <italic>TRB</italic> V-gene or J-gene, there may still be overlap in terms of sequence identity between allele groups. For simplicity, we orient all sequences in the 5’-to-3’ direction, and use the top strand for V-gene sequences and the bottom strand for J-gene sequences. We will be introducing modeling methods as they relate to V-genes and V-gene trimming, however, with this sequence orientation, the same methods can be applied to J-genes and J-gene trimming. We will use <inline-formula><mml:math id="inf29"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> to represent a gene sequence oriented in the 5’-to-3’ direction and <inline-formula><mml:math id="inf30"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> to represent the number of nucleotides deleted from the 3’ end of this sequence as we describe our modeling.</p><p>We are interested in modeling the probability of trimming <inline-formula><mml:math id="inf31"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> nucleotides from a given gene sequence <inline-formula><mml:math id="inf32"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="inf33"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula>. We can define an empirical conditional probability density function to estimate this probability. To start, we can uniformly sample from any given individual’s repertoire. Let <inline-formula><mml:math id="inf34"><mml:mi mathsize="90%">S</mml:mi></mml:math></inline-formula> be a random variable that represents the gene-allele-group sequence from such a sample. Let <inline-formula><mml:math id="inf35"><mml:mi mathsize="90%">N</mml:mi></mml:math></inline-formula> be a random variable that represents the number of deleted nucleotides, which for notational convenience we assume take on a non-negative integer value (nonsensical values will have probability zero). Let <inline-formula><mml:math id="inf36"><mml:mrow><mml:mn mathsize="90%">0</mml:mn><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">i</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:msub><mml:mi mathsize="90%">K</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> represent the number of TCRs that use gene allele group <inline-formula><mml:math id="inf37"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula>. Let <inline-formula><mml:math id="inf38"><mml:mrow><mml:mn mathsize="90%">0</mml:mn><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">i</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:msub><mml:mi mathsize="90%">K</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> represent the number of TCRs that have gene allele group <inline-formula><mml:math id="inf39"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf40"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> gene nucleotides deleted. With these data, we can form the empirical conditional probability density function:<disp-formula id="equ1"><label>(1)</label><mml:math id="m1"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msup><mml:mi>C</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:msup><mml:mi>C</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mfrac><mml:mo>.</mml:mo></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>Using these TCRβ repertoire data, we want to model the influence of various sequence-level parameters on <inline-formula><mml:math id="inf41"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> . With this assumption, let <inline-formula><mml:math id="inf42"><mml:mi mathsize="90%">L</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf43"><mml:mi mathsize="90%">U</mml:mi></mml:math></inline-formula> be lower and upper bounds, respectively, on <inline-formula><mml:math id="inf44"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> such that <inline-formula><mml:math id="inf45"><mml:mrow><mml:msup><mml:mi mathsize="90%">N</mml:mi><mml:mo mathsize="90%" stretchy="false">′</mml:mo></mml:msup><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mi mathsize="90%">L</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">U</mml:mi><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> is the set of all reasonable nucleotide deletion amounts. The precise location of hairpin opening and its relationship to deletion is unclear. Hence, we have chosen to define <inline-formula><mml:math id="inf46"><mml:mrow><mml:mi mathsize="90%">L</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow></mml:math></inline-formula> since smaller trimming amounts may result from an alternative, hairpin-opening-position-related (or other) trimming mechanism. Likewise, we have chosen to define <inline-formula><mml:math id="inf47"><mml:mrow><mml:mi mathsize="90%">U</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">14</mml:mn></mml:mrow></mml:math></inline-formula> since trimming amounts greater than 14 nucleotides are uncommon and could also result from an alternative trimming mechanism. We will subset the training data set, after IGoR annotation (see details in a previous section), such that we will only consider TCRs that have <inline-formula><mml:math id="inf48"><mml:mrow><mml:mn mathsize="90%">2</mml:mn><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:mn mathsize="90%">14</mml:mn></mml:mrow></mml:math></inline-formula>. Similarly, the one existing analysis (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>) exploring the relationship between sequence context and nucleotide trimming only considered TCRs that had <inline-formula><mml:math id="inf49"><mml:mrow><mml:mn mathsize="90%">2</mml:mn><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:mn mathsize="90%">12</mml:mn></mml:mrow></mml:math></inline-formula> for their modeling. We summarize all of the notation discussed in this section, as well as in the following sections, in <xref ref-type="table" rid="app1table1">Appendix 1—table 1</xref>.</p></sec><sec id="s4-5"><title>V(D)J recombination modeling assumptions</title><p>For our model, we make the following assumptions about V(D)J recombination biology:</p><list list-type="order"><list-item><p>During the V(D)J recombination process, the gene DNA hairpin is nicked open by a single-stranded break (<xref ref-type="bibr" rid="bib16">Gauss and Lieber, 1996</xref>; <xref ref-type="bibr" rid="bib36">Nadel and Feeney, 1997</xref>; <xref ref-type="bibr" rid="bib29">Ma et al., 2002</xref>; <xref ref-type="bibr" rid="bib21">Jackson et al., 2004</xref>; <xref ref-type="bibr" rid="bib27">Lu et al., 2007</xref>).</p></list-item><list-item><p>This hairpin nick occurs at the +2 position, leading to a 4-nucleotide-long 3’-single-stranded-overhang (the 2 nucleotides furthest 3’ are considered P-nucleotides) (<xref ref-type="bibr" rid="bib29">Ma et al., 2002</xref>; <xref ref-type="bibr" rid="bib27">Lu et al., 2007</xref>). We will discuss a sensitivity analysis to this assumption, which showed that the assumed hairpin-nick position had little impact on our model fitting, in the appendix.</p></list-item><list-item><p>If any nonzero amount of the original gene sequence is deleted, all P-nucleotides will also be deleted (<xref ref-type="bibr" rid="bib16">Gauss and Lieber, 1996</xref>; <xref ref-type="bibr" rid="bib49">Srivastava and Robins, 2012</xref>).</p></list-item><list-item><p>Nucleotide trimming occurs before N-insertion.</p></list-item></list><p>With these assumptions, we can resolve the nucleotide sequence on both sides of the trimming site and define mechanistically interpretable model features using these two sequences. Specifically, we define a ‘trimming motif’ consisting of several nucleotides on either side of the trimming site, the predicted ‘DNA-shape’ of the nucleotides and bonds in close proximity to the trimming site, the counts of GC or AT nucleotides on either side of the trimming site beyond the ‘trimming motif’ region (e.g. the ‘two-side base-count beyond’), and the sequence-independent ‘length’ from the end of the gene to the trimming site (see Appendix 2 for further details). An example of how an arbitrary V-gene sequence is transformed into features for modeling is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>. We will assume that observations can be drawn from a model in which these features vary across trimming lengths <inline-formula><mml:math id="inf50"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> for a given gene allele group <inline-formula><mml:math id="inf51"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula>. We can then explore the influence of these features on the probability of trimming at a certain site given a gene sequence.</p></sec><sec id="s4-6"><title>Defining a model covariate function</title><p>With the features summarized above, we can define a model covariate function <inline-formula><mml:math id="inf52"><mml:mi mathsize="90%">f</mml:mi></mml:math></inline-formula> than contains any unique combination of parameter-specific covariate functions (<xref ref-type="table" rid="table1">Table 1</xref>). This function <inline-formula><mml:math id="inf53"><mml:mi mathsize="90%">f</mml:mi></mml:math></inline-formula> will be the sum of each of the desired parameter-specific covariate functions. This framework allows us to generalize the existing PWM model (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>) to a model that allows for arbitrary sequence features. For example, we replicate this PWM model using the model covariate function, <inline-formula><mml:math id="inf54"><mml:mrow><mml:msub><mml:mi mathsize="90%">f</mml:mi><mml:mn mathsize="90%">1</mml:mn></mml:msub><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">2</mml:mn><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">4</mml:mn><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="inf55"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> represents the number of trimmed nucleotides, <inline-formula><mml:math id="inf56"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> represents the gene-allele-group sequence, <inline-formula><mml:math id="inf57"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup></mml:math></inline-formula> represents <italic>motif</italic>-specific parameter coefficients, and <inline-formula><mml:math id="inf58"><mml:mi mathsize="90%">a</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf59"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula> are non-negative integer values that represent the number of nucleotides 5’ and 3’ of the trimming site, respectively, that are included in the ‘trimming motif’. This function is described further in (<xref ref-type="disp-formula" rid="equ21">Equation 14</xref>). To extend this model to a model containing <italic>motif</italic> parameters and <italic>base-count-beyond</italic> parameters, the model covariate function will be<disp-formula id="equ2"><label>(2)</label><mml:math id="m2"><mml:mrow><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></disp-formula></p><p>where <inline-formula><mml:math id="inf60"><mml:msub><mml:mi mathsize="90%">f</mml:mi><mml:mn mathsize="90%">2</mml:mn></mml:msub></mml:math></inline-formula> represents the <italic>base-count-beyond</italic> model covariate function (<xref ref-type="disp-formula" rid="equ30">Equation 17</xref>), <inline-formula><mml:math id="inf61"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup></mml:math></inline-formula> and <inline-formula><mml:math id="inf62"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup></mml:math></inline-formula> represent <italic>base-count-beyond</italic>-specific parameter coefficients, and <inline-formula><mml:math id="inf63"><mml:mi mathsize="90%">c</mml:mi></mml:math></inline-formula> represents the number of nucleotides 5’ of the trimming site to be included in the base-count. We will use this <italic>motif</italic> and <italic>base-count-beyond</italic> model example to discuss the model formulation in the following sections, however, many other parameter combinations are possible. We will not define a model covariate function that contains two parameters that model the same feature. For example, <italic>length</italic> and <italic>base-count-beyond</italic> coefficients will never be included in a model covariate function together (since they both parameterize length). Likewise, <italic>motif</italic> and <italic>DNA-shape</italic> coefficients will never both be included in a model covariate function.</p><table-wrap id="table1" position="float"><label>Table 1.</label><caption><title>Summary of all parameter-specific coefficients and covariate functions for a trimming site <inline-formula><mml:math id="inf64"><mml:mi>n</mml:mi></mml:math></inline-formula> and gene sequence <inline-formula><mml:math id="inf65"><mml:mi>σ</mml:mi></mml:math></inline-formula>.</title><p>Here, <inline-formula><mml:math id="inf66"><mml:mi>a</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf67"><mml:mi>b</mml:mi></mml:math></inline-formula> represent the number of nucleotides 5’ and 3’ of the trimming site to be included in the ‘trimming motif,’ respectively, and <inline-formula><mml:math id="inf68"><mml:mi>c</mml:mi></mml:math></inline-formula> represents the number of nucleotides 5’ of the trimming site to be included in the base-count.</p></caption><table frame="hsides" rules="groups"><thead><tr><th align="left" valign="bottom">Parameter</th><th align="left" valign="bottom">Model coefficient variables</th><th align="left" valign="bottom">Parameter-specific covariate function</th></tr></thead><tbody><tr><td align="left" valign="middle"><italic>Motif</italic> parameters</td><td align="left" valign="middle"><inline-formula><mml:math id="inf69"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup></mml:math></inline-formula> coefficients</td><td align="char" char="." valign="middle"><inline-formula><mml:math id="inf70"><mml:mrow><mml:msub><mml:mi mathsize="90%">f</mml:mi><mml:mn mathsize="90%">1</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> (<xref ref-type="disp-formula" rid="equ21">Equation 14</xref>)</td></tr><tr><td align="left" valign="middle"><italic>Base-count-beyond</italic> parameters</td><td align="left" valign="middle"><inline-formula><mml:math id="inf71"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math></inline-formula> and <inline-formula><mml:math id="inf72"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math></inline-formula> coefficients</td><td align="char" char="." valign="middle"><inline-formula><mml:math id="inf73"><mml:mrow><mml:msub><mml:mi mathsize="90%">f</mml:mi><mml:mn mathsize="90%">2</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> (<xref ref-type="disp-formula" rid="equ30">Equation 17</xref>)</td></tr><tr><td align="left" valign="middle"><italic>DNA-shape</italic> parameters</td><td align="left" valign="middle"><inline-formula><mml:math id="inf74"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">Shape</mml:mtext></mml:msup></mml:math></inline-formula> coefficients</td><td align="char" char="." valign="middle"><inline-formula><mml:math id="inf75"><mml:mrow><mml:msub><mml:mi mathsize="90%">f</mml:mi><mml:mn mathsize="90%">3</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">Shape</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> (<xref ref-type="disp-formula" rid="equ32">Equation 19</xref>)</td></tr><tr><td align="left" valign="middle"><italic>Length</italic> parameters</td><td align="left" valign="middle"><inline-formula><mml:math id="inf76"><mml:msup><mml:mi mathsize="90%">β</mml:mi><mml:mtext mathsize="90%">ldiSt</mml:mtext></mml:msup></mml:math></inline-formula> coefficients</td><td align="char" char="." valign="middle"><inline-formula><mml:math id="inf77"><mml:mrow><mml:msub><mml:mi mathsize="90%">f</mml:mi><mml:mn mathsize="90%">4</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%">β</mml:mi><mml:mtext mathsize="90%">ldiSt</mml:mtext></mml:msup><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> (<xref ref-type="disp-formula" rid="equ33">Equation 20</xref>)</td></tr></tbody></table></table-wrap></sec><sec id="s4-7"><title>Predicting trimming probabilities using conditional logistic regression</title><p>We will be using the <italic>motif</italic> and <italic>base-count-beyond</italic> parameters given by (<xref ref-type="disp-formula" rid="equ2">Equation 2</xref>) as examples for the remainder of this section, however, we could also formulate a model with any other parameter of interest, as described in the previous section (<xref ref-type="table" rid="table1">Table 1</xref>). As such, we can fit a conditional logit model which posits that<disp-formula id="equ3"><label>(3)</label><mml:math id="m3"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:mfrac><mml:mrow><mml:mi>exp</mml:mi><mml:mo>⁡</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:msup><mml:mi>n</mml:mi><mml:mrow><mml:mi mathvariant="normal">′</mml:mi></mml:mrow></mml:msup><mml:mo>∈</mml:mo><mml:msup><mml:mi>N</mml:mi><mml:mrow><mml:mi mathvariant="normal">′</mml:mi></mml:mrow></mml:msup></mml:mrow></mml:munder><mml:mi>exp</mml:mi><mml:mo>⁡</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msup><mml:mi>n</mml:mi><mml:mrow><mml:mi mathvariant="normal">′</mml:mi></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>where <inline-formula><mml:math id="inf78"><mml:msup><mml:mi mathsize="90%">N</mml:mi><mml:mo mathsize="90%" stretchy="false">′</mml:mo></mml:msup></mml:math></inline-formula> is the set of all reasonable trimming lengths, <inline-formula><mml:math id="inf79"><mml:mi mathsize="90%">a</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf80"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula> represent the number of nucleotides 5’ and 3’ of the trimming site to be included in the ‘trimming motif,’ respectively, <inline-formula><mml:math id="inf81"><mml:mi mathsize="90%">c</mml:mi></mml:math></inline-formula> represents the number of nucleotides 5’ of the trimming site to be included in the base-count parameters, and <inline-formula><mml:math id="inf82"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> is the model covariate function for the <italic>motif</italic> and <italic>base-count-beyond</italic> model given by (<xref ref-type="disp-formula" rid="equ2">Equation 2</xref>). We will let <inline-formula><mml:math id="inf83"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> denote the conditional probability that a given gene will be trimmed by <inline-formula><mml:math id="inf84"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> nucleotides.</p><p>Let <inline-formula><mml:math id="inf85"><mml:msub><mml:mi mathsize="90%">y</mml:mi><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">k</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">n</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> equal 1 if a gene allele group <inline-formula><mml:math id="inf86"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> is trimmed by <inline-formula><mml:math id="inf87"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> nucleotides for TCR <inline-formula><mml:math id="inf88"><mml:mi mathsize="90%">k</mml:mi></mml:math></inline-formula> from subject <inline-formula><mml:math id="inf89"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula>, and equal 0 otherwise. With this, we can define a likelihood function, <inline-formula><mml:math id="inf90"><mml:mrow><mml:mi mathsize="90%">L</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, such that for a random sample of subjects, <inline-formula><mml:math id="inf91"><mml:mrow><mml:mi mathsize="90%">L</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, is the likelihood of the model parameters, <inline-formula><mml:math id="inf92"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup></mml:math></inline-formula>, <inline-formula><mml:math id="inf93"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup></mml:math></inline-formula>, and <inline-formula><mml:math id="inf94"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup></mml:math></inline-formula>, given that we observed a set of trimming amounts for a set of given genes. As such, the log-likelihood function can be written as<disp-formula id="equ4"><mml:math id="m4"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>L</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mstyle displaystyle="true" scriptlevel="0"><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>k</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>n</mml:mi></mml:mrow></mml:munder><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>k</mml:mi><mml:mi>σ</mml:mi><mml:mi>n</mml:mi></mml:mrow></mml:msub><mml:mo>⋅</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mstyle></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>where <inline-formula><mml:math id="inf95"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace"> AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> is given by (<xref ref-type="disp-formula" rid="equ3">Equation 3</xref>). Instead of maximizing this log-likelihood directly, we may wish to aggregate the data to reduce the number of observations and simplify model fitting. Recall that for subject <inline-formula><mml:math id="inf96"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="inf97"><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">i</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> represents the number of TCRs which use gene allele group <inline-formula><mml:math id="inf98"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf99"><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">i</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> represents the number of TCRs which have gene allele group <inline-formula><mml:math id="inf100"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf101"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> gene nucleotides deleted. As such, <inline-formula><mml:math id="inf102"><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">i</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> is the count of observations which will have the same trimming probabilities <inline-formula><mml:math id="inf103"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace"> AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> and will have been trimmed by <inline-formula><mml:math id="inf104"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> for subject <inline-formula><mml:math id="inf105"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula> and gene allele group <inline-formula><mml:math id="inf106"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula>. Thus, using this aggregated data from all subjects <inline-formula><mml:math id="inf107"><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mi mathsize="90%">I</mml:mi></mml:mrow></mml:math></inline-formula>, we can re-write the log-likelihood function equivalently as<disp-formula id="equ5"><label>(4)</label><mml:math id="m5"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>L</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>n</mml:mi></mml:mrow></mml:munder><mml:msup><mml:mi>C</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>As above, for a random sample of subjects, <inline-formula><mml:math id="inf108"><mml:mrow><mml:mi mathsize="90%">L</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> is the likelihood of the model parameters, <inline-formula><mml:math id="inf109"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup></mml:math></inline-formula>, <inline-formula><mml:math id="inf110"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup></mml:math></inline-formula>, and <inline-formula><mml:math id="inf111"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup></mml:math></inline-formula>, given that we observed a set of trimming amounts for a set of given genes.</p><p>With this likelihood formulation, all observations in the sample get uniform treatment in the construction of the likelihood. However, subjects may differ in their repertoire size and composition for reasons other than trimming. For example, it is known that gene usage differs across subjects. Thus, to avoid having these differences pollute our <inline-formula><mml:math id="inf112"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf113"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, and <inline-formula><mml:math id="inf114"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> inference, we propose a subject and gene weighting scheme.</p><p>As such, we can define the expected likelihood of a process where we first draw a subject <inline-formula><mml:math id="inf115"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula> uniformly at random, then we sample TCR sequences from their repertoire according to a given distribution, as follows. For a single TCR sequence from such a sample, let <inline-formula><mml:math id="inf116"><mml:mi mathsize="90%">S</mml:mi></mml:math></inline-formula> be a random variable representing the gene of the sequence, and let <inline-formula><mml:math id="inf117"><mml:mi mathsize="90%">N</mml:mi></mml:math></inline-formula> be a random variable representing the number of deleted nucleotides. We can sample each TCR sequence with probability <inline-formula><mml:math id="inf118"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>samp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> which we will specify later. Also, given random <inline-formula><mml:math id="inf119"><mml:mi mathsize="90%">S</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf120"><mml:mi mathsize="90%">N</mml:mi></mml:math></inline-formula>, the log-likelihood of the model parameters, <inline-formula><mml:math id="inf121"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup></mml:math></inline-formula>, <inline-formula><mml:math id="inf122"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup></mml:math></inline-formula>, and <inline-formula><mml:math id="inf123"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup></mml:math></inline-formula>, is given by<disp-formula id="equ6"><mml:math id="m6"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>L</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo>;</mml:mo><mml:mi>N</mml:mi><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>∣</mml:mo><mml:mi>S</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>With this, the expected log-likelihood of the model parameters, <inline-formula><mml:math id="inf124"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msup><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf125"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup></mml:math></inline-formula>, and <inline-formula><mml:math id="inf126"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup></mml:math></inline-formula> given this random sample is given by<disp-formula id="equ7"><mml:math id="m7"><mml:mrow><mml:mtable columnalign="left left" rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mi>E</mml:mi><mml:mo stretchy="false">[</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>L</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mi mathvariant="normal">m</mml:mi><mml:mi mathvariant="normal">o</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">i</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mi mathvariant="normal">A</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mi mathvariant="normal">G</mml:mi><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>∣</mml:mo><mml:mi>I</mml:mi><mml:mo>=</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">]</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi></mml:mrow></mml:munder><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>samp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mo>⋅</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mo>=</mml:mo><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi></mml:mrow></mml:munder><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>samp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mo>⋅</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula></p><p>We can define a new, weighted log-likelihood function, <inline-formula><mml:math id="inf127"><mml:mrow><mml:mrow><mml:mi mathsize="90%">log</mml:mi><mml:mo>⁡</mml:mo><mml:msub><mml:mi mathsize="90%">L</mml:mi><mml:mtext mathsize="90%">expected</mml:mtext></mml:msub></mml:mrow><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, equivalent to this expected log-likelihood:<disp-formula id="equ8"><label>(5)</label><mml:math id="m8"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mtext>expected</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:munder><mml:mi>E</mml:mi><mml:mo stretchy="false">[</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>L</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>∣</mml:mo><mml:mi>I</mml:mi><mml:mo>=</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">]</mml:mo><mml:mo>.</mml:mo></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>For a random sample of subjects, the weighted likelihood, <inline-formula><mml:math id="inf128"><mml:mrow><mml:msub><mml:mi mathsize="90%">L</mml:mi><mml:mtext mathsize="90%">expected</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, represents the likelihood of the model parameters, <inline-formula><mml:math id="inf129"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup></mml:math></inline-formula>, <inline-formula><mml:math id="inf130"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup></mml:math></inline-formula>, and <inline-formula><mml:math id="inf131"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup></mml:math></inline-formula>, given that we observed a set of trimming amounts for a given set of gene allele groups after weighting observations according to the sampling procedure <inline-formula><mml:math id="inf132"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>samp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula>. We can use whichever sampling procedure, <inline-formula><mml:math id="inf133"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>samp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula>, we want. For example, recall that we originally formed the empirical conditional PDFs in (<xref ref-type="disp-formula" rid="equ1">Equation 1</xref>) for each subject <inline-formula><mml:math id="inf134"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula> by uniformly sampling from each TCR repertoire to get a total repertoire size of <inline-formula><mml:math id="inf135"><mml:msub><mml:mi mathsize="90%">K</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub></mml:math></inline-formula>:<disp-formula id="equ9"><mml:math id="m9"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msup><mml:mi>C</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:msup><mml:mi>C</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mfrac><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula><disp-formula id="equ10"><mml:math id="m10"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo>∣</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msup><mml:mi>C</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msub><mml:mi>K</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mfrac><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula></p><p>and<disp-formula id="equ11"><mml:math id="m11"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mi>I</mml:mi></mml:mfrac><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p><p>With this, we can define a sampling procedure equivalent to this empirical joint PDF as follows:<disp-formula id="equ12"><label>(6)</label><mml:math id="m12"><mml:mrow><mml:mtable columnalign="left left" rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" scriptlevel="0"><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>samp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mstyle></mml:mtd><mml:mtd><mml:mo>:=</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mspace width="thinmathspace"/><mml:mo>=</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>σ</mml:mi><mml:mo>∣</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula></p><p>With this sampling procedure,<disp-formula id="equ13"><label>(7)</label><mml:math id="m13"><mml:mrow><mml:mtable columnalign="left left" rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mtext>expected</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mo>=</mml:mo><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>n</mml:mi></mml:mrow></mml:munder><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>σ</mml:mi><mml:mo>∣</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mo>⋅</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula></p><p>As such, each subject, instead of each observation, gets uniform treatment in the construction of the weighted likelihood.</p><p>While this procedure would correct for individual subjects having different repertoire sizes, it does not account for gene usage differences. To avoid having these differences pollute our <inline-formula><mml:math id="inf136"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf137"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, and <inline-formula><mml:math id="inf138"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> inference, we propose a subject-independent gene-allele-group sampling scheme. While we could use any distribution on <inline-formula><mml:math id="inf139"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula>, including a uniform weight by gene allele groups, we have chosen to define:<disp-formula id="equ14"><mml:math id="m14"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>marg</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mfrac><mml:mn>1</mml:mn><mml:mi>I</mml:mi></mml:mfrac><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:munder><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>σ</mml:mi><mml:mo>∣</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>We can reformulate the sampling procedure which is an empirical average per-gene-allele-group frequency such that:<disp-formula id="equ15"><label>(8)</label><mml:math id="m15"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>samp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>marg</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p><p>With this subject-independent gene sampling procedure, we can define a weighted likelihood <inline-formula><mml:math id="inf140"><mml:mrow><mml:msub><mml:mi mathsize="90%">L</mml:mi><mml:mi mathsize="90%">W</mml:mi></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> such that<disp-formula id="equ16"><label>(9)</label><mml:math id="m16"><mml:mrow><mml:mtable columnalign="left left" rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>W</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mo>:=</mml:mo><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>n</mml:mi></mml:mrow></mml:munder><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>marg</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>emp</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mo>⋅</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula></p><p>As such, each gene and each subject get uniform treatment in the construction of the weighted likelihood.</p><p>From here, we can maximize this weighted log-likelihood, <inline-formula><mml:math id="inf141"><mml:mrow><mml:mrow><mml:mi mathsize="90%">log</mml:mi><mml:mo>⁡</mml:mo><mml:msub><mml:mi mathsize="90%">L</mml:mi><mml:mi mathsize="90%">W</mml:mi></mml:msub></mml:mrow><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, to estimate the log-probabilities <inline-formula><mml:math id="inf142"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup></mml:math></inline-formula>, <inline-formula><mml:math id="inf143"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup></mml:math></inline-formula>, and <inline-formula><mml:math id="inf144"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup></mml:math></inline-formula>, where <inline-formula><mml:math id="inf145"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup></mml:math></inline-formula> is equivalent to a (log) position-weight-matrix. To estimate each coefficient, we can solve the weighted maximum likelihood estimation problem:<disp-formula id="equ17"><label>(10)</label><mml:math id="m17"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mtext>argmax</mml:mtext><mml:mrow><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:msub><mml:mtext> </mml:mtext><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>W</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>using the <monospace>mclogit</monospace> package in R. We can formulate a weighted maximum likelihood problem in a similar way for any model covariate function <inline-formula><mml:math id="inf146"><mml:mi mathsize="90%">f</mml:mi></mml:math></inline-formula> containing a unique combination of parameter-specific covariate functions (<xref ref-type="table" rid="table1">Table 1</xref>).</p><p>We compare our inferred coefficients to the existing PWM model which was designed and trained using least squares (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>). When replicating this model using our methods described above (i.e. the <italic>2×4 motif</italic> model), we note highly similar results (<xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref>).</p></sec><sec id="s4-8"><title>Evaluating model fit and generalizability across genes</title><p>In order to evaluate the model fit and generalizability of each model, we use a variety of training and testing data sets to train each model and calculate the log loss. We will describe our general model evaluation procedure here. We describe variations of this general model evaluation procedure in Appendix 3. Let <inline-formula><mml:math id="inf147"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">T</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> represent a training data set and <inline-formula><mml:math id="inf148"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> represent a held-out testing data set. With the training set <inline-formula><mml:math id="inf149"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">T</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, we can train each model of interest as described above in (<xref ref-type="disp-formula" rid="equ17">Equation 10</xref>). After this model fitting, we can calculate the expected per-sequence conditional log loss of the model with given coefficients, <inline-formula><mml:math id="inf150"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula>, for a given held-out testing set, <inline-formula><mml:math id="inf151"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, such that<disp-formula id="equ18"><label>(11)</label><mml:math id="m18"><mml:mrow><mml:mtable columnalign="left left" rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mi>ℓ</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi mathvariant="script">M</mml:mi></mml:mrow><mml:mo>∣</mml:mo><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="1em"/><mml:mo>:=</mml:mo><mml:mo>−</mml:mo><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>n</mml:mi></mml:mrow></mml:munder><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:msub><mml:mtext>emp</mml:mtext><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:mrow><mml:mi mathvariant="script">M</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="1em"/><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>n</mml:mi></mml:mrow></mml:munder><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:msub><mml:mtext>emp</mml:mtext><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:msub><mml:mtext>emp</mml:mtext><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>σ</mml:mi><mml:mo>∣</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:msub><mml:mtext>emp</mml:mtext><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mo>⋅</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>∣</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:mrow><mml:mi mathvariant="script">M</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula></p><p>where <inline-formula><mml:math id="inf152"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula> represents a subject, <inline-formula><mml:math id="inf153"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> represents a trimming length, and <inline-formula><mml:math id="inf154"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> represents a gene allele group. Because we are incorporating the empirically observed frequency of each subject, trimming length, and gene allele group within each ‘held-out testing set,’ <inline-formula><mml:math id="inf155"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:msub><mml:mtext>emp</mml:mtext><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>i</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula>, in this formulation, the expected per-sequence conditional log loss values are guaranteed to be directly comparable between held-out testing sets with varying compositions. Models that have lower expected per-sequence conditional log loss will indicate that the model has a better fit.</p></sec><sec id="s4-9"><title>Assessing significance of model coefficients</title><p>During model fitting, we estimated the model coefficients <inline-formula><mml:math id="inf156"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf157"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, and <inline-formula><mml:math id="inf158"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> by maximizing the weighted likelihood function given by (<xref ref-type="disp-formula" rid="equ16">Equation 9</xref>). To measure the significance of each of these model coefficients <inline-formula><mml:math id="inf159"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:mi>β</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>∈</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> we want to test whether each coefficient <inline-formula><mml:math id="inf160"><mml:mrow><mml:mover accent="true"><mml:mi mathsize="90%">β</mml:mi><mml:mo mathsize="90%" stretchy="false">^</mml:mo></mml:mover><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0</mml:mn></mml:mrow></mml:math></inline-formula>. To do this, we can first estimate the standard error of each inferred coefficient using a clustered bootstrap (with subject-gene pairs as the sampling unit). As such, for each bootstrap iterate, we sampled subject-gene pairs from the full V-gene training data set with replacement. Using this re-sampled data, we maximized the weighted likelihood function given by (<xref ref-type="disp-formula" rid="equ16">Equation 9</xref>) to re-estimate each coefficient. We repeated this bootstrap process 1000 times and used the resulting 1000 coefficient estimates to estimate a standard error for each model coefficient. With this estimated standard error of each inferred model coefficient <inline-formula><mml:math id="inf161"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:mi>β</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>∈</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula>, we test whether <inline-formula><mml:math id="inf162"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:mi>β</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> by calculating the test statistic<disp-formula id="equ19"><label>(12)</label><mml:math id="m19"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>T</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mover><mml:mi>β</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mover><mml:mi>β</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>se</mml:mi><mml:mo>⁡</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mover><mml:mi>β</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>and comparing <inline-formula><mml:math id="inf163"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>T</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mover><mml:mi>β</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> to a <inline-formula><mml:math id="inf164"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>N</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> distribution to obtain each p-value. We consider the significance of each model coefficient using a Bonferroni-corrected threshold. To establish the threshold, we corrected for the total number of model coefficients being evaluated in the given model.</p></sec><sec id="s4-10"><title>Evaluating model coefficient variation in the context of SNPs</title><p>With the <italic>motif</italic> and <italic>base-count-beyond</italic> model, we are interested in quantifying variation in model coefficients in the context of genetic variations within the gene encoding the Artemis protein that were previously identified as being associated with increasing the extent of trimming (<xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>). Recall that we trained this model using the model covariate function given by (<xref ref-type="disp-formula" rid="equ2">Equation 2</xref>). During model fitting, we estimated the model coefficients <inline-formula><mml:math id="inf165"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf166"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, and <inline-formula><mml:math id="inf167"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> by maximizing the weighted likelihood function given by (<xref ref-type="disp-formula" rid="equ16">Equation 9</xref>).</p><p>We have previously identified a set <inline-formula><mml:math id="inf168"><mml:mi mathsize="90%">X</mml:mi></mml:math></inline-formula> of SNPs within the gene encoding the Artemis protein that are significantly associated with increasing the extent of trimming (<xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>). For each SNP <inline-formula><mml:math id="inf169"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:mi>X</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula> and individual <inline-formula><mml:math id="inf170"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mo>…</mml:mo><mml:mo>,</mml:mo><mml:mi>I</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula>, we measure the number of minor alleles in the genotype, <inline-formula><mml:math id="inf171"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>g</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>∈</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mn>1</mml:mn><mml:mo>,</mml:mo><mml:mn>2</mml:mn><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula>. We are interested in whether each of the inferred model coefficients <inline-formula><mml:math id="inf172"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:mi>β</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>∈</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> vary in the context of genotype for each genetic variant <inline-formula><mml:math id="inf173"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:mi>X</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>. As such, for each SNP of interest, we can adapt the <italic>1×2 motif + two-side base-count beyond</italic> model covariate function to allow for genotype-specific variation of each model coefficient by incorporating additional interaction coefficients <inline-formula><mml:math id="inf174"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>∈</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:msubsup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> to model the relationship between each model parameter and the SNP <inline-formula><mml:math id="inf175"><mml:mi mathsize="90%">x</mml:mi></mml:math></inline-formula> genotype. We can then estimate the coefficients of this new model, <inline-formula><mml:math id="inf176"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf177"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf178"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf179"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msubsup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mi>x</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf180"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msubsup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mi>x</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, and <inline-formula><mml:math id="inf181"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msubsup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mi>x</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, as before by maximizing the weighted likelihood given by (<xref ref-type="disp-formula" rid="equ16">Equation 9</xref>) using the adapted model covariate function. We can measure the significance of each of the model coefficients using the methods described in the previous section. Ultimately if a SNP-coefficient interaction term <inline-formula><mml:math id="inf182"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mrow><mml:mover><mml:mi>β</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>x</mml:mi></mml:mrow></mml:msub><mml:mo>∈</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mrow><mml:mover><mml:msubsup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mi>x</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msubsup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mi>x</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msubsup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mi>x</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow></mml:mstyle></mml:math></inline-formula> is significant, we can conclude that the corresponding model coefficient <inline-formula><mml:math id="inf183"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:mi>β</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> varies significantly in the context of the genotype of SNP <inline-formula><mml:math id="inf184"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>x</mml:mi><mml:mo>∈</mml:mo><mml:mi>X</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>. We use this same procedure to evaluate whether each model coefficient varies in the context of each SNP of interest.</p></sec></sec></body><back><sec sec-type="additional-information" id="s5"><title>Additional information</title><fn-group content-type="competing-interest"><title>Competing interests</title><fn fn-type="COI-statement" id="conf1"><p>No competing interests declared</p></fn><fn fn-type="COI-statement" id="conf2"><p>No competing interests declared</p></fn></fn-group><fn-group content-type="author-contribution"><title>Author contributions</title><fn fn-type="con" id="con1"><p>Conceptualization, Software, Formal analysis, Validation, Investigation, Visualization, Methodology, Writing – original draft, Writing – review and editing</p></fn><fn fn-type="con" id="con2"><p>Methodology, Writing – review and editing</p></fn><fn fn-type="con" id="con3"><p>Conceptualization, Supervision, Funding acquisition, Investigation, Methodology, Writing – review and editing</p></fn><fn fn-type="con" id="con4"><p>Conceptualization, Supervision, Funding acquisition, Investigation, Methodology, Writing – review and editing</p></fn></fn-group></sec><sec sec-type="supplementary-material" id="s6"><title>Additional files</title><supplementary-material id="mdar"><label>MDAR checklist</label><media xlink:href="elife-85145-mdarchecklist1-v1.pdf" mimetype="application" mime-subtype="pdf"/></supplementary-material></sec><sec sec-type="data-availability" id="s7"><title>Data availability</title><p>The current manuscript is a computational study, so no data have been generated for this manuscript. Code is available on <ext-link ext-link-type="uri" xlink:href="https://github.com/magdalenarussell/mechanistic-trimming">GitHub</ext-link> (copy archived at <xref ref-type="bibr" rid="bib42">Russell et al., 2022a</xref>). Numerical data used to generate figures is available as source data for Figures 3, 4, 5, 6, and 7.</p><p>The following previously published datasets were used:</p><p><element-citation publication-type="data" specific-use="references" id="dataset1"><person-group person-group-type="author"><name><surname>Emerson</surname><given-names>RO</given-names></name><name><surname>DeWitt</surname><given-names>WS</given-names></name><name><surname>Vignali</surname><given-names>M</given-names></name><name><surname>Gravley</surname><given-names>J</given-names></name><name><surname>Osborne</surname><given-names>EJ</given-names></name><name><surname>Desmarais</surname><given-names>C</given-names></name><name><surname>Klinger</surname><given-names>M</given-names></name><name><surname>Carlson</surname><given-names>CS</given-names></name><name><surname>Hansen</surname><given-names>JA</given-names></name><name><surname>Rieder</surname><given-names>M</given-names></name><name><surname>Robins</surname><given-names>HS</given-names></name><name><surname>Hu</surname><given-names>JK</given-names></name></person-group><year iso-8601-date="2017">2017</year><data-title>Immunosequencing identifies signatures of cytomegalovirus exposure history and HLA mediated effects on the T cell repertoire</data-title><source>ImmuneACCESS</source><pub-id pub-id-type="doi">10.21417/B7001Z</pub-id></element-citation></p><p><element-citation publication-type="data" specific-use="references" id="dataset2"><person-group person-group-type="author"><name><surname>Russell</surname><given-names>ML</given-names></name><name><surname>Souquette</surname><given-names>A</given-names></name><name><surname>Levine</surname><given-names>DM</given-names></name><name><surname>Allen</surname><given-names>EK</given-names></name><name><surname>Kuan</surname><given-names>G</given-names></name><name><surname>Simon</surname><given-names>N</given-names></name><name><surname>Balmaseda</surname><given-names>A</given-names></name><name><surname>Gordon</surname><given-names>A</given-names></name><name><surname>Thomas</surname><given-names>PG</given-names></name><name><surname>Matsen</surname><given-names>FA</given-names></name><name><surname>Bradley</surname><given-names>P</given-names></name></person-group><year iso-8601-date="2022">2022</year><data-title>Combining genotypes and T cell receptor distributions to infer genetic loci determining V(D)J recombination probabilities</data-title><source>NCBI BioProject</source><pub-id pub-id-type="accession" xlink:href="https://www.ncbi.nlm.nih.gov/bioproject/PRJNA762269">PRJNA762269</pub-id></element-citation></p><p><element-citation publication-type="data" specific-use="references" id="dataset3"><person-group person-group-type="author"><name><surname>Robins</surname><given-names>H</given-names></name><name><surname>Pearson</surname><given-names>O</given-names></name></person-group><year iso-8601-date="2015">2015</year><data-title>Normal Human PBMC Deep Sequencing TCRB versus TCRG comparison</data-title><source>ImmuneACCESS</source><pub-id pub-id-type="accession" xlink:href="https://clients.adaptivebiotech.com/pub/TCRB-TCRG-comparison">TCRB-TCRG-comparison</pub-id></element-citation></p><p><element-citation publication-type="data" specific-use="references" id="dataset4"><person-group person-group-type="author"><name><surname>Briney</surname><given-names>B</given-names></name><name><surname>Inderbitzin</surname><given-names>A</given-names></name><name><surname>Joyce</surname><given-names>C</given-names></name><name><surname>Burton</surname><given-names>DR</given-names></name></person-group><year iso-8601-date="2019">2019</year><data-title>Commonality despite exceptional diversity in the baseline human antibody repertoire</data-title><source>NCBI BioProject</source><pub-id pub-id-type="accession" xlink:href="https://www.ncbi.nlm.nih.gov/bioproject/PRJNA406949">PRJNA406949</pub-id></element-citation></p><p><element-citation publication-type="data" specific-use="references" id="dataset5"><person-group person-group-type="author"><name><surname>Jaffe</surname><given-names>DB</given-names></name><name><surname>Shahi</surname><given-names>P</given-names></name><name><surname>Adams</surname><given-names>BA</given-names></name><name><surname>Chrisman</surname><given-names>AM</given-names></name><name><surname>Finnegan</surname><given-names>PM</given-names></name><name><surname>Raman</surname><given-names>N</given-names></name><name><surname>Royall</surname><given-names>AE</given-names></name><name><surname>Tsai</surname><given-names>F</given-names></name><name><surname>Vollbrecht</surname><given-names>T</given-names></name><name><surname>Reyes</surname><given-names>DS</given-names></name><name><surname>McDonnell</surname><given-names>WJ</given-names></name></person-group><year iso-8601-date="2022">2022</year><data-title>Functional antibodies exhibit light chain coherence</data-title><source>Figshare</source><pub-id pub-id-type="doi">10.25452/figshare.plus.20338177</pub-id></element-citation></p><p><element-citation publication-type="data" specific-use="references" id="dataset6"><person-group person-group-type="author"><name><surname>Martin</surname><given-names>PJ</given-names></name><name><surname>Levine</surname><given-names>DM</given-names></name><name><surname>Storer</surname><given-names>BE</given-names></name><name><surname>Nelson</surname><given-names>SC</given-names></name><name><surname>Dong</surname><given-names>X</given-names></name><name><surname>Hansen</surname><given-names>JA</given-names></name></person-group><year iso-8601-date="2020">2020</year><data-title>Recipient and donor genetic variants associated with mortality after allogeneic hematopoietic cell transplantation</data-title><source>NCBI dbGaP</source><pub-id pub-id-type="accession" xlink:href="https://www.ncbi.nlm.nih.gov/projects/gap/cgi-bin/study.cgi?study_id=phs001918.v1.p1">phs001918</pub-id></element-citation></p></sec><ack id="ack"><title>Acknowledgements</title><p>The authors thank David Schatz and Thayer Fisher for helpful discussions regarding this paper, as well as Duncan Ralph for processing the productive IGH sequence data from <xref ref-type="bibr" rid="bib22">Jaffe et al., 2022</xref>, and Nathaniel Spisak, Thierry Mora, and Aleksandra Walczak for sharing preprocessed data from <xref ref-type="bibr" rid="bib48">Spisak et al., 2020</xref>. The authors would also like to thank Fred Hutch scientific computing, supported by the National Institutes of Health award S10OD028685. This work was supported by the National Institutes of Health under awards R01 AI146028, R01 AI136514, and R35 GM141457. Dr. Matsen is an Investigator of the Howard Hughes Medical Institute (HHMI). This article is subject to HHMI’s Open Access to Publications policy. HHMI lab heads have previously granted a nonexclusive CC BY 4.0 license to the public and a sublicensable license to HHMI in their research articles. Pursuant to those licenses, the author-accepted manuscript of this article can be made freely available under a CC BY 4.0 license immediately upon publication.</p></ack><ref-list><title>References</title><ref id="bib1"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Briney</surname><given-names>B</given-names></name><name><surname>Inderbitzin</surname><given-names>A</given-names></name><name><surname>Joyce</surname><given-names>C</given-names></name><name><surname>Burton</surname><given-names>DR</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Commonality despite exceptional diversity in the baseline human antibody repertoire</article-title><source>Nature</source><volume>566</volume><fpage>393</fpage><lpage>397</lpage><pub-id pub-id-type="doi">10.1038/s41586-019-0879-y</pub-id><pub-id pub-id-type="pmid">30664748</pub-id></element-citation></ref><ref id="bib2"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Chang</surname><given-names>HHY</given-names></name><name><surname>Watanabe</surname><given-names>G</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Unifying the DNA end-processing roles of the ARTEMIS nuclease</article-title><source>Journal of Biological Chemistry</source><volume>290</volume><fpage>24036</fpage><lpage>24050</lpage><pub-id pub-id-type="doi">10.1074/jbc.M115.680900</pub-id></element-citation></ref><ref id="bib3"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Chang</surname><given-names>HHY</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Structure-Specific nuclease activities of ARTEMIS and the ARTEMIS: DNA-PKcs complex</article-title><source>Nucleic Acids Research</source><volume>44</volume><fpage>4991</fpage><lpage>4997</lpage><pub-id pub-id-type="doi">10.1093/nar/gkw456</pub-id><pub-id pub-id-type="pmid">27198222</pub-id></element-citation></ref><ref id="bib4"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Chang</surname><given-names>HHY</given-names></name><name><surname>Watanabe</surname><given-names>G</given-names></name><name><surname>Gerodimos</surname><given-names>CA</given-names></name><name><surname>Ochi</surname><given-names>T</given-names></name><name><surname>Blundell</surname><given-names>TL</given-names></name><name><surname>Jackson</surname><given-names>SP</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Different DNA end configurations dictate which NHEJ components are most important for joining efficiency</article-title><source>The Journal of Biological Chemistry</source><volume>291</volume><fpage>24377</fpage><lpage>24389</lpage><pub-id pub-id-type="doi">10.1074/jbc.M116.752329</pub-id><pub-id pub-id-type="pmid">27703001</pub-id></element-citation></ref><ref id="bib5"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Chiu</surname><given-names>TP</given-names></name><name><surname>Comoglio</surname><given-names>F</given-names></name><name><surname>Zhou</surname><given-names>T</given-names></name><name><surname>Yang</surname><given-names>L</given-names></name><name><surname>Paro</surname><given-names>R</given-names></name><name><surname>Rohs</surname><given-names>R</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>DNAshapeR: an R/bioconductor package for DNA shape prediction and feature encoding</article-title><source>Bioinformatics</source><volume>32</volume><fpage>1211</fpage><lpage>1213</lpage><pub-id pub-id-type="doi">10.1093/bioinformatics/btv735</pub-id><pub-id pub-id-type="pmid">26668005</pub-id></element-citation></ref><ref id="bib6"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Cohen</surname><given-names>RM</given-names></name><name><surname>Kleinstein</surname><given-names>SH</given-names></name><name><surname>Louzoun</surname><given-names>Y</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Somatic hypermutation targeting is influenced by location within the immunoglobulin V region</article-title><source>Molecular Immunology</source><volume>48</volume><fpage>1477</fpage><lpage>1483</lpage><pub-id pub-id-type="doi">10.1016/j.molimm.2011.04.002</pub-id><pub-id pub-id-type="pmid">21592579</pub-id></element-citation></ref><ref id="bib7"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Cui</surname><given-names>A</given-names></name><name><surname>Di Niro</surname><given-names>R</given-names></name><name><surname>Vander Heiden</surname><given-names>JA</given-names></name><name><surname>Briggs</surname><given-names>AW</given-names></name><name><surname>Adams</surname><given-names>K</given-names></name><name><surname>Gilbert</surname><given-names>T</given-names></name><name><surname>O’Connor</surname><given-names>KC</given-names></name><name><surname>Vigneault</surname><given-names>F</given-names></name><name><surname>Shlomchik</surname><given-names>MJ</given-names></name><name><surname>Kleinstein</surname><given-names>SH</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>A model of somatic hypermutation targeting in mice based on high-throughput Ig sequencing data</article-title><source>Journal of Immunology</source><volume>197</volume><fpage>3566</fpage><lpage>3574</lpage><pub-id pub-id-type="doi">10.4049/jimmunol.1502263</pub-id><pub-id pub-id-type="pmid">27707999</pub-id></element-citation></ref><ref id="bib8"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Dash</surname><given-names>P</given-names></name><name><surname>Fiore-Gartland</surname><given-names>AJ</given-names></name><name><surname>Hertz</surname><given-names>T</given-names></name><name><surname>Wang</surname><given-names>GC</given-names></name><name><surname>Sharma</surname><given-names>S</given-names></name><name><surname>Souquette</surname><given-names>A</given-names></name><name><surname>Crawford</surname><given-names>JC</given-names></name><name><surname>Clemens</surname><given-names>EB</given-names></name><name><surname>Nguyen</surname><given-names>THO</given-names></name><name><surname>Kedzierska</surname><given-names>K</given-names></name><name><surname>La Gruta</surname><given-names>NL</given-names></name><name><surname>Bradley</surname><given-names>P</given-names></name><name><surname>Thomas</surname><given-names>PG</given-names></name></person-group><year iso-8601-date="2017">2017</year><article-title>Quantifiable predictive features define epitope-specific T cell receptor repertoires</article-title><source>Nature</source><volume>547</volume><fpage>89</fpage><lpage>93</lpage><pub-id pub-id-type="doi">10.1038/nature22383</pub-id><pub-id pub-id-type="pmid">28636592</pub-id></element-citation></ref><ref id="bib9"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Dominski</surname><given-names>Z</given-names></name></person-group><year iso-8601-date="2007">2007</year><article-title>Nucleases of the metallo-beta-lactamase family and their role in DNA and RNA metabolism</article-title><source>Critical Reviews in Biochemistry and Molecular Biology</source><volume>42</volume><fpage>67</fpage><lpage>93</lpage><pub-id pub-id-type="doi">10.1080/10409230701279118</pub-id><pub-id pub-id-type="pmid">17453916</pub-id></element-citation></ref><ref id="bib10"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Dunn-Walters</surname><given-names>DK</given-names></name><name><surname>Dogan</surname><given-names>A</given-names></name><name><surname>Boursier</surname><given-names>L</given-names></name><name><surname>MacDonald</surname><given-names>CM</given-names></name><name><surname>Spencer</surname><given-names>J</given-names></name></person-group><year iso-8601-date="1998">1998</year><article-title>Base-Specific sequences that bias somatic hypermutation deduced by analysis of out-of-frame human igvh genes</article-title><source>Journal of Immunology</source><volume>160</volume><fpage>2360</fpage><lpage>2364</lpage><pub-id pub-id-type="pmid">9498777</pub-id></element-citation></ref><ref id="bib11"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Elhanati</surname><given-names>Y</given-names></name><name><surname>Sethna</surname><given-names>Z</given-names></name><name><surname>Marcou</surname><given-names>Q</given-names></name><name><surname>Callan</surname><given-names>CG</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><year iso-8601-date="2015">2015</year><article-title>Inferring processes underlying B-cell repertoire diversity</article-title><source>Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences</source><volume>370</volume><elocation-id>20140243</elocation-id><pub-id pub-id-type="doi">10.1098/rstb.2014.0243</pub-id><pub-id pub-id-type="pmid">26194757</pub-id></element-citation></ref><ref id="bib12"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Emerson</surname><given-names>RO</given-names></name><name><surname>DeWitt</surname><given-names>WS</given-names></name><name><surname>Vignali</surname><given-names>M</given-names></name><name><surname>Gravley</surname><given-names>J</given-names></name><name><surname>Hu</surname><given-names>JK</given-names></name><name><surname>Osborne</surname><given-names>EJ</given-names></name><name><surname>Desmarais</surname><given-names>C</given-names></name><name><surname>Klinger</surname><given-names>M</given-names></name><name><surname>Carlson</surname><given-names>CS</given-names></name><name><surname>Hansen</surname><given-names>JA</given-names></name><name><surname>Rieder</surname><given-names>M</given-names></name><name><surname>Robins</surname><given-names>HS</given-names></name></person-group><year iso-8601-date="2017">2017</year><article-title>Immunosequencing identifies signatures of cytomegalovirus exposure history and HLA-mediated effects on the T cell repertoire</article-title><source>Nature Genetics</source><volume>49</volume><fpage>659</fpage><lpage>665</lpage><pub-id pub-id-type="doi">10.1038/ng.3822</pub-id><pub-id pub-id-type="pmid">28369038</pub-id></element-citation></ref><ref id="bib13"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Feeney</surname><given-names>AJ</given-names></name><name><surname>Victor</surname><given-names>KD</given-names></name><name><surname>Vu</surname><given-names>K</given-names></name><name><surname>Nadel</surname><given-names>B</given-names></name><name><surname>Chukwuocha</surname><given-names>RU</given-names></name></person-group><year iso-8601-date="1994">1994</year><article-title>Influence of the V (D) J recombination mechanism on the formation of the primary T and B cell repertoires</article-title><source>Seminars in Immunology</source><volume>6</volume><fpage>155</fpage><lpage>163</lpage><pub-id pub-id-type="doi">10.1006/smim.1994.1021</pub-id><pub-id pub-id-type="pmid">7948955</pub-id></element-citation></ref><ref id="bib14"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Feng</surname><given-names>J</given-names></name><name><surname>Shaw</surname><given-names>DA</given-names></name><name><surname>Minin</surname><given-names>VN</given-names></name><name><surname>Simon</surname><given-names>N</given-names></name><name><surname>Matsen</surname><given-names>FA</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Survival analysis of DNA mutation motifs with penalized proportional hazards</article-title><source>The Annals of Applied Statistics</source><volume>13</volume><fpage>1268</fpage><lpage>1294</lpage><pub-id pub-id-type="doi">10.1214/18-aoas1233</pub-id><pub-id pub-id-type="pmid">33214798</pub-id></element-citation></ref><ref id="bib15"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Fugmann</surname><given-names>SD</given-names></name><name><surname>Lee</surname><given-names>AI</given-names></name><name><surname>Shockett</surname><given-names>PE</given-names></name><name><surname>Villey</surname><given-names>IJ</given-names></name><name><surname>Schatz</surname><given-names>DG</given-names></name></person-group><year iso-8601-date="2000">2000</year><article-title>The RAG proteins and V (D) J recombination: complexes, ends, and transposition</article-title><source>Annual Review of Immunology</source><volume>18</volume><fpage>495</fpage><lpage>527</lpage><pub-id pub-id-type="doi">10.1146/annurev.immunol.18.1.495</pub-id><pub-id pub-id-type="pmid">10837067</pub-id></element-citation></ref><ref id="bib16"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gauss</surname><given-names>GH</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="1996">1996</year><article-title>Mechanistic constraints on diversity in human V (D) J recombination</article-title><source>Molecular and Cellular Biology</source><volume>16</volume><fpage>258</fpage><lpage>269</lpage><pub-id pub-id-type="doi">10.1128/MCB.16.1.258</pub-id><pub-id pub-id-type="pmid">8524303</pub-id></element-citation></ref><ref id="bib17"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gellert</surname><given-names>M</given-names></name></person-group><year iso-8601-date="1994">1994</year><article-title>Dna double-strand breaks and hairpins in V (D) J recombination</article-title><source>Seminars in Immunology</source><volume>6</volume><fpage>125</fpage><lpage>130</lpage><pub-id pub-id-type="doi">10.1006/smim.1994.1018</pub-id><pub-id pub-id-type="pmid">7948952</pub-id></element-citation></ref><ref id="bib18"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gerodimos</surname><given-names>CA</given-names></name><name><surname>Chang</surname><given-names>HHY</given-names></name><name><surname>Watanabe</surname><given-names>G</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2017">2017</year><article-title>Effects of DNA end configuration on XRCC4-DNA ligase IV and its stimulation of Artemis activity</article-title><source>The Journal of Biological Chemistry</source><volume>292</volume><fpage>13914</fpage><lpage>13924</lpage><pub-id pub-id-type="doi">10.1074/jbc.M117.798850</pub-id><pub-id pub-id-type="pmid">28696258</pub-id></element-citation></ref><ref id="bib19"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gilfillan</surname><given-names>S</given-names></name><name><surname>Dierich</surname><given-names>A</given-names></name><name><surname>Lemeur</surname><given-names>M</given-names></name><name><surname>Benoist</surname><given-names>C</given-names></name><name><surname>Mathis</surname><given-names>D</given-names></name></person-group><year iso-8601-date="1993">1993</year><article-title>Mice lacking TdT: mature animals with an immature lymphocyte repertoire</article-title><source>Science</source><volume>261</volume><fpage>1175</fpage><lpage>1178</lpage><pub-id pub-id-type="doi">10.1126/science.8356452</pub-id><pub-id pub-id-type="pmid">8356452</pub-id></element-citation></ref><ref id="bib20"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gu</surname><given-names>J</given-names></name><name><surname>Li</surname><given-names>S</given-names></name><name><surname>Zhang</surname><given-names>X</given-names></name><name><surname>Wang</surname><given-names>LC</given-names></name><name><surname>Niewolik</surname><given-names>D</given-names></name><name><surname>Schwarz</surname><given-names>K</given-names></name><name><surname>Legerski</surname><given-names>RJ</given-names></name><name><surname>Zandi</surname><given-names>E</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2010">2010</year><article-title>Dna-Pkcs regulates a single-stranded DNA endonuclease activity of ARTEMIS</article-title><source>DNA Repair</source><volume>9</volume><fpage>429</fpage><lpage>437</lpage><pub-id pub-id-type="doi">10.1016/j.dnarep.2010.01.001</pub-id><pub-id pub-id-type="pmid">20117966</pub-id></element-citation></ref><ref id="bib21"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Jackson</surname><given-names>KJL</given-names></name><name><surname>Gaeta</surname><given-names>B</given-names></name><name><surname>Sewell</surname><given-names>W</given-names></name><name><surname>Collins</surname><given-names>AM</given-names></name></person-group><year iso-8601-date="2004">2004</year><article-title>Exonuclease activity and P nucleotide addition in the generation of the expressed immunoglobulin repertoire</article-title><source>BMC Immunology</source><volume>5</volume><elocation-id>19</elocation-id><pub-id pub-id-type="doi">10.1186/1471-2172-5-19</pub-id><pub-id pub-id-type="pmid">15345030</pub-id></element-citation></ref><ref id="bib22"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Jaffe</surname><given-names>DB</given-names></name><name><surname>Shahi</surname><given-names>P</given-names></name><name><surname>Adams</surname><given-names>BA</given-names></name><name><surname>Chrisman</surname><given-names>AM</given-names></name><name><surname>Finnegan</surname><given-names>PM</given-names></name><name><surname>Raman</surname><given-names>N</given-names></name><name><surname>Royall</surname><given-names>AE</given-names></name><name><surname>Tsai</surname><given-names>F</given-names></name><name><surname>Vollbrecht</surname><given-names>T</given-names></name><name><surname>Reyes</surname><given-names>DS</given-names></name><name><surname>Hepler</surname><given-names>NL</given-names></name><name><surname>McDonnell</surname><given-names>WJ</given-names></name></person-group><year iso-8601-date="2022">2022</year><article-title>Functional antibodies exhibit light chain coherence</article-title><source>Nature</source><volume>611</volume><fpage>352</fpage><lpage>357</lpage><pub-id pub-id-type="doi">10.1038/s41586-022-05371-z</pub-id><pub-id pub-id-type="pmid">36289331</pub-id></element-citation></ref><ref id="bib23"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Jose</surname><given-names>D</given-names></name><name><surname>Datta</surname><given-names>K</given-names></name><name><surname>Johnson</surname><given-names>NP</given-names></name><name><surname>von Hippel</surname><given-names>PH</given-names></name></person-group><year iso-8601-date="2009">2009</year><article-title>Spectroscopic studies of position-specific DNA `` breathing'' fluctuations at replication forks and primer-template junctions</article-title><source>PNAS</source><volume>106</volume><fpage>4231</fpage><lpage>4236</lpage><pub-id pub-id-type="doi">10.1073/pnas.0900803106</pub-id></element-citation></ref><ref id="bib24"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kallenbach</surname><given-names>S</given-names></name><name><surname>Doyen</surname><given-names>N</given-names></name><name><surname>Fanton d’Andon</surname><given-names>M</given-names></name><name><surname>Rougeon</surname><given-names>F</given-names></name></person-group><year iso-8601-date="1992">1992</year><article-title>Three lymphoid-specific factors account for all junctional diversity characteristic of somatic assembly of T-cell receptor and immunoglobulin genes</article-title><source>PNAS</source><volume>89</volume><fpage>2799</fpage><lpage>2803</lpage><pub-id pub-id-type="doi">10.1073/pnas.89.7.2799</pub-id></element-citation></ref><ref id="bib25"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Komori</surname><given-names>T</given-names></name><name><surname>Okada</surname><given-names>A</given-names></name><name><surname>Stewart</surname><given-names>V</given-names></name><name><surname>Alt</surname><given-names>FW</given-names></name></person-group><year iso-8601-date="1993">1993</year><article-title>Lack of N regions in antigen receptor variable region genes of tdt-deficient lymphocytes</article-title><source>Science</source><volume>261</volume><fpage>1171</fpage><lpage>1175</lpage><pub-id pub-id-type="doi">10.1126/science.8356451</pub-id><pub-id pub-id-type="pmid">8356451</pub-id></element-citation></ref><ref id="bib26"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Li</surname><given-names>S</given-names></name><name><surname>Chang</surname><given-names>HH</given-names></name><name><surname>Niewolik</surname><given-names>D</given-names></name><name><surname>Hedrick</surname><given-names>MP</given-names></name><name><surname>Pinkerton</surname><given-names>AB</given-names></name><name><surname>Hassig</surname><given-names>CA</given-names></name><name><surname>Schwarz</surname><given-names>K</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Evidence that the DNA endonuclease ARTEMIS also has intrinsic 5′-exonuclease activity</article-title><source>Journal of Biological Chemistry</source><volume>289</volume><fpage>7825</fpage><lpage>7834</lpage><pub-id pub-id-type="doi">10.1074/jbc.M113.544874</pub-id></element-citation></ref><ref id="bib27"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Lu</surname><given-names>H</given-names></name><name><surname>Schwarz</surname><given-names>K</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2007">2007</year><article-title>Extent to which hairpin opening by the ARTEMIS: DNA-PKcs complex can contribute to junctional diversity in V (D) J recombination</article-title><source>Nucleic Acids Research</source><volume>35</volume><fpage>6917</fpage><lpage>6923</lpage><pub-id pub-id-type="doi">10.1093/nar/gkm823</pub-id></element-citation></ref><ref id="bib28"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Lu</surname><given-names>H</given-names></name><name><surname>Shimazaki</surname><given-names>N</given-names></name><name><surname>Raval</surname><given-names>P</given-names></name><name><surname>Gu</surname><given-names>J</given-names></name><name><surname>Watanabe</surname><given-names>G</given-names></name><name><surname>Schwarz</surname><given-names>K</given-names></name><name><surname>Swanson</surname><given-names>PC</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>A biochemically defined system for coding joint formation in V (D) J recombination</article-title><source>Molecular Cell</source><volume>31</volume><fpage>485</fpage><lpage>497</lpage><pub-id pub-id-type="doi">10.1016/j.molcel.2008.05.029</pub-id></element-citation></ref><ref id="bib29"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ma</surname><given-names>Y</given-names></name><name><surname>Pannicke</surname><given-names>U</given-names></name><name><surname>Schwarz</surname><given-names>K</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2002">2002</year><article-title>Hairpin opening and overhang processing by an artemis/DNA-dependent protein kinase complex in nonhomologous end joining and V (D) J recombination</article-title><source>Cell</source><volume>108</volume><fpage>781</fpage><lpage>794</lpage><pub-id pub-id-type="doi">10.1016/S0092-8674(02)00671-2</pub-id></element-citation></ref><ref id="bib30"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ma</surname><given-names>Y</given-names></name><name><surname>Schwarz</surname><given-names>K</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2005">2005</year><article-title>The ARTEMIS: DNA-PKcs endonuclease cleaves DNA loops, flaps, and gaps</article-title><source>DNA Repair</source><volume>4</volume><fpage>845</fpage><lpage>851</lpage><pub-id pub-id-type="doi">10.1016/j.dnarep.2005.04.013</pub-id></element-citation></ref><ref id="bib31"><element-citation publication-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><year iso-8601-date="2018">2018</year><article-title>High-Throughput immune repertoire analysis with igor</article-title><source>Nature Communications</source><volume>9</volume><elocation-id>561</elocation-id><pub-id pub-id-type="doi">10.1038/s41467-018-02832-w</pub-id><pub-id pub-id-type="pmid">29422654</pub-id></element-citation></ref><ref id="bib32"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Martin</surname><given-names>PJ</given-names></name><name><surname>Levine</surname><given-names>DM</given-names></name><name><surname>Storer</surname><given-names>BE</given-names></name><name><surname>Nelson</surname><given-names>SC</given-names></name><name><surname>Dong</surname><given-names>X</given-names></name><name><surname>Hansen</surname><given-names>JA</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Recipient and donor genetic variants associated with mortality after allogeneic hematopoietic cell transplantation</article-title><source>Blood Advances</source><volume>4</volume><fpage>3224</fpage><lpage>3233</lpage><pub-id pub-id-type="doi">10.1182/bloodadvances.2020001927</pub-id></element-citation></ref><ref id="bib33"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Moshous</surname><given-names>D</given-names></name><name><surname>Callebaut</surname><given-names>I</given-names></name><name><surname>de Chasseval</surname><given-names>R</given-names></name><name><surname>Corneo</surname><given-names>B</given-names></name><name><surname>Cavazzana-Calvo</surname><given-names>M</given-names></name><name><surname>Le Deist</surname><given-names>F</given-names></name><name><surname>Tezcan</surname><given-names>I</given-names></name><name><surname>Sanal</surname><given-names>O</given-names></name><name><surname>Bertrand</surname><given-names>Y</given-names></name><name><surname>Philippe</surname><given-names>N</given-names></name><name><surname>Fischer</surname><given-names>A</given-names></name><name><surname>de Villartay</surname><given-names>JP</given-names></name></person-group><year iso-8601-date="2001">2001</year><article-title>Artemis, a novel DNA double-strand break repair/V (D) J recombination protein, is mutated in human severe combined immune deficiency</article-title><source>Cell</source><volume>105</volume><fpage>177</fpage><lpage>186</lpage><pub-id pub-id-type="doi">10.1016/s0092-8674(01)00309-9</pub-id><pub-id pub-id-type="pmid">11336668</pub-id></element-citation></ref><ref id="bib34"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Murugan</surname><given-names>A</given-names></name><name><surname>Mora</surname><given-names>T</given-names></name><name><surname>Walczak</surname><given-names>AM</given-names></name><name><surname>Callan</surname><given-names>CG</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Statistical inference of the generation probability of T-cell receptors from sequence repertoires</article-title><source>PNAS</source><volume>109</volume><fpage>16161</fpage><lpage>16166</lpage><pub-id pub-id-type="doi">10.1073/pnas.1212755109</pub-id><pub-id pub-id-type="pmid">22988065</pub-id></element-citation></ref><ref id="bib35"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Nadel</surname><given-names>B</given-names></name><name><surname>Feeney</surname><given-names>AJ</given-names></name></person-group><year iso-8601-date="1995">1995</year><article-title>Influence of coding-end sequence on coding-end processing in V (D) J recombination</article-title><source>Journal of Immunology</source><volume>155</volume><fpage>4322</fpage><lpage>4329</lpage><pub-id pub-id-type="pmid">7594591</pub-id></element-citation></ref><ref id="bib36"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Nadel</surname><given-names>B</given-names></name><name><surname>Feeney</surname><given-names>AJ</given-names></name></person-group><year iso-8601-date="1997">1997</year><article-title>Nucleotide deletion and P addition in V (D) J recombination: a determinant role of the coding-end sequence</article-title><source>Molecular and Cellular Biology</source><volume>17</volume><fpage>3768</fpage><lpage>3778</lpage><pub-id pub-id-type="doi">10.1128/MCB.17.7.3768</pub-id><pub-id pub-id-type="pmid">9199310</pub-id></element-citation></ref><ref id="bib37"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Pettinati</surname><given-names>I</given-names></name><name><surname>Brem</surname><given-names>J</given-names></name><name><surname>Lee</surname><given-names>SY</given-names></name><name><surname>McHugh</surname><given-names>PJ</given-names></name><name><surname>Schofield</surname><given-names>CJ</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>The chemical biology of human metallo-β-lactamase fold proteins</article-title><source>Trends in Biochemical Sciences</source><volume>41</volume><fpage>338</fpage><lpage>355</lpage><pub-id pub-id-type="doi">10.1016/j.tibs.2015.12.007</pub-id><pub-id pub-id-type="pmid">26805042</pub-id></element-citation></ref><ref id="bib38"><element-citation publication-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></name></person-group><year iso-8601-date="2016">2016</year><article-title>Consistency of VDJ rearrangement and substitution parameters enables accurate B cell receptor sequence annotation</article-title><source>PLOS Computational Biology</source><volume>12</volume><elocation-id>e1004409</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pcbi.1004409</pub-id><pub-id pub-id-type="pmid">26751373</pub-id></element-citation></ref><ref id="bib39"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Robins</surname><given-names>HS</given-names></name><name><surname>Srivastava</surname><given-names>SK</given-names></name><name><surname>Campregher</surname><given-names>PV</given-names></name><name><surname>Turtle</surname><given-names>CJ</given-names></name><name><surname>Andriesen</surname><given-names>J</given-names></name><name><surname>Riddell</surname><given-names>SR</given-names></name><name><surname>Carlson</surname><given-names>CS</given-names></name><name><surname>Warren</surname><given-names>EH</given-names></name></person-group><year iso-8601-date="2010">2010</year><article-title>Overlap and effective size of the human CD8+ T cell receptor repertoire</article-title><source>Science Translational Medicine</source><volume>2</volume><elocation-id>47</elocation-id><pub-id pub-id-type="doi">10.1126/scitranslmed.3001442</pub-id><pub-id pub-id-type="pmid">20811043</pub-id></element-citation></ref><ref id="bib40"><element-citation publication-type="web"><person-group person-group-type="author"><name><surname>Robins</surname><given-names>H</given-names></name><name><surname>Pearson</surname><given-names>O</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Normal human PBMC, deep sequencing, TCRB vs TCRG comparison</article-title><ext-link ext-link-type="uri" xlink:href="https://clients.adaptivebiotech.com/pub/TCRB-TCRG-comparison">https://clients.adaptivebiotech.com/pub/TCRB-TCRG-comparison</ext-link><date-in-citation iso-8601-date="2022-10-25">October 25, 2022</date-in-citation></element-citation></ref><ref id="bib41"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Rogozin</surname><given-names>IB</given-names></name><name><surname>Kolchanov</surname><given-names>NA</given-names></name></person-group><year iso-8601-date="1992">1992</year><article-title>Somatic hypermutagenesis in immunoglobulin genes. II. Influence of neighbouring base sequences on mutagenesis</article-title><source>Biochimica et Biophysica Acta</source><volume>1171</volume><fpage>11</fpage><lpage>18</lpage><pub-id pub-id-type="doi">10.1016/0167-4781(92)90134-l</pub-id><pub-id pub-id-type="pmid">1420357</pub-id></element-citation></ref><ref id="bib42"><element-citation publication-type="software"><person-group person-group-type="author"><name><surname>Russell</surname><given-names>ML</given-names></name><name><surname>Simon</surname><given-names>N</given-names></name><name><surname>Bradley</surname><given-names>P</given-names></name><name><surname>Matsen</surname><given-names>FA</given-names></name></person-group><year iso-8601-date="2022">2022a</year><data-title>Mechanistic-trimming</data-title><version designator="swh:1:rev:2ba723b3bd4a354fe78f677230b8a6dfb506422d">swh:1:rev:2ba723b3bd4a354fe78f677230b8a6dfb506422d</version><source>Software Heritage</source><ext-link ext-link-type="uri" xlink:href="https://archive.softwareheritage.org/swh:1:dir:85c0bff261bbd6cb74debec11141d2f4195907f1;origin=https://github.com/magdalenarussell/mechanistic-trimming;visit=swh:1:snp:d9194a4fb82240b9842906aed109cca46c80ae4f;anchor=swh:1:rev:2ba723b3bd4a354fe78f677230b8a6dfb506422d">https://archive.softwareheritage.org/swh:1:dir:85c0bff261bbd6cb74debec11141d2f4195907f1;origin=https://github.com/magdalenarussell/mechanistic-trimming;visit=swh:1:snp:d9194a4fb82240b9842906aed109cca46c80ae4f;anchor=swh:1:rev:2ba723b3bd4a354fe78f677230b8a6dfb506422d</ext-link></element-citation></ref><ref id="bib43"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Russell</surname><given-names>ML</given-names></name><name><surname>Souquette</surname><given-names>A</given-names></name><name><surname>Levine</surname><given-names>DM</given-names></name><name><surname>Schattgen</surname><given-names>SA</given-names></name><name><surname>Allen</surname><given-names>EK</given-names></name><name><surname>Kuan</surname><given-names>G</given-names></name><name><surname>Simon</surname><given-names>N</given-names></name><name><surname>Balmaseda</surname><given-names>A</given-names></name><name><surname>Gordon</surname><given-names>A</given-names></name><name><surname>Thomas</surname><given-names>PG</given-names></name><name><surname>Matsen</surname><given-names>FA</given-names></name><name><surname>Bradley</surname><given-names>P</given-names></name></person-group><year iso-8601-date="2022">2022b</year><article-title>Combining genotypes and T cell receptor distributions to infer genetic loci determining V (D) J recombination probabilities</article-title><source>eLife</source><volume>11</volume><elocation-id>e73475</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.73475</pub-id><pub-id pub-id-type="pmid">35315770</pub-id></element-citation></ref><ref id="bib44"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Schatz</surname><given-names>DG</given-names></name><name><surname>Swanson</surname><given-names>PC</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>V (D) J recombination: mechanisms of initiation</article-title><source>Annual Review of Genetics</source><volume>45</volume><fpage>167</fpage><lpage>202</lpage><pub-id pub-id-type="doi">10.1146/annurev-genet-110410-132552</pub-id><pub-id pub-id-type="pmid">21854230</pub-id></element-citation></ref><ref id="bib45"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sethna</surname><given-names>Z</given-names></name><name><surname>Elhanati</surname><given-names>Y</given-names></name><name><surname>Callan</surname><given-names>CG</given-names></name><name><surname>Walczak</surname><given-names>AM</given-names></name><name><surname>Mora</surname><given-names>T</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>OLGA: fast computation of generation probabilities of B- and T-cell receptor amino acid sequences and motifs</article-title><source>Bioinformatics</source><volume>35</volume><fpage>2974</fpage><lpage>2981</lpage><pub-id pub-id-type="doi">10.1093/bioinformatics/btz035</pub-id><pub-id pub-id-type="pmid">30657870</pub-id></element-citation></ref><ref id="bib46"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sethna</surname><given-names>Z</given-names></name><name><surname>Isacchini</surname><given-names>G</given-names></name><name><surname>Dupic</surname><given-names>T</given-names></name><name><surname>Mora</surname><given-names>T</given-names></name><name><surname>Walczak</surname><given-names>AM</given-names></name><name><surname>Elhanati</surname><given-names>Y</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Population variability in the generation and selection of T-cell repertoires</article-title><source>PLOS Computational Biology</source><volume>16</volume><elocation-id>e1008394</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pcbi.1008394</pub-id><pub-id pub-id-type="pmid">33296360</pub-id></element-citation></ref><ref id="bib47"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Slabodkin</surname><given-names>A</given-names></name><name><surname>Chernigovskaya</surname><given-names>M</given-names></name><name><surname>Mikocziova</surname><given-names>I</given-names></name><name><surname>Akbar</surname><given-names>R</given-names></name><name><surname>Scheffer</surname><given-names>L</given-names></name><name><surname>Pavlović</surname><given-names>M</given-names></name><name><surname>Bashour</surname><given-names>H</given-names></name><name><surname>Snapkov</surname><given-names>I</given-names></name><name><surname>Mehta</surname><given-names>BB</given-names></name><name><surname>Weber</surname><given-names>CR</given-names></name><name><surname>Gutierrez-Marcos</surname><given-names>J</given-names></name><name><surname>Sollid</surname><given-names>LM</given-names></name><name><surname>Haff</surname><given-names>IH</given-names></name><name><surname>Sandve</surname><given-names>GK</given-names></name><name><surname>Robert</surname><given-names>PA</given-names></name><name><surname>Greiff</surname><given-names>V</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>Individualized VDJ Recombination Predisposes the Available Ig Sequence Space</article-title><source>bioRxiv</source><pub-id pub-id-type="doi">10.1101/2021.04.19.440409</pub-id></element-citation></ref><ref id="bib48"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Spisak</surname><given-names>N</given-names></name><name><surname>Walczak</surname><given-names>AM</given-names></name><name><surname>Mora</surname><given-names>T</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Learning the heterogeneous hypermutation landscape of immunoglobulins from high-throughput repertoire data</article-title><source>Nucleic Acids Research</source><volume>48</volume><fpage>10702</fpage><lpage>10712</lpage><pub-id pub-id-type="doi">10.1093/nar/gkaa825</pub-id><pub-id pub-id-type="pmid">33035336</pub-id></element-citation></ref><ref id="bib49"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Srivastava</surname><given-names>SK</given-names></name><name><surname>Robins</surname><given-names>HS</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Palindromic nucleotide analysis in human T cell receptor rearrangements</article-title><source>PLOS ONE</source><volume>7</volume><elocation-id>e52250</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pone.0052250</pub-id><pub-id pub-id-type="pmid">23284955</pub-id></element-citation></ref><ref id="bib50"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Tsai</surname><given-names>AG</given-names></name><name><surname>Engelhart</surname><given-names>AE</given-names></name><name><surname>Hatmal</surname><given-names>MM</given-names></name><name><surname>Houston</surname><given-names>SI</given-names></name><name><surname>Hud</surname><given-names>NV</given-names></name><name><surname>Haworth</surname><given-names>IS</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2009">2009</year><article-title>Conformational variants of duplex DNA correlated with cytosine-rich chromosomal fragile sites</article-title><source>The Journal of Biological Chemistry</source><volume>284</volume><fpage>7157</fpage><lpage>7164</lpage><pub-id pub-id-type="doi">10.1074/jbc.M806866200</pub-id><pub-id pub-id-type="pmid">19106104</pub-id></element-citation></ref><ref id="bib51"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Vander Heiden</surname><given-names>JA</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>Stern</surname><given-names>JNH</given-names></name><name><surname>O’Connor</surname><given-names>KC</given-names></name><name><surname>Hafler</surname><given-names>DA</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><year iso-8601-date="2014">2014</year><article-title>Presto: a toolkit for processing high-throughput sequencing RAW reads of lymphocyte receptor repertoires</article-title><source>Bioinformatics</source><volume>30</volume><fpage>1930</fpage><lpage>1932</lpage><pub-id pub-id-type="doi">10.1093/bioinformatics/btu138</pub-id></element-citation></ref><ref id="bib52"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Wei</surname><given-names>L</given-names></name><name><surname>Chahwan</surname><given-names>R</given-names></name><name><surname>Wang</surname><given-names>S</given-names></name><name><surname>Wang</surname><given-names>X</given-names></name><name><surname>Pham</surname><given-names>PT</given-names></name><name><surname>Goodman</surname><given-names>MF</given-names></name><name><surname>Bergman</surname><given-names>A</given-names></name><name><surname>Scharff</surname><given-names>MD</given-names></name><name><surname>MacCarthy</surname><given-names>T</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Overlapping hotspots in CDRs are critical sites for V region diversification</article-title><source>PNAS</source><volume>112</volume><fpage>E728</fpage><lpage>E737</lpage><pub-id pub-id-type="doi">10.1073/pnas.1500788112</pub-id></element-citation></ref><ref id="bib53"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Yaari</surname><given-names>G</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>Gupta</surname><given-names>N</given-names></name><name><surname>Stern</surname><given-names>JNH</given-names></name><name><surname>O’Connor</surname><given-names>KC</given-names></name><name><surname>Hafler</surname><given-names>DA</given-names></name><name><surname>Laserson</surname><given-names>U</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><year iso-8601-date="2013">2013</year><article-title>Models of somatic hypermutation targeting and substitution based on synonymous mutations from high-throughput immunoglobulin sequencing data</article-title><source>Frontiers in Immunology</source><volume>4</volume><elocation-id>358</elocation-id><pub-id pub-id-type="doi">10.3389/fimmu.2013.00358</pub-id><pub-id pub-id-type="pmid">24298272</pub-id></element-citation></ref><ref id="bib54"><element-citation publication-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><year iso-8601-date="2013">2013</year><article-title>IgBLAST: an immunoglobulin variable domain sequence analysis tool</article-title><source>Nucleic Acids Research</source><volume>41</volume><fpage>W34</fpage><lpage>W40</lpage><pub-id pub-id-type="doi">10.1093/nar/gkt382</pub-id></element-citation></ref><ref id="bib55"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Yosaatmadja</surname><given-names>Y</given-names></name><name><surname>Baddock</surname><given-names>HT</given-names></name><name><surname>Newman</surname><given-names>JA</given-names></name><name><surname>Bielinski</surname><given-names>M</given-names></name><name><surname>Gavard</surname><given-names>AE</given-names></name><name><surname>Mukhopadhyay</surname><given-names>SMM</given-names></name><name><surname>Dannerfjord</surname><given-names>AA</given-names></name><name><surname>Schofield</surname><given-names>CJ</given-names></name><name><surname>McHugh</surname><given-names>PJ</given-names></name><name><surname>Gileadi</surname><given-names>O</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>Structural and mechanistic insights into the ARTEMIS endonuclease and strategies for its inhibition</article-title><source>Nucleic Acids Research</source><volume>49</volume><fpage>9310</fpage><lpage>9326</lpage><pub-id pub-id-type="doi">10.1093/nar/gkab693</pub-id></element-citation></ref><ref id="bib56"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Zhao</surname><given-names>B</given-names></name><name><surname>Rothenberg</surname><given-names>E</given-names></name><name><surname>Ramsden</surname><given-names>DA</given-names></name><name><surname>Lieber</surname><given-names>MR</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>The molecular basis and disease relevance of non-homologous DNA end joining</article-title><source>Nature Reviews. Molecular Cell Biology</source><volume>21</volume><fpage>765</fpage><lpage>781</lpage><pub-id pub-id-type="doi">10.1038/s41580-020-00297-8</pub-id><pub-id pub-id-type="pmid">33077885</pub-id></element-citation></ref><ref id="bib57"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Zhou</surname><given-names>T</given-names></name><name><surname>Yang</surname><given-names>L</given-names></name><name><surname>Lu</surname><given-names>Y</given-names></name><name><surname>Dror</surname><given-names>I</given-names></name><name><surname>Dantas Machado</surname><given-names>AC</given-names></name><name><surname>Ghane</surname><given-names>T</given-names></name><name><surname>Di Felice</surname><given-names>R</given-names></name><name><surname>Rohs</surname><given-names>R</given-names></name></person-group><year iso-8601-date="2013">2013</year><article-title>DNAshape: a method for the high-throughput prediction of DNA structural features on a genomic scale</article-title><source>Nucleic Acids Research</source><volume>41</volume><fpage>W56</fpage><lpage>W62</lpage><pub-id pub-id-type="doi">10.1093/nar/gkt437</pub-id><pub-id pub-id-type="pmid">23703209</pub-id></element-citation></ref></ref-list><app-group><app id="appendix-1"><title>Appendix 1</title><sec sec-type="appendix" id="s8"><title>Extended notation</title><table-wrap id="app1table1" position="float"><label>Appendix 1—table 1.</label><caption><title>Summary of all notation used in our modeling.</title></caption><table frame="hsides" rules="groups"><thead><tr><th align="left" valign="bottom">Variable</th><th align="left" valign="bottom">Description</th></tr></thead><tbody><tr><td align="left" valign="bottom">General notation</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf185"><mml:mi mathsize="90%">I</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Set of all individuals</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf186"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Index for an individual in the set <inline-formula><mml:math id="inf187"><mml:mi mathsize="90%">I</mml:mi></mml:math></inline-formula> of all individuals</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf188"><mml:msub><mml:mi mathsize="90%">K</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub></mml:math></inline-formula></td><td align="left" valign="bottom">Total number of TCRs in the repertoire of individual <inline-formula><mml:math id="inf189"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf190"><mml:mi mathsize="90%">k</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Index of a sequence in the TCR repertoire of individual <inline-formula><mml:math id="inf191"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf192"><mml:mi mathsize="90%">S</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Random variable that represents the gene sequence</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf193"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">General notation for a gene-allele-group sequence oriented 5’-to-3’</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf194"><mml:msub><mml:mi mathsize="90%">σ</mml:mi><mml:mi mathsize="90%">V</mml:mi></mml:msub></mml:math></inline-formula></td><td align="left" valign="bottom">V-gene-allele-group sequence (‘top’ strand oriented 5’-to-3’)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf195"><mml:msub><mml:mi mathsize="90%">σ</mml:mi><mml:mi mathsize="90%">J</mml:mi></mml:msub></mml:math></inline-formula></td><td align="left" valign="bottom">J-gene-allele-group sequence (‘bottom’ strand oriented 5’-to-3’)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf196"><mml:mi mathsize="90%">N</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Random variable that represents the number of deleted nucleotides</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf197"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Number of deleted nucleotides from the 3’-side of a gene sequence</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf198"><mml:mi mathsize="90%">L</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Lower bound of ‘reasonable’ trimming amounts, we have defined <inline-formula><mml:math id="inf199"><mml:mrow><mml:mi mathsize="90%">L</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf200"><mml:mi mathsize="90%">U</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Upper bound of ‘reasonable’ trimming amounts, we have defined <inline-formula><mml:math id="inf201"><mml:mrow><mml:mi mathsize="90%">U</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">14</mml:mn></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf202"><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">i</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">The number of TCRs that use gene allele group <inline-formula><mml:math id="inf203"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> in the sampled repertoire of individual <inline-formula><mml:math id="inf204"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf205"><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">i</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">The number of TCRs that have gene allele group <inline-formula><mml:math id="inf206"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf207"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> nucleotides deleted in the sampled repertoire of individual <inline-formula><mml:math id="inf208"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf209"><mml:msup><mml:mi mathsize="90%">N</mml:mi><mml:mo mathsize="90%" stretchy="false">′</mml:mo></mml:msup></mml:math></inline-formula></td><td align="left" valign="bottom">Set of all ‘reasonable’ trimming amounts; <inline-formula><mml:math id="inf210"><mml:mrow><mml:msup><mml:mi mathsize="90%">N</mml:mi><mml:mo mathsize="90%" stretchy="false">′</mml:mo></mml:msup><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mn mathsize="90%">2</mml:mn><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo>⁢</mml:mo><mml:mn mathsize="90%">14</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf211"><mml:mrow><mml:msub><mml:mi mathsize="90%">P</mml:mi><mml:mtext mathsize="90%">emp</mml:mtext></mml:msub><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">N</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo maxsize="90%" minsize="90%">∣</mml:mo><mml:mi mathsize="90%">S</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">i</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Empirical conditional probability density function (<xref ref-type="disp-formula" rid="equ1">Equation 1</xref>)</td></tr><tr><td align="left" valign="bottom">Motif parameter-specific notation</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf212"><mml:mi mathsize="90%">a</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Non-negative integer value that represents the number of nucleotides 5’ of the trimming site to be included in the ‘trimming motif’</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf213"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Non-negative integer value that represents the number of nucleotides 3’ of the trimming site to be included in the ‘trimming motif’</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf214"><mml:msubsup><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%">j</mml:mi></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow></mml:msubsup></mml:math></inline-formula></td><td align="left" valign="bottom">‘Trimming motif’ sequence (<xref ref-type="disp-formula" rid="equ20">Equation 13</xref>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf215"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">s</mml:mi></mml:mrow><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msubsup></mml:math></inline-formula></td><td align="left" valign="bottom">(Log) position weight matrix coefficient for trimming motif position <inline-formula><mml:math id="inf216"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> and nucleotide <inline-formula><mml:math id="inf217"><mml:mrow><mml:mi mathsize="90%">s</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mi mathsize="90%">A</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">T</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">C</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">G</mml:mi><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf218"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup></mml:math></inline-formula></td><td align="left" valign="bottom">Set of all <italic>motif</italic> coefficients <inline-formula><mml:math id="inf219"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">s</mml:mi></mml:mrow><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msubsup></mml:math></inline-formula> for all positions <inline-formula><mml:math id="inf220"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> and nucleotide <inline-formula><mml:math id="inf221"><mml:mrow><mml:mi mathsize="90%">s</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mi mathsize="90%">A</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">T</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">C</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">G</mml:mi><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf222"><mml:mrow><mml:mi mathsize="90%">f</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom"><italic>Motif</italic>-specific covariate function (<xref ref-type="disp-formula" rid="equ21">Equation 14</xref>)</td></tr><tr><td align="left" valign="bottom">Base-count-beyond parameter-specific notation</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf223"><mml:mi mathsize="90%">c</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Non-negative integer value that represents the number of nucleotides 5’ of the trimming site to be included in the 5’ base-count-beyond the ‘trimming motif’</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf224"><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">x</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Count of nucleotides that are A or T in an arbitrary sequence <inline-formula><mml:math id="inf225"><mml:mi mathsize="90%">x</mml:mi></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf226"><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">x</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Count of nucleotides that are G or C in an arbitrary sequence <inline-formula><mml:math id="inf227"><mml:mi mathsize="90%">x</mml:mi></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf228"><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">5</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">The nucleotide sequence 5’ of the trimming site, beyond the ‘trimming motif’ (<xref ref-type="disp-formula" rid="equ24">Equation 15</xref>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf229"><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">3</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">The nucleotide sequence 3’ of the trimming site, beyond the ‘trimming motif’ (<xref ref-type="disp-formula" rid="equ27">Equation 16</xref>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf230"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">5</mml:mn><mml:mtext mathsize="90%">AT</mml:mtext></mml:msubsup></mml:math></inline-formula> and <inline-formula><mml:math id="inf231"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">3</mml:mn><mml:mtext mathsize="90%">AT</mml:mtext></mml:msubsup></mml:math></inline-formula></td><td align="left" valign="bottom"><italic>Base-count-beyond</italic> model coefficients for the 5’ and 3’ sequence base-counts of A and T nucleotides beyond the trimming motif</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf232"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup></mml:math></inline-formula></td><td align="left" valign="bottom">Set of AT-<italic>base-count-beyond</italic> model coefficients (includes <inline-formula><mml:math id="inf233"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">5</mml:mn><mml:mtext mathsize="90%">AT</mml:mtext></mml:msubsup></mml:math></inline-formula> and <inline-formula><mml:math id="inf234"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">3</mml:mn><mml:mtext mathsize="90%">AT</mml:mtext></mml:msubsup></mml:math></inline-formula>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf235"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">5</mml:mn><mml:mtext mathsize="90%">GC</mml:mtext></mml:msubsup></mml:math></inline-formula> and <inline-formula><mml:math id="inf236"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">3</mml:mn><mml:mtext mathsize="90%">GC</mml:mtext></mml:msubsup></mml:math></inline-formula></td><td align="left" valign="bottom"><italic>Base-count-beyond</italic> model coefficients for the 5’ and 3’ sequence base-counts of G and C nucleotides beyond the trimming motif</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf237"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup></mml:math></inline-formula></td><td align="left" valign="bottom">Set of GC-<italic>base-count-beyond</italic> model coefficients (includes <inline-formula><mml:math id="inf238"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">5</mml:mn><mml:mtext mathsize="90%">GC</mml:mtext></mml:msubsup></mml:math></inline-formula> and <inline-formula><mml:math id="inf239"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">3</mml:mn><mml:mtext mathsize="90%">GC</mml:mtext></mml:msubsup></mml:math></inline-formula>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf240"><mml:mrow><mml:mi mathsize="90%">f</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom"><italic>Base-count-beyond</italic>-specific covariate function (<xref ref-type="disp-formula" rid="equ21">Equation 14</xref>)</td></tr><tr><td align="left" valign="bottom">DNA-shape parameter-specific notation</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf241"><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">‘Expanded trimming sequence window’ (<xref ref-type="disp-formula" rid="equ39">Equation 18</xref>); consists of the ‘trimming motif’ sequence extended by 2 nucleotides in both the 5’ and 3’ direction</td></tr><tr><td align="left" valign="bottom">E</td><td align="left" valign="bottom">Nucleotide electrostatic potential</td></tr><tr><td align="left" valign="bottom">W</td><td align="left" valign="bottom">Nucleotide minor groove width</td></tr><tr><td align="left" valign="bottom">P</td><td align="left" valign="bottom">Nucleotide propeller twist</td></tr><tr><td align="left" valign="bottom">R</td><td align="left" valign="bottom">Di-nucleotide roll</td></tr><tr><td align="left" valign="bottom">H</td><td align="left" valign="bottom">Di-nucleotide helical twist</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf242"><mml:mrow><mml:msup><mml:mtext mathsize="90%">shape</mml:mtext><mml:mtext mathsize="90%">u</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Measure of nucleotide shape <inline-formula><mml:math id="inf243"><mml:mrow><mml:mi mathsize="90%">u</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mtext mathsize="90%">E</mml:mtext><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">W</mml:mtext><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">P</mml:mtext><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> for the nucleotide at position <inline-formula><mml:math id="inf244"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> within the ‘expanded trimming sequence window’ <inline-formula><mml:math id="inf245"><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf246"><mml:mrow><mml:msup><mml:mtext mathsize="90%">shape</mml:mtext><mml:mtext mathsize="90%">V</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">d</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Measure of di-nucleotide shape <inline-formula><mml:math id="inf247"><mml:mrow><mml:mi mathsize="90%">v</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mtext mathsize="90%">R</mml:mtext><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">H</mml:mtext><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> for the di-nucleotide at position <inline-formula><mml:math id="inf248"><mml:mrow><mml:mi mathsize="90%">d</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> within the ‘expanded trimming sequence window’ <inline-formula><mml:math id="inf249"><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf250"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mrow><mml:mi mathsize="90%">u</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">j</mml:mi></mml:mrow><mml:mtext mathsize="90%">Shape</mml:mtext></mml:msubsup></mml:math></inline-formula></td><td align="left" valign="bottom">DNA-shape coefficients for nucleotide shape type <inline-formula><mml:math id="inf251"><mml:mrow><mml:mi mathsize="90%">u</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mtext mathsize="90%">E</mml:mtext><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">W</mml:mtext><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">P</mml:mtext><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> and ‘expanded trimming sequence window’ nucleotide position <inline-formula><mml:math id="inf252"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf253"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mrow><mml:mi mathsize="90%">v</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">d</mml:mi></mml:mrow><mml:mtext mathsize="90%">Shape</mml:mtext></mml:msubsup></mml:math></inline-formula></td><td align="left" valign="bottom">DNA-shape coefficients for di-nucleotide shape type <inline-formula><mml:math id="inf254"><mml:mrow><mml:mi mathsize="90%">v</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mtext mathsize="90%">R</mml:mtext><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">H</mml:mtext><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> and ‘expanded trimming sequence window’ di-nucleotide position <inline-formula><mml:math id="inf255"><mml:mrow><mml:mi mathsize="90%">d</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf256"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">Shape</mml:mtext></mml:msup></mml:math></inline-formula></td><td align="left" valign="bottom">Set of all nucleotide and di-nucleotide DNA-shape coefficients</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf257"><mml:mrow><mml:mi mathsize="90%">f</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">Shape</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">DNA-shape-specific covariate function (<xref ref-type="disp-formula" rid="equ32">Equation 19</xref>)</td></tr><tr><td align="left" valign="bottom">Length parameter-specific notation</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf258"><mml:msup><mml:mi mathsize="90%">β</mml:mi><mml:mtext mathsize="90%">ldiSt</mml:mtext></mml:msup></mml:math></inline-formula></td><td align="left" valign="bottom"><italic>Length</italic> specific model coefficient</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf259"><mml:mrow><mml:mi mathsize="90%">f</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%">β</mml:mi><mml:mtext mathsize="90%">ldiSt</mml:mtext></mml:msup><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom"><italic>Length</italic>-specific covariate function</td></tr><tr><td align="left" valign="bottom">Modeling notation</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf260"><mml:mrow><mml:mi mathsize="90%">f</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Example model covariate function including <italic>motif</italic> and <italic>base-count-beyond</italic> model parameters (<xref ref-type="disp-formula" rid="equ2">Equation 2</xref>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf261"><mml:mrow><mml:mi mathsize="90%">P</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo lspace="2.5pt" mathsize="90%" rspace="2.5pt" stretchy="false">∣</mml:mo><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Conditional logit model formulation using the <italic>motif</italic> and <italic>base-count-beyond</italic> model covariate function (<xref ref-type="disp-formula" rid="equ3">Equation 3</xref>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf262"><mml:mrow><mml:mrow><mml:mi mathsize="90%">log</mml:mi><mml:mo>⁡</mml:mo><mml:mi mathsize="90%">L</mml:mi></mml:mrow><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Aggregated log-likelihood for the conditional logit model; this likelihood function is un-weighted (<xref ref-type="disp-formula" rid="equ5">Equation 4</xref>) and gives every observation uniform treatment in the likelihood</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf263"><mml:mrow><mml:msub><mml:mi mathsize="90%">P</mml:mi><mml:mtext mathsize="90%">samp</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mrow><mml:mi mathsize="90%">N</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mi mathsize="90%">n</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">S</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mi mathsize="90%">σ</mml:mi></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Sampling procedure for the construction of the expected likelihood</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf264"><mml:mrow><mml:mrow><mml:mi mathsize="90%">log</mml:mi><mml:mo>⁡</mml:mo><mml:msub><mml:mi mathsize="90%">L</mml:mi><mml:mtext mathsize="90%">expected</mml:mtext></mml:msub></mml:mrow><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Expected log-likelihood for the conditional logit model; this likelihood function (<xref ref-type="disp-formula" rid="equ8">Equation 5</xref>) weights each observation by its sampling probability, <inline-formula><mml:math id="inf265"><mml:mrow><mml:msub><mml:mi mathsize="90%">P</mml:mi><mml:mtext mathsize="90%">samp</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mrow><mml:mi mathsize="90%">N</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mi mathsize="90%">n</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">S</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mi mathsize="90%">σ</mml:mi></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf266"><mml:mrow><mml:mrow><mml:mi mathsize="90%">log</mml:mi><mml:mo>⁡</mml:mo><mml:msub><mml:mi mathsize="90%">L</mml:mi><mml:mtext mathsize="90%">emp</mml:mtext></mml:msub></mml:mrow><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Expected log-likelihood for the conditional logit model; this likelihood function (<xref ref-type="disp-formula" rid="equ13">Equation 7</xref>) weights each observation by its sampling probability from the empirical joint PDF (<xref ref-type="disp-formula" rid="equ12">Equation 6</xref>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf267"><mml:mrow><mml:msub><mml:mi mathsize="90%">P</mml:mi><mml:mtext mathsize="90%">marg</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Empirical average per-gene-allele-group frequency used in formulating a subject-independent gene sampling procedure (<xref ref-type="disp-formula" rid="equ15">Equation 8</xref>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf268"><mml:mrow><mml:mrow><mml:mi mathsize="90%">log</mml:mi><mml:mo>⁡</mml:mo><mml:msub><mml:mi mathsize="90%">L</mml:mi><mml:mi mathsize="90%">W</mml:mi></mml:msub></mml:mrow><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Expected log-likelihood for the conditional logit model; this likelihood function (<xref ref-type="disp-formula" rid="equ16">Equation 9</xref>) weights each observation using a subject-independent gene sampling procedure (<xref ref-type="disp-formula" rid="equ15">Equation 8</xref>)</td></tr><tr><td align="left" valign="bottom">Model evaluation notation</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf269"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">An arbitrary model trained on a specified training data set</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf270"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">V</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula></td><td align="left" valign="bottom">Full V-gene data set</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf271"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">J</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula></td><td align="left" valign="bottom">Full J-gene data set</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf272"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula></td><td align="left" valign="bottom">Arbitrary held-out data set</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf273"><mml:mrow><mml:mi mathsize="90%">P</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mtext mathsize="90%">H</mml:mtext><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Probability of the arbitrary held-out data set (<xref ref-type="disp-formula" rid="equ35">Equation 21</xref>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf274"><mml:mrow><mml:mi mathsize="90%" mathvariant="normal">ℓ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi><mml:mo lspace="2.5pt" mathsize="90%" rspace="2.5pt" stretchy="false">∣</mml:mo><mml:mtext mathsize="90%">H</mml:mtext></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Expected per-sequence conditional log loss (<xref ref-type="disp-formula" rid="equ18">Equation 11</xref>) of a trained model <inline-formula><mml:math id="inf275"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula> evaluated on a data set <inline-formula><mml:math id="inf276"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf277"><mml:mrow><mml:mi mathsize="90%">E</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">[</mml:mo><mml:mrow><mml:mi mathsize="90%" mathvariant="normal">ℓ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">]</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Expected per-sequence conditional log loss across 20 random held-out data sets (<xref ref-type="disp-formula" rid="equ36">Equation 22</xref>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf278"><mml:mrow><mml:mi mathsize="90%">RMSE</mml:mi><mml:mo>⁡</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">V</mml:mtext><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Per-gene mean squared error (<xref ref-type="disp-formula" rid="equ37">Equation 23</xref>) for a gene <inline-formula><mml:math id="inf279"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> using a model <inline-formula><mml:math id="inf280"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula> trained using the V-gene training data set<inline-formula><mml:math id="inf281"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">V</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom">Coefficient evaluation notation</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf282"><mml:mrow><mml:mi mathsize="90%">T</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mover accent="true"><mml:mi mathsize="90%">β</mml:mi><mml:mo mathsize="90%" stretchy="false">^</mml:mo></mml:mover><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Test statistic (<xref ref-type="disp-formula" rid="equ19">Equation 12</xref>) for evaluating the significance of a single inferred coefficient <inline-formula><mml:math id="inf283"><mml:mover accent="true"><mml:mi mathsize="90%">β</mml:mi><mml:mo mathsize="90%" stretchy="false">^</mml:mo></mml:mover></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf284"><mml:mi mathsize="90%">X</mml:mi></mml:math></inline-formula></td><td align="left" valign="bottom">Set of SNPs within the gene encoding the Artemis protein that were previously identified to be associated with increasing the extent of trimming (<xref ref-type="bibr" rid="bib43">Russell et al., 2022b</xref>)</td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf285"><mml:msub><mml:mi mathsize="90%">g</mml:mi><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">x</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula></td><td align="left" valign="bottom">Number of minor alleles in the genotype of an individual <inline-formula><mml:math id="inf286"><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mi mathsize="90%">I</mml:mi></mml:mrow></mml:math></inline-formula> for SNP <inline-formula><mml:math id="inf287"><mml:mrow><mml:mi mathsize="90%">x</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mi mathsize="90%">X</mml:mi></mml:mrow></mml:math></inline-formula></td></tr><tr><td align="left" valign="bottom"><inline-formula><mml:math id="inf288"><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:msubsup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mi mathsize="90%">x</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msubsup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msubsup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mi mathsize="90%">x</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msubsup><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msubsup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mi mathsize="90%">x</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msubsup><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:math></inline-formula></td><td align="left" valign="bottom">Set of interaction coefficients between each model parameter and the SNP <inline-formula><mml:math id="inf289"><mml:mi mathsize="90%">x</mml:mi></mml:math></inline-formula> genotype</td></tr></tbody></table></table-wrap></sec></app><app id="appendix-2"><title>Appendix 2</title><sec sec-type="appendix" id="s9"><title>Extended parameter description</title><sec sec-type="appendix" id="s9-1"><title>Defining the ‘trimming motif’ and position-weight-matrix weight for a given gene and trimming site</title><fig id="app2fig1" position="float"><label>Appendix 2—figure 1.</label><caption><title>Summary of trimming motif parameters.</title><p>Let <inline-formula><mml:math id="inf290"><mml:mrow><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn>2</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="inf291"><mml:mrow><mml:mi>b</mml:mi><mml:mo>=</mml:mo><mml:mn>4</mml:mn></mml:mrow></mml:math></inline-formula>. The 6-nucleotide trimming motif given by (<xref ref-type="disp-formula" rid="equ20">Equation 13</xref>) is shown in the orange box and the trimming site is shown by the vertical orange line. An arbitrary gene sequence is highlighted in gray and the two possible P-nucleotides are highlighted in purple. (<bold>A</bold>) For <inline-formula><mml:math id="inf292"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>5</mml:mn></mml:mrow></mml:math></inline-formula>, the 6-nucleotide trimming motif will not contain P-nucleotides. (<bold>B</bold>) For <inline-formula><mml:math id="inf293"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>3</mml:mn></mml:mrow></mml:math></inline-formula>, the 6-nucleotide trimming motif will contain one P-nucleotide. (<bold>C</bold>) For <inline-formula><mml:math id="inf294"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:math></inline-formula>, the trimming motif will contain two P-nucleotides and will be ‘incomplete’ (contain less than 6 nucleotides).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-app2-fig1-v1.tif"/></fig><p>Existing probabilistic models of nucleotide trimming using repertoire sequencing data have shown that the local nucleotide context around the trimming site, which we refer to as the ‘trimming motif,’ do a surprisingly good job of predicting the distribution of trimming lengths for a variety of genes (<xref ref-type="bibr" rid="bib34">Murugan et al., 2012</xref>). This simple PWM model uses a trimming motif containing 2 nucleotides 5’ of the trimming site and 4 nucleotides 3’ of the trimming site to predict the probability of trimming at that site. In practice, we can define the trimming motif to be any size. Let <inline-formula><mml:math id="inf295"><mml:mi mathsize="90%">a</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf296"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula> be non-negative integer values that represent the number of nucleotides 5’ and 3’ of the trimming site, respectively. Together, these <inline-formula><mml:math id="inf297"><mml:mrow><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%">b</mml:mi></mml:mrow></mml:math></inline-formula> nucleotides will compose the trimming motif. For a gene-allele-group sequence <inline-formula><mml:math id="inf298"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> and a number of deleted nucleotides <inline-formula><mml:math id="inf299"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula>, let <inline-formula><mml:math id="inf300"><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%">j</mml:mi></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> represent the nucleotide identity at the trimming motif position <inline-formula><mml:math id="inf301"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> where positions <inline-formula><mml:math id="inf302"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>j</mml:mi><mml:mo>&lt;</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> represent motif positions 5’ of the trimming site and positions <inline-formula><mml:math id="inf303"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">≥</mml:mo><mml:mn mathsize="90%">0</mml:mn></mml:mrow></mml:math></inline-formula> represent motif positions 3’ of the trimming site. As such, the trimming motif sequence is given by<disp-formula id="equ20"><label>(13)</label><mml:math id="m20"><mml:mrow><mml:msubsup><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%">j</mml:mi></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow></mml:msubsup><mml:mo mathsize="90%" stretchy="false">.</mml:mo></mml:mrow></mml:math></disp-formula></p><p>Depending on <inline-formula><mml:math id="inf304"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula>, this trimming motif may or may not include P-nucleotides. For example, for <inline-formula><mml:math id="inf305"><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">≥</mml:mo><mml:mi mathsize="90%">b</mml:mi></mml:mrow></mml:math></inline-formula>, the <inline-formula><mml:math id="inf306"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula> 3’ trimming motif nucleotides will include the <inline-formula><mml:math id="inf307"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula> deleted gene sequence nucleotides 3’ of the trimming site (and no P-nucleotides) (<xref ref-type="fig" rid="app2fig1">Appendix 2—figure 1A</xref>). Since we are assuming that the initial hairpin nick occurs at the +2 position, there will be two P-nucleotides present in the 5’-to-3’ gene sequence. For <inline-formula><mml:math id="inf308"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>b</mml:mi><mml:mo>−</mml:mo><mml:mn>2</mml:mn><mml:mo>≤</mml:mo><mml:mi>n</mml:mi><mml:mo>&lt;</mml:mo><mml:mi>b</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>, where the 2 represents the total P-nucleotide count in the full sequence, P-nucleotides will be included in the trimming motif sequence. Specifically, the <inline-formula><mml:math id="inf309"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula> total 3’ trimming motif nucleotides will include <inline-formula><mml:math id="inf310"><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">n</mml:mi></mml:mrow></mml:math></inline-formula> P-nucleotides and <inline-formula><mml:math id="inf311"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> deleted gene sequence nucleotides (<xref ref-type="fig" rid="app2fig1">Appendix 2—figure 1B, C</xref>). Likewise, as a result of the +2 hairpin nick position assumption, TCRs that have <inline-formula><mml:math id="inf312"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>n</mml:mi><mml:mo>&lt;</mml:mo><mml:mi>b</mml:mi><mml:mo>−</mml:mo><mml:mn>2</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> will not have a full, <inline-formula><mml:math id="inf313"><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%">b</mml:mi></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:math></inline-formula>-length nucleotide trimming motif (<xref ref-type="fig" rid="app2fig1">Appendix 2—figure 1C</xref>). For these ‘off-the-end’ motif cases, we assign zero influence to the missing nucleotides during model fitting.</p><p>With this trimming motif, let <inline-formula><mml:math id="inf314"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">s</mml:mi></mml:mrow><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msubsup></mml:math></inline-formula> be a (log) position-weight-matrix coefficient for trimming motif position <inline-formula><mml:math id="inf315"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> and nucleotide <inline-formula><mml:math id="inf316"><mml:mrow><mml:mi mathsize="90%">s</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mi mathsize="90%">A</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">T</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">C</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">G</mml:mi><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>. We can define an un-normalized position-weight-matrix weight<disp-formula id="equ21"><label>(14)</label><mml:math id="m21"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:munderover><mml:mo>∑</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:mi>a</mml:mi></mml:mrow><mml:mrow><mml:mi>b</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:munderover><mml:msubsup><mml:mi>β</mml:mi><mml:mrow><mml:mi>j</mml:mi><mml:mi>σ</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mi>j</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msubsup></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>that will serve as a <italic>motif</italic>-specific model covariate function in subsequent modeling. As described above, since we are considering ‘off-the-end’ motif cases, <inline-formula><mml:math id="inf317"><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%">j</mml:mi></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> represent the nucleotide identity at sequence position <inline-formula><mml:math id="inf318"><mml:mi mathsize="90%">j</mml:mi></mml:math></inline-formula> where positions <inline-formula><mml:math id="inf319"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>j</mml:mi><mml:mo>&lt;</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> represent sequence positions 5’ of the trimming site and positions <inline-formula><mml:math id="inf320"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">≥</mml:mo><mml:mn mathsize="90%">0</mml:mn></mml:mrow></mml:math></inline-formula> represent sequence positions 3’ of the trimming site.</p></sec><sec sec-type="appendix" id="s9-2"><title>AT and GC base-count-beyond the trimming motif</title><p>For an arbitrary sequence <inline-formula><mml:math id="inf321"><mml:mi mathsize="90%">x</mml:mi></mml:math></inline-formula>, we can count the number of AT and GC nucleotides within the sequence as<disp-formula id="equ22"><mml:math id="m22"><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">x</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">A</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">x</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">T</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">x</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:math></disp-formula></p><p>and<disp-formula id="equ23"><mml:math id="m23"><mml:mrow><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">x</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">G</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">x</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">C</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">x</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo></mml:mrow></mml:math></disp-formula></p><p>respectively.</p><p>Because the count of AT or GC nucleotides within the sequences 5’ and 3’ of the trimming site may influence the probability of trimming differently, we will calculate the counts separately. We will not include nucleotides that were already included in the <italic>motif</italic> parameterization. As above, for a gene-allele-group sequence <inline-formula><mml:math id="inf322"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> and a number of deleted nucleotides <inline-formula><mml:math id="inf323"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula>, let <inline-formula><mml:math id="inf324"><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%">j</mml:mi></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> represent the nucleotide identity at sequence position <inline-formula><mml:math id="inf325"><mml:mi mathsize="90%">j</mml:mi></mml:math></inline-formula> where positions <inline-formula><mml:math id="inf326"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>j</mml:mi><mml:mo>&lt;</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> represent sequence positions 5’ of the trimming site and positions <inline-formula><mml:math id="inf327"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>j</mml:mi><mml:mo>≥</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> represent sequence positions 3’ of the trimming site. Let <inline-formula><mml:math id="inf328"><mml:mi mathsize="90%">c</mml:mi></mml:math></inline-formula> be a non-negative integer value that represents the number of nucleotides 5’ of the trimming site that will be included in the 5’-nucleotide counts (<xref ref-type="fig" rid="app2fig2">Appendix 2—figure 2</xref>). Recall that <inline-formula><mml:math id="inf329"><mml:mi mathsize="90%">a</mml:mi></mml:math></inline-formula> is a non-negative integer value that represents the number of nucleotides 5’ of the trimming site that are included in the ‘trimming motif’ described in the previous section. As such, the nucleotide sequence 5’ of the trimming site, beyond the ‘trimming motif,’ is given by<disp-formula id="equ24"><label>(15)</label><mml:math id="m24"><mml:mrow><mml:msub><mml:mrow><mml:mtext mathvariant="sans-serif">seq</mml:mtext></mml:mrow><mml:mrow><mml:mn>5</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:msubsup><mml:mrow><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mi>j</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mi>a</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>a</mml:mi><mml:mo>+</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msubsup><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p><p>Within this sequence <inline-formula><mml:math id="inf330"><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">5</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, we can count the number of AT and GC nucleotides as<disp-formula id="equ25"><mml:math id="m25"><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">5</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">A</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">5</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">T</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">5</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:math></disp-formula></p><p>and<disp-formula id="equ26"><mml:math id="m26"><mml:mrow><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">5</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">G</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">5</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">C</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">5</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">c</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo></mml:mrow></mml:math></disp-formula></p><p>respectively</p><p>To count the number of AT and GC nucleotides in the sequence 3’ of the trimming site, we will include all nucleotides located 3’ of the trimming site that are beyond the ‘trimming motif.’ However, because we are interested in using GC nucleotide content in both directions of the wider sequence as a proxy for the capacity for sequence-breathing and since sequence-breathing is only relevant for nucleotides that are paired, we will not include the nucleotides within the 3’ single-stranded-overhang when counting 3’ AT and GC nucleotides (<xref ref-type="fig" rid="app2fig2">Appendix 2—figure 2</xref>). Since we are assuming that the initial hairpin nick occurs at the +2 position leading to a 4-nucleotide-long 3’ single-stranded-overhang, for <inline-formula><mml:math id="inf331"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>n</mml:mi><mml:mo>&gt;</mml:mo><mml:mn>2</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>, the nucleotide sequence 3’ of the trimming site, beyond the ‘trimming motif,’ is given by<disp-formula id="equ27"><label>(16)</label><mml:math id="m27"><mml:mrow><mml:msub><mml:mrow><mml:mtext mathvariant="sans-serif">seq</mml:mtext></mml:mrow><mml:mrow><mml:mn>3</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false"><mml:mtr><mml:mtd><mml:msubsup><mml:mrow><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mi>j</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>3</mml:mn><mml:mo>−</mml:mo><mml:mi>n</mml:mi></mml:mrow><mml:mrow><mml:mo>−</mml:mo><mml:mi>b</mml:mi></mml:mrow></mml:msubsup></mml:mtd><mml:mtd><mml:mrow><mml:mtext>if </mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>−</mml:mo><mml:mn>3</mml:mn><mml:mo stretchy="false">)</mml:mo><mml:mo>≥</mml:mo><mml:mi>b</mml:mi></mml:mrow></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mtd><mml:mtd><mml:mrow><mml:mtext>if </mml:mtext><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>−</mml:mo><mml:mn>3</mml:mn><mml:mo stretchy="false">)</mml:mo><mml:mo>&lt;</mml:mo><mml:mi>b</mml:mi></mml:mrow></mml:mrow></mml:mtd></mml:mtr></mml:mtable><mml:mo fence="true" stretchy="true" symmetric="true"/></mml:mrow></mml:mrow></mml:math></disp-formula></p><p>where <inline-formula><mml:math id="inf332"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula> is a non-negative integer value that represents the number of nucleotides 3’ of the trimming site that are included in the ‘trimming motif‘ described in the previous section. For <inline-formula><mml:math id="inf333"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>−</mml:mo><mml:mn>3</mml:mn><mml:mo stretchy="false">)</mml:mo><mml:mo>&lt;</mml:mo><mml:mi>b</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula>, all nucleotides 3’ of the trimming site are considered single-stranded and, thus, no nucleotides will be included in the sequence used to calculate the AT and GC base-counts (<xref ref-type="fig" rid="app2fig2">Appendix 2—figure 2C</xref>). Within this sequence <inline-formula><mml:math id="inf334"><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">3</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, we can count the number of AT and GC nucleotides as<disp-formula id="equ28"><mml:math id="m28"><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">3</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">A</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">3</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">T</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">3</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:mrow></mml:mrow></mml:math></disp-formula></p><p>and<disp-formula id="equ29"><mml:math id="m29"><mml:mrow><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">3</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">G</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">3</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mrow><mml:msup><mml:mi mathsize="90%">C</mml:mi><mml:mtext mathsize="90%">C</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mn mathsize="90%">3</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo></mml:mrow></mml:math></disp-formula></p><p>respectively. As defined, these GC and AT base-counts for the 3’ sequence are dependent on sequence length and provide a parameterization of both GC nucleotide content in both directions of the wider sequence and length.</p><p>With these 5’ and 3’ base counts, we can define <inline-formula><mml:math id="inf335"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">5</mml:mn><mml:mtext mathsize="90%">AT</mml:mtext></mml:msubsup></mml:math></inline-formula>, <inline-formula><mml:math id="inf336"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">3</mml:mn><mml:mtext mathsize="90%">AT</mml:mtext></mml:msubsup></mml:math></inline-formula>, <inline-formula><mml:math id="inf337"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">5</mml:mn><mml:mtext mathsize="90%">GC</mml:mtext></mml:msubsup></mml:math></inline-formula>, and <inline-formula><mml:math id="inf338"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mn mathsize="90%">3</mml:mn><mml:mtext mathsize="90%">GC</mml:mtext></mml:msubsup></mml:math></inline-formula> to be <italic>base-count-beyond</italic> model coefficients for 5’ and 3’ sequence base-counts of AT and GC beyond the ‘trimming motif,’ respectively. With these coefficients, we can define a <italic>base-count-beyond</italic> covariate function for each trimming site <inline-formula><mml:math id="inf339"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> and gene <inline-formula><mml:math id="inf340"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula>:<disp-formula id="equ30"><label>(17)</label><mml:math id="m30"><mml:mrow><mml:mtable columnalign="left left" rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:msubsup><mml:mi>β</mml:mi><mml:mrow><mml:mn>5</mml:mn></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo>⋅</mml:mo><mml:msup><mml:mi>C</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mtext mathvariant="sans-serif">seq</mml:mtext></mml:mrow><mml:mrow><mml:mn>5</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mo>+</mml:mo><mml:msubsup><mml:mi>β</mml:mi><mml:mrow><mml:mn>3</mml:mn></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo>⋅</mml:mo><mml:msup><mml:mi>C</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mtext mathvariant="sans-serif">seq</mml:mtext></mml:mrow><mml:mrow><mml:mn>3</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="1em"/><mml:mo>+</mml:mo><mml:msubsup><mml:mi>β</mml:mi><mml:mrow><mml:mn>5</mml:mn></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo>⋅</mml:mo><mml:msup><mml:mi>C</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mtext mathvariant="sans-serif">seq</mml:mtext></mml:mrow><mml:mrow><mml:mn>5</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mo>+</mml:mo><mml:msubsup><mml:mi>β</mml:mi><mml:mrow><mml:mn>3</mml:mn></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo>⋅</mml:mo><mml:msup><mml:mi>C</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mtext mathvariant="sans-serif">seq</mml:mtext></mml:mrow><mml:mrow><mml:mn>3</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula></p><fig id="app2fig2" position="float"><label>Appendix 2—figure 2.</label><caption><title>Summary of base-count parameters.</title><p>Let <inline-formula><mml:math id="inf341"><mml:mrow><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="inf342"><mml:mrow><mml:mi>b</mml:mi><mml:mo>=</mml:mo><mml:mn>2</mml:mn></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="inf343"><mml:mrow><mml:mi>c</mml:mi><mml:mo>=</mml:mo><mml:mn>5</mml:mn></mml:mrow></mml:math></inline-formula>. An arbitrary gene sequence is highlighted in gray and the two possible P-nucleotides are highlighted in purple. The trimming site is shown by the vertical orange line and the ‘trimming motif,’ as defined in (<xref ref-type="disp-formula" rid="equ20">Equation 13</xref>), is shown by the orange box. The <inline-formula><mml:math id="inf344"><mml:mi>c</mml:mi></mml:math></inline-formula> nucleotides included in the count of AT and GC nucleotides 5’ of the trimming site, beyond the ‘trimming motif,’ are expressed by (<xref ref-type="disp-formula" rid="equ24">Equation 15</xref>) and are shown in the green box. The nucleotides included in the count of AT and GC nucleotides 3’ of the trimming site, beyond the ‘trimming motif,’ are expressed by (<xref ref-type="disp-formula" rid="equ27">Equation 16</xref>) and are shown in the yellow box. As described in the text, we are assuming that the initial hairpin nick occurs at the +2 position leading to a 4-nucleotide-long 3’ single-stranded-overhang. We exclude these single-stranded nucleotides in the 3’-base-count-beyond sequence. In this figure, the 4 nucleotides nearest to the 3’ side of each sequence (this includes the two P-nucleotides and the two 3’-most gene sequence nucleotides) are considered single-stranded and will not be included in the 3’-base-count-beyond sequence. (<bold>A</bold>) For <inline-formula><mml:math id="inf345"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>6</mml:mn></mml:mrow></mml:math></inline-formula>, 2 nucleotides 3’ of the trimming site will be used in the 3’ sequence base-counts. (<bold>B</bold>) For <inline-formula><mml:math id="inf346"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>5</mml:mn></mml:mrow></mml:math></inline-formula>, 1 nucleotide 3’ of the trimming site will be used in the 3’ sequence base-counts. (<bold>C</bold>) For <inline-formula><mml:math id="inf347"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>4</mml:mn></mml:mrow></mml:math></inline-formula>, all nucleotides 3’ of the trimming site are considered single-stranded and, thus, no nucleotides will be used for the 3’ sequence base-counts.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-app2-fig2-v1.tif"/></fig></sec><sec sec-type="appendix" id="s9-3"><title>DNA-shape around the trimming site</title><p>Methods have been previously developed to estimate DNA-shape features at a single-nucleotide position using the sequence context of 2 neighboring nucleotides on both sides of the nucleotide of interest (<xref ref-type="bibr" rid="bib57">Zhou et al., 2013</xref>; <xref ref-type="bibr" rid="bib5">Chiu et al., 2016</xref>). As such, these methods use a sliding-pentamer model, centered at each nucleotide of interest, to derive the structural features of nucleotides within a sequence window of any length. These structural features include estimations of electrostatic potential (E), minor groove width (W), and propeller twist (P) for each nucleotide in the sequence window and estimations of roll (R) and helical twist (H) for each di-nucleotide pair in the sequence window. For simplicity, we will use the term ‘DNA-shape parameters’ to refer to all five of these structural features.</p><p>For our purposes, we can define a ‘trimming sequence window’ of size <inline-formula><mml:math id="inf348"><mml:mrow><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%">b</mml:mi></mml:mrow></mml:math></inline-formula>, as introduced in the ‘trimming motif’ section with (<xref ref-type="disp-formula" rid="equ20">Equation 13</xref>), where <inline-formula><mml:math id="inf349"><mml:mi mathsize="90%">a</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf350"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula> are non-negative integer values that represent the number of nucleotides 5’ and 3’ of the trimming site, respectively. In order to estimate the DNA-shape for all nucleotides within this window, we will expand the ‘trimming sequence window’ by 2 nucleotides on both sides such that there are <inline-formula><mml:math id="inf351"><mml:mrow><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow></mml:math></inline-formula> nucleotides 5’ and <inline-formula><mml:math id="inf352"><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow></mml:math></inline-formula> nucleotides 3’ of the trimming site included in an ‘expanded trimming sequence window.’ For a gene-allele-group sequence <inline-formula><mml:math id="inf353"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> and a number of deleted nucleotides <inline-formula><mml:math id="inf354"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula>, let <inline-formula><mml:math id="inf355"><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%">j</mml:mi></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> represent the nucleotide identity at the ‘expanded trimming sequence window’ position <inline-formula><mml:math id="inf356"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> where positions <inline-formula><mml:math id="inf357"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>j</mml:mi><mml:mo>&lt;</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> represent expanded trimming sequence window positions 5’ of the trimming site and positions <inline-formula><mml:math id="inf358"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>j</mml:mi><mml:mo>≥</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> represent expanded trimming sequence window positions 3’ of the trimming site. As such, the expanded trimming sequence window is given by<disp-formula id="equ31"><label>(18)</label><mml:math id="m31"><mml:mrow><mml:msub><mml:mrow><mml:mtext mathvariant="sans-serif">seq</mml:mtext></mml:mrow><mml:mrow><mml:mtext>expd</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:msubsup><mml:mrow><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>σ</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mi>j</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mi>a</mml:mi><mml:mo>+</mml:mo><mml:mn>2</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>b</mml:mi><mml:mo>+</mml:mo><mml:mn>2</mml:mn><mml:mo stretchy="false">)</mml:mo><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msubsup><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p><p>Depending on <inline-formula><mml:math id="inf359"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula>, this expanded trimming sequence window may or may not include P-nucleotides. For example, for <inline-formula><mml:math id="inf360"><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">≥</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, the <inline-formula><mml:math id="inf361"><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:math></inline-formula> 3’ expanded trimming sequence window nucleotides will include the <inline-formula><mml:math id="inf362"><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:math></inline-formula> deleted gene sequence nucleotides 3’ of the trimming site (and no P-nucleotides) (<xref ref-type="fig" rid="app2fig3">Appendix 2—figure 3A</xref>). For <inline-formula><mml:math id="inf363"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>b</mml:mi><mml:mo>≤</mml:mo><mml:mi>n</mml:mi><mml:mo>&lt;</mml:mo><mml:mi>b</mml:mi><mml:mo>+</mml:mo><mml:mn>2</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula>, the <inline-formula><mml:math id="inf364"><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:math></inline-formula> 3’ expanded trimming sequence window nucleotides will include <inline-formula><mml:math id="inf365"><mml:mrow><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">n</mml:mi></mml:mrow></mml:math></inline-formula> P-nucleotides and <inline-formula><mml:math id="inf366"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> deleted gene sequence nucleotides (<xref ref-type="fig" rid="app2fig3">Appendix 2—figure 3B</xref>). Since we are assuming that the initial hairpin nick occurs at the +2 position, TCRs that have <inline-formula><mml:math id="inf367"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>n</mml:mi><mml:mo>&lt;</mml:mo><mml:mi>b</mml:mi></mml:mrow></mml:mstyle></mml:math></inline-formula> will not have a full, <inline-formula><mml:math id="inf368"><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">4</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:math></inline-formula>-length nucleotide expanded trimming sequence window (<xref ref-type="fig" rid="app2fig3">Appendix 2—figure 3C</xref>). The sliding-pentamer model (<xref ref-type="bibr" rid="bib57">Zhou et al., 2013</xref>; <xref ref-type="bibr" rid="bib5">Chiu et al., 2016</xref>) requires a full pentamer for estimating the DNA-shape of each base of interest, and, thus, for these ‘off-the-end’ expanded trimming sequence window cases, we cannot estimate DNA-shape parameters for all nucleotides within the trimming sequence window. As such, when estimating DNA-shape parameters, we must choose <inline-formula><mml:math id="inf369"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula> such that <inline-formula><mml:math id="inf370"><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:mi mathsize="90%">n</mml:mi></mml:mrow></mml:math></inline-formula> for all trimming lengths <inline-formula><mml:math id="inf371"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> in the data set.</p><p>For each nucleotide position <inline-formula><mml:math id="inf372"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> within the expanded trimming sequence window <inline-formula><mml:math id="inf373"><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, we can estimate the nucleotide electrostatic potential,<inline-formula><mml:math id="inf374"><mml:mrow><mml:msup><mml:mtext mathsize="90%">shape</mml:mtext><mml:mtext mathsize="90%">E</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, minor groove width, <inline-formula><mml:math id="inf375"><mml:mrow><mml:msup><mml:mtext mathsize="90%">shape</mml:mtext><mml:mtext mathsize="90%">W</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, and propeller twist, <inline-formula><mml:math id="inf376"><mml:mrow><mml:msup><mml:mtext mathsize="90%">shape</mml:mtext><mml:mtext mathsize="90%">P</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>. We then standardize the estimated values for each shape type. We can define <inline-formula><mml:math id="inf377"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mrow><mml:mi mathsize="90%">u</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">j</mml:mi></mml:mrow><mml:mtext mathsize="90%">Shape</mml:mtext></mml:msubsup></mml:math></inline-formula> to be a nucleotide shape model coefficient for nucleotide shape type <inline-formula><mml:math id="inf378"><mml:mrow><mml:mi mathsize="90%">u</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mtext mathsize="90%">E</mml:mtext><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">W</mml:mtext><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">P</mml:mtext><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> and trimming sequence window nucleotide position <inline-formula><mml:math id="inf379"><mml:mrow><mml:mi mathsize="90%">j</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>. Let <inline-formula><mml:math id="inf380"><mml:mrow><mml:mi mathsize="90%">d</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> be the location of each di-nucleotide in the trimming sequence window such that <inline-formula><mml:math id="inf381"><mml:mrow><mml:mi mathsize="90%">d</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0</mml:mn></mml:mrow></mml:math></inline-formula> represents the location of the trimming site, <inline-formula><mml:math id="inf382"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>d</mml:mi><mml:mo>&lt;</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> represents di-nucleotide positions 5’ of the trimming site, and <inline-formula><mml:math id="inf383"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>d</mml:mi><mml:mo>&gt;</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mstyle></mml:math></inline-formula> represents di-nucleotide positions 3’ of the trimming site. For each di-nucleotide <inline-formula><mml:math id="inf384"><mml:mrow><mml:mi mathsize="90%">d</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> within the expanded trimming sequence window <inline-formula><mml:math id="inf385"><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, we can estimate the di-nucleotide roll, <inline-formula><mml:math id="inf386"><mml:mrow><mml:msup><mml:mtext mathsize="90%">shape</mml:mtext><mml:mtext mathsize="90%">R</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">d</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> and helical twist, <inline-formula><mml:math id="inf387"><mml:mrow><mml:msup><mml:mtext mathsize="90%">shape</mml:mtext><mml:mtext mathsize="90%">H</mml:mtext></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">d</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:msub><mml:mtext mathsize="90%">seq</mml:mtext><mml:mtext mathsize="90%">expd</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">a</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">b</mml:mi><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>. As above, we then standardize the estimated values for each di-nucleotide shape type. We can define <inline-formula><mml:math id="inf388"><mml:msubsup><mml:mi mathsize="90%">β</mml:mi><mml:mrow><mml:mi mathsize="90%">v</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">d</mml:mi></mml:mrow><mml:mtext mathsize="90%">Shape</mml:mtext></mml:msubsup></mml:math></inline-formula> to be a di-nucleotide shape model coefficient for di-nucleotide shape type <inline-formula><mml:math id="inf389"><mml:mrow><mml:mi mathsize="90%">v</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mtext mathsize="90%">R</mml:mtext><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">H</mml:mtext><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> and trimming sequence window di-nucleotide position <inline-formula><mml:math id="inf390"><mml:mrow><mml:mi mathsize="90%">d</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">{</mml:mo><mml:mrow><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%">a</mml:mi></mml:mrow><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mrow><mml:mi mathsize="90%">b</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>. We use the R package DNAshapeR (<xref ref-type="bibr" rid="bib5">Chiu et al., 2016</xref>) to estimate these DNA-shape parameters for each trimming sequence window. With these standardized DNA-shape estimates, we can define a DNA-shape covariate function for each trimming site <inline-formula><mml:math id="inf391"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> and gene <inline-formula><mml:math id="inf392"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula><disp-formula id="equ32"><label>(19)</label><mml:math id="m32"><mml:mrow><mml:mtable columnalign="left left" rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">shape</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:munderover><mml:mo>∑</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:mi>a</mml:mi></mml:mrow><mml:mrow><mml:mi>b</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:munderover><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>u</mml:mi><mml:mo>∈</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mrow><mml:mtext mathvariant="monospace">E</mml:mtext></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mtext mathvariant="monospace">W</mml:mtext></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mtext mathvariant="monospace">P</mml:mtext></mml:mrow><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow></mml:munder><mml:msubsup><mml:mi>β</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">shape</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo>⋅</mml:mo><mml:msup><mml:mrow><mml:mtext mathvariant="sans-serif">shape</mml:mtext></mml:mrow><mml:mrow><mml:mi>u</mml:mi></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mtext mathvariant="sans-serif">seq</mml:mtext></mml:mrow><mml:mrow><mml:mtext>expd</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="1em"/><mml:mo>+</mml:mo><mml:mstyle displaystyle="true" scriptlevel="0"><mml:munderover><mml:mo>∑</mml:mo><mml:mrow><mml:mi>d</mml:mi><mml:mo>=</mml:mo><mml:mo>−</mml:mo><mml:mi>a</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>b</mml:mi><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:munderover><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>v</mml:mi><mml:mo>∈</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mrow><mml:mtext mathvariant="monospace">R</mml:mtext></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mtext mathvariant="monospace">H</mml:mtext></mml:mrow><mml:mo fence="false" stretchy="false">}</mml:mo></mml:mrow></mml:munder><mml:msubsup><mml:mi>β</mml:mi><mml:mrow><mml:mi>v</mml:mi><mml:mi>d</mml:mi></mml:mrow><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">shape</mml:mtext></mml:mrow></mml:mrow></mml:msubsup><mml:mo>⋅</mml:mo><mml:msup><mml:mrow><mml:mtext mathvariant="sans-serif">shape</mml:mtext></mml:mrow><mml:mrow><mml:mi>v</mml:mi></mml:mrow></mml:msup><mml:mo stretchy="false">(</mml:mo><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mtext mathvariant="sans-serif">seq</mml:mtext></mml:mrow><mml:mrow><mml:mtext>expd</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:mstyle></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula></p><fig id="app2fig3" position="float"><label>Appendix 2—figure 3.</label><caption><title>Summary of DNA-shape parameters.</title><p>Let <inline-formula><mml:math id="inf393"><mml:mrow><mml:mi>a</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="inf394"><mml:mrow><mml:mi>b</mml:mi><mml:mo>=</mml:mo><mml:mn>2</mml:mn></mml:mrow></mml:math></inline-formula>. The 3-nucleotide trimming sequence window is shown in the orange box and the trimming site is shown by the vertical orange line. The 7-nucleotide expanded trimming sequence window is represented by the pink boxes in addition to the original trimming sequence window orange box. An arbitrary gene sequence is highlighted in gray and the two possible P-nucleotides are highlighted in purple. (<bold>A</bold>) For <inline-formula><mml:math id="inf395"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>5</mml:mn></mml:mrow></mml:math></inline-formula>, both the 7-nucleotide expanded trimming sequence window and the original 3-nucleotide trimming sequence window will not contain P-nucleotides. (<bold>B</bold>) For <inline-formula><mml:math id="inf396"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>3</mml:mn></mml:mrow></mml:math></inline-formula>, the 7-nucleotide expanded trimming sequence window will contain one P-nucleotide and the original 3-nucleotide trimming sequence window will not contain P-nucleotides. (<bold>C</bold>) For <inline-formula><mml:math id="inf397"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:math></inline-formula>, the 7-nucleotide expanded trimming sequence window will be ‘incomplete’ (contain less than 7 nucleotides), and thus, will be invalid for estimating DNA-shape for the nucleotides within the original trimming sequence window.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-app2-fig3-v1.tif"/></fig></sec><sec sec-type="appendix" id="s9-4"><title>Length</title><p>We can think of the trimming amount <inline-formula><mml:math id="inf398"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> as a measure of the sequence-independent length from the end of the gene for each gene and trimming site, and define <inline-formula><mml:math id="inf399"><mml:msup><mml:mi mathsize="90%">β</mml:mi><mml:mtext mathsize="90%">ldiSt</mml:mtext></mml:msup></mml:math></inline-formula> to be a <italic>length</italic> model coefficient. As such, we can define a length covariate function for each trimming site <inline-formula><mml:math id="inf400"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula><disp-formula id="equ33"><label>(20)</label><mml:math id="m33"><mml:mrow><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:mi>σ</mml:mi><mml:mo>;</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">ldist</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:msup><mml:mi>β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">ldist</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>⋅</mml:mo><mml:mi>n</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p></sec></sec></app><app id="appendix-3"><title>Appendix 3</title><sec sec-type="appendix" id="s10"><title>Extended model validation methods</title><sec sec-type="appendix" id="s10-1"><title>Calculating the expected per-sequence conditional log loss across the full V-gene training data set</title><p>With the full V-gene training set, we can train each model of interest as described above in (<xref ref-type="disp-formula" rid="equ17">Equation 10</xref>) to obtain a trained model <inline-formula><mml:math id="inf401"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula>. After this model fitting, we can calculate the expected per-sequence conditional log loss of the model, <inline-formula><mml:math id="inf402"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula>, for the full V-gene training data set, <inline-formula><mml:math id="inf403"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">V</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, using the procedure described above in (<xref ref-type="disp-formula" rid="equ18">Equation 11</xref>). Here, we use the full V-gene data set as both the training data set and the testing data set. Models that have lower expected per-sequence conditional log loss on the V-gene training data set will indicate that the model has a better fit. Model evaluation using held-out testing sets, as described below, is required for evaluating model generalizability.</p></sec><sec sec-type="appendix" id="s10-2"><title>Calculating the expected per-sequence conditional log loss across held-out samples</title><p>Because our goal is to learn a model that is gene-agnostic, we will evaluate the performance and generalizability of each model by calculating the expected per-sequence conditional log loss using many different held-out data sets. A model that is generalizable across many genes will perform well and have a good fit across all held-out samples despite their varying gene compositions. To test this, we will create each random, held-out sample from the original training data set by cluster-sampling all observations from V-gene allele groups, <inline-formula><mml:math id="inf404"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula>, uniformly at random. We will refer to each random, held-out sample as the ‘held-out testing set.’ Let <inline-formula><mml:math id="inf405"><mml:mi mathsize="90%">G</mml:mi></mml:math></inline-formula> be the total number of unique V-gene allele groups in the original data set. Let <inline-formula><mml:math id="inf406"><mml:mrow><mml:msub><mml:mi mathsize="90%">G</mml:mi><mml:mtext mathsize="90%">test</mml:mtext></mml:msub><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mtext mathsize="90%">Round</mml:mtext><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mn mathsize="90%">0.3</mml:mn><mml:mo mathsize="90%" stretchy="false">⋅</mml:mo><mml:mi mathsize="90%">G</mml:mi></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:mrow></mml:math></inline-formula> be an integer which represents the number of unique genes included in each ‘held-out testing set.’ As such, we can sample each gene <inline-formula><mml:math id="inf407"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> with probability<disp-formula id="equ34"><mml:math id="m34"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>sample</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi>V</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mi>G</mml:mi></mml:mfrac></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>such that the probability of each ‘held-out testing set’ H is given by<disp-formula id="equ35"><label>(21)</label><mml:math id="m35"><mml:mrow><mml:mtable columnalign="left left" rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:munderover><mml:mo>∏</mml:mo><mml:mrow><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mtext>test</mml:mtext></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mtext>sample</mml:mtext></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="thinmathspace"/><mml:mspace width="thinmathspace"/><mml:mspace width="thinmathspace"/><mml:mo>=</mml:mo><mml:mstyle displaystyle="true" scriptlevel="0"><mml:munderover><mml:mo>∏</mml:mo><mml:mrow><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mtext>test</mml:mtext></mml:mrow></mml:msub></mml:mrow></mml:munderover><mml:mfrac><mml:mn>1</mml:mn><mml:mi>G</mml:mi></mml:mfrac><mml:mo>.</mml:mo></mml:mstyle></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula></p><p>The remaining genes not sampled as part of the ‘held-out testing set’ <inline-formula><mml:math id="inf408"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> will compose the ‘training set’ <inline-formula><mml:math id="inf409"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">T</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>. Using this ‘training set,’ we can train each model of interest as described above in (<xref ref-type="disp-formula" rid="equ17">Equation 10</xref>). After this model training, we can calculate the expected per-sequence conditional log loss of the model, <inline-formula><mml:math id="inf410"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula>, for the ‘held-out testing set,’ <inline-formula><mml:math id="inf411"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, as described above in (<xref ref-type="disp-formula" rid="equ18">Equation 11</xref>). To achieve an unbiased estimate of the model performance, we will repeat the above procedure across 20 unique held-out testing sets and calculate the expected per-sequence conditional log loss across all samples. As such, the expected per-sequence conditional log loss across these random samples is given by<disp-formula id="equ36"><label>(22)</label><mml:math id="m36"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>E</mml:mi><mml:mo stretchy="false">[</mml:mo><mml:mi>ℓ</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi mathvariant="script">M</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">]</mml:mo><mml:mo>=</mml:mo><mml:munderover><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>20</mml:mn></mml:mrow></mml:munderover><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mo>⋅</mml:mo><mml:mi>ℓ</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi mathvariant="script">M</mml:mi></mml:mrow><mml:mo>∣</mml:mo><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:mstyle></mml:mrow></mml:math></disp-formula></p><p>We use the same, unique held-out testing sets to calculate the expected per-sequence conditional log loss of each model of interest, and thus, we can compare model fit and generalizability by directly comparing the expected per-sequence conditional log loss of each model. Models that have lower expected per-sequence conditional log loss will indicate that the model is a better fit and is more generalizable across genes.</p></sec><sec sec-type="appendix" id="s10-3"><title>Calculating the expected per-sequence conditional log loss across held-out samples of the ‘most-different’ V-genes</title><p>While the previously described procedure for evaluating the expected per-sequence conditional log loss across held-out samples of the V-gene data set provided a metric for evaluating model generalizability across different gene sets, we were interested in evaluating model performance for groups of genes which were considered ‘most-different’ sequence-wise. Many of the germline V-gene sequences are quite similar, however, there are subgroups of these sequences which share unique sequence traits. We can characterize these ‘most-different’ V-genes by either using only the ‘terminal’ V-gene sequences (e.g. that last 24 nucleotides of each sequence which is directly parameterized in the models) or using the entire V-gene sequences.</p><p>To define the ‘most-different’ V-gene allele group using the ‘terminal‘ V-gene sequences, we first calculate the pairwise hamming distance between each gene-allele-group pair. We then use hierarchical clustering to cluster V-gene allele groups based on their pairwise hamming distances (<xref ref-type="fig" rid="app3fig1">Appendix 3—figure 1A</xref>). The cluster that has the smallest average pairwise hamming distance within the cluster and the largest average pairwise hamming distance outside of the cluster is defined to be the ‘most-different’ V-gene-allele-group cluster. To define the ‘most-different’ V-gene allele group using the entire V-gene sequences, we first align all gene sequences using the DECIPHER package in R. Using these aligned sequences, we can then proceed with the same procedure as described for the ‘terminal’ V-gene sequences to define the ‘most-different’ V-gene allele group (<xref ref-type="fig" rid="app3fig1">Appendix 3—figure 1B</xref>).</p><p>Once we have defined a cluster of the ‘most-different’ V-gene allele groups, using either the ‘terminal’ V-gene sequences or the full sequences, we can define a held-out testing data set <inline-formula><mml:math id="inf412"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> containing all data observations from the V-gene allele groups within this ‘most-different’ V-gene-allele-group cluster. All data observations from the remaining gene allele groups that were not defined to be part of the ‘most-different’ cluster will compose the ‘training set’ <inline-formula><mml:math id="inf413"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">T</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>. Using this ‘training set,’ we can train each model of interest as described above in (<xref ref-type="disp-formula" rid="equ17">Equation 10</xref>). After this model training, we can calculate the expected per-sequence conditional log loss of the model, <inline-formula><mml:math id="inf414"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula>, for the ‘held-out testing set,’ <inline-formula><mml:math id="inf415"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">H</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, as described above in (<xref ref-type="disp-formula" rid="equ18">Equation 11</xref>). Models that have lower expected per-sequence conditional log loss will indicate better fit and generalizability across even the ‘most-different’ genes. We can repeat this process for other V-gene-allele-group clusters (e.g. the ‘second-most-different’ V-gene-allele-group cluster) as desired.</p><fig id="app3fig1" position="float"><label>Appendix 3—figure 1.</label><caption><title>Un-rooted trees of ‘terminal‘ V-gene sequences (<bold>A</bold>) and full-length V-gene sequences (<bold>B</bold>) derived from hierarchical clustering.</title><p>Tips are colored according to cluster membership. The tips corresponding to the ‘most-different’ group within each tree are colored in orange.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-app3-fig1-v1.tif"/></fig></sec><sec sec-type="appendix" id="s10-4"><title>Calculating the expected per-sequence conditional log loss across the full J-gene data set</title><p>With the full V-gene training set, we can train each model of interest as described above in (<xref ref-type="disp-formula" rid="equ17">Equation 10</xref>) to obtain a trained model <inline-formula><mml:math id="inf416"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula>. After this model fitting, we can calculate the expected per-sequence conditional log loss of the model, <inline-formula><mml:math id="inf417"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula>, for the full J-gene training data set, <inline-formula><mml:math id="inf418"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">J</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, using the procedure described above in (<xref ref-type="disp-formula" rid="equ18">Equation 11</xref>). Here, we use the full V-gene data set as the training data set and the full J-gene data set as the testing data set. Models that have lower expected per-sequence conditional log loss on the J-gene data set will indicate that the model is a better fit and is more generalizable.</p></sec><sec sec-type="appendix" id="s10-5"><title>Evaluating TCRβ V-gene trimming models using the expected per-sequence conditional log loss across testing data sets</title><p>To validate the performance of each model, we worked with TCRα- and TCRβ-immunosequencing data representing 150 individuals, TCRγ-immunosequencing data representing 23 individuals, and IGH-immunosequencing data representing 9 individuals from three independent validation cohorts (described above). With these data, we used the model coefficients from the previous TCRβ V-gene training run (‘frozen’ in git commit 093610a on our repository) and then compute the expected per-sequence conditional log loss of the model using each independent validation data set of interest. Models that have low expected per-sequence conditional log loss across all testing data sets will indicate that the model is more generalizable and less overfit to the training data. We validated each model using V- and J-gene sequences separately.</p></sec></sec></app><app id="appendix-4"><title>Appendix 4</title><sec sec-type="appendix" id="s11"><title>Extended experimental analyses</title><sec sec-type="appendix" id="s11-1"><title>Exploring the gene specificity of the ‘trimming motif’</title><p>To evaluate the specificity of the <italic>motif</italic> coefficients across different genes, we can compare the per-gene model predictions for the <italic>motif</italic> and <italic>base-count beyond</italic> model to a model that only contains <italic>base-count beyond</italic> parameters. To do this, we first use the entire V-gene data set <inline-formula><mml:math id="inf419"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">V</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula> to train both the <italic>motif</italic> and <italic>base-count beyond</italic> model as before in (<xref ref-type="disp-formula" rid="equ17">Equation 10</xref>) and a model that contains only <italic>base-count beyond</italic> parameters (and no motif parameters). We can then use these models to predict the probability of trimming each possible trimming amount, <inline-formula><mml:math id="inf420"><mml:mrow><mml:mn mathsize="90%">2</mml:mn><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">≤</mml:mo><mml:mn mathsize="90%">14</mml:mn></mml:mrow></mml:math></inline-formula>, for each gene-allele-group sequence <inline-formula><mml:math id="inf421"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula>. For each of these models, we can then calculate the per-gene root mean squared error, <inline-formula><mml:math id="inf422"><mml:mi mathsize="90%">RMSE</mml:mi></mml:math></inline-formula>, for each gene <inline-formula><mml:math id="inf423"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> such that<disp-formula id="equ37"><label>(23)</label><mml:math id="m37"><mml:mrow><mml:mrow><mml:mi mathsize="90%">RMSE</mml:mi><mml:mo>⁡</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mtext mathsize="90%">V</mml:mtext><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:msqrt><mml:mfrac><mml:mrow><mml:mstyle displaystyle="true"><mml:munderover><mml:mo largeop="true" mathsize="90%" movablelimits="false" stretchy="false" symmetric="true">∑</mml:mo><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mi mathsize="90%">I</mml:mi></mml:munderover></mml:mstyle><mml:mrow><mml:mstyle displaystyle="true"><mml:munderover><mml:mo largeop="true" mathsize="90%" movablelimits="false" stretchy="false" symmetric="true">∑</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow><mml:mn mathsize="90%">14</mml:mn></mml:munderover></mml:mstyle><mml:msup><mml:mrow><mml:mo maxsize="120%" minsize="120%">(</mml:mo><mml:mrow><mml:mrow><mml:msub><mml:mi mathsize="90%">P</mml:mi><mml:mtext mathsize="90%">emp</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo lspace="2.5pt" mathsize="90%" rspace="2.5pt" stretchy="false">∣</mml:mo><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">i</mml:mi></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mrow><mml:mi mathsize="90%">P</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo lspace="2.5pt" mathsize="90%" rspace="2.5pt" stretchy="false">∣</mml:mo><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:mrow><mml:mo maxsize="120%" minsize="120%">)</mml:mo></mml:mrow><mml:mn mathsize="90%">2</mml:mn></mml:msup></mml:mrow></mml:mrow><mml:mrow><mml:mo fence="true" maxsize="90%" minsize="90%">|</mml:mo><mml:mi mathsize="90%">I</mml:mi><mml:mo fence="true" maxsize="90%" minsize="90%">|</mml:mo></mml:mrow></mml:mfrac></mml:msqrt></mml:mrow></mml:math></disp-formula></p><p>where <inline-formula><mml:math id="inf424"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula> is a model trained using the V-gene training data set <inline-formula><mml:math id="inf425"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mtext mathvariant="bold">V</mml:mtext></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf426"><mml:mi mathsize="90%">I</mml:mi></mml:math></inline-formula> is the set of all individuals in the data set, <inline-formula><mml:math id="inf427"><mml:mrow><mml:mo fence="true" maxsize="90%" minsize="90%">|</mml:mo><mml:mi mathsize="90%">I</mml:mi><mml:mo fence="true" maxsize="90%" minsize="90%">|</mml:mo></mml:mrow></mml:math></inline-formula> is the length of the set of individuals <inline-formula><mml:math id="inf428"><mml:mi mathsize="90%">I</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="inf429"><mml:mrow><mml:msub><mml:mi mathsize="90%">P</mml:mi><mml:mtext mathsize="90%">emp</mml:mtext></mml:msub><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo lspace="2.5pt" mathsize="90%" rspace="2.5pt" stretchy="false">∣</mml:mo><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%">i</mml:mi></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> is the empirical conditional PDF given by (<xref ref-type="disp-formula" rid="equ1">Equation 1</xref>) for trimming length <inline-formula><mml:math id="inf430"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula>, gene <inline-formula><mml:math id="inf431"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula>, and individual <inline-formula><mml:math id="inf432"><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo mathsize="90%" stretchy="false">∈</mml:mo><mml:mi mathsize="90%">I</mml:mi></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="inf433"><mml:mrow><mml:mi mathsize="90%">P</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%">n</mml:mi><mml:mo lspace="2.5pt" mathsize="90%" rspace="2.5pt" stretchy="false">∣</mml:mo><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">;</mml:mo><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:mrow></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> is the predicted trimming probability from a specified model <inline-formula><mml:math id="inf434"><mml:mi class="ltx_font_mathcaligraphic" mathsize="90%">ℳ</mml:mi></mml:math></inline-formula>. We can then compare this per-gene root mean squared error for the model trained using both <italic>motif</italic> and <italic>base-count beyond</italic> parameters with a model trained using just <italic>base-count beyond</italic> parameters.</p></sec><sec sec-type="appendix" id="s11-2"><title>Sensitivity analysis for hairpin nick position</title><p>For our modeling, we assume that the initial hairpin nick occurs at the +2 position and will create two P-nucleotides at the end of the 5’-to-3’ gene sequence. Assuming a different hairpin nick position would incorporate a different number of P-nucleotides at the end of the gene sequence (<xref ref-type="fig" rid="app4fig1">Appendix 4—figure 1</xref>). While the hairpins are assumed to be nicked at the +2 position most frequently (<xref ref-type="bibr" rid="bib29">Ma et al., 2002</xref>; <xref ref-type="bibr" rid="bib27">Lu et al., 2007</xref>), we wanted to test the sensitivity of our models to this hairpin nick position assumption. To do this, we assumed each of the other possible hairpin opening positions (e.g. −2,–1, 0,+1,+3) one-at-a-time and appended the appropriate number of associated of P-nucleotides given the assumed hairpin nick position to the 3’-end of each V-gene-allele-group sequence in the data set. With each of these hairpin position data sets, we re-trained the <italic>motif</italic> and <italic>base-count beyond</italic> model as before in (<xref ref-type="disp-formula" rid="equ17">Equation 10</xref>) and calculate the expected per-sequence conditional log loss of the model using (<xref ref-type="disp-formula" rid="equ18">Equation 11</xref>). We can compare these expected per-sequence conditional log losses to evaluate the sensitivity of the model to the +2 hairpin nick assumption.</p><fig id="app4fig1" position="float"><label>Appendix 4—figure 1.</label><caption><title>An arbitrary DNA hairpin can be nicked opened at various positions near the hairpin (left figure).</title><p>Hairpin nick position 0 refers to a nick at the tip of the hairpin, position –1 refers to a nick before the last nucleotide on the 5’ strand, position +1 refers to a nick before the last nucleotide on the 3’ strand, etc. The resulting 5’-to-3’ sequences from the various nick positions for the arbitrary gene sequence are shown on the right. Nucleotides originating from the 5’ strand of the DNA hairpin are highlighted in gray and P-nucleotides (originating from the 3’ strand of the DNA hairpin) are highlighted in purple. The various hairpin nick positions lead to 5’-to-3’ sequences that contain different amounts of P-nucleotides. Hairpin nick positions <italic>gt</italic><sub>0</sub> lead to 5’-to-3’ sequences that contain P-nucleotides, nick positions equal to zero lead to 5’-to-3’ sequences without P-nucleotides, and nick positions &lt; 0 lead to 5’-to-3’ sequences without P-nucleotides and with portions of the original 5’ DNA hairpin strand removed.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-85145-app4-fig1-v1.tif"/></fig></sec><sec sec-type="appendix" id="s11-3"><title>Evaluating the weight of the <italic>1×2 motif</italic> and <italic>two-side base-count beyond</italic> model terms across data sets</title><p>For each testing data set, we can measure the weight of the <italic>1×2 motif</italic> and <italic>two-side base-count beyond</italic> model terms within the full <italic>1×2 motif + two-side base-count beyond</italic> model. Recall that we trained the full <italic>1×2 motif + two-side base-count beyond</italic> model using the model covariate function given by (<xref ref-type="disp-formula" rid="equ2">Equation 2</xref>)<disp-formula id="equ38"><mml:math id="m38"><mml:mrow><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>+</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></disp-formula></p><p>where <inline-formula><mml:math id="inf435"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> represents the number of trimmed nucleotides, <inline-formula><mml:math id="inf436"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math></inline-formula> represents the V-gene-allele-group sequence, <inline-formula><mml:math id="inf437"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msup></mml:math></inline-formula> represents <italic>motif</italic>-specific parameter coefficients, <inline-formula><mml:math id="inf438"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">AT</mml:mtext></mml:msup></mml:math></inline-formula> and <inline-formula><mml:math id="inf439"><mml:msup><mml:mi mathsize="90%" mathvariant="bold-italic">β</mml:mi><mml:mtext mathsize="90%">GC</mml:mtext></mml:msup></mml:math></inline-formula> represent <italic>base-count-beyond</italic>-specific parameter coefficients, <inline-formula><mml:math id="inf440"><mml:mi mathsize="90%">a</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf441"><mml:mi mathsize="90%">b</mml:mi></mml:math></inline-formula> are non-negative integer values that represent the number of nucleotides 5’ and 3’ of the trimming site, respectively, that are included in the ‘trimming motif, and <inline-formula><mml:math id="inf442"><mml:mi mathsize="90%">c</mml:mi></mml:math></inline-formula> represents the number of nucleotides 5’ of the trimming site to be included in the base-count. As such, for each training data set, we can use the inferred coefficients, <inline-formula><mml:math id="inf443"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, <inline-formula><mml:math id="inf444"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, and <inline-formula><mml:math id="inf445"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math></inline-formula>, from a previous training run and define a new two-parameter model containing a scale coefficient for the <italic>1×2 motif</italic> terms and a second scale coefficient for the <italic>two-side base-count beyond</italic> terms. The covariate function for this new model is given by<disp-formula id="equ39"><mml:math id="m39"><mml:mrow><mml:mtable columnalign="left left" rowspacing="4pt" columnspacing="1em"><mml:mtr><mml:mtd><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub><mml:mo>;</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mover><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>,</mml:mo><mml:msub><mml:mi>α</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>α</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">count</mml:mtext></mml:mrow></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>:=</mml:mo><mml:msub><mml:mi>α</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msub><mml:mo>⋅</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">motif</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="2em"/><mml:mspace width="1em"/><mml:mo>+</mml:mo><mml:msub><mml:mi>α</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">count</mml:mtext></mml:mrow></mml:mrow></mml:msub><mml:mo>⋅</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>σ</mml:mi><mml:mrow><mml:mi mathvariant="normal">V</mml:mi></mml:mrow></mml:msub><mml:mo>;</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">AT</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mrow><mml:mtext mathvariant="monospace">GC</mml:mtext></mml:mrow></mml:mrow></mml:msup><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:mrow></mml:math></disp-formula></p><p>where <inline-formula><mml:math id="inf446"><mml:msub><mml:mi mathsize="90%">α</mml:mi><mml:mtext mathsize="90%">mtif</mml:mtext></mml:msub></mml:math></inline-formula> is the scale coefficient for the <italic>1×2 motif</italic> terms and <inline-formula><mml:math id="inf447"><mml:msub><mml:mi mathsize="90%">α</mml:mi><mml:mtext mathsize="90%">Cunt</mml:mtext></mml:msub></mml:math></inline-formula> is the scale coefficient for the <italic>two-side base-count beyond</italic> terms. We can then train this new model as described previously for each data set of interest and compare the inferred scale coefficients.</p></sec></sec></app></app-group></back><sub-article article-type="editor-report" id="sa0"><front-stub><article-id pub-id-type="doi">10.7554/eLife.85145.sa0</article-id><title-group><article-title>Editor's evaluation</article-title></title-group><contrib-group><contrib contrib-type="author"><name><surname>Graw</surname><given-names>Frederik</given-names></name><role specific-use="editor">Reviewing Editor</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/00f7hpc57</institution-id><institution>Friedrich-Alexander-University Erlangen-Nürnberg</institution></institution-wrap><country>Germany</country></aff></contrib></contrib-group><related-object id="sa0ro1" object-id-type="id" object-id="10.1101/2022.12.08.519635" link-type="continued-by" xlink:href="https://sciety.org/articles/activity/10.1101/2022.12.08.519635"/></front-stub><body><p>Russell et al. study and reveal compelling evidence for potential sequence-based factors that may drive VDJ trimming, a mechanism involved in VDJ recombination that shapes adaptive immune repertoire generation. The work is based on a rigorous statistical comparison of logistic regression models to reveal the role and function of cutting enzymes in shaping T- and B-cell receptor diversity which could provide fundamental new insights into these processes.</p></body></sub-article><sub-article article-type="decision-letter" id="sa1"><front-stub><article-id pub-id-type="doi">10.7554/eLife.85145.sa1</article-id><title-group><article-title>Decision letter</article-title></title-group><contrib-group content-type="section"><contrib contrib-type="editor"><name><surname>Graw</surname><given-names>Frederik</given-names></name><role>Reviewing Editor</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/00f7hpc57</institution-id><institution>Friedrich-Alexander-University Erlangen-Nürnberg</institution></institution-wrap><country>Germany</country></aff></contrib></contrib-group><contrib-group><contrib contrib-type="reviewer"><name><surname>Mora</surname><given-names>Thierry</given-names></name><role>Reviewer</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/02feahw73</institution-id><institution>CNRS</institution></institution-wrap><country>France</country></aff></contrib></contrib-group></front-stub><body><boxed-text id="sa2-box1"><p>Our editorial process produces two outputs: (i) <ext-link ext-link-type="uri" xlink:href="https://sciety.org/articles/activity/10.1101/2022.12.08.519635">public reviews</ext-link> designed to be posted alongside <ext-link ext-link-type="uri" xlink:href="https://www.biorxiv.org/content/10.1101/2022.12.08.519635v1">the preprint</ext-link> for the benefit of readers; (ii) feedback on the manuscript for the authors, including requests for revisions, shown below. We also include an acceptance summary that explains what the editors found interesting or important about the work.</p></boxed-text><p><bold>Decision letter after peer review:</bold></p><p>Thank you for submitting your article &quot;Statistical inference reveals the role of length, breathing, and nucleotide identity in V(D)J nucleotide trimming&quot; for consideration by <italic>eLife</italic>. Your article has been reviewed by 2 peer reviewers, and the evaluation has been overseen by a Reviewing Editor and Betty Diamond as the Senior Editor. The following individual involved in the review of your submission has agreed to reveal their identity: Thierry Mora (Reviewer #2).</p><p>The reviewers have discussed their reviews with one another, and the Reviewing Editor has drafted this to help you prepare a revised submission.</p><p>Your manuscript addresses an important topic and interesting approach to foster our understanding of processes relevant to immune repertoire generation. However, there were several aspects identified during the review process that would require major revisions to support or adapt the claims made. In particular, this affects the following essential revisions:</p><p>Essential revisions:</p><p>1) A rephrasing or additional support for the claim to provide mechanistic insights which seem to be overstated. Based on the fact that only statistical models are used, there is currently no real indication of mechanistic or quantitative insight into the involved processes.</p><p>2) An extensive restructuring and rewriting of the manuscript to clarify the focus of the paper (see comments of reviewer 3, e.g. regarding the extended methods section)</p><p>3) Improved explanation of the model, as well as several details concerning the statistical analyses</p><p><italic>Reviewer #1 (Recommendations for the authors):</italic></p><p>Really great work and very interesting. My recommendations are mostly questions and some suggestions.</p><p>– The text is really dense (especially when you talk about and compare all the different models tested). Can that somehow be shortened and made more concise?</p><p>– Maybe it's mentioned somewhere, but how many sequences were in train and test datasets? Have you performed subsampling studies to understand at what sequence number your models become stable?</p><p>– You only use unselected sequences. If you had used productive sequences, would the results have been dramatically different?</p><p>– You are somehow splitting the datasets by V gene distance. How would the results have looked like with a random train/test split?</p><p>– Figure 3a, 4a what's the statistical significance between curves? I rarely see error bars (if at all) in any of the figures. To what extent are your results dependent on just sampling once?</p><p>– You use the term mechanism a lot. The title is also quite strongly worded (&quot;reveal role of&quot;). To what extent is this justified given that you &quot;only&quot; perform statistical modeling and no experimental investigations? To what extent are you sure that your models are really a reflection of biology (causal)?</p><p><italic>Reviewer #2 (Recommendations for the authors):</italic></p><p>DNA breathing: At the end of the day, what is used in the model is the GC content on both sides of the cut site. While I recognize this has been shown to be associated with breathing, I think the authors should remain more factual about their conclusions, and stick to the observation that GC content is predictive in the abstract and introduction, writing about breathing only as a possible interpretation rather than a solid result. It would be both more precise and clearer – I struggled to understand what the paper actually showed until I reached the bottom of page 5, where the proxy for breathing is finally explained.</p><p>The model definitions are quite complex, and a cartoon of the DNA sequence, with the overhang, cut site, etc, would be very much needed to better explain the geometrical configuration of the model and the notations, as in the first Figure. It could help answer some of the following questions which confused me: which part of the sequence is subject to the PWM? Which part of the sequence is included in the sequence breathing counts on the 3' and 5' sides? Why are there 3 (and not 4, or 2) parameters in the sequence-breathing part of the model? Relatedly, why not combine distance with breathing parameters (i.e. are they redundant)? When does the 3' overhang start (we learn later it's at +2)? What is DNA shape? From what reference point is the length of deletion n counted? I'm aware there are such cartoons in the Methods, but they should be shown earlier and combined in a clearer manner, to display the definitions of the models and notations directly on the cartoon rather than painstakingly explained in the captions.</p><p>Methods: The methods are way too long for what they aim to explain: 25 pages, with a 5-page long table of notations! I would strongly recommend simplifying them to make them more readable. I will readily admit that I didn't comb through them with as much care as I would have liked, partly for lack of time, partly because I didn't feel I would learn much more from them than I already understood from the main text. I suspect very few readers will. The paper would be greatly improved by reducing its length, but also by providing key details and explanations in the Results section, to make it more self-contained.</p><p>Training set: From the methods, it appears that the Emerson dataset is first processed by IGoR to sample from the posterior distribution of scenarios. This non-obvious but essential step should be made clear in the description of the training data in the Results section.</p><p>I was also wondering why the authors didn't directly take the V-gene-dependent deletion probability distribution provided by IGoR, which (at first sight) should be strictly equivalent to sampling from that posterior distribution while being much easier. If you restrict to a single V gene, sampling scenarios and just sampling from the IGoR-provided distribution of deletion lengths for that V gene are exactly the same thing, by definition of the EM algorithm. Could you please explain that choice?</p></body></sub-article><sub-article article-type="reply" id="sa2"><front-stub><article-id pub-id-type="doi">10.7554/eLife.85145.sa2</article-id><title-group><article-title>Author response</article-title></title-group></front-stub><body><disp-quote content-type="editor-comment"><p>Essential revisions:</p><p>1) A rephrasing or additional support for the claim to provide mechanistic insights which seem to be overstated. Based on the fact that only statistical models are used, there is currently no real indication of mechanistic or quantitative insight into the involved processes.</p></disp-quote><p>We have rephrased portions of the manuscript to emphasize that while the sequence-level features we have included in our models are mechanistically interpretable and provide quantitative statistical evidence regarding the trimming mechanism, they do not directly imply causation.</p><disp-quote content-type="editor-comment"><p>2) An extensive restructuring and rewriting of the manuscript to clarify the focus of the paper (see comments of reviewer 3, e.g. regarding the extended methods section)</p></disp-quote><p>As suggested by reviewer 3, we have substantially condensed and simplified the Methods section and added important methods-related details to the Results section.</p><disp-quote content-type="editor-comment"><p>3) Improved explanation of the model, as well as several details concerning the statistical analyses</p></disp-quote><p>We have added a figure to more clearly describe the geometrical configuration of the model features.</p><disp-quote content-type="editor-comment"><p>Reviewer #1 (Recommendations for the authors):</p><p>Really great work and very interesting. My recommendations are mostly questions and some suggestions.</p><p>– The text is really dense (especially when you talk about and compare all the different models tested). Can that somehow be shortened and made more concise?</p></disp-quote><p>We agree that the text is dense within the &quot;Model set-up overview&quot; section of the Results. We have created a new figure (Figure 1) to describe the geometrical configuration of the features included in each model. We hope that this cartoon will help clarify the model definitions within this section. We have also substantially shortened the main Methods section in an effort to make it more readable. Otherwise, we feel that the text detail is required to fully describe the model set-up and results.</p><disp-quote content-type="editor-comment"><p>– Maybe it's mentioned somewhere, but how many sequences were in train and test datasets? Have you performed subsampling studies to understand at what sequence number your models become stable?</p></disp-quote><p>This is a great suggestion! We have included a new supplementary figure (Figure 4 —figure supplement 7) showing how the magnitudes of the inferred model coefficients vary when sub-sampling the training data set. We find that the coefficients are quite stable until the size of the training data set reaches around 82,800 sequences or below. Because the full training data set used for all model training includes 21,193,153 sequences, we don't feel that our conclusions are dependent on the size of the training data set. We have added the following sentence to highlight this finding in the Results (lines 252-254):</p><p>&quot;We noted minimal variation in the magnitude of each inferred coefficient even when changing the number of sequences included in the training data set.&quot;</p><p>We also agree that including the sequence counts for each data set would be valuable. We have now added the following sentences to the Methods section:</p><p>For the training data set (lines 515-520):</p><p>&quot;After these processing and filtering steps, we used V-gene trimming length distributions from 21,193,153 non-productive sequences for all model training. To test each trained model, we used V-gene trimming length distributions from the remaining 107,121,841 productive sequences. From this same data set, we also used J-gene trimming length distributions from 107,255,406 productive sequences and 20,204,801 non-productive sequences to test each model.&quot;</p><p>For the independent TRA and TRB testing data sets (lines 528-534):</p><p>&quot;From the TCRalpha data set, we used V-gene trimming length distributions from 123,496 non-productive sequences and 862,096 productive sequences and J-gene trimming length distributions from 141,451 non-productive sequences and 1,101,114 productive sequences to test each model. From the TCRbeta data set, we used V-gene trimming length distributions from 64,738 non-productive sequences and 1,435,153 productive sequences and J-gene trimming length distributions from 59,608 non-productive sequences and 1,496,953 productive sequences to test each model.&quot;</p><p>For the TRG testing data set (lines 538-541):</p><p>&quot;We used V-gene trimming length distributions from 2,403,293 non-productive sequences and 1,002,662 productive sequences and J-gene trimming length distributions from 568,824 non-productive sequences and 250,493 productive sequences to test each model.&quot;</p><p>For the IGH testing data sets (lines 556-559):</p><p>&quot;From these data sets, we used V-gene trimming length distributions from 160,714 non-productive sequences and 32,245 productive sequences and J-gene trimming length distributions from 297,298 non-productive sequences and 74,884 productive sequences to test each model.&quot;</p><disp-quote content-type="editor-comment"><p>– You only use unselected sequences. If you had used productive sequences, would the results have been dramatically different?</p></disp-quote><p>This is a good question. To explore this, we trained a new &quot;motif + base-count-beyond&quot; model using only productive V-gene sequences from the same cohort of individuals as the non-productive V-gene training data set and found that the inferred coefficients were highly similar between the two models. We have added a section in the Results (lines 272-281) and a Supplementary Figure (Figure 3—figure supplement 6) to highlight this. While we have used productive V-gene and J-gene sequences to test each model trained using the non-productive V-gene training data set (as shown in Figure 6—figure supplement 2), we have not explored how a model trained using productive V-gene sequences performs across non-productive sequences. Given that the inferred coefficients were highly similar between the &quot;motif + base-count-beyond&quot; trained using non-productive V-gene sequences and the one trained using productive V-gene sequences, we would not expect the validation results to be substantially different.</p><disp-quote content-type="editor-comment"><p>– You are somehow splitting the datasets by V gene distance. How would the results have looked like with a random train/test split?</p></disp-quote><p>Thanks for raising this question. We have already evaluated each model using many random held-out subsets of the V-gene training data set. To clarify this, we have changed our wording to include the word &quot;random&quot; when describing these held-out subsets (i.e. Figure 2 plot and caption, line 202). Overall, we found that the expected per-sequence log loss for each model was slightly higher, but quite similar, for these random subsets compared to the log loss computed across the full training data set. These results are shown in the second x-axis entry of Figure 2.</p><disp-quote content-type="editor-comment"><p>– Figure 3a, 4a what's the statistical significance between curves? I rarely see error bars (if at all) in any of the figures. To what extent are your results dependent on just sampling once?</p></disp-quote><p>We have provided figures 4a and 5b (formerly 3a and 4b, which we assume the reviewer is referring to since 4a was a histogram) to allow readers to qualitatively compare the model-derived trimming distributions to empirical trimming distributions (from each individual in the training data set) for the most commonly used genes. Because our model does not provide error estimates, it is not obvious to us how we would quantify statistical significance between the model-derived trimming distributions and the empirical trimming distributions for each gene.</p><p>When evaluating the expected per-sequence log loss of each model across various data sets (as in Figure 2), most of the values are computed on a single sample (e.g. a cluster of genes defined to be &quot;most different&quot;, the full J-gene data set, etc.). However, since we have evaluated the loss of each model using many different held-out subsets of the training data set and various independent testing data sets, we feel confident that our results do not depend on just sampling once for each data set. As described in the previous suggestion, we have also calculated the loss of each model across many random, held-out subsets of the training data set. We have added a supplemental figure (Figure 2—figure supplement 1) to describe the variation in losses across the random, held-out subsets of the training data set for each model.</p><disp-quote content-type="editor-comment"><p>– You use the term mechanism a lot. The title is also quite strongly worded (&quot;reveal role of&quot;). To what extent is this justified given that you &quot;only&quot; perform statistical modeling and no experimental investigations? To what extent are you sure that your models are really a reflection of biology (causal)?</p></disp-quote><p>Thank you for your question. Many of the model features we have explored are inspired by previous experimental observations (i.e. certain DNA end configurations require sequence-breathing for Artemis nucleolytic action) or statistical modeling efforts (i.e. a 2x4 sequence motif is highly predictive of trimming probabilities). While our work may not directly identify mechanistic causation, the sequence-level features that we have included in our models are mechanistically interpretable and reveal quantitative statistical evidence regarding the trimming process. Additionally, because we are using statistical inference on high-throughput sequencing data from humans, in some ways, the inferences gained from our models are perhaps more a reflection of the true biological process in humans than experimental investigations using model organisms.</p><p>With that being said, we have adapted a sentence in the Discussion (lines 393-397) to highlight that our models are not causal in their design and cut back on our usage of the term &quot;mechanism&quot; throughout the manuscript (i.e. see lines 113, 194, etc.) We have also further emphasized that our models serve to quantify the effects of various sequence-level features in the trimming process rather than provide mechanistic causal evidence (see lines 232-234, 400, 438-439, etc.).</p><disp-quote content-type="editor-comment"><p>Reviewer #2 (Recommendations for the authors):</p><p>DNA breathing: At the end of the day, what is used in the model is the GC content on both sides of the cut site. While I recognize this has been shown to be associated with breathing, I think the authors should remain more factual about their conclusions, and stick to the observation that GC content is predictive in the abstract and introduction, writing about breathing only as a possible interpretation rather than a solid result. It would be both more precise and clearer – I struggled to understand what the paper actually showed until I reached the bottom of page 5, where the proxy for breathing is finally explained.</p></disp-quote><p>This is a good suggestion and we have changed our wording of the model terms from &quot;the capacity for sequence-breathing&quot; to &quot;the GC nucleotide content in both directions of the wider sequence&quot; throughout the manuscript (for example, see lines 21-26 and 118-124). For clarity, we now describe sequence-breathing as a possible interpretation of the GC nucleotide content model terms within the Abstract (lines 23-25) and Introduction (lines 118-120). We also added a sentence highlighting the previously-identified role of sequence-breathing in the trimming mechanism within the Introduction (lines 88-90) to add justification to our interpretations. We aren't aware of any other nucleotide-level determinants of sequence-breathing, but we're happy to hear of other approaches.</p><disp-quote content-type="editor-comment"><p>The model definitions are quite complex, and a cartoon of the DNA sequence, with the overhang, cut site, etc, would be very much needed to better explain the geometrical configuration of the model and the notations, as in the first Figure. It could help answer some of the following questions which confused me: which part of the sequence is subject to the PWM? Which part of the sequence is included in the sequence breathing counts on the 3' and 5' sides? Why are there 3 (and not 4, or 2) parameters in the sequence-breathing part of the model? Relatedly, why not combine distance with breathing parameters (i.e. are they redundant)? When does the 3' overhang start (we learn later it's at +2)? What is DNA shape? From what reference point is the length of deletion n counted? I'm aware there are such cartoons in the Methods, but they should be shown earlier and combined in a clearer manner, to display the definitions of the models and notations directly on the cartoon rather than painstakingly explained in the captions.</p></disp-quote><p>Thank you for this great suggestion! We have included a new figure (Figure 1) to describe the geometrical configuration of an example V-gene sequence and the features included in each model. We hope that this cartoon will answer most of the questions you have listed.</p><disp-quote content-type="editor-comment"><p>Methods: The methods are way too long for what they aim to explain: 25 pages, with a 5-page long table of notations! I would strongly recommend simplifying them to make them more readable. I will readily admit that I didn't comb through them with as much care as I would have liked, partly for lack of time, partly because I didn't feel I would learn much more from them than I already understood from the main text. I suspect very few readers will. The paper would be greatly improved by reducing its length, but also by providing key details and explanations in the Results section, to make it more self-contained.</p></disp-quote><p>We have reduced the length of the main Methods section to 7.5 pages and included additional details (i.e. the notation table) as appendices. We do feel that the full detail is important for readers wishing to fully understand and reproduce the results.</p><p>We have also moved some key methods-related details to the Results section (for example, IGoR details on lines 132-138). We hope that these changes will make the Methods more readable.</p><disp-quote content-type="editor-comment"><p>Training set: From the methods, it appears that the Emerson dataset is first processed by IGoR to sample from the posterior distribution of scenarios. This non-obvious but essential step should be made clear in the description of the training data in the Results section.</p></disp-quote><p>We have added the following sentences (lines 132-138 in the manuscript) to the Results section to clarify the methods used to annotate each sequence in the training data set:</p><p>&quot;V(D)J recombination scenarios were assigned to each sequence for each individual using the IGoR software which can learn unbiased V(D)J recombination statistics from immune sequence reads (Marcou et. al, Nature Communications 2018). Using these V(D)J recombination statistics, IGoR output a list of potential recombination scenarios with their corresponding likelihoods for each TCRb-chain sequence in the training data set. We annotated each sequence with a single V(D)J recombination scenario by sampling from these potential scenarios according to the posterior probability of each scenario (see Methods for further details).&quot;</p><disp-quote content-type="editor-comment"><p>I was also wondering why the authors didn't directly take the V-gene-dependent deletion probability distribution provided by IGoR, which (at first sight) should be strictly equivalent to sampling from that posterior distribution while being much easier. If you restrict to a single V gene, sampling scenarios and just sampling from the IGoR-provided distribution of deletion lengths for that V gene are exactly the same thing, by definition of the EM algorithm. Could you please explain that choice?</p></disp-quote><p>This is a great point! We chose the posterior-sampling approach for several reasons. First, this approach allowed us to consider all possible V-gene (and J-gene) annotations for each sequence. Also, because we were interested in training each model using V-gene sequences from the Emerson data set and validating each model using J-gene sequences from the same data set, sampling scenarios from the posterior distribution allowed us to simultaneously infer V-gene and J-gene trimming amounts in a single sequence annotation step. Lastly, while we began our analyses by annotating each sequence with the &quot;most-parsimonious&quot; scenario, to avoid possible biases introduced by that annotation approach, we chose to transition to a probabilistic annotation approach (using IGoR). Because our modeling pipeline was already built to intake a complete sequence annotation (including gene choices, trimming amounts, and insertions), we chose to sample scenarios from the posterior distribution produced by IGoR which outputs a similar data structure.</p></body></sub-article></article>