<!DOCTYPE article
PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD with MathML3 v1.3 20210610//EN" "JATS-archivearticle1-3-mathml3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.3" xml:lang="en" article-type="research-article"><?properties manuscript?><processing-meta base-tagset="archiving" mathml-version="3.0" table-model="xhtml" tagset-family="jats"><restricted-by>pmc</restricted-by></processing-meta><front><journal-meta><journal-id journal-id-type="nlm-journal-id">9604648</journal-id><journal-id journal-id-type="pubmed-jr-id">20305</journal-id><journal-id journal-id-type="nlm-ta">Nat Biotechnol</journal-id><journal-id journal-id-type="iso-abbrev">Nat Biotechnol</journal-id><journal-title-group><journal-title>Nature biotechnology</journal-title></journal-title-group><issn pub-type="ppub">1087-0156</issn><issn pub-type="epub">1546-1696</issn></journal-meta><article-meta><article-id pub-id-type="pmid">39394482</article-id><article-id pub-id-type="pmc">12439118</article-id><article-id pub-id-type="doi">10.1038/s41587-024-02422-w</article-id><article-id pub-id-type="manuscript">NIHMS2099604</article-id><article-categories><subj-group subj-group-type="heading"><subject>Article</subject></subj-group></article-categories><title-group><article-title>Model-directed generation of artificial CRISPR&#x02013;Cas13a guide RNA sequences improves nucleic acid detection</article-title></title-group><contrib-group><contrib contrib-type="author"><contrib-id contrib-id-type="orcid" authenticated="false">http://orcid.org/0000-0002-8834-1461</contrib-id><name><surname>Mantena</surname><given-names>Sreekar</given-names></name><xref rid="A1" ref-type="aff">1</xref><xref rid="A2" ref-type="aff">2</xref><xref rid="A3" ref-type="aff">3</xref></contrib><contrib contrib-type="author"><name><surname>Pillai</surname><given-names>Priya P.</given-names></name><xref rid="A1" ref-type="aff">1</xref></contrib><contrib contrib-type="author"><contrib-id contrib-id-type="orcid" authenticated="false">http://orcid.org/0000-0003-2110-7475</contrib-id><name><surname>Petros</surname><given-names>Brittany A.</given-names></name><xref rid="A1" ref-type="aff">1</xref><xref rid="A4" ref-type="aff">4</xref><xref rid="A5" ref-type="aff">5</xref><xref rid="A6" ref-type="aff">6</xref></contrib><contrib contrib-type="author"><name><surname>Welch</surname><given-names>Nicole L.</given-names></name><xref rid="A1" ref-type="aff">1</xref></contrib><contrib contrib-type="author"><contrib-id contrib-id-type="orcid" authenticated="false">http://orcid.org/0000-0002-8971-184X</contrib-id><name><surname>Myhrvold</surname><given-names>Cameron</given-names></name><xref rid="A7" ref-type="aff">7</xref><xref rid="A8" ref-type="aff">8</xref><xref rid="A9" ref-type="aff">9</xref><xref rid="A10" ref-type="aff">10</xref></contrib><contrib contrib-type="author"><contrib-id contrib-id-type="orcid" authenticated="false">http://orcid.org/0000-0002-9843-1890</contrib-id><name><surname>Sabeti</surname><given-names>Pardis C.</given-names></name><xref rid="A1" ref-type="aff">1</xref><xref rid="A11" ref-type="aff">11</xref><xref rid="A12" ref-type="aff">12</xref><xref rid="A13" ref-type="aff">13</xref><xref rid="A14" ref-type="aff">14</xref><xref rid="CR1" ref-type="corresp">&#x02709;</xref></contrib><contrib contrib-type="author"><contrib-id contrib-id-type="orcid" authenticated="false">http://orcid.org/0000-0002-8871-2349</contrib-id><name><surname>Metsky</surname><given-names>Hayden C.</given-names></name><xref rid="A1" ref-type="aff">1</xref><xref rid="A14" ref-type="aff">14</xref><xref rid="CR1" ref-type="corresp">&#x02709;</xref></contrib></contrib-group><aff id="A1"><label>1</label>Broad Institute of MIT and Harvard, Cambridge, MA, USA</aff><aff id="A2"><label>2</label>Department of Statistics, Harvard University, Cambridge, MA, USA</aff><aff id="A3"><label>3</label>Department of Molecular and Cellular Biology, Harvard University, Cambridge, MA, USA</aff><aff id="A4"><label>4</label>Division of Health Sciences and Technology, Harvard Medical School and Massachusetts Institute of Technology, Cambridge, MA, USA</aff><aff id="A5"><label>5</label>MD&#x02013;PhD Program, Harvard/Massachusetts Institute of Technology, Boston, MA, USA</aff><aff id="A6"><label>6</label>Department of Systems Biology, Harvard Medical School, Boston, MA, USA</aff><aff id="A7"><label>7</label>Department of Molecular Biology, Princeton University, Princeton, NJ, USA</aff><aff id="A8"><label>8</label>Department of Chemical and Biological Engineering, Princeton University, Princeton, NJ, USA</aff><aff id="A9"><label>9</label>Omenn&#x02013;Darling Bioengineering Institute, Princeton University, Princeton, NJ, USA</aff><aff id="A10"><label>10</label>Department of Chemistry, Princeton University, Princeton, NJ, USA</aff><aff id="A11"><label>11</label>Howard Hughes Medical Institute, Chevy Chase, MD, USA</aff><aff id="A12"><label>12</label>Department of Organismic and Evolutionary Biology, Harvard University, Cambridge, MA, USA</aff><aff id="A13"><label>13</label>Department of Immunology and Infectious Diseases, Harvard T.H. Chan School of Public Health, Boston, MA, USA</aff><aff id="A14"><label>14</label>These authors contributed equally: Pardis C. Sabeti, Hayden C. Metsky</aff><author-notes><fn fn-type="con" id="FN1"><p id="P1">Author contributions</p><p id="P2">S.M. implemented and evaluated model-directed exploration algorithms for Cas13-based viral detection. P.P.P., N.L.W., C.M. and B.A.P. provided critical insights. H.C.M. initiated the project and performed some of the early methods development and analysis. S.M. and H.C.M. wrote the manuscript with input from other authors. H.C.M. and P.C.S. supervised the project.</p></fn><corresp id="CR1"><label>&#x02709;</label><bold>Correspondence and requests for materials</bold> should be addressed to Pardis C. Sabeti or Hayden C. Metsky. <email>pardis@broadinstitute.org</email>; <email>hayden@broadinstitute.org</email></corresp></author-notes><pub-date pub-type="nihms-submitted"><day>28</day><month>7</month><year>2025</year></pub-date><pub-date pub-type="ppub"><month>8</month><year>2025</year></pub-date><pub-date pub-type="epub"><day>11</day><month>10</month><year>2024</year></pub-date><pub-date pub-type="pmc-release"><day>17</day><month>9</month><year>2025</year></pub-date><volume>43</volume><issue>8</issue><fpage>1266</fpage><lpage>1273</lpage><permissions><license><license-p><bold>Reprints and permissions information</bold> is available at <ext-link ext-link-type="uri" xlink:href="http://www.nature.com/reprints">www.nature.com/reprints</ext-link>.</license-p></license></permissions><abstract id="ABS1"><p id="P3">CRISPR guide RNA sequences deriving exactly from natural sequences may not perform optimally in every application. Here we implement and evaluate algorithms for designing maximally fit, artificial CRISPR&#x02013;Cas13a guides with multiple mismatches to natural sequences that are tailored for diagnostic applications. These guides offer more sensitive detection of diverse pathogens and discrimination of pathogen variants compared with guides derived directly from natural sequences and illuminate design principles that broaden Cas13a targeting.</p></abstract></article-meta></front><body><p id="P4">Molecular diagnostic technologies have transformed the detection and surveillance of infectious pathogens. The performance of these assays depends critically on the diagnostic oligonucleotide sequences that they employ to bind to targeted nucleic acids. Current techniques for designing such diagnostic oligonucleotides, including PCR primers and clustered regularly interspaced short palindromic repeats (CRISPR) guide RNAs, select sequences directly from those in nature or from a simple function of natural sequences, such as a consensus, according to machine-learned discriminative models or thermodynamic heuristics<sup><xref rid="R1" ref-type="bibr">1</xref>&#x02013;<xref rid="R6" ref-type="bibr">6</xref></sup>. Thus, outputs of these techniques are identical (or nearly identical) to the input, natural sequences. However, natural diagnostic guide sequences may not perform the best in every application. Artificial diagnostic sequences that differ from any natural sequence by several mismatches may achieve superior diagnostic activity than their natural counterparts. Machine learning methods have been applied to generate new, artificial biological sequences such as proteins<sup><xref rid="R7" ref-type="bibr">7</xref>&#x02013;<xref rid="R12" ref-type="bibr">12</xref></sup> and DNA regulatory elements<sup><xref rid="R13" ref-type="bibr">13</xref>&#x02013;<xref rid="R15" ref-type="bibr">15</xref></sup>, but, to the best of our knowledge, such techniques have not been applied to design diagnostic sequences.</p><p id="P5">We hypothesized that harnessing a generative design approach to construct artificial diagnostic oligonucleotide sequences may advance performance on key detection tasks. For instance, if our goal were to detect all forms of a genetically diverse pathogen (&#x02018;multitarget detection&#x02019;) and there are several polymorphisms in an otherwise efficacious target region, an artificial oligonucleotide sequence could more sensitively detect all combinations of polymorphisms than any sequence that fully matches one particular combination (<xref rid="F1" ref-type="fig">Fig. 1a</xref>). This would enable us to achieve improved diagnostic sensitivity. Alternatively, if our goal were to distinguish between two highly similar targets (&#x02018;variant identification&#x02019;), even those that differ by a single-nucleotide polymorphism (SNP), an artificial sequence with optimally positioned mismatches could achieve greater specificity than a sequence identical to one target (<xref rid="F2" ref-type="fig">Fig. 2a</xref>). This would enable us to more accurately identify mutation(s) in a pathogen or discriminate between pathogen lineages. Previous work<sup><xref rid="R16" ref-type="bibr">16</xref>,<xref rid="R17" ref-type="bibr">17</xref></sup> has described heuristic rules to introduce handcrafted specificity-enhancing mismatches into diagnostic oligonucleotide sequences, but these strategies are bespoke and are limited by the degree of variation they can distinguish.</p><p id="P6">In this study, we focus on designing guides for use with CRISPR&#x02013;Cas13a-based detection assays; specifically, we design artificial 28 nt CRISPR guide RNA spacer sequences. Cas13a-based assays have increasingly received attention because of their minimal equipment requirements and ease of use in low-resource settings<sup><xref rid="R18" ref-type="bibr">18</xref>,<xref rid="R19" ref-type="bibr">19</xref></sup>. We previously described Activity-informed Design with All-inclusive Patrolling of Targets (ADAPT)<sup><xref rid="R6" ref-type="bibr">6</xref></sup>, which designs diagnostic guides by using a convolutional neural network (CNN) as a discriminative model to select among natural sequences (or consensuses of sequence clusters). Since the approach selects among a predetermined list of sequences, ADAPT cannot design guides that are several mismatches or more from natural sequences, it cannot design guides for variant identification down to single-nucleotide resolution, and it is unable to uncover novel strategies that optimize guide design. By contrast, algorithms that create artificial guide sequences could achieve these goals while enabling superior diagnostic sensitivity and specificity, particularly for challenges in infectious diseases.</p><p id="P7">Designing artificial guide sequences necessitates exploring a vast high-dimensional space of RNA sequences. Each guide has a fitness according to the task at hand, such as multitarget detection (<xref rid="F1" ref-type="fig">Fig. 1a</xref>) or variant identification (<xref rid="F2" ref-type="fig">Fig. 2a</xref>). Highly fit artificial guide sequences should be nearby in sequence space to the complements of their targets, but this region, with ~10<sup>7</sup>&#x02013;10<sup>9</sup> sequences (<xref rid="SD1" ref-type="supplementary-material">Supplementary Note 1</xref>), is sufficiently large to motivate the development of algorithms that efficiently search the sequence space.</p><p id="P8">Here, we implement and evaluate a set of algorithms for designing artificial CRISPR&#x02013;Cas13a guide RNAs. These algorithms combine a machine-learned model&#x02014;trained to predict the enzymatic activity that results from a guide&#x02013;target interaction&#x02014;with search algorithms to explore a fitness landscape of guides. Our predictive model is the CNN we previously developed and implemented in ADAPT<sup><xref rid="R6" ref-type="bibr">6</xref></sup>. It predicts the enzymatic activity of Cas13a, a proxy of a given guide&#x02019;s sensitivity for detecting a given target. We implement and evaluate two design algorithms: (1) a generative model that employs a conditional Wasserstein Generative Adversarial Network and activation maximization (WGAN-AM) to explore a continuous latent space of sequences<sup><xref rid="R13" ref-type="bibr">13</xref>,<xref rid="R20" ref-type="bibr">20</xref>,<xref rid="R21" ref-type="bibr">21</xref></sup> (<xref rid="F3" ref-type="fig">Extended Data Fig. 1a</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 1</xref>) and (<xref rid="F2" ref-type="fig">2</xref>) an evolutionary algorithm<sup><xref rid="R22" ref-type="bibr">22</xref>&#x02013;<xref rid="R24" ref-type="bibr">24</xref></sup> that performs iterative rounds of random mutation, fitness evaluation and selection to explore the fitness landscape in discrete steps (<xref rid="F3" ref-type="fig">Extended Data Fig. 1b</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 2</xref>). Our model-directed exploration process&#x02014;including the predictive model, search algorithms and fitness functions&#x02014;is conditioned on user-provided target sequences, making it broadly applicable to any input targets rather than being restricted to specific genomic sites. We built a software package to make these design approaches easily accessible for Cas13 guide RNA design. It is called Building Artificial Diagnostic Guides by Exploring Regions of Sequences (BADGERS) and is freely available at <ext-link xlink:href="https://github.com/broadinstitute/badgers-cas13" ext-link-type="uri">https://github.com/broadinstitute/badgers-cas13</ext-link> (ref. <xref rid="R25" ref-type="bibr">25</xref>).</p><p id="P9">First, we applied the algorithms in BADGERS to design guides, for use with Cas13a-based detection, that are sensitive across a pathogen&#x02019;s genomic variation, that is, for multitarget detection. The fitness function that we maximize is the average predicted activity across sequenced genomes (<xref rid="F1" ref-type="fig">Fig. 1a</xref> and <xref rid="S2" ref-type="sec">Methods</xref>). We focus on five RNA viruses, chosen for their extensive diversity (enterovirus B, Lassa and dengue) or public health relevance (influenza A and severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2)). We employed the design algorithms implemented in BADGERS to design guides and benchmarked them against algorithms representing current, state-of-the-art design approaches (<xref rid="S2" ref-type="sec">Methods</xref>). These baseline methods include a simple, commonly used algorithm that complements the consensus sequence at the target site (&#x02018;consensus&#x02019;) and a more advanced algorithm that we term &#x02018;model-based choice&#x02019; (MBC), which reflects the method implemented in ADAPT, which we previously developed<sup><xref rid="R6" ref-type="bibr">6</xref></sup>. MBC employs clustering to compute a candidate set of guides and selects the guide, from this predetermined list, with maximal fitness based on our model&#x02019;s predictions. Although the predictive model of guide activity used by MBC and the algorithms in BADGERS is the same, MBC is conceptually and algorithmically distinct; MBC does not use the predictive model to explore a sequence space and it cannot generate artificial guide sequences with several mismatches from the targets (<xref rid="S2" ref-type="sec">Methods</xref>).</p><p id="P10">We computationally evaluated the multitarget detection performance of the different design methods across these five pathogens using the same predictive model of guide activity (<xref rid="S2" ref-type="sec">Methods</xref>). BADGERS-designed guides were predicted to detect more diversity than guides designed by baseline methods across nearly all genomic regions of all five pathogens. In several regions within dengue, Lassa and influenza A viruses, the BADGERS-designed guides were predicted to detect 10&#x02013;20% more sequence variation (<xref rid="F1" ref-type="fig">Fig. 1b</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 3</xref>). The sequence and nucleotide composition of a viral pathogen vary across different genomic regions and influence the activity of diagnostic guides; thus, BADGERS-designed guides may achieve a coverage improvement in some regions but not others. The BADGERS-designed guides also achieved a higher mean fitness genome wide (<xref rid="F1" ref-type="fig">Fig. 1c</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 4a</xref>). At most sites, the guides generated by the algorithms in BADGERS are several mismatches away from any sequenced genomes, suggesting that the WGAN-AM and evolutionary methods&#x02019; ability to search fitness landscapes and generate artificial sequences contributes to their superior performance (<xref rid="F1" ref-type="fig">Fig. 1d</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 5</xref>). For example, in Lassa virus segment S, the WGAN-AM and evolutionary algorithms designed guides that were distinct from any observed sequence at ~92% and ~99.9% of genomic sites, respectively.</p><p id="P11">Computational predictions are inherently limited so we set out to experimentally benchmark the multitarget detection performance of the BADGERS-designed guides. We used a random sampling strategy (<xref rid="S2" ref-type="sec">Methods</xref>) to select three representative genomic sites from each of the five viruses we considered (15 sites in total) and employed both the algorithms in BADGERS and baseline methods to design guides for these sites. We tested these guides against multiple synthetic targets that represent the genomic diversity of each virus (<xref rid="S2" ref-type="sec">Methods</xref>), measuring the fluorescence readout over time. Cas13a is activated through guide-mediated recognition of a target; once active, it engages in collateral cleavage of a fluorescent reporter to generate the fluorescent readout, with greater fluorescent signal indicating stronger guide&#x02013;target affinity at a fixed target concentration. All guides were tested against the target concentrations 10<sup>10</sup> copies per microlitre, 10<sup>9</sup> copies per microlitre and 10<sup>8</sup> copies per microlitre, which represent typical postamplification concentrations of viral pathogens<sup><xref rid="R6" ref-type="bibr">6</xref>,<xref rid="R26" ref-type="bibr">26</xref>,<xref rid="R27" ref-type="bibr">27</xref></sup>.</p><p id="P12">For all but one of the 15 tested sites, the BADGERS-designed guides achieved higher activity across sequence diversity than the baseline guides (<xref rid="F1" ref-type="fig">Fig. 1e</xref>&#x02013;<xref rid="F1" ref-type="fig">h</xref>, and <xref rid="SD1" ref-type="supplementary-material">Supplementary Figs. 6</xref> and <xref rid="SD1" ref-type="supplementary-material">7</xref>) and often enabled a lower limit of detection as well (<xref rid="F1" ref-type="fig">Fig. 1i</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 6</xref>). The algorithms in BADGERS provide the greatest advantage in highly diverse viruses, for example, Lassa virus. This advantage is less pronounced at more conserved sites from less diverse viruses, for example, SARS-CoV-2 (<xref rid="SD1" ref-type="supplementary-material">Supplementary Figs. 3</xref> and <xref rid="SD1" ref-type="supplementary-material">8</xref>).</p><p id="P13">We next applied the algorithms in BADGERS to our second diagnostic objective: to design guides that optimally identify specific SNPs or distinguish between pathogen lineages, that is, variant identification (<xref rid="F2" ref-type="fig">Fig. 2a</xref>). This objective can be conceptualized as designing a guide that achieves high activity on an on-target sequence and minimal activity on an off-target sequence; the fitness function is approximately the difference between these activities (<xref rid="F2" ref-type="fig">Fig. 2a</xref> and <xref rid="S2" ref-type="sec">Methods</xref>).</p><p id="P14">To computationally evaluate the performance of BADGERS&#x02019;s generative design approach in designing guides that identify SNPs, we considered a set of 100 pairs of randomly generated on-target and off-target sequences, each differing by one nucleotide (<xref rid="S2" ref-type="sec">Methods</xref>). We applied the algorithms in BADGERS to these target sets and also designed guides using the canonical strategy<sup><xref rid="R17" ref-type="bibr">17</xref></sup> for this problem: this strategy places the SNP at position 26 of the guide and introduces a synthetic mismatch, at position 24 of the guide, to both the on- and off-target sequences (<xref rid="S2" ref-type="sec">Methods</xref>). MBC&#x02019;s design approach cannot create guides that can differentiate between lineages down to the single-nucleotide level, so it could not be applied to this task. In silico, the BADGERS-designed guides exhibited similar predicted on-target activity to those designed by this synthetic mismatch method, but achieved lower off-target activity (<xref rid="F2" ref-type="fig">Fig. 2b</xref>&#x02013;<xref rid="F2" ref-type="fig">d</xref>).</p><p id="P15">We benchmarked the design algorithms&#x02019; variant identification performance experimentally, first by designing guides for six clinically relevant SNPs and comparing them with the baseline canonical synthetic mismatch approach. The six SNPs include four associated with antimicrobial resistance in <italic toggle="yes">Plasmodium falciparum</italic> (Pfcrt K76T, Pfdhps A437G, Pfk13 C580Y and Pfmdr1 Y184F), one associated with microcephaly in Zika virus (PrM S139N) and one associated with immune evasion in SARS-CoV-2&#x02019;s spike protein (K417N/K417T)<sup><xref rid="R28" ref-type="bibr">28</xref>&#x02013;<xref rid="R34" ref-type="bibr">34</xref></sup>. Experimentally, across nearly all of these tasks, the BADGERS-designed guides exhibited lower off-target activities while maintaining similar on-target activities to baseline guides (<xref rid="F2" ref-type="fig">Fig. 2e</xref>,<xref rid="F2" ref-type="fig">f</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 9a</xref>&#x02013;<xref rid="SD1" ref-type="supplementary-material">c</xref>). Several baseline guides (including those for the S139, A437G and K417T targets) had an off-target signal nearly identical to the on-target signal throughout the reaction, which complicates SNP identification. In contrast, the BADGERS-designed guides achieved an on-target signal two to three times above the off-target signal (<xref rid="F2" ref-type="fig">Fig. 2e</xref>,<xref rid="F2" ref-type="fig">f</xref>).</p><p id="P16">We further benchmarked the design algorithms&#x02019; variant discrimination performance experimentally for designing guides that differentiate viral lineages, focusing on dengue virus (DENV) serotypes 1&#x02013;4 and seven key SARS-CoV-2 lineages (<xref rid="S2" ref-type="sec">Methods</xref>). In the DENV task, one serotype is the on-target set (for example, DENV-1) and the other three serotypes comprise the off-target set (for example, DENV-2, 3 and 4). Both the BADGERS-designed guides and baseline guides differentiated the DENV subtypes with high specificity at a target concentration of 10<sup>8</sup> copies per microlitre, probably because there are DENV genomic regions with sufficient dissimilarity across serotypes (<xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 9d</xref>). However, when tested at a lower target concentration of 10<sup>6</sup> copies per microlitre, the baseline guides exhibited low on-target fluorescence for serotypes 2 and 4, while the BADGERS-designed guides achieved, as desired, a high on-target fluorescence for those serotypes (<xref rid="F2" ref-type="fig">Fig. 2g</xref>). In the SARS-CoV-2 task, we designed guides that differentiate the ancestral Wuhan lineage (that is, Ref), Alpha, Beta, Delta, Gamma, Omicron/BA.1 and Omicron/BA.2 (<xref rid="S2" ref-type="sec">Methods</xref>). The BADGERS-designed guides enabled robust lineage discrimination, while the baseline guides for Alpha, Gamma and Ref had off-target activities that were nearly as high as their on-target activities throughout the reaction (<xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 9e</xref>).</p><p id="P17">Overall, the WGAN-AM and evolutionary search algorithms performed similarly in our two tasks, despite employing distinct techniques and creating different guides. On average, the evolutionary algorithm designed guides that are more distinct from observed sequences than the WGAN-AM&#x02019;s guides (<xref rid="F2" ref-type="fig">Figs. 1d</xref> and <xref rid="F2" ref-type="fig">2c</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 5</xref>). Fundamentally, the WGAN-AM and evolutionary methods represent two different classes of search algorithms: the WGAN-AM samples sequences from a generative network while the evolutionary algorithm simulates natural selection. To explore the utility of alternative search algorithms, we evaluated the performance of another method in each class. Specifically, we performed in silico benchmarking of conditioning by adaptive sampling (CbAS)<sup><xref rid="R35" ref-type="bibr">35</xref></sup>, which employs a generative network, and AdaLead<sup><xref rid="R36" ref-type="bibr">36</xref></sup>, which employs an evolutionary-inspired approach (<xref rid="S2" ref-type="sec">Methods</xref>). All four search algorithms provide a substantial improvement over the baseline approaches. Different search algorithms do exhibit subtle differences in performance depending on the specific task; for example, the WGAN-AM&#x02013;designed guides achieved a lower mean fitness on the multitarget detection objective than guides designed by the other three search algorithms, although this was not the case on the variant identification objective (<xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 4</xref>).</p><p id="P18">Next, we sought to understand whether the algorithms in BADGERS leverage known rules governing Cas13a activity to enhance guide performance. Remarkably, we found that the generative design algorithms implicitly learn Cas13a&#x02019;s protospacer and mismatch preferences without having them explicitly encoded and rationally apply this biological understanding among our two design objectives to generate optimally fit guides. For example, guide&#x02013;target mismatches in close proximity to one another are known to decrease enzymatic activity<sup><xref rid="R37" ref-type="bibr">37</xref>&#x02013;<xref rid="R39" ref-type="bibr">39</xref></sup>. When applied to the first objective of multitarget detection, the BADGERS-designed artificial guide sequences reduced the number of adjacent guide&#x02013;target mismatches at mismatch-sensitive positions relative to baseline guides, enabling superior sensitivity (<xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 10</xref>). In contrast, when applied to the variant identification objective, the algorithms in BADGERS introduced artificial mismatches within 4 nt of the SNP for the majority of target sets (WGAN-AM, 61% and evolutionary, 81%), reducing off-target activity (<xref rid="F2" ref-type="fig">Fig. 2c</xref>). Additionally, for nearly 75% of simulated targets, the algorithms in BADGERS further optimized guide specificity by placing the SNP between positions 18 and 23, a region where mismatches are known<sup><xref rid="R6" ref-type="bibr">6</xref></sup> to be highly deleterious to LwaCas13a activity (<xref rid="F2" ref-type="fig">Fig. 2d</xref>).</p><p id="P19">Furthermore, we found that the algorithms in BADGERS take advantage of another biological property of Cas13a to design guides optimally suited for both objectives. Previous work has found that Cas13a guides exhibit reduced activity when targeting a genomic site with complementarity to Cas13a&#x02019;s tag sequence, particularly targets with a G nucleotide at the position immediately 3&#x02032; to the protospacer (the protospacer-flanking site (PFS))<sup><xref rid="R39" ref-type="bibr">39</xref>,<xref rid="R40" ref-type="bibr">40</xref></sup>. In the variant identification objective, when the targeted SNP is a mutation from a G to a non-G nucleotide (as it is in the experimentally tested S139N and C580Y targets), the algorithms in BADGERS positioned the G at the PFS to achieve minimal off-target activity (schematized in <xref rid="F4" ref-type="fig">Extended Data Fig. 2</xref> and experimental results in <xref rid="F2" ref-type="fig">Fig. 2e</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 9a</xref>). However, in the multitarget detection objective, the algorithms in BADGERS exhibited an unexpected design decision. For genomic sites with a G at the PFS, the algorithms often introduced a mismatch directly adjacent to the tag sequence at position 28 in the protospacer (the same as position 1 in the spacer), which we term the tag-adjacent mismatch (TAM). Intriguingly, among the genomic sites with a G at the PFS, the TAM was present in 45.7% of guides designed by the WGAN-AM algorithm and 76.2% of guides designed by the evolutionary algorithm (<xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 11</xref>).</p><p id="P20">We hypothesized that the TAM could represent a different design strategy, discovered by the algorithms in BADGERS, that enables improved guide activity on targets with a G at the PFS, so we explored the TAM&#x02019;s relevance further. Mechanistically, the TAM may disrupt base pairing between the G at the PFS of the target and the C in the CRISPR RNA (crRNA) tag sequence, promoting the separation of the Cas13&#x02013;target complex and thereby increasing collateral cleavage activity and the resulting fluorescent signal. To test our hypothesis, we designed a library of guides against targets having unfavorable nucleotides (GN) and favorable nucleotides (AN, TN or CN) for the first two positions of the antitag region; the first nucleotide of the antitag region is the PFS (<xref rid="S2" ref-type="sec">Methods</xref> and <xref rid="F2" ref-type="fig">Fig. 2h</xref>). Guides with a TAM targeting a sequence with a G at the PFS exhibited substantially greater activity than guides without this TAM (<xref rid="F2" ref-type="fig">Fig. 2h</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 12</xref>). Furthermore, the TAM conferred the greatest benefit when the targeted sequence was GT in the antitag region. This is mechanistically explainable: the first two nucleotides of Cas13a&#x02019;s tag sequence complement GT, so the TAM&#x02019;s disruption of this double base pairing may enhance activity more than for targets with a non-GT allele (<xref rid="F2" ref-type="fig">Fig. 2h</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 12</xref>). As expected, introducing a TAM to guides targeting a sequence with a non-G at the PFS did not increase activity. To our knowledge, this design principle of introducing a mismatch in the spacer to rescue the activity of guides with extended tag:antitag complementarity has not been described before, suggesting that these algorithms are capable of elucidating new design principles.</p><p id="P21">In this study, we demonstrate that generative design algorithms can yield maximally fit guide sequences for pathogen detection and surveillance, and can illuminate guide design rules. These algorithms leverage a predictive model to explore a sequence landscape, only evaluating ~4,000 out of ~10<sup>16</sup> potential guides throughout their search process, yet are capable of designing artificial guide sequences that outperform those derived directly from nature (<xref rid="SD1" ref-type="supplementary-material">Supplementary Note 1</xref>). Crucially, our approach is not trained on nor restricted to a specific design task, but rather can generate guides for any conditioned target set. The machine-learned models of guide activity that steer our optimization process enable our method to exploit features of Cas13a&#x02019;s underlying biology (for example, antitag and mismatch preferences) to generate guides that optimize diagnostic performance. During the early 2022 surge in coronavirus disease 2019 (COVID-19) cases, we applied a prototype version of our method to design guides that distinguish SARS-CoV-2 variants, demonstrating that BADGERS-designed panels achieve high concordance with next-generation sequencing in a clinical context<sup><xref rid="R41" ref-type="bibr">41</xref></sup>. Furthermore, these methods can reveal interpretable guide design rules for CRISPR-based technologies. The TAM proposed by the generative design algorithms may enable Cas13a-based technologies to more efficiently target a broader range of sequences and improve our understanding of the enzyme&#x02019;s nuclease activation mechanisms.</p><p id="P22">While false positive sequences, which score highly computationally yet are nonfunctional experimentally, are a challenge in generative sequence design, none of the BADGERS-designed guide sequences fell into this category. This may be partly due to the nature of our tasks as our focus on nucleotide base pairing entails substantially less structural complexity and a smaller sequence space relative to other tasks (for example, protein design). Nevertheless, the design algorithms that we evaluated still rely on predictive models of guide activity, which may return inaccurate predictions for guide&#x02013;target pairs outside of the training domain. Certain design approaches&#x02014;such as the WGAN-AM, which was trained to generate active guide&#x02013;target pairs, or CbAS, which considers uncertainty in activity predictions&#x02014;may be less susceptible to generating out-of-domain sequences than methods such as the evolutionary algorithm that are less constrained in their search. Additionally, these methods may not perform as well when applied to pathogens whose sequence composition is highly dissimilar from the viral sequences that comprised the predictive model&#x02019;s training dataset. Also, because different orthologs of Cas13 are known to have varying sequence preferences, the design algorithms that we evaluated may not be reliable in designing guides for non-Cas13a enzymes. Furthermore, although these algorithms do enhance diagnostic sensitivity, many regions of viral genomes are hypervariable and, in some cases, even the guides designed by our methods do not detect the full extent of sequence diversity (for example, DENV and enterovirus B; <xref rid="F1" ref-type="fig">Fig. 1f</xref>,<xref rid="F1" ref-type="fig">g</xref>).</p><p id="P23">In the realm of pathogen diagnostics, to our knowledge, all current design methods for nucleic acid technologies derive oligonucleotide sequences directly from pathogen genomes<sup><xref rid="R1" ref-type="bibr">1</xref>&#x02013;<xref rid="R6" ref-type="bibr">6</xref></sup>. Our results suggest that generative sequence design algorithms offer substantial benefits relative to approaches (like the one in ADAPT) that are not geared toward designing artificial guide sequences. Namely, the algorithms in BADGERS created guides that achieved superior performance to MBC (the technique employed by ADAPT) on the multitarget detection objective and enabled the discrimination of lineages down to single-nucleotide resolution, a task ADAPT cannot perform. To achieve this, BADGERS&#x02019;s methods engineered guide sequences by leveraging rational design principles (for example, G&#x02013;U base pairing and nucleotide and position-specific effects of mismatches) and discovered strategies for guide design (including the terminal adjacent mismatch).</p><p id="P24">Though we focused on Cas13 guide RNAs in this study, artificial sequences stand to optimize the design of diagnostic sequences beyond CRISPR guide RNAs, including the primers and fluorescent probes employed in PCR, loop-mediated isothermal amplification and recombinase polymerase amplification. While the specific search algorithms employed in this work to generate artificial sequences achieved strong performance, the field of biological sequence design is rapidly advancing with the recent application of other classes of design methods (for example, autoregressive and diffusion-based generative methods) and future work should investigate how these approaches may further benefit diagnostic design. Beyond diagnostics, generative design methods could design rationally mismatched guide RNAs for base editors to minimize bystander editing rates<sup><xref rid="R16" ref-type="bibr">16</xref></sup>. For certain CRISPR screens, where the objective is to introduce maximal sequence diversity into protein-coding genes, these methods could design guides that maximize the number of distinct edits made at the targeted sites<sup><xref rid="R42" ref-type="bibr">42</xref></sup>. Furthermore, while high-fidelity variants of CRISPR enzymes have lowered off-target editing rates<sup><xref rid="R43" ref-type="bibr">43</xref></sup>, these class of algorithms could optimize guide RNA sequences to minimize these off-target effects further. Recent work has also highlighted the importance of accounting for human genetic diversity when designing CRISPR therapeutics<sup><xref rid="R43" ref-type="bibr">43</xref>,<xref rid="R44" ref-type="bibr">44</xref></sup>, and generative design approaches are poised to generate guide sequences that optimally account for this diversity.</p><p id="P25">Generative methods are transforming the field of biological sequence design, with recent work focusing on generating long protein and DNA sequences<sup><xref rid="R10" ref-type="bibr">10</xref>,<xref rid="R12" ref-type="bibr">12</xref>,<xref rid="R45" ref-type="bibr">45</xref></sup>. Here, we show that algorithms that explore sequence landscapes to design artificial sequences can not only optimize shorter RNA sequences, such as crRNAs, but can simultaneously elucidate mechanistic design rules and serve needs in pathogen surveillance.</p><sec id="S1"><title>Online content</title><p id="P26">Any methods, additional references, Nature Portfolio reporting summaries, source data, extended data, <xref rid="SD1" ref-type="supplementary-material">supplementary information</xref>, acknowledgements, peer review information; details of author contributions and competing interests; and statements of data and code availability are available at <ext-link xlink:href="https://doi.org/10.1038/s41587-024-02422-w" ext-link-type="uri">https://doi.org/10.1038/s41587-024-02422-w</ext-link>.</p></sec><sec id="S2"><title>Methods</title><p id="P27">The model-directed exploration algorithms developed in this work pair (1) a predictive model of diagnostic guide activity with (2) exploration algorithms that search through a landscape of guide sequences. Together, they design guides that optimize a well-defined objective function.</p><p id="P28">A guide sequence is a ~20&#x02013;30 nt nucleic acid sequence that binds to a target. In our applications, the guide is the 28 nt crRNA spacer sequence for use with CRISPR&#x02013;Cas13a-based detection. It allows detection of a target by leading to a readout when the target is present.</p><sec id="S3"><title>Predictive model of diagnostic guide activity</title><p id="P29">We previously developed the predictive models used in this work and they are described in detail in ref. <xref rid="R6" ref-type="bibr">6</xref>. The input into these models is a 28 nt guide sequence <italic toggle="yes">g</italic> and a 48 nt target sequence <italic toggle="yes">t</italic> (having 10 nt of context on each site of the guide&#x02019;s binding region). The output of the classification model <inline-formula><mml:math id="M15" display="inline"><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>&#x02208;</mml:mo><mml:mo>[</mml:mo><mml:mn>0,1</mml:mn><mml:mo>]</mml:mo></mml:math></inline-formula> can be interpreted as the probability that a given guide&#x02013;target pair is active. The output of the regression model <inline-formula><mml:math id="M16" display="inline"><mml:mi>R</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>&#x02208;</mml:mo><mml:mo>[</mml:mo><mml:mo>-</mml:mo><mml:mn>4,0</mml:mn><mml:mo>]</mml:mo></mml:math></inline-formula> is the predicted activity of an active guide&#x02013;target pair. Higher values of <inline-formula><mml:math id="M17" display="inline"><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula> may suggest that a guide is more likely to bind to a given target, and higher values of <inline-formula><mml:math id="M18" display="inline"><mml:mi>R</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula> may suggest that, after binding, a guide&#x02019;s signal on a given target will grow faster.</p><p id="P30">In this study, we combined the classifier and regression model&#x02019;s predictions to define a weighted activity metric, <italic toggle="yes">A</italic>, which follows from the law of total probability:
<disp-formula id="FD1">
<mml:math id="M19" display="block"><mml:mi>A</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>g</mml:mi><mml:mspace width="0.25em"/><mml:mtext>is active on</mml:mtext><mml:mspace width="0.25em"/><mml:mi>t</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x000d7;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mtext>activity of active</mml:mtext><mml:mspace width="0.25em"/><mml:mi>g</mml:mi><mml:mspace width="0.25em"/><mml:mtext>on</mml:mtext><mml:mspace width="0.25em"/><mml:mi>t</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mspace linebreak="newline"/><mml:mo>+</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mn>1</mml:mn><mml:mo>&#x02212;</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>g</mml:mi><mml:mspace width="0.25em"/><mml:mtext>is active on</mml:mtext><mml:mspace width="0.25em"/><mml:mi>t</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x000d7;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mtext>activity of inactive</mml:mtext><mml:mspace width="0.25em"/><mml:mi>g</mml:mi><mml:mspace width="0.25em"/><mml:mtext>on</mml:mtext><mml:mspace width="0.25em"/><mml:mi>t</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:math>
</disp-formula></p><p id="P31">In our case, <inline-formula><mml:math id="M20" display="inline"><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>P</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi></mml:math></inline-formula> is active on <inline-formula><mml:math id="M21" display="inline"><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo><mml:mi>R</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula> = activity of active <italic toggle="yes">g</italic> on <italic toggle="yes">t</italic> and &#x02212;4 is the activity of inactive <italic toggle="yes">g</italic> on <italic toggle="yes">t</italic> because guides that are inactive have a near-zero signal, which is represented in our dataset by an activity of &#x02212;4, the lower bound of measured signal.</p><p id="P32">Thus, for a given guide&#x02013;target pair, we computed <inline-formula><mml:math id="M22" display="inline"><mml:mi>A</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula> as follows:
<disp-formula id="FD2">
<mml:math id="M23" display="block"><mml:mi>A</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>&#x000d7;</mml:mo><mml:mi>R</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:mn>1</mml:mn><mml:mo>-</mml:mo><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mo>&#x000d7;</mml:mo><mml:mo>-</mml:mo><mml:mn>4</mml:mn></mml:math>
</disp-formula></p></sec><sec id="S4"><title>Objective functions for diagnostic and surveillance applications</title><p id="P33">Model-directed exploration algorithms can design a guide sequence that optimizes a well-defined objective function across a genome&#x02019;s sequence variation.</p><p id="P34">We focus on designing guides that optimize two specific objective functions. These objectives have applications in diagnostic testing and pathogen genomic surveillance.</p><sec id="S5"><title>Multitarget detection.</title><p id="P35">In the first application (&#x02018;multitarget detection&#x02019;), our goal is to design guides that are maximally active across genome sequence diversity. As such, the objective function for this application is
<disp-formula id="FD3">
<mml:math id="M24" display="block"><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mo>&#x02223;</mml:mo><mml:mo>,</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>E</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:msub><mml:mo>[</mml:mo><mml:mi>A</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mo>&#x02223;</mml:mo><mml:mo>,</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo><mml:mo>=</mml:mo><mml:mrow><mml:munder><mml:mo stretchy="true">&#x02211;</mml:mo><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:munder></mml:mrow><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>&#x000d7;</mml:mo><mml:mi>A</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mo>&#x02223;</mml:mo><mml:mo>,</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo><mml:mo>,</mml:mo></mml:math>
</disp-formula>
where <inline-formula><mml:math id="M25" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula> is the set of genome sequence targets and <inline-formula><mml:math id="M26" display="inline"><mml:mi>t</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mi>T</mml:mi></mml:math></inline-formula> is a single target.</p><p id="P36">Genome sequence diversity varies spatially and temporally, so the <inline-formula><mml:math id="M27" display="inline"><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> represents a prior probability of encountering a target <inline-formula><mml:math id="M28" display="inline"><mml:mi>t</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mi>T</mml:mi></mml:math></inline-formula>. We set a uniform prior distribution (assuming that all <inline-formula><mml:math id="M29" display="inline"><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> are equal to <inline-formula><mml:math id="M30" display="inline"><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mi>T</mml:mi><mml:mo>|</mml:mo></mml:mrow></mml:mfrac></mml:math></inline-formula>) over the target genome sequences, following the choice in ref. <xref rid="R6" ref-type="bibr">6</xref>, but one could modify <inline-formula><mml:math id="M31" display="inline"><mml:msub><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> as certain lineages of a pathogen become more or less prevalent in a geographic region of interest or over time.</p><p id="P37">Additionally, one could also consider defining more complex objective functions (such as the tenth percentile of the distribution of activity across genomic diversity), although these functions may be nondifferentiable and more difficult for certain exploration algorithms to maximize.</p></sec><sec id="S6"><title>Variant identification.</title><p id="P38">In the second application (&#x02018;variant identification&#x02019;), our goal is to design a diagnostic guide <italic toggle="yes">g</italic> that can optimally differentiate between closely related sequences, maximizing activity against one set of targeted sequences (on-target) while minimizing activity against a separate but homologous set of nontargeted sequences (off-target). In our notation, <inline-formula><mml:math id="M32" display="inline"><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> represents the on-target sequences and <inline-formula><mml:math id="M33" display="inline"><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> represents the off-target sequences.</p><p id="P39">Initially, we considered a simple objective function: the difference between the expected on-target activity and expected off-target activity, <inline-formula><mml:math id="M34" display="inline"><mml:msub><mml:mrow><mml:mi>E</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x02208;</mml:mo><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo>[</mml:mo><mml:mi mathvariant="normal">A</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>E</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x02208;</mml:mo><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo>[</mml:mo><mml:mi mathvariant="normal">A</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>]</mml:mo></mml:math></inline-formula>. Although many guides designed using this objective had a large difference between the expected on-target activity and expected off-target activity, they were often inactive or only marginally active on the on-target sequences, making these guide designs unusable because the function does not enforce that the guide&#x02019;s activity on the on-target set of sequences be sufficiently high for detection.</p><p id="P40">Thus, we defined an objective function for the variant identification application that is maximized only when the designed guide has high activity on the on-target sequences and low activity on the off-target sequences. We based this objective function upon the logistic function so it is differentiable. The objective is defined below as
<disp-formula id="FD4">
<mml:math id="M35" display="block"><mml:msub><mml:mi>f</mml:mi><mml:mtext>D</mml:mtext></mml:msub><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mo>&#x02223;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mfrac><mml:mn>1</mml:mn><mml:mrow><mml:mn>1</mml:mn><mml:mo>+</mml:mo><mml:mi>a</mml:mi><mml:msup><mml:mtext>e</mml:mtext><mml:mrow><mml:mi>k</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mo>&#x02212;</mml:mo><mml:mtext>logsumexp</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mo>&#x02212;</mml:mo><mml:mi>A</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mo>&#x02223;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>&#x02212;</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mfrac><mml:mo>&#x02212;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>+</mml:mo><mml:mi>r</mml:mi><mml:mo>&#x000d7;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mfrac><mml:mrow><mml:mo>&#x02212;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>+</mml:mo><mml:mi>a</mml:mi><mml:msup><mml:mtext>e</mml:mtext><mml:mrow><mml:mi>k</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mtext>logsumexp</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>A</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>g</mml:mi><mml:mo>,</mml:mo><mml:mo>&#x02223;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>&#x02212;</mml:mo><mml:mi>o</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow></mml:mfrac></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>,</mml:mo></mml:math>
</disp-formula>
where <italic toggle="yes">o</italic>, <italic toggle="yes">a</italic>, <italic toggle="yes">k</italic> and <italic toggle="yes">r</italic> are all parameters that modulate the slope and curvature of the objective function. The values of these parameters were determined through a random search procedure described in <xref rid="SD1" ref-type="supplementary-material">Supplementary Note 2</xref>. We use <inline-formula><mml:math id="M36" display="inline"><mml:mtext>logsumexp</mml:mtext><mml:mfenced separators="|"><mml:mrow><mml:mi>A</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:math></inline-formula> as shorthand for <inline-formula><mml:math id="M37" display="inline"><mml:mtext>logsumexp</mml:mtext><mml:mfenced separators="|"><mml:mrow><mml:mfenced open="{" close="}" separators="|"><mml:mrow><mml:mi>A</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>&#x02200;</mml:mo><mml:mi>t</mml:mi><mml:mo>&#x02208;</mml:mo><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:math></inline-formula>, where <inline-formula><mml:math id="M38" display="inline"><mml:mtext>logsumexp</mml:mtext><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>&#x02026;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mi mathvariant="normal">o</mml:mi><mml:mi mathvariant="normal">g</mml:mi><mml:mfenced close="" separators="|"><mml:mrow><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">x</mml:mi><mml:mi mathvariant="normal">p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mo>&#x022ef;</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="normal">e</mml:mi><mml:mi mathvariant="normal">x</mml:mi><mml:mi mathvariant="normal">p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mo>)</mml:mo></mml:math></inline-formula> is a smooth approximation to the maximum.</p><p id="P41">The value of <inline-formula><mml:math id="M40" display="inline"><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">D</mml:mi></mml:mrow></mml:msub><mml:mfenced separators="|"><mml:mrow><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math></inline-formula> increases as the minimum activity of the guide across the on-target set increases and the maximum activity of the guide across the off-target set decreases. A visualization of this objective function is included in <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 13</xref>.</p></sec></sec><sec id="S7"><title>Exploration algorithms</title><p id="P42">The above objective functions define the fitness of a guide for two types of detection tasks. Our goal is to design maximally fit guide sequences&#x02014;those that maximize the value of these objective functions. We developed two algorithms, a WGAN-AM approach and an evolutionary algorithm, that search over a landscape of guide sequences to generate these maximally fit guides.</p><sec id="S8"><title>Conditional WGAN-AM.</title><p id="P43">A generative adversarial network (GAN) is an unsupervised deep learning framework that approximates an underlying data-generating distribution<sup><xref rid="R46" ref-type="bibr">46</xref></sup>. A well-trained GAN can generate new samples of data (for example, photographs or genomic sequences) that have properties similar to those of the training set.</p><p id="P44">We use a Wasserstein GAN (WGAN) inspired by the application in ref. <xref rid="R20" ref-type="bibr">20</xref>, but with one key difference. Our WGAN uses a conditional GAN, in particular conditional on a given target set<sup><xref rid="R47" ref-type="bibr">47</xref></sup>. The generator network, <inline-formula><mml:math id="M41" display="inline"><mml:mi>G</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula>, generates a guide sequence for the given target set. This difference allows our method to generalize well across different target sets, which contrasts to using a GAN that has been fit to data derived from a single target set. The WGAN uses a latent variable <bold><italic toggle="yes">z</italic></bold> as an input, and <bold><italic toggle="yes">z</italic></bold> can be modulated to explore the sequence space and generate different guide sequences for a given target set. <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 14a</xref> schematizes the architecture of the generative network of our WGAN.</p><p id="P45">We trained the WGAN on the same set of active guide&#x02013;target pairs that our previously developed CNN regression model was trained on<sup><xref rid="R6" ref-type="bibr">6</xref></sup>. These guide&#x02013;target pairs were experimentally demonstrated to be active via the Combinatorial Arrayed Reactions for Multiplexed Evaluation of Nucleic acids (CARMEN)&#x02013;Cas13 system<sup><xref rid="R6" ref-type="bibr">6</xref></sup>. Thus, the generator outputs guides with measurable activity against the conditioned target. We trained the WGAN via the WGAN gradient penalty method in ref. <xref rid="R48" ref-type="bibr">48</xref>. We used a batch size of 32 and trained the critic 5 times for each batch on which the generator was trained. We used the following hyperparameters for the Adam optimizer<sup><xref rid="R48" ref-type="bibr">48</xref></sup>: <italic toggle="yes">&#x003b1;</italic> = 0.0001, <italic toggle="yes">&#x003b2;</italic><sub>1</sub> = 0.9, <italic toggle="yes">&#x003b2;</italic><sub>2</sub> = 0.999 and <italic toggle="yes">&#x003f5;</italic> = 10<sup>&#x02212;7</sup>.</p><p id="P46">The generator network <inline-formula><mml:math id="M42" display="inline"><mml:mi>G</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula> captures the high-level features that make a guide active against a given target set and is capable of generating an artificial guide sequence given a target set. To generate maximally fit diagnostic guides, we employed a joint activation maximization framework<sup><xref rid="R20" ref-type="bibr">20</xref></sup>. In this joint framework, the WGAN&#x02019;s generator, <inline-formula><mml:math id="M43" display="inline"><mml:mi>G</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula>, transforms the latent vector <bold><italic toggle="yes">z</italic></bold> into a candidate guide sequence <italic toggle="yes">g</italic> and the objective function, <inline-formula><mml:math id="M44" display="inline"><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula>, computes the guide&#x02019;s fitness.</p><p id="P47">To generate optimal guides, we compute the gradient of the guide&#x02019;s fitness with respect to the latent vector <bold><italic toggle="yes">z</italic></bold>, and use the Adam optimizer<sup><xref rid="R49" ref-type="bibr">49</xref></sup> to take steps in the direction of this gradient: <inline-formula><mml:math id="M45" display="inline"><mml:msup><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn><mml:mo>)</mml:mo></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:msup><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:mtext>step size</mml:mtext><mml:mo>)</mml:mo><mml:mo>&#x000d7;</mml:mo><mml:msub><mml:mrow><mml:mo>&#x02207;</mml:mo></mml:mrow><mml:mrow><mml:mi>z</mml:mi></mml:mrow></mml:msub><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula>, where <inline-formula><mml:math id="M47" display="inline"><mml:msub><mml:mrow><mml:mo>&#x02207;</mml:mo></mml:mrow><mml:mrow><mml:mi>z</mml:mi></mml:mrow></mml:msub><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mrow><mml:munder><mml:mo stretchy="true">&#x02211;</mml:mo><mml:mrow><mml:mi>d</mml:mi></mml:mrow></mml:munder></mml:mrow><mml:mfrac><mml:mrow><mml:mo>&#x02202;</mml:mo><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>&#x02202;</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>&#x000d7;</mml:mo><mml:mfrac><mml:mrow><mml:mo>&#x02202;</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>d</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>&#x02202;</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:math></inline-formula> and <italic toggle="yes">d</italic> is one of the ten dimensions of the latent vector.</p><p id="P48">This procedure allows us to perform a continuous search over the latent space to generate guide sequences that have optimal fitness. To more thoroughly explore the fitness landscape and account for the fact that several local minima may exist in the fitness landscape, we perform multiple searches over the latent space with each search starting at a different random starting point (sampled from a normal distribution) in the latent space. A pseudocode overview of the WGAN-AM algorithm is available in <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 1</xref> and a high-level schematic is presented in <xref rid="F3" ref-type="fig">Extended Data Fig. 1a</xref>.</p><p id="P49">The WGAN-AM algorithm&#x02019;s generated guide sequences are implicitly constrained. Since the WGAN&#x02019;s generator network approximates the conditional probability distribution <inline-formula><mml:math id="M48" display="inline"><mml:mi>P</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula> of the guide&#x02013;target pairs in the training set, the guide sequences output by the WGAN&#x02019;s generator network have similar properties (for example, mismatch positions and mismatch types) to the guide sequences used to train the regression model. Thus, the WGAN-AM algorithm searches regions of the fitness landscape in which the regression model is likely to accurately predict guide activity. Owing to the generator network&#x02019;s structure, it is unlikely that the WGAN-AM algorithm will design guides that are so different than the guide sequences in the training set that the regression model&#x02019;s predictions are no longer accurate and the model behaves pathologically. For example, we would not expect the WGAN-AM algorithm to generate guides that have a much higher number of mismatches against their target sets than those in the training data for the predictive models.</p></sec><sec id="S9"><title>Evolutionary algorithm.</title><p id="P50">We also tested an unconstrained search algorithm that could reach any region of the fitness landscape&#x02014;an evolutionary algorithm. Evolutionary algorithms are biologically inspired optimization algorithms that are widely used in computer science to search across a domain of candidate solutions. They have been applied to design biological sequences that exhibit a desired property, such as peptide sequences that have maximal antimicrobial activity<sup><xref rid="R23" ref-type="bibr">23</xref>,<xref rid="R50" ref-type="bibr">50</xref>,<xref rid="R51" ref-type="bibr">51</xref></sup>.</p><p id="P51">We build upon this work to develop an evolutionary algorithm that searches over our fitness landscape of guide sequences by performing iterative rounds of fitness evaluation, selection and mutation<sup><xref rid="R51" ref-type="bibr">51</xref></sup>.</p><p id="P52">First, we initialize a population of guide sequences <inline-formula><mml:math id="M49" display="inline"><mml:msub><mml:mrow><mml:mi>G</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> by extracting all of the guide-length sequences at the genomic site of interest. Then, we use the objective function <inline-formula><mml:math id="M50" display="inline"><mml:mi>f</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula> to evaluate the fitness of each of these candidate guides. We sample <italic toggle="yes">S</italic> parent guides from this population with a probability <inline-formula><mml:math id="M51" display="inline"><mml:msub><mml:mrow><mml:mi>q</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003b2;</mml:mi><mml:mo>&#x000d7;</mml:mo><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mi>I</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:mrow><mml:munderover><mml:mo stretchy="true">&#x02211;</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>G</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:munderover></mml:mrow><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x003b2;</mml:mi><mml:mo>&#x000d7;</mml:mo><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:msup></mml:mrow></mml:mfrac></mml:math></inline-formula>, where <inline-formula><mml:math id="M52" display="inline"><mml:mi>&#x003b2;</mml:mi></mml:math></inline-formula> represents the selection intensity<sup><xref rid="R51" ref-type="bibr">51</xref></sup>. We then mutate the randomly sampled guides with a mutation frequency <italic toggle="yes">&#x003b3;</italic>. Specifically, for each position in the guide, we randomly sample a value from the standard uniform distribution, <italic toggle="yes">x</italic> ~ Uniform(0,1). If <italic toggle="yes">x</italic> &#x0003c; <italic toggle="yes">&#x003b3;</italic>, we mutate the nucleotide at that position (for example, &#x02018;A&#x02019;) to one of the other nucleotides (for example, &#x02018;C&#x02019;, &#x02018;G&#x02019; or &#x02018;U&#x02019;) with uniform probability. Finally, we add the resulting child guides to the guide population. We repeat these rounds of fitness evaluation, selection and mutation for several generations until the limit on the number of calls to the objective function, <italic toggle="yes">L</italic>, is exceeded. We return the guide sequences in the final population.</p><p id="P53">Throughout the search process, the algorithms in BADGERS are capable of efficiently recognizing the positions at which fitness increases if the guide diverges from the consensus sequence, but they do not explicitly evaluate each possible nucleotide at those positions. Thus, after the last generation (of the evolutionary algorithm) and after the last outer round (of the WGAN-AM algorithm), the algorithms perform a local search, where they identify positions at which the generated guide differs from the consensus, mutate the guide to the other possible nucleotides at each of these positions and then select the resulting guide with the best fitness.</p><p id="P54">A pseudocode overview of the evolutionary algorithm is available in <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 2</xref> and a high-level schematic is presented in <xref rid="F3" ref-type="fig">Extended Data Fig. 1b</xref>.</p></sec><sec id="S10"><title>CbAS and AdaLead search algorithms.</title><p id="P55">To computationally evaluate the performance of other search algorithms used in the field of biological sequence design in this domain, we applied CbAS<sup><xref rid="R35" ref-type="bibr">35</xref></sup> and AdaLead<sup><xref rid="R36" ref-type="bibr">36</xref></sup> to design guides for both objectives. The random search process used to determine the hyperparameters of the search algorithms is described in <xref rid="SD1" ref-type="supplementary-material">Supplementary Note 2</xref>. We implemented and tested all models using TensorFlow 2.8.0<sup><xref rid="R52" ref-type="bibr">52</xref></sup> and FLEXS 0.2.8<sup><xref rid="R36" ref-type="bibr">36</xref></sup> in Python 3.7.10.</p></sec></sec><sec id="S11"><title>Computational benchmarking of model-directed exploration algorithms</title><p id="P56">To characterize the ability of the WGAN&#x02019;s generator network to introduce mismatches at different positions in the guide and between different alleles, we ran a simulation. We computed the consensus sequence at each of the 100 genomic sites used in the multitarget detection random search. For each consensus sequence <italic toggle="yes">C</italic><sub>1</sub>,&#x02026;,<italic toggle="yes">C</italic><sub>100</sub>, we randomly sampled 500 latent variables <inline-formula><mml:math id="M53" display="inline"><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mo>~</mml:mo><mml:mi>N</mml:mi><mml:mo>(</mml:mo><mml:mn>0,1</mml:mn><mml:mo>)</mml:mo></mml:math></inline-formula> and generated 500 guides conditioned on that consensus sequence using the generator network <inline-formula><mml:math id="M54" display="inline"><mml:mi>G</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>z</mml:mi><mml:mo>&#x02223;</mml:mo><mml:msub><mml:mrow><mml:mi>C</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math></inline-formula>. We computed the Euclidean norm of the latent variable as well as the Hamming distance between the WGAN-AM generated guide and the consensus sequence, which is the number of positions at which the two guides have different nucleotides.</p><p id="P57">We found that that, as the Euclidean norm of the latent variable <bold><italic toggle="yes">z</italic></bold> increases, the guide generated by the WGAN&#x02019;s generator network has a higher Hamming distance from the sequence that it was conditioned upon. In other words, as the latent variable <bold><italic toggle="yes">z</italic></bold> gets farther from the origin, the generator introduces more mutations into the generated guide. This property is illustrated in <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 14b</xref>. Thus, the latent space <bold><italic toggle="yes">z</italic></bold> has an interpretable biological meaning.</p><p id="P58">Additionally, to benchmark the algorithms&#x02019; ability to design guides for the variant identification objective, we created a synthetic benchmarking dataset. To avoid biasing the sequence composition toward a limited set of pathogen genomes and evaluate the performance of the methods across a large distribution of sequences, we randomly generated 100 pairs of DNA sequences, each pair consisting of targets that differ by one nucleotide. The algorithms in BADGERS were run on this dataset and the results are shown in <xref rid="F2" ref-type="fig">Fig. 2b</xref>&#x02013;<xref rid="F2" ref-type="fig">d</xref>.</p></sec><sec id="S12"><title>Designing diagnostic guides for experiments</title><p id="P59">We applied our model-directed exploration algorithms to design diagnostic guides for both the multitarget detection and variant identification applications.</p><sec id="S13"><title>Multitarget detection experiments.</title><p id="P60">For the multitarget detection application, we selected five RNA viruses that are of public health interest and cause substantial morbidity and mortality globally. We used ADAPT<sup><xref rid="R6" ref-type="bibr">6</xref></sup> to download and curate complete genomes for DENV (taxid: 12637), influenza A virus (segment 2, taxid: 11320) and enterovirus B (taxid: 138949) on 30 August 2021 from the National Center for Biotechnology Information (NCBI) GenBank<sup><xref rid="R53" ref-type="bibr">53</xref></sup>. For SARS-CoV-2, we downloaded all complete genomes available on the Global Initiative on Sharing All Influenza Data (GISAID)<sup><xref rid="R54" ref-type="bibr">54</xref></sup> on 28 June 2021, removed the sequences flagged as &#x02018;low quality&#x02019; and randomly sampled 10,000 of the genomes. For Lassa virus (segment S, taxid: 11620), we directly downloaded complete genomes from GenBank<sup><xref rid="R53" ref-type="bibr">53</xref></sup> using the following search criteria: &#x02018;txid11620[Organism:exp]&#x02019; AND &#x02018;segment S&#x02019; AND &#x02018;complete sequence&#x02019; on 31 August 2021. We used MAFFT<sup><xref rid="R55" ref-type="bibr">55</xref></sup> to generate alignments for these five viral species. The predictive models <inline-formula><mml:math id="M55" display="inline"><mml:mo>(</mml:mo><mml:mi>R</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula> and <inline-formula><mml:math id="M56" display="inline"><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo><mml:mo>)</mml:mo></mml:math></inline-formula> employed in this work require an input of a 48 nt target sequence (a 28 nt guide-binding target sequence plus 10 nt of context on each side). Thus, we extracted 48 nt sliding windows along the genome and considered the target set <italic toggle="yes">T</italic> at that genomic site. We removed the genomic sites with less than ten valid sequences (sequences that are a contiguous 48 nt and have no ambiguity or gaps). Both of the model-based exploration algorithms were run on all of these target sets using the multitarget objective function, <inline-formula><mml:math id="M57" display="inline"><mml:msub><mml:mrow><mml:mi>f</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi></mml:mrow></mml:msub><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:math></inline-formula>, to design guides for these genomic sites.</p><p id="P61">To benchmark the performance of our model-based exploration algorithms against current methods, we used ADAPT to design guides at each of these genomic sites. ADAPT is software suite that employs machine learning and combinatorial optimization to design diagnostic guides and is state-of-the-art in the field<sup><xref rid="R6" ref-type="bibr">6</xref></sup>. When running ADAPT, we used the arguments &#x02018;-w 28 -gl 28 --predict-cas13a-activity-model --obj maximize-activity -hgc 1 --cluster-threshold 0.3&#x02019; with SEARCH-TYPE set to sliding window, such that the CNN-based predictive model was used and ADAPT was restricted to designing one guide at each site. We refer to this usage of ADAPT as MBC since the predictive model is being used to select a maximally fit sequence present in the ground set.</p><p id="P62">Furthermore, we computed the consensus of the sequence alignment at each of these genomic sites to represent a simple baseline approach to guide sequence design. These guides are called &#x02018;consensus guides&#x02019; throughout the text.</p><p id="P63">We sought to appropriately compare the performance of the guides designed by the baseline methods (MBC and the consensus) with the performance of the guides designed by our model-directed exploration algorithms (WGAN-AM and evolutionary). It is not tractable to experimentally test the tens of thousands of diagnostic guides designed. Thus, for every genomic site, we computed a relative performance metric, <inline-formula><mml:math id="M58" display="inline"><mml:msub><mml:mrow><mml:mi mathvariant="normal">R</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, the summed fitness of the guides designed by the model-directed exploration algorithms subtracted by the summed fitness of the guides designed by the baseline methods: <inline-formula><mml:math id="M59" display="inline"><mml:msub><mml:mrow><mml:mi mathvariant="normal">R</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfenced separators="|"><mml:mrow><mml:mi>f</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mtext>WGAN</mml:mtext></mml:mrow></mml:msub><mml:mo>&#x02223;</mml:mo><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mi>f</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mtext>evolutionary</mml:mtext></mml:mrow></mml:msub><mml:mo>&#x02223;</mml:mo><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced><mml:mo>-</mml:mo><mml:mfenced separators="|"><mml:mrow><mml:mi>f</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mtext>consensus</mml:mtext></mml:mrow></mml:msub><mml:mo>&#x02223;</mml:mo><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mi>f</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mtext>MBC</mml:mtext></mml:mrow></mml:msub><mml:mo>&#x02223;</mml:mo><mml:msub><mml:mrow><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:math></inline-formula>.</p><p id="P64">Previous studies<sup><xref rid="R6" ref-type="bibr">6</xref>,<xref rid="R17" ref-type="bibr">17</xref></sup> have shown that LwaCas13a exhibits reduced activity when targeting a genomic sites with a G at the PFS, so we only considered genomic sites with a non-G at the PFS for experimental testing. For each viral species, all genomic sites with a non-G at the PFS were sorted into quantiles by their respective RP<sub><italic toggle="yes">i</italic></sub>, so genomic sites with the highest RP<italic toggle="yes"><sub>i</sub></italic> were in the fourth quartile. We randomly sampled two sites from the fourth quartile and randomly sampled one site from the first quartile for each viral species. This method for selecting genomic sites allows us to experimentally test sites at which the guides designed by the model-directed exploration algorithms were likely to have superior performance than the guides designed by previous methods, as well as sites at which guides designed by previous methods were likely to have similar or better performance than the guides designed by the model-directed exploration algorithms. Each panel with experimental multitarget detection results shows one such site.</p><p id="P65">To computationally characterize guide performance, we computed the coverage of the guides designed by the algorithms in BADGERS and the baseline methods across different genomic windows in the viral pathogens, as shown in <xref rid="F1" ref-type="fig">Fig. 1b</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 3</xref>.</p><p id="P66">A guide <italic toggle="yes">g</italic> was considered to detect a target if it was predicted to be active by the classification model (<inline-formula><mml:math id="M60" display="inline"><mml:mi>C</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>&#x0003e;</mml:mo><mml:mn>0.577467</mml:mn></mml:math></inline-formula>) and was predicted to be in the top quartile of activity by the regression model (<inline-formula><mml:math id="M61" display="inline"><mml:mi>R</mml:mi><mml:mo>(</mml:mo><mml:mi>g</mml:mi><mml:mo>&#x02223;</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>&#x0003e;</mml:mo><mml:mo>-</mml:mo><mml:mn>1.2801363</mml:mn></mml:math></inline-formula>), based on the &#x02018;highly active&#x02019; criterion used in ref. <xref rid="R6" ref-type="bibr">6</xref>. The coverage was computed by determining the percentage of targets a guide detects in the given target set. To visualize these results in <xref rid="F1" ref-type="fig">Fig. 1b</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 3</xref>, the guide designed by each method in each genomic window with the maximum predicted coverage was selected. The percentage of targets detected by this guide is shown in the graphs.</p><p id="P67">We computed the predicted guide activity across all targetable genomic sites in these pathogens, as shown in <xref rid="F1" ref-type="fig">Fig. 1c</xref> and <xref rid="SD1" ref-type="supplementary-material">Supplementary Fig. 4a</xref>. Targetable genomic sites are defined as sites at which the baseline methods had meaningful activity <inline-formula><mml:math id="M62" display="inline"><mml:mfenced close="" separators="|"><mml:mrow><mml:mfrac><mml:mrow><mml:mi>A</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mtext>consensus</mml:mtext></mml:mrow></mml:msub><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:mfenced><mml:mo>+</mml:mo><mml:mi>A</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>g</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">M</mml:mi><mml:mi mathvariant="normal">B</mml:mi><mml:mi mathvariant="normal">C</mml:mi></mml:mrow></mml:msub><mml:mo>&#x02223;</mml:mo><mml:mi>T</mml:mi></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac><mml:mo>&#x0003e;</mml:mo><mml:mo>-</mml:mo><mml:mn>2.5</mml:mn></mml:mrow></mml:mfenced></mml:math></inline-formula>; in practice, it would not make sense to target sites that fall below this minimal threshold). In these figures and in all box plots throughout the manuscript, the bounds of the box represent the first and third quartiles (Q1 and Q3), the center represents the median and the whiskers extend from Q1 &#x02013; 1.5 &#x000d7; interquartile range to Q3 + 1.5 &#x000d7; interquartile range.</p></sec><sec id="S14"><title>Variant identification experiments.</title><p id="P68">For the variant identification application, we sought to design diagnostic guides that could differentiate between DENV serotypes 1&#x02013;4 and the SARS-CoV-2 World Health Organization-designated variants of concern. For DENV, we downloaded all available complete genomes for serotypes 1&#x02013;4 from the Virus Pathogen Database and Analysis Resource<sup><xref rid="R56" ref-type="bibr">56</xref></sup> on 1 February 2022. We used MAFFT<sup><xref rid="R55" ref-type="bibr">55</xref></sup> to generate an alignment of the genomes.</p><p id="P69">For SARS-CoV-2, we downloaded the &#x02018;full length variant alignment&#x02019; from GISAID on 22 January 2022. This alignment contains representative sequences for the targeted SARS-CoV-2 lineages: Wuhan reference, Alpha (B.1.1.7), Beta (B.1.351), Gamma (P.1), Delta (B.1.617.2), Omicron (BA.1) and Omicron (BA.2). The GISAID accessions for these reference genomes are EPI ISL 402124, EPI ISL 674612, EPI ISL 940877, EPI ISL 2777382, EPI ISL 1758376, EPI ISL 6914029 and EPI ISL 7190366, respectively. We referenced analyses on the CoVariants<sup><xref rid="R57" ref-type="bibr">57</xref></sup> and outbreak. info<sup><xref rid="R58" ref-type="bibr">58</xref></sup> websites to confirm that the insertions, deletions and mutations targeted by our guides were highly conserved and were present in at least 85% of genomic sequences of each variant.</p><p id="P70">The model-directed exploration algorithms were run on the DENV and SARS-CoV-2 alignments described above to design guides that were specific to each serotype/genotype/lineage.</p><p id="P71">To benchmark the performance of the model-directed exploration algorithms for variant identification of lineages (beyond a single SNP), we implemented a baseline approach. This baseline approach designs guide sequences by finding the 28 nt subsequence of the on-target consensus that has the highest Hamming distance from the off-target consensus and has an average nucleotide identity of at least 90% across the on-target genomes. This approach mimics the strategy (usually performed by hand) of identifying regions that are conserved among the on-target genomes but divergent from the off-targets.</p><p id="P72">For the antimalarial resistance panel, we downloaded reference sequences for the <italic toggle="yes">P. falciparum</italic> genes <italic toggle="yes">Pfmdr1</italic>, <italic toggle="yes">Pfcrt</italic>, <italic toggle="yes">Pfk13</italic> and <italic toggle="yes">Pfdhps</italic> from GenBank accessions <ext-link xlink:href="https://https/www.ncbi.nlm.nih.gov/nuccore/HQ215532.1" ext-link-type="uri">HQ215532.1</ext-link>, <ext-link xlink:href="https://https/www.ncbi.nlm.nih.gov/nuccore/LC498250.1" ext-link-type="uri">LC498250.1</ext-link>, <ext-link xlink:href="https://https/www.ncbi.nlm.nih.gov/nuccore/KT328114.1" ext-link-type="uri">KT328114.1</ext-link> and <ext-link xlink:href="https://https/www.ncbi.nlm.nih.gov/nuccore/KE123491.1" ext-link-type="uri">KE123491.1</ext-link>, respectively.</p><p id="P73">For the K417N/T identification task, we used the same SARS-CoV-2 sequences that we previously downloaded from GISAID, as described above. For the Zika virus S139N identification task, we downloaded the reference sequence from GenBank accession <ext-link xlink:href="https://https/www.ncbi.nlm.nih.gov/nuccore/MT483911.1" ext-link-type="uri">MT483911.1</ext-link>. We extracted the 250 nt genomic regions encapsulating the sites of interest in each gene and used them as the target sequences.</p><p id="P74">The model-directed exploration algorithms were run to design guides for each of the four SNPs of interest in the <italic toggle="yes">P. falciparum</italic> genome, the K417N/T SNP in SARS-CoV-2 and the S139N SNP in Zika virus. We also sought to benchmark our algorithms against a baseline. The &#x02018;synthetic mismatch&#x02019; strategy (where the SNP is placed at position 26 of the protospacer and a mismatch at position 24 is introduced against both the derived and ancestral targets) is currently the standard approach for designing Cas13a guides that identify SNPs<sup><xref rid="R17" ref-type="bibr">17</xref>,<xref rid="R59" ref-type="bibr">59</xref></sup>. The synthetic mismatch creates a double mismatch against the off-target sequence (positions 24 and 26), but only one mismatch against the on-target (position 24). We employed the synthetic mismatch strategy to design guides that target these four SNPs of interest, enabling us to benchmark the performance of our methods against the current standard.</p></sec></sec><sec id="S15"><title>Tag-adjacent mismatch experiments</title><p id="P75">As discussed in the main text, the model-directed exploration algorithms often introduce a mismatch at position 28 in the guide when targeting a genomic site with G nucleotide at the PFS (<xref rid="F2" ref-type="fig">Fig. 2h</xref>). We refer to this mismatch the TAM and hypothesized that it may enhance guide&#x02013;target activity.</p><p id="P76">To determine whether this was the case, we designed an experimental library consisting of targets that were representative of viral sequence diversity. We randomly sampled four viral families from a list of all viral families that have at least one vertebrate-infecting species. Then, within each of these four families, we randomly sampled one vertebrate-infecting species that has at least 100 complete genomes. The four selected viral species were primate tick-borne encephalitis virus (NCBI taxid: 11084), human mastadenovirus D (taxid: 130310), hepatitis B virus (taxid: 10407) and Zaire ebolavirus (taxid: 186538). For each of these viral species, we downloaded all available complete genomes from GenBank<sup><xref rid="R53" ref-type="bibr">53</xref></sup> on 15 February 2022 and used MAFFT<sup><xref rid="R55" ref-type="bibr">55</xref></sup> to create an alignment. We randomly selected a genomic site with a G nucleotide at the PFS in each of the four alignments and used this as our target sequence. We mutated the G nucleotide at the PFS in the original target sequence to create three additional targets with a non-G nucleotide at the PFS. Furthermore, since the nucleotide directly 3&#x02032; of a site with a G at the PFS also impacts activity<sup><xref rid="R6" ref-type="bibr">6</xref></sup>, we additionally mutated the original target sequence to create targets that have an antitag region of GC, GG, GA and GT.</p><p id="P77">For each of the four species, we designed the guide sequence without a TAM by simply extracting the 28 nt protospacer-binding region from the original target sequence. We also designed three guide sequences with the TAM by mutating the nucleotide at position 28 of the guide&#x02019;s protospacer to the other three possible bases at that position.</p></sec><sec id="S16"><title>Preparing target sequences for experiments</title><p id="P78">To experimentally test the performance of our guides, we first designed target sequences against which we would test guides. We designed these targets to be representative of viral genomic diversity. We ran ADAPT&#x02019;s pick_test_targets.py program developed in ref. <xref rid="R6" ref-type="bibr">6</xref>, with the arguments &#x02018;--num-representative-targets 5 --min-target-len 250&#x02019;. This script extracts a region of the alignment that encapsulates the guide-binding sites and is at least 250 nt long. Then, it clusters the resulting sequences and determines the medoid of each cluster, which are used as the representative target sequences. At all of the genomic sites we experimentally tested, the targets represented at least 95% of the total genomic diversity.</p><p id="P79">We added a T7 promoter sequence (5&#x02032;-GAAATTAATACGACTCACTATAGGG-3&#x02032;) followed by a positive control sequence (5&#x02032;-CACTATAGGGGCTCTAGCGACTTCTTTAAATAGTGGCTTAAAATAAC-3&#x02032;) to the 5&#x02032; end of every target sequence. In each experiment, we included a crRNA with a protospacer that was complementary to this positive control sequence (5&#x02032;-GCTCTAGCGACTTCTTTAAATAGTGGCT-3&#x02032;). This positive control enabled us to verify that the target sequences were synthesized correctly. <italic toggle="yes">P. falciparum</italic>&#x02019;s genome may pose DNA synthesis challenges because it is GC poor, so we added a second positive control sequence (5&#x02032;-GAATGGAAGCACCGAGAGTATATGAAGATCTTCATGTGTGCAAAAGAATGGTAAAGCAGAGAAGGAGC-3&#x02032;) to the 3&#x02032; end of all the <italic toggle="yes">P. falciparum</italic> target sequences. In each experiment that had <italic toggle="yes">P. falciparum</italic> targets, we included crRNA with a protospacer that was complementary to this positive control (5&#x02032;-TTCTTTTGCACACATGAAGATCTTCATAT-3&#x02032;).</p></sec><sec id="S17"><title>Preparing guide sequences for experiments</title><p id="P80">At each genomic site, the WGAN-AM algorithm outputs <italic toggle="yes">r<sub>outer</sub></italic> guides and the evolutionary algorithm outputs <italic toggle="yes">S</italic> guides; the WGAN-AM guide sequence and the evolutionary guide sequence with the highest predicted fitness were used for experimental testing. All of the methods employed in this work (including the model-based exploration algorithms and the baseline methods) output guide sequences in the frame of Cas13&#x02019;s protospacer. Thus, to prepare the guide sequences for experiments, we took the reverse complement of them to transform them to the frame of the CRISPR&#x02013;Cas13 spacer and added the LwaCas13 direct repeat (5&#x02032;-GAUUUAGACUACCCCAAAAACGAAGGGGACUAAAAC-3&#x02032;) to the 5&#x02032; end ofthe crRNA sequence.</p><p id="P81">All oligonucleotide sequences employed are available at <ext-link xlink:href="https://github.com/broadinstitute/badgers-cas13-analysis" ext-link-type="uri">https://github.com/broadinstitute/badgers-cas13-analysis</ext-link>.</p></sec><sec id="S18"><title>Experimentally evaluating diagnostic guide designs</title><sec id="S19"><title>Experimental methods.</title><p id="P82">We used the mCARMEN<sup><xref rid="R41" ref-type="bibr">41</xref></sup> platform to experimentally test the performance of diagnostic guides. Briefly, mCARMEN is a CRISPR-based diagnostic technology that uses a Fluidigm microfluidic chip to enable highly multiplexed testing of dozens of diagnostic guides against dozens of RNA targets. We followed the protocol described in the &#x02018;General mCARMEN procedures&#x02019; section of ref. <xref rid="R41" ref-type="bibr">41</xref>, with the following modifications:</p><p id="P83">All DNA targets were ordered as gBlocks from Integrated DNA Technologies. All crRNAs and the quenched synthetic fluorescent RNA reporter (FAM/rUrUrUrUrUrUrU/3IABkFQ/) were also ordered from Integrated DNA Technologies.</p><p id="P84">The DNA targets were serially diluted to the concentrations of 10<sup>10</sup>, 10<sup>9</sup> and 10<sup>8</sup> copies per microlitre and 1.43 &#x003bc;l of each target served as input to each sample mix. The quenched synthetic fluorescent reporter was included in the sample mix at a concentration of 500 nM. The crRNAs were included in the assay mixes at a concentration of 212.5 nM, and LwaCas13 from GenScript was included in the assay mix at a concentration of 42.5 nM.</p><p id="P85">After chip loading, the Fluidigm Biomark HD was set to a constant temperature of 37 &#x000b0;C and was used to image the integrated fluidic circuit on the FAM and ROX channels every 5 min for 3 h.</p></sec><sec id="S20"><title>Analysis of experimental data.</title><p id="P86">To robustly characterize the performance of each of the guide&#x02013;target pairs, we computed reference-normalized background-subtracted fluorescence values, as was done in refs. <xref rid="R6" ref-type="bibr">6</xref>,<xref rid="R41" ref-type="bibr">41</xref>: <inline-formula><mml:math id="M63" display="inline"><mml:mrow><mml:mtext>reference-normalized fluorescence</mml:mtext><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi>R</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>&#x02212;</mml:mo><mml:msub><mml:mi>R</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:mrow></mml:mfrac></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M64" display="inline"><mml:msub><mml:mrow><mml:mi>S</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> is the guide&#x02013;target pair&#x02019;s FAM signal at time point <italic toggle="yes">t<inline-formula><mml:math id="M65" display="inline"><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>S</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></italic> is the guide&#x02013;target pair&#x02019;s FAM signal at time point 0, <inline-formula><mml:math id="M66" display="inline"><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> is the guide&#x02013;target pair&#x02019;s reference ROX signal at time point <italic toggle="yes">t</italic> and <inline-formula><mml:math id="M67" display="inline"><mml:msub><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> is the guide&#x02013;target pair&#x02019;s reference ROX signal at time point 0.</p><p id="P87">To compute the reference-normalized background-subtracted fluorescence of each guide&#x02013;target pair at time <italic toggle="yes">t</italic>, we subtracted the reference-normalized fluorescence of the no-template control at time <italic toggle="yes">t</italic> from the reference-normalized fluorescence of the guide&#x02013;target pair at time <italic toggle="yes">t</italic>. Thus, if a guide&#x02013;target pair has a reference-normalized background-subtracted fluorescence greater than 0, it has a fluorescence that is higher than the no-template control signal.</p><p id="P88">In the heat maps of fluorescence, we plotted the reference-normalized background-subtracted fluorescence at the 1 h time point. In the kinetic curves of fluorescence, we plotted all the reference-normalized background-subtracted fluorescence values collected throughout the course of the reaction (<italic toggle="yes">t</italic> = 0&#x02013;180 min).</p></sec></sec><sec id="S21"><title>Reporting summary</title><p id="P89">Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.</p></sec></sec><sec sec-type="data-availability" id="S22"><title>Data availability</title><p id="P90">The viral genomes used in this manuscript were downloaded from the publicly accessible NCBI GenBank (<ext-link xlink:href="https://www.ncbi.nlm.nih.gov/genbank/" ext-link-type="uri">https://www.ncbi.nlm.nih.gov/genbank/</ext-link>) and GISAID (<ext-link xlink:href="https://gisaid.org/" ext-link-type="uri">https://gisaid.org/</ext-link>) databases. The data generated and analyzed in the manuscript is available via GitHub at <ext-link xlink:href="https://github.com/broadinstitute/badgers-cas13-analysis" ext-link-type="uri">https://github.com/broadinstitute/badgers-cas13-analysis</ext-link> (ref. <xref rid="R25" ref-type="bibr">25</xref>).</p></sec><sec id="S23"><title>Code availability</title><p id="P91">The BADGERS software package is available under the MIT license via GitHub at <ext-link xlink:href="https://github.com/broadinstitute/badgers-cas13" ext-link-type="uri">https://github.com/broadinstitute/badgers-cas13</ext-link> (ref. <xref rid="R25" ref-type="bibr">25</xref>). The repository contains detailed instructions on how to run the algorithms on any input genomic sequences. The code used to run the analyses in this manuscript is available via GitHub at <ext-link xlink:href="https://github.com/broadinstitute/badgers-cas13-analysis" ext-link-type="uri">https://github.com/broadinstitute/badgers-cas13-analysis</ext-link>.</p></sec><sec sec-type="extended-data" id="S25"><title>Extended Data</title><fig position="anchor" id="F3"><label>Extended Data Fig. 1 |</label><caption><title>BADGERS designs artificial diagnostic guides using the WGAN-AM and evolutionary search algorithms.</title><p id="P92"><bold>(a)</bold> WGAN-AM algorithm for guide design. The generative model, <italic toggle="yes">G</italic>(<italic toggle="yes"><bold>z</bold></italic>|<italic toggle="yes">T</italic>), generates active guide sequences conditional on a given target set <italic toggle="yes">T</italic>. A latent variable <italic toggle="yes"><bold>z</bold></italic> modulates the generator&#x02019;s output, allowing for different guide sequences. To generate optimal guides, the algorithm starts at a random value of <italic toggle="yes"><bold>z</bold></italic>, computes the fitness of the generated guide f(<italic toggle="yes">g</italic>|<italic toggle="yes">T</italic>), and adjusts <italic toggle="yes"><bold>z</bold></italic> in the direction of &#x02207;<sub><italic toggle="yes"><bold>z</bold></italic></sub><italic toggle="yes">f</italic>(<italic toggle="yes">g</italic>|<italic toggle="yes">T</italic>). <bold>(b)</bold> Evolutionary algorithm for guide design. The algorithm initializes a population of candidate guides, G<sub>0</sub>, by extracting the guide-length subsequences at the targeted genomic site. To form the population G<sub><italic toggle="yes">k</italic></sub> in each generation <italic toggle="yes">k</italic>, <italic toggle="yes">n</italic> parent guides are sampled from the population G<sub><italic toggle="yes">k</italic>-1</sub> with probability proportional to their fitness <italic toggle="yes">f</italic>(<italic toggle="yes">g</italic>|<italic toggle="yes">T</italic>). The <italic toggle="yes">n</italic> guides are randomly mutated, and the resulting mutated child guides are added to the population. This process is repeated until <italic toggle="yes">L</italic>, the limit on the number of guides whose fitness has been evaluated, is reached.</p></caption><graphic xlink:href="nihms-2099604-f0003" position="float"/></fig><fig position="anchor" id="F4"><label>Extended Data Fig. 2 |</label><caption><title>Algorithms in BADGERS exploit Cas13a&#x02019;s protospacer context preferences to design optimal variant identification guides.</title><p id="P93">When targeting a SNP from a G nucleotide to a non-G nucleotide, the algorithms in BADGERS often place the G nucleotide in the off-target at the PFS for optimal SNP discrimination. In this schematized example, the guides were designed to achieve high activity on the S139N target and low activity on the S139 target. Both the WGAN-AM and evolutionary algorithm positioned the guides such that the G nucleotide in the S139 off-target sequence is located at the PFS, thus lowering off-target activity, as is experimentally observed (<xref rid="F2" ref-type="fig">Fig. 2e</xref>).</p></caption><graphic xlink:href="nihms-2099604-f0004" position="float"/></fig></sec><sec sec-type="supplementary-material" id="SM1"><title>Supplementary Material</title><supplementary-material id="SD1" position="float" content-type="local-data"><label>Supplementary Material</label><media xlink:href="NIHMS2099604-supplement-Supplementary_Material.pdf" id="d67e2988" position="anchor"/></supplementary-material><p id="P94">The online version contains <xref rid="SD1" ref-type="supplementary-material">supplementary material</xref> available at <ext-link xlink:href="https://doi.org/10.1038/s41587-024-02422-w" ext-link-type="uri">https://doi.org/10.1038/s41587-024-02422-w</ext-link>.</p></sec></body><back><ack id="S26"><title>Acknowledgements</title><p id="P95">We thank T. Nguyen, J. Arizti Sanz and L. Pinello for valuable discussions and advice. This project was made possible by the Amazon Web Services Diagnostic Development Initiative and Defense Advanced Research Projects Agency (DARPA) grant no. D18AC00006. H.C.M. was supported by National Institutes of Health (NIH)/National Institute of Allergy and Infectious Diseases (NIAID) grant no. K01AI163498 and U.S. Agency for International Development (USAID) Prime grant no. 58-3022-2-031. S.M. and B.A.P. were supported by NIH/National Institute of General Medical Sciences (NIGMS) grant no. T32GM144273. B.A.P. was also supported by NIH/NIGMS grant no. T32GM007753 and the Broad Institute MD-PhD Fellowship. C.M. was supported by INV-034761 from the Bill and Melinda Gates Foundation and the Princeton Catalysis Initiative. P.C.S was supported by Howard Hughes Medical Institute (HHMI), NIH/NIAID grant no. U19AI110818 and U01AI151812, Centers for Disease Control and Prevention (CDC) grant no. NU50CK000629 and 75D30122C15113, Flu Lab, and a cohort of generous donors through TED&#x02019;s Audacious Project, including the ELMA Foundation, MacKenzie Scott, the Skoll Foundation and Open Philanthropy.</p></ack><fn-group><fn fn-type="COI-statement" id="FN2"><p id="P96">Competing interests</p><p id="P97">S.M., P.P.P., H.C.M. and P.C.S. are co-inventors on patent applications filed by the Broad Institute related to work in this study. H.C.M. is an employee of and holds equity in Inceptive Nucleics, Inc. P.C.S. is a co-founder of and consultant to Sherlock Biosciences and Delve Bio, and is a Board Member of Danaher Corporation, and holds equity in all three companies. C.M. is a co-founder of Carver Biosciences, a startup company developing Cas13-based antivirals, and holds equity in Carver Biosciences. The other authors declare no competing interests.</p></fn><fn id="FN3"><p id="P98"><xref rid="S25" ref-type="sec">Extended data</xref> is available for this paper at <ext-link xlink:href="https://doi.org/10.1038/s41587-024-02422-w" ext-link-type="uri">https://doi.org/10.1038/s41587-024-02422-w</ext-link>.</p></fn></fn-group><ref-list><title>References</title><ref id="R1"><label>1.</label><mixed-citation publication-type="journal"><name><surname>Jabado</surname><given-names>OJ</given-names></name>
<etal/>
<article-title>Greene SCPrimer: a rapid comprehensive tool for designing degenerate primers from multiple sequence alignments</article-title>. <source>Nucleic Acids Res</source>. <volume>34</volume>, <fpage>6605</fpage>&#x02013;<lpage>6611</lpage> (<year>2006</year>).<pub-id pub-id-type="pmid">17135211</pub-id>
</mixed-citation></ref><ref id="R2"><label>2.</label><mixed-citation publication-type="journal"><name><surname>Kreer</surname><given-names>C</given-names></name>
<etal/>
<article-title>openPrimeR for multiplex amplification of highly diverse templates</article-title>. <source>J. Immunol. Methods</source>
<volume>480</volume>, <fpage>112752</fpage> (<year>2020</year>).<pub-id pub-id-type="pmid">31991148</pub-id>
</mixed-citation></ref><ref id="R3"><label>3.</label><mixed-citation publication-type="journal"><name><surname>Duitama</surname><given-names>J</given-names></name>
<etal/>
<article-title>PrimerHunter: a primer design tool for PCR-based virus subtype identification</article-title>. <source>Nucleic Acids Res</source>. <volume>37</volume>, <fpage>2483</fpage>&#x02013;<lpage>2492</lpage> (<year>2009</year>).<pub-id pub-id-type="pmid">19264805</pub-id>
</mixed-citation></ref><ref id="R4"><label>4.</label><mixed-citation publication-type="journal"><name><surname>Brodin</surname><given-names>J</given-names></name>
<etal/>
<article-title>A multiple-alignment based primer design algorithm for genetically highly variable DNA targets</article-title>. <source>BMC Bioinform</source>. <volume>14</volume>, <fpage>255</fpage> (<year>2013</year>).</mixed-citation></ref><ref id="R5"><label>5.</label><mixed-citation publication-type="journal"><name><surname>Varliero</surname><given-names>G</given-names></name>, <name><surname>Wray</surname><given-names>J</given-names></name>, <name><surname>Malandain</surname><given-names>C</given-names></name> &#x00026; <name><surname>Barker</surname><given-names>G</given-names></name>
<article-title>PhyloPrimer: a taxon-specific oligonucleotide design platform</article-title>. <source>PeerJ</source>
<volume>9</volume>, <fpage>e11120</fpage> (<year>2021</year>).<pub-id pub-id-type="pmid">33986979</pub-id>
</mixed-citation></ref><ref id="R6"><label>6.</label><mixed-citation publication-type="journal"><name><surname>Metsky</surname><given-names>HC</given-names></name>
<etal/>
<article-title>Designing sensitive viral diagnostics with machine learning</article-title>. <source>Nat. Biotechnol</source>
<volume>40</volume>, <fpage>1123</fpage>&#x02013;<lpage>1131</lpage> (<year>2022</year>).<pub-id pub-id-type="pmid">35241837</pub-id>
</mixed-citation></ref><ref id="R7"><label>7.</label><mixed-citation publication-type="journal"><name><surname>Gupta</surname><given-names>A</given-names></name> &#x00026; <name><surname>Zou</surname><given-names>J</given-names></name>
<article-title>Feedback GAN for DNA optimizes protein functions</article-title>. <source>Nat. Mach. Intell</source>
<volume>1</volume>, <fpage>105</fpage>&#x02013;<lpage>111</lpage> (<year>2019</year>).</mixed-citation></ref><ref id="R8"><label>8.</label><mixed-citation publication-type="journal"><name><surname>Repecka</surname><given-names>D</given-names></name>
<etal/>
<article-title>Expanding functional protein sequence spaces using generative adversarial networks</article-title>. <source>Nat. Mach. Intell</source>
<volume>3</volume>, <fpage>324</fpage>&#x02013;<lpage>333</lpage> (<year>2021</year>).</mixed-citation></ref><ref id="R9"><label>9.</label><mixed-citation publication-type="journal"><name><surname>Shin</surname><given-names>J-E</given-names></name>
<etal/>
<article-title>Protein design and variant prediction using autoregressive generative models</article-title>. <source>Nat. Commun</source>
<volume>12</volume>, <fpage>2403</fpage> (<year>2021</year>).<pub-id pub-id-type="pmid">33893299</pub-id>
</mixed-citation></ref><ref id="R10"><label>10.</label><mixed-citation publication-type="journal"><name><surname>Watson</surname><given-names>JL</given-names></name>
<etal/>
<article-title>De novo design of protein structure and function with RFdiffusion</article-title>. <source>Nature</source>
<volume>620</volume>, <fpage>1089</fpage>&#x02013;<lpage>1100</lpage> (<year>2023</year>).<pub-id pub-id-type="pmid">37433327</pub-id>
</mixed-citation></ref><ref id="R11"><label>11.</label><mixed-citation publication-type="journal"><name><surname>Strokach</surname><given-names>A</given-names></name> &#x00026; <name><surname>Kim</surname><given-names>PM</given-names></name>
<article-title>Deep generative modeling for protein design</article-title>. <source>Curr. Opin. Struct. Biol</source>
<volume>72</volume>, <fpage>226</fpage>&#x02013;<lpage>236</lpage> (<year>2022</year>).<pub-id pub-id-type="pmid">34963082</pub-id>
</mixed-citation></ref><ref id="R12"><label>12.</label><mixed-citation publication-type="journal"><name><surname>Madani</surname><given-names>A</given-names></name>
<etal/>
<article-title>Large language models generate functional protein sequences across diverse families</article-title>. <source>Nat. Biotechnol</source>
<volume>41</volume>, <fpage>1099</fpage>&#x02013;<lpage>1106</lpage> (<year>2023</year>).<pub-id pub-id-type="pmid">36702895</pub-id>
</mixed-citation></ref><ref id="R13"><label>13.</label><mixed-citation publication-type="journal"><name><surname>Taskiran</surname><given-names>II</given-names></name>
<etal/>
<article-title>Cell type directed design of synthetic enhancers</article-title>. <source>Nature</source>
<volume>626</volume>, <fpage>212</fpage>&#x02013;<lpage>220</lpage> (<year>2024</year>).<pub-id pub-id-type="pmid">38086419</pub-id>
</mixed-citation></ref><ref id="R14"><label>14.</label><mixed-citation publication-type="journal"><name><surname>de Almeida</surname><given-names>BP</given-names></name>
<etal/>
<article-title>Targeted design of synthetic enhancers for selected tissues in the <italic toggle="yes">Drosophila</italic> embryo</article-title>. <source>Nature</source>
<volume>626</volume>, <fpage>207</fpage>&#x02013;<lpage>211</lpage> (<year>2024</year>).<pub-id pub-id-type="pmid">38086418</pub-id>
</mixed-citation></ref><ref id="R15"><label>15.</label><mixed-citation publication-type="journal"><name><surname>Gosai</surname><given-names>SJ</given-names></name>
<etal/>
<source>Machine-guided design of synthetic cell type-specific cis-regulatory elements</source>. Preprint at <ext-link xlink:href="https://www.biorxiv.org/content/10.1101/2023.08.08.552077v1" ext-link-type="uri">https://www.biorxiv.org/content/10.1101/2023.08.08.552077v1</ext-link> (<year>2023</year>).</mixed-citation></ref><ref id="R16"><label>16.</label><mixed-citation publication-type="journal"><name><surname>Zhao</surname><given-names>D</given-names></name>
<etal/>
<article-title>Imperfect guide-RNA (igRNA) enables CRISPR single-base editing with ABE and CBE</article-title>. <source>Nucleic Acids Res</source>. <volume>50</volume>, <fpage>4161</fpage>&#x02013;<lpage>4170</lpage> (<year>2022</year>).<pub-id pub-id-type="pmid">35349689</pub-id>
</mixed-citation></ref><ref id="R17"><label>17.</label><mixed-citation publication-type="journal"><name><surname>Gootenberg</surname><given-names>JS</given-names></name>
<etal/>
<article-title>Nucleic acid detection with CRISPR&#x02013;Cas13a/C2c2</article-title>. <source>Science</source>
<volume>356</volume>, <fpage>438</fpage>&#x02013;<lpage>442</lpage> (<year>2017</year>).<pub-id pub-id-type="pmid">28408723</pub-id>
</mixed-citation></ref><ref id="R18"><label>18.</label><mixed-citation publication-type="journal"><name><surname>Arizti-Sanz</surname><given-names>J</given-names></name>
<etal/>
<article-title>Simplified Cas13-based assays for the fast identification of SARS-CoV-2 and its variants</article-title>. <source>Nat. Biomed. Eng</source>
<volume>6</volume>, <fpage>932</fpage>&#x02013;<lpage>943</lpage> (<year>2022</year>).<pub-id pub-id-type="pmid">35637389</pub-id>
</mixed-citation></ref><ref id="R19"><label>19.</label><mixed-citation publication-type="journal"><name><surname>Kaminski</surname><given-names>MM</given-names></name>, <name><surname>Abudayyeh</surname><given-names>OO</given-names></name>, <name><surname>Gootenberg</surname><given-names>JS</given-names></name>, <name><surname>Zhang</surname><given-names>F</given-names></name> &#x00026; <name><surname>Collins</surname><given-names>JJ</given-names></name>
<article-title>CRISPR-based diagnostics</article-title>. <source>Nat. Biomed. Eng</source>
<volume>5</volume>, <fpage>643</fpage>&#x02013;<lpage>656</lpage> (<year>2021</year>).<pub-id pub-id-type="pmid">34272525</pub-id>
</mixed-citation></ref><ref id="R20"><label>20.</label><mixed-citation publication-type="journal"><name><surname>Killoran</surname><given-names>N</given-names></name>, <name><surname>Lee</surname><given-names>LJ</given-names></name>, <name><surname>Delong</surname><given-names>A</given-names></name>, <name><surname>Duvenaud</surname><given-names>D</given-names></name> &#x00026; <name><surname>Frey</surname><given-names>BJ</given-names></name>
<source>Generating and designing DNA with deep generative models</source>. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1712.06148" ext-link-type="uri">https://arxiv.org/abs/1712.06148</ext-link> (<year>2017</year>).</mixed-citation></ref><ref id="R21"><label>21.</label><mixed-citation publication-type="journal"><name><surname>Zrimec</surname><given-names>J</given-names></name>
<etal/>
<article-title>Controlling gene expression with deep generative design of regulatory DNA</article-title>. <source>Nat. Commun</source>
<volume>13</volume>, <fpage>5099</fpage> (<year>2022</year>).<pub-id pub-id-type="pmid">36042233</pub-id>
</mixed-citation></ref><ref id="R22"><label>22.</label><mixed-citation publication-type="journal"><name><surname>Sample</surname><given-names>PJ</given-names></name>
<etal/>
<article-title>Human 5&#x02032; UTR design and variant effect prediction from a massively parallel translation assay</article-title>. <source>Nat. Biotechnol</source>
<volume>37</volume>, <fpage>803</fpage>&#x02013;<lpage>809</lpage> (<year>2019</year>).<pub-id pub-id-type="pmid">31267113</pub-id>
</mixed-citation></ref><ref id="R23"><label>23.</label><mixed-citation publication-type="journal"><name><surname>Porto</surname><given-names>WF</given-names></name>
<etal/>
<article-title>In silico optimization of a guava antimicrobial peptide enables combinatorial exploration for peptide design</article-title>. <source>Nat. Commun</source>
<volume>9</volume>, <fpage>1490</fpage> (<year>2018</year>).<pub-id pub-id-type="pmid">29662055</pub-id>
</mixed-citation></ref><ref id="R24"><label>24.</label><mixed-citation publication-type="journal"><name><surname>Fox</surname><given-names>R</given-names></name>
<article-title>Directed molecular evolution by machine learning and the influence of nonlinear interactions</article-title>. <source>J. Theor. Biol</source>
<volume>234</volume>, <fpage>187</fpage>&#x02013;<lpage>199</lpage> (<year>2005</year>).<pub-id pub-id-type="pmid">15757678</pub-id>
</mixed-citation></ref><ref id="R25"><label>25.</label><mixed-citation publication-type="journal"><name><surname>Mantena</surname><given-names>S</given-names></name>
<etal/>
<article-title>BADGERS: a package for designing artificial Cas13a diagnostic guides</article-title>. <source>GitHub</source>
<ext-link xlink:href="https://github.com/broadinstitute/badgers-cas13" ext-link-type="uri">https://github.com/broadinstitute/badgers-cas13</ext-link> (<year>2024</year>).</mixed-citation></ref><ref id="R26"><label>26.</label><mixed-citation publication-type="journal"><name><surname>Granados</surname><given-names>A</given-names></name>, <name><surname>Peci</surname><given-names>A</given-names></name>, <name><surname>McGeer</surname><given-names>A</given-names></name> &#x00026; <name><surname>Gubbay</surname><given-names>JB</given-names></name>
<article-title>Influenza and rhinovirus viral load and disease severity in upper respiratory tract infections</article-title>. <source>J. Clin. Virol</source>
<volume>86</volume>, <fpage>14</fpage>&#x02013;<lpage>19</lpage> (<year>2017</year>).<pub-id pub-id-type="pmid">27893998</pub-id>
</mixed-citation></ref><ref id="R27"><label>27.</label><mixed-citation publication-type="journal"><name><surname>Dayarathna</surname><given-names>S</given-names></name>
<etal/>
<source>Are viral loads in the febrile phase a predictive factor of dengue disease severity?</source> Preprint at <ext-link xlink:href="https://www.medrxiv.org/content/10.1101/2023.07.31.23293412v1" ext-link-type="uri">https://www.medrxiv.org/content/10.1101/2023.07.31.23293412v1</ext-link> (<year>2023</year>).</mixed-citation></ref><ref id="R28"><label>28.</label><mixed-citation publication-type="journal"><name><surname>Yuan</surname><given-names>L</given-names></name>
<etal/>
<article-title>A single mutation in the prM protein of Zika virus contributes to fetal microcephaly</article-title>. <source>Science</source>
<volume>358</volume>, <fpage>933</fpage>&#x02013;<lpage>936</lpage> (<year>2017</year>).<pub-id pub-id-type="pmid">28971967</pub-id>
</mixed-citation></ref><ref id="R29"><label>29.</label><mixed-citation publication-type="journal"><name><surname>Apinjoh</surname><given-names>TO</given-names></name>, <name><surname>Ouattara</surname><given-names>A</given-names></name>, <name><surname>Titanji</surname><given-names>VPK</given-names></name>, <name><surname>Djimde</surname><given-names>A</given-names></name> &#x00026; <name><surname>Amambua-Ngwa</surname><given-names>A</given-names></name>
<article-title>Genetic diversity and drug resistance surveillance of plasmodium falciparum for malaria elimination: is there an ideal tool for resource-limited sub-Saharan Africa?</article-title>
<source>Malar. J</source>
<volume>18</volume>, <fpage>217</fpage> (<year>2019</year>).<pub-id pub-id-type="pmid">31242921</pub-id>
</mixed-citation></ref><ref id="R30"><label>30.</label><mixed-citation publication-type="journal"><name><surname>Carter</surname><given-names>TE</given-names></name>
<etal/>
<article-title>Evaluation of dihydrofolate reductase and dihydropteroate synthetase genotypes that confer resistance to sulphadoxine-pyrimethamine in <italic toggle="yes">Plasmodium falciparum</italic> in Haiti</article-title>. <source>Malar. J</source>
<volume>11</volume>, <fpage>275</fpage> (<year>2012</year>).<pub-id pub-id-type="pmid">22889367</pub-id>
</mixed-citation></ref><ref id="R31"><label>31.</label><mixed-citation publication-type="journal"><name><surname>Quan</surname><given-names>H</given-names></name>
<etal/>
<article-title>High multiple mutations of <italic toggle="yes">Plasmodium falciparum</italic>-resistant genotypes to sulphadoxine&#x02013;pyrimethamine in Lagos, Nigeria</article-title>. <source>Infect. Dis. Poverty</source>
<volume>9</volume>, <fpage>91</fpage> (<year>2020</year>).<pub-id pub-id-type="pmid">32653033</pub-id>
</mixed-citation></ref><ref id="R32"><label>32.</label><mixed-citation publication-type="journal"><name><surname>Yoshida</surname><given-names>N</given-names></name>, <name><surname>Yamauchi</surname><given-names>M</given-names></name>, <name><surname>Morikawa</surname><given-names>R</given-names></name>, <name><surname>Hombhanje</surname><given-names>F</given-names></name> &#x00026; <name><surname>Mita</surname><given-names>T</given-names></name>
<article-title>Increase in the proportion of <italic toggle="yes">Plasmodium falciparum</italic> with kelch13 C580Y mutation and decline in <italic toggle="yes">pfcrt</italic> and <italic toggle="yes">pfmdr1</italic> mutant alleles in Papua New Guinea</article-title>. <source>Malar. J</source>
<volume>20</volume>, <fpage>410</fpage> (<year>2021</year>).<pub-id pub-id-type="pmid">34666779</pub-id>
</mixed-citation></ref><ref id="R33"><label>33.</label><mixed-citation publication-type="journal"><name><surname>Hyde</surname><given-names>JE</given-names></name>
<article-title>Drug-resistant malaria</article-title>. <source>Trends Parasitol</source>. <volume>21</volume>, <fpage>494</fpage>&#x02013;<lpage>498</lpage> (<year>2005</year>).<pub-id pub-id-type="pmid">16140578</pub-id>
</mixed-citation></ref><ref id="R34"><label>34.</label><mixed-citation publication-type="journal"><name><surname>Harvey</surname><given-names>WT</given-names></name>
<etal/>
<article-title>SARS-CoV-2 variants, spike mutations and immune escape</article-title>. <source>Nat. Rev. Microbiol</source>
<volume>19</volume>, <fpage>409</fpage>&#x02013;<lpage>424</lpage> (<year>2021</year>).<pub-id pub-id-type="pmid">34075212</pub-id>
</mixed-citation></ref><ref id="R35"><label>35.</label><mixed-citation publication-type="confproc"><name><surname>Brookes</surname><given-names>D</given-names></name>, <name><surname>Park</surname><given-names>H</given-names></name> &#x00026; <name><surname>Listgarten</surname><given-names>J</given-names></name>
<source>Conditioning by adaptive sampling for robust design</source>. In <conf-name>Proc. 36th International Conference on Machine Learning</conf-name> (eds <name><surname>Chaudhuri</surname><given-names>K</given-names></name> &#x00026; <name><surname>Salakhutdinov</surname><given-names>R</given-names></name>) vol. <volume>97</volume>, <fpage>773</fpage>&#x02013;<lpage>782</lpage> (<publisher-name>PMLR</publisher-name>, <year>2019</year>).</mixed-citation></ref><ref id="R36"><label>36.</label><mixed-citation publication-type="journal"><name><surname>Sinai</surname><given-names>S</given-names></name>
<etal/>
<source>AdaLead: a simple and robust adaptive greedy search algorithm for sequence design</source>. Preprint at <ext-link xlink:href="https://arxiv.org/abs/2010.02141" ext-link-type="uri">https://arxiv.org/abs/2010.02141</ext-link> (<year>2020</year>).</mixed-citation></ref><ref id="R37"><label>37.</label><mixed-citation publication-type="journal"><name><surname>Tambe</surname><given-names>A</given-names></name>, <name><surname>East-Seletsky</surname><given-names>A</given-names></name>, <name><surname>Knott</surname><given-names>GJ</given-names></name>, <name><surname>Doudna</surname><given-names>JA</given-names></name> &#x00026; <name><surname>O&#x02019;Connell</surname><given-names>MR</given-names></name>
<article-title>RNA binding and HEPN-nuclease activation are decoupled in CRISPR&#x02013;Cas13a</article-title>. <source>Cell Rep</source>. <volume>24</volume>, <fpage>1025</fpage>&#x02013;<lpage>1036</lpage> (<year>2018</year>).<pub-id pub-id-type="pmid">30044970</pub-id>
</mixed-citation></ref><ref id="R38"><label>38.</label><mixed-citation publication-type="journal"><name><surname>Abudayyeh</surname><given-names>OO</given-names></name>
<etal/>
<article-title>RNA targeting with CRISPR&#x02013;Cas13</article-title>. <source>Nature</source>
<volume>550</volume>, <fpage>280</fpage>&#x02013;<lpage>284</lpage> (<year>2017</year>).<pub-id pub-id-type="pmid">28976959</pub-id>
</mixed-citation></ref><ref id="R39"><label>39.</label><mixed-citation publication-type="journal"><name><surname>Abudayyeh</surname><given-names>OO</given-names></name>
<etal/>
<article-title>C2c2 is a single-component programmable RNA-guided RNA-targeting CRISPR effector</article-title>. <source>Science</source>
<volume>353</volume>, <fpage>aaf5573</fpage> (<year>2016</year>).<pub-id pub-id-type="pmid">27256883</pub-id>
</mixed-citation></ref><ref id="R40"><label>40.</label><mixed-citation publication-type="journal"><name><surname>Meeske</surname><given-names>AJ</given-names></name> &#x00026; <name><surname>Marraffini</surname><given-names>LA</given-names></name>
<article-title>RNA guide complementarity prevents self-targeting in type VI CRISPR systems</article-title>. <source>Mol. Cell</source>
<volume>71</volume>, <fpage>791</fpage>&#x02013;<lpage>801.e3</lpage> (<year>2018</year>).<pub-id pub-id-type="pmid">30122537</pub-id>
</mixed-citation></ref><ref id="R41"><label>41.</label><mixed-citation publication-type="journal"><name><surname>Welch</surname><given-names>NL</given-names></name>
<etal/>
<article-title>Multiplexed CRISPR-based microfluidic platform for clinical testing of respiratory viruses and identification of SARS-CoV-2 variants</article-title>. <source>Nat. Med</source>
<volume>28</volume>, <fpage>1083</fpage>&#x02013;<lpage>1094</lpage> (<year>2022</year>).<pub-id pub-id-type="pmid">35130561</pub-id>
</mixed-citation></ref><ref id="R42"><label>42.</label><mixed-citation publication-type="journal"><name><surname>Bock</surname><given-names>C</given-names></name>
<etal/>
<article-title>High-content CRISPR screening</article-title>. <source>Nat. Rev. Methods Primers</source>
<volume>2</volume>, <fpage>9</fpage> (<year>2022</year>).<pub-id pub-id-type="pmid">37214176</pub-id>
</mixed-citation></ref><ref id="R43"><label>43.</label><mixed-citation publication-type="journal"><name><surname>Huang</surname><given-names>X</given-names></name>, <name><surname>Yang</surname><given-names>D</given-names></name>, <name><surname>Zhang</surname><given-names>J</given-names></name>, <name><surname>Xu</surname><given-names>J</given-names></name> &#x00026; <name><surname>Chen</surname><given-names>YE</given-names></name>
<article-title>Recent advances in improving gene-editing specificity through CRISPR&#x02013;Cas9 nuclease engineering</article-title>. <source>Cells</source>
<volume>11</volume>, <fpage>2186</fpage> (<year>2022</year>).<pub-id pub-id-type="pmid">35883629</pub-id>
</mixed-citation></ref><ref id="R44"><label>44.</label><mixed-citation publication-type="journal"><name><surname>Saha</surname><given-names>K</given-names></name>
<article-title>Accounting for diversity in the design of CRISPR-based therapeutic genome editing</article-title>. <source>Nat Genet</source>. <volume>55</volume>, <fpage>6</fpage>&#x02013;<lpage>7</lpage> (<year>2023</year>).<pub-id pub-id-type="pmid">36593304</pub-id>
</mixed-citation></ref><ref id="R45"><label>45.</label><mixed-citation publication-type="journal"><name><surname>Shanehsazzadeh</surname><given-names>A</given-names></name>
<etal/>
<source>Unlocking de novo antibody design with generative artificial intelligence</source>. Preprint at <ext-link xlink:href="https://www.biorxiv.org/content/10.1101/2023.01.08.523187v1" ext-link-type="uri">https://www.biorxiv.org/content/10.1101/2023.01.08.523187v1</ext-link> (<year>2023</year>).</mixed-citation></ref><ref id="R46"><label>46.</label><mixed-citation publication-type="journal"><name><surname>Goodfellow</surname><given-names>IJ</given-names></name>
<etal/>
<source>Generative adversarial networks</source>. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1406.2661" ext-link-type="uri">https://arxiv.org/abs/1406.2661</ext-link> (<year>2014</year>).</mixed-citation></ref><ref id="R47"><label>47.</label><mixed-citation publication-type="journal"><name><surname>Mirza</surname><given-names>M</given-names></name> &#x00026; <name><surname>Osindero</surname><given-names>S</given-names></name>
<source>Conditional generative adversarial nets</source>. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1411.1784" ext-link-type="uri">https://arxiv.org/abs/1411.1784</ext-link> (<year>2014</year>).</mixed-citation></ref><ref id="R48"><label>48.</label><mixed-citation publication-type="journal"><name><surname>Gulrajani</surname><given-names>I</given-names></name>, <name><surname>Ahmed</surname><given-names>F</given-names></name>, <name><surname>Arjovsky</surname><given-names>M</given-names></name>, <name><surname>Dumoulin</surname><given-names>V</given-names></name> &#x00026; <name><surname>Courville</surname><given-names>A</given-names></name>
<source>Improved training of Wasserstein GANs</source>. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1704.00028" ext-link-type="uri">https://arxiv.org/abs/1704.00028</ext-link> (<year>2017</year>).</mixed-citation></ref><ref id="R49"><label>49.</label><mixed-citation publication-type="journal"><name><surname>Kingma</surname><given-names>DP</given-names></name> &#x00026; <name><surname>Ba</surname><given-names>J</given-names></name>
<source>Adam: a method for stochastic optimization</source>. Preprint at <ext-link xlink:href="https://arxiv.org/abs/1412.6980" ext-link-type="uri">https://arxiv.org/abs/1412.6980</ext-link> (<year>2014</year>).</mixed-citation></ref><ref id="R50"><label>50.</label><mixed-citation publication-type="journal"><name><surname>Yoshida</surname><given-names>M</given-names></name>
<etal/>
<article-title>Using evolutionary algorithms and machine learning to explore sequence space for the discovery of antimicrobial peptides</article-title>. <source>Chem</source>
<volume>4</volume>, <fpage>533</fpage>&#x02013;<lpage>543</lpage> (<year>2018</year>).</mixed-citation></ref><ref id="R51"><label>51.</label><mixed-citation publication-type="journal"><name><surname>Sinai</surname><given-names>S</given-names></name> &#x00026; <name><surname>Kelsic</surname><given-names>ED</given-names></name>
<source>A primer on model-guided exploration of fitness landscapes for biological sequence design</source>. Preprint at <ext-link xlink:href="https://arxiv.org/abs/2010.10614" ext-link-type="uri">https://arxiv.org/abs/2010.10614</ext-link> (<year>2020</year>).</mixed-citation></ref><ref id="R52"><label>52.</label><mixed-citation publication-type="journal"><name><surname>Abadi</surname><given-names>M</given-names></name>, <etal/>
<source>TensorFlow: large-scale machine learning on heterogeneous systems</source> (<year>2015</year>).</mixed-citation></ref><ref id="R53"><label>53.</label><mixed-citation publication-type="journal"><name><surname>Federhen</surname><given-names>S</given-names></name>
<article-title>The NCBI taxonomy database</article-title>. <source>Nucleic Acids Res</source>. <volume>40</volume>, <fpage>D136</fpage>&#x02013;<lpage>D143</lpage> (<year>2012</year>).<pub-id pub-id-type="pmid">22139910</pub-id>
</mixed-citation></ref><ref id="R54"><label>54.</label><mixed-citation publication-type="journal"><name><surname>Shu</surname><given-names>Y</given-names></name> &#x00026; <name><surname>McCauley</surname><given-names>J</given-names></name>
<article-title>GISAID: global initiative on sharing all influenza data&#x02014;from vision to reality</article-title>. <source>Euro Surveil</source>. <volume>22</volume>, <fpage>30494</fpage> (<year>2017</year>).</mixed-citation></ref><ref id="R55"><label>55.</label><mixed-citation publication-type="journal"><name><surname>Katoh</surname><given-names>K</given-names></name> &#x00026; <name><surname>Standley</surname><given-names>DM</given-names></name>
<article-title>MAFFT multiple sequence alignment software version 7: improvements in performance and usability</article-title>. <source>Mol. Biol. Evol</source>
<volume>30</volume>, <fpage>772</fpage>&#x02013;<lpage>780</lpage> (<year>2013</year>).<pub-id pub-id-type="pmid">23329690</pub-id>
</mixed-citation></ref><ref id="R56"><label>56.</label><mixed-citation publication-type="journal"><name><surname>Pickett</surname><given-names>BE</given-names></name>
<etal/>
<article-title>ViPR: an open bioinformatics database and analysis resource for virology research</article-title>. <source>Nucleic Acids Res</source>. <volume>40</volume>, <fpage>D593</fpage>&#x02013;<lpage>D598</lpage> (<year>2011</year>).<pub-id pub-id-type="pmid">22006842</pub-id>
</mixed-citation></ref><ref id="R57"><label>57.</label><mixed-citation publication-type="journal"><name><surname>Hodcroft</surname><given-names>EB</given-names></name>
<article-title>SARS-CoV-2 mutations and variants of interest</article-title>. <source>CoVariants</source>
<ext-link xlink:href="https://covariants.org/" ext-link-type="uri">https://covariants.org/</ext-link> (<year>2020</year>).</mixed-citation></ref><ref id="R58"><label>58.</label><mixed-citation publication-type="journal"><name><surname>Gangavarapu</surname><given-names>K</given-names></name>
<etal/>
<article-title>Outbreak.info genomic reports: scalable and dynamic surveillance of SARS-CoV-2 variants and mutations</article-title>. <source>Nat. Methods</source>
<volume>20</volume>, <fpage>512</fpage>&#x02013;<lpage>522</lpage> (<year>2023</year>).<pub-id pub-id-type="pmid">36823332</pub-id>
</mixed-citation></ref><ref id="R59"><label>59.</label><mixed-citation publication-type="journal"><name><surname>Kellner</surname><given-names>MJ</given-names></name>, <name><surname>Koob</surname><given-names>JG</given-names></name>, <name><surname>Gootenberg</surname><given-names>JS</given-names></name>, <name><surname>Abudayyeh</surname><given-names>OO</given-names></name> &#x00026; <name><surname>Zhang</surname><given-names>F</given-names></name>
<article-title>SHERLOCK: nucleic acid detection with CRISPR nucleases</article-title>. <source>Nat. Protoc</source>
<volume>14</volume>, <fpage>2986</fpage>&#x02013;<lpage>3012</lpage> (<year>2019</year>).<pub-id pub-id-type="pmid">31548639</pub-id>
</mixed-citation></ref></ref-list></back><floats-group><fig position="float" id="F1"><label>Fig. 1 |</label><caption><title>Algorithms in BADGERS design guides that are maximally sensitive across genomic variation.</title><p id="P99"><bold>a</bold>, Artificial guide sequences&#x02014;that is, those that differ from any naturally observed sequence&#x02014;can increase detection across sequence variation. In the example target set shown, there are two lineages. The consensus of the targets has two mismatches with lineage 2 (in red), which could reduce enzymatic activity and thus sensitivity for that lineage. The artificial guide sequence, which has only one mismatch with lineage 1 and one with lineage 2, could yield superior performance since Cas13a better tolerates a single mismatch than two mismatches in close proximity. <bold>b</bold>, The proportion of dengue virus (DENV) genomes detected by the diagnostic guides designed with methods implemented in BADGERS (WGAN-AM and evolutionary) and baseline methods (MBC and consensus) within fixed-size windows along the genome. A guide is considered to detect a target if it meets the criteria described in <xref rid="S2" ref-type="sec">Methods</xref>. <bold>c</bold>, The relative fitness of the guides designed by MBC, WGAN-AM and evolutionary algorithms at sites in the DENV genome. The relative fitness is the difference between the fitness of the labeled algorithm&#x02019;s guide and the fitness of the consensus guide. A predictive model of guide&#x02013;target activity was used to compute these fitnesses, and the distribution is across targetable genomic sites (<italic toggle="yes">n</italic> = 2,465; <xref rid="S2" ref-type="sec">Methods</xref>). <italic toggle="yes">P</italic> values were computed using one-sided Wilcoxon signed-rank tests. <bold>d</bold>, Minimum Hamming distance between the guides designed by each algorithm and all target sequences at a given genomic site. The distribution is shown across targetable genomic sites. <bold>e</bold>&#x02013;<bold>h</bold>, Normalized fluorescence for guides detecting representative targets of genomic sites in influenza A virus (<bold>e</bold>), DENV (<bold>f</bold>), enterovirus B (<bold>g</bold>) and Lassa virus (<bold>h</bold>) measured at the 1 h time point. The color bar below <bold>e</bold> and its scale apply to all of <bold>e</bold>&#x02013;<bold>h</bold>. Each column represents a target and has width proportional to the percentage of sequence diversity it represents. Each row is a concentration of the target sequence in copies per microlitre, representing postamplification target concentrations. <bold>i</bold>, Normalized fluorescence, over the course of the reaction, when detecting the five representative targets of Lassa virus at 10<sup>8</sup> copies per microlitre. The parentheticals indicate the percentage of all genomes represented by the target. The MBC-designed guide and consensus guide were identical at this site and are represented by &#x02018;MBC/consensus&#x02019;.</p></caption><graphic xlink:href="nihms-2099604-f0001" position="float"/></fig><fig position="float" id="F2"><label>Fig. 2 |</label><caption><title>Algorithms in BADGERS design optimal guides for variant identification and propose a mechanistic guide design principle.</title><p id="P100"><bold>a</bold>, Artificial guide sequences can increase the specificity of a guide designed to discriminate one target from another. A baseline approach is to design a guide whose sequence is directly derived from the on-target sequence. Here, the baseline guide has only one mismatch against the off-target sequence, and thus has substantial off-target activity and achieves poor specificity. An artificial guide sequence that has an additional mismatch introduced could have a double mismatch to the off-target sequence, enabling lower off-target activity and more robust specificity. <bold>b</bold>&#x02013;<bold>d</bold>, Design features of 28 nt guides that differentiate between 100 pairs of synthetic targets such that, in each pair, <italic toggle="yes">T</italic><sub>2</sub> has a single-nucleotide difference (1 SNP) with <italic toggle="yes">T</italic><sub>1</sub>. For each pair of targets, we applied the algorithms in BADGERS to design guides for each of the 28 possible SNP placements along the guide, and chose the guide with the highest fitness among the 28 as best able to differentiate the two targets. <bold>b</bold>, Benchmarking predicted activities against a widely used design approach that introduces a synthetic mismatch between the guide and its targets (baseline; <xref rid="S2" ref-type="sec">Methods</xref>). Top: distributions of the difference in predicted on-target and off-target activities (<italic toggle="yes">A</italic>(<italic toggle="yes">g</italic>|<italic toggle="yes">T</italic><sub>1</sub>) &#x02212; <italic toggle="yes">A</italic>(<italic toggle="yes">g</italic>|<italic toggle="yes">T</italic><sub>2</sub>)) across the 100 target pairs. Bottom: breakdown of the difference into predicted on-target activity (<italic toggle="yes">A</italic>(<italic toggle="yes">g</italic>|<italic toggle="yes">T</italic><sub>1</sub>); bottom left) and predicted off-target activity (<italic toggle="yes">A</italic>(<italic toggle="yes">g</italic>|<italic toggle="yes">T</italic><sub>2</sub>); bottom right). <bold>c</bold>, Additional guide mismatches were introduced by BADGERS&#x02019;s design algorithms relative to the targets. Namely, the plotted value is the percent of BADGERS-designed guides that have a mismatch against both <italic toggle="yes">T</italic><sub>1</sub> and <italic toggle="yes">T</italic><sub>2</sub> at positions around the SNP (positive positions are 3&#x02032; to the SNP and negative are 5&#x02032;). <bold>d</bold>, The position (pos.) of the SNP within the BADGERS-designed guides. For the majority of target pairs, BADGERS&#x02019;s design algorithms place the SNP within Cas13a&#x02019;s mismatch-sensitive seed region. <bold>e</bold>, Experimental results of guides designed with different approaches for identifying the S139N SNP in Zika virus and A437G antimalarial resistance SNP in <italic toggle="yes">P. falciparum</italic> at a target concentration of 10<sup>8</sup> copies per microlitre. The title of each plot indicates the target the guides were designed to detect as the on-target. <bold>f</bold>, Normalized fluorescence over time of guides designed to identify the K417N/T SNP in SARS-CoV-2 at 10<sup>8</sup> copies per microlitre. <bold>g</bold>, Normalized fluorescence over time of guides designed to identify each of the four DENV serotypes at 10<sup>6</sup> copies per microlitre. In <bold>f</bold> and <bold>g</bold>, there are multiple off-targets for each discrimination task, so the dotted off-target curve shows the maximum fluorescence of the guide across the off-targets computed at each time point (for example, the off-target curves for K417 represent the fluorescence for the higher of the K417N and K417T targets at each time point in the reaction). <bold>h</bold>, Evaluation of the effect of the tag-adjacent mismatch (mis.) on rescuing guide activity when there are unfavorable (GN) nucleotides at the antitag region. The curves show the normalized fluorescence of guides detecting targets that have different nucleotide pairs at the antitag region, at 10<sup>7</sup> copies per microlitre. All guides are identical to the targets at positions 1&#x02013;27 in the protospacer. The colored lines represent guides with a terminal adjacent mismatch (at position 28), while the dashed black lines represent guides without a mismatch to the target. The dinucleotide above each plot indicates the first two nucleotides of that target&#x02019;s antitag region, and the guide sequences represented in the schematic are reverse complemented.</p></caption><graphic xlink:href="nihms-2099604-f0002" position="float"/></fig></floats-group></article>