# Detecting Genetically Engineered Viruses With Metagenomic Sequencing

*This represents work from several people at the NAO. Thanks especially to Dan Rice for implementing the duplicate junction detection, and to* [*@Will Bradshaw*](https://forum.effectivealtruism.org/users/willbradshaw?mention=user) *and* [*@mike_mclaren*](https://forum.effectivealtruism.org/users/mike_mclaren?mention=user) *for editorial feedback.*

**Summary**
===========

If someone were to intentionally cause a [stealth](https://www.gcsp.ch/publications/securing-civilisation-against-catastrophic-pandemics) pandemic today, one of the ways they might do it is by modifying an existing virus. Over the past few months we’ve been working on building a computational pipeline that could flag evidence of this kind of genetic engineering, and we now have an initial pipeline working end to end. When given 35B read pairs of wastewater sequencing data it raises 14 alerts for manual review, 13 of which are quickly dismissible false positives and one is a known genetically engineered sequence derived from HIV. While it’s hard to get a good estimate before actually going and doing it, our best guess is that if this system were deployed at the scale of approximately $1.5M/y it could detect something genetically engineered that shed like SARS-CoV-2 before 0.2% of people in the monitored sewersheds had been infected.

**System Design**
=================

The core of the system is based on two observations:

*   If someone has made substantial modifications to an existing virus then somewhere in the engineered genome there will be a series of bases that are a good match for the original genome followed by a series of bases that are a poor match for the original genome. We can look for sequencing reads that have this property and raise them for human review.
*   Chimeric reads can occur as an artifact of sequencing, which can lead to false positives. The chance that you would see multiple chimeras involving exactly the same junction by chance, however, is relatively low. By requiring 2x coverage of the junction we can remove almost all false positives, at the cost of requiring approximately twice as much sequencing.

Translating these observations into sufficiently performant code that does not trigger alerts on common sequencing artifacts has taken some work, but we now have this running.

While it would be valuable to release our detector so that others can evaluate it or apply it to their own sequencing reads, knowing the details of how we have applied this algorithm could allow someone to engineer sequences that it would not be able to detect. While we would like to build a detection system that can’t be more readily bypassed once you know how it works, we’re unfortunately not there yet.

**Evaluation**
==============

We have evaluated the system in two ways: by measuring its performance on simulated genetic engineered genomes and by applying it to a real-world dataset collected by a partner lab.

**Simulation**
--------------

We chose a selection of 35 viruses that [Virus Host DB](https://www.genome.jp/virushostdb) categorizes as human-infecting viruses, with special attention to respiratory viruses:

| **Disease** | **Virus** | **Genome Length** |
| --- | --- | --- |
| AIDS | HIV | 9,000 |
| Chickenpox and Shingles | Human alphaherpesvirus 3 | 100,000 |
| Chikungunya | Chikungunya virus | 10,000 |
| Common cold | Human coronavirus 229E | 30,000 |
| Common cold | Human coronavirus NL63 | 30,000 |
| Common cold | Human coronavirus OC43 | 30,000 |
| Common cold | Human rhinovirus NAT001 | 7,000 |
| Common cold | Rhinovirus A1 | 7,000 |
| Common cold | Rhinovirus B3 | 7,000 |
| Conjunctivitis | Human adenovirus 54 | 30,000 |
| COVID-19 | SARS-CoV-2 | 30,000 |
| Ebola | Ebola | 20,000 |
| Gastroenteritis | Astrovirus MLB1 | 6,000 |
| Influenza | Influenza A Virus, H1N1 | 10,000 |
| Influenza | Influenza A Virus, H2N2 | 10,000 |
| Influenza | Influenza A Virus, H3N2 | 10,000 |
| Influenza | Influenza A Virus, H7N9 | 10,000 |
| Influenza | Influenza A Virus, H9N2 | 10,000 |
| Influenza | Influenza C Virus | 10,000 |
| Measles | Measles morbillivirus | 20,000 |
| MERS | MERS Virus | 30,000 |
| Metapneumovirus infection | Human metapneumovirus | 10,000 |
| Mononucleosis | Human herpesvirus 4 type 2 | 200,000 |
| MPox | Monkeypox virus | 200,000 |
| Mumps | Mumps orthorubulavirus | 20,000 |
| Nipah | Henipavirus nipahense | 20,000 |
| Parainfluenza | Human orthorubulavirus 2 | 20,000 |
| Parainfluenza | Human parainfluenza virus 4a | 20,000 |
| Parainfluenza | Human respirovirus 1 | 20,000 |
| Parainfluenza | Human respirovirus 3 | 20,000 |
| Parainfluenza | Parainfluenza virus 5 | 20,000 |
| Respiratory illness, conjunctivitis | Human adenovirus 1 | 40,000 |
| Respiratory illness, gastroenteritis | Human adenovirus 5 | 40,000 |
| RSV infection | RSV | 20,000 |
| Rubella (German measles) | Rubella virus | 10,000 |

For each virus we generated 1,000 simulated engineered genomes by inserting a random string of 500 bases at a random location within its genome. Then we ran [InSilicoSeq](https://github.com/HadrienG/InSilicoSeq) 2.0.1 to generate 100,000 read pairs for each virus. We configured InSilicoSeq to use a sequencing error model approximating a NovaSeq, and to generate reads from fragments with a mean length of 187 and a standard deviation of 50. We also generated a set of control sequences, using the same process but without inserting any bases.

After running the pipeline on these 7,000,000 read pairs (100,000 per virus × 35 viruses × treatment vs control) we checked what fraction of reads were flagged as containing a suspicious junction. While normally we filter the output of the pipeline to only junctions that appear multiple times, we didn’t do that for these tests. The issue is that while with a real genetically engineered virus you would expect to see the same junction consistently each time you happened to sequence that portion of its genome, in our tests here we didn’t insert into a single consistent location.

The pipeline flagged 1.2% of simulated engineered reads and 0.003% of control reads. How does 1.2% compare to what the pipeline should be able to do? We made a simple baseline model, where sequencing reads are uniformly distributed along the genome, there are no read errors, and a junction can only be flagged if it is at least 30 bases from the end of a sequencing read. Of the sequencing reads that the baseline model classifies as flaggable, the pipeline flagged 71%. We haven’t yet looked into why this is lower than predicted, and aren’t sure whether it’s the model being overly optimistic or the pipeline missing cases it ought to be able to identify.

This chart shows, for each virus, the fraction of sequencing reads flagged as containing a suspicious junction and the pipeline performance relative to the simple model:

![](https://res.cloudinary.com/cea/image/upload/f_auto,q_auto/v1/mirroredImages/da6iKGxco8hjwH4nv/jfp83m4vny7yabwxgpu8)

Note that we don’t label the viruses on this chart, because that could be useful to someone in selecting a virus for the kind of attack we are attempting to detect.

**Real World Evaluation**
-------------------------

We partnered with [Marc Johnson](https://medicine.missouri.edu/faculty/marc-johnson-phd) and [Clayton Rushford](https://bondlsc.missouri.edu/person/clayton-rushford/) at the University of Missouri (MU) to sequence municipal wastewater, primarily RNA, and collected 35 billion paired-end sequences across four runs. The sequencing was performed at the University of Missouri Genomics Technology Core on a NovaSeq 6000 with an S4 flow cell, and covered samples collected between December 2023 and April 2024.

Applying the pipeline to these 35 billion read pairs it flags fourteen collections of reads for manual evaluation. Of these:

*   Eight are chimeras between common gastrointestinal viruses and bacterial ribosomal RNA. While you might expect that requiring the same junction to be seen multiple times would filter these out, this is a common enough pattern that we occasionally see repeats. In seven of eight cases there are several bases of overlap, where the end of the viral sequence shares bases with the beginning of the rRNA sequence. Average overlap across the seven cases is six bases, with a minimum of four and a maximum of nine.
*   Five are flagged because the databases we use for removing false positives are not complete. While we have ideas for how to efficiently screen against very large databases, we currently need to make some compromises for efficiency.
*   One is an engineered lentiviral vector, most likely [pHR’-CMVLacZ](https://www.ncbi.nlm.nih.gov/nucleotide/AF105229.1). This, and related vectors, use molecular machinery derived from HIV to insert genes into target genomes. While this is a benign example of an engineered sequence derived from a human-infecting virus, the pipeline doesn’t know this and is correct to flag it.

It’s possible to tune the pipeline to be more or less sensitive by requiring a different coverage level. If we turn up the sensitivity by flagging things for manual review on the first observation, it flags 12k suspicious junctions, far too many for manual review. If instead we turn down the sensitivity and require three observations it no longer flags any chimeras between gastrointestinal viruses and ribosomal RNA, and only flags the lentiviral vector and three sequences missing from the databases we use to screen out false positives.

We also partnered with [Jason Rothman](https://jasonrothman.weebly.com/) in [Katrine Whiteson’s lab](https://kwhiteson.bio.uci.edu/) at the University of California, Irvine (UCI), in an additional municipal wastewater RNA sequencing effort. From the 25 billion paired-end sequences we’ve analyzed from this group the pipeline flags 64 collections of reads for evaluation. While this is slightly too many for manual evaluation, in spot checking a large fraction are a kind of artifact called “[strand-split artifact reads](https://pubmed.ncbi.nlm.nih.gov/30418619/)”. These are sequencing reads which switch strand and direction partway through the read. These should be possible to automatically identify and exclude, but this is work we still need to do.

**System Sensitivity**
======================

We’ve [previously estimated](https://doi.org/10.1101/2023.12.22.23300450) that, in a week where 1% of people in a sewershed have contracted Covid-19, with the sequencing and sampling approach in [Rothman et al. (2021)](https://pubmed.ncbi.nlm.nih.gov/34550753/) one in 7.7M municipal wastewater RNA sequencing reads would be from the SARS-CoV-2 genome, a relative abundance of 1.3e-7.

As noted above, the pipeline flags only an average of 1.2% of simulated engineered reads, primarily because most reads from an engineered pathogen won’t happen to include both the original virus and the modified section. This means that the relative abundance of flaggable reads would be 1.6e-9 if we estimate from SARS-CoV-2.

The most cost-effective sequencer right now, in terms of cost per base, is the Illumina NovaSeq X. It can produce approximately 10B read pairs with a [$9,600 flow cell](https://www.illumina.com/products/by-type/sequencing-kits/cluster-gen-sequencing-reagents/novaseq-x-series-reagent-kits.html) or 25B with a [$16,000 flow cell](https://www.illumina.com/products/by-type/sequencing-kits/cluster-gen-sequencing-reagents/novaseq-x-series-reagent-kits.html). The flow cell is usually around 3/4 of the total cost, so we estimate $13,000 for 10B and $22,000 for 25B. The sequencer runs for just over a day, and you lose some time to sequencing preparation on the beginning and bioinformatics on the end, so we’ll estimate five days end to end time.

If you were to run a NovaSeq X 25B once a week (approximately $1.5M/y) and needed to see a junction in two different samples before alerting, how many people in your catchment would be sick before the system raised an alert? Running our simulator ([blog post](https://naobservatory.org/blog/simulating-approaches-to-metagenomic-pandemic-identification), [simulator data](https://data.securebio.org/simulator/#scenario_ww_c=false&scenario_ns_c_1m=false&scenario_ww_f=false&scenario_ns_f_1m=false&custom_scenario=true&covid=true&flu=false&custom_pathogen=false&doubling_time=3&cv_doubling_time=10%25&genome_length=30%2C000&wastewater=false&nasal=false&custom_sampling=true&sigma_shedding_values=0.05&direct_flaggable=true&shedding_duration=5&sigma_shedding_duration=0.05&low_quality=true&sample_population=500%2C000&sampling_m=false&sampling_t=false&sampling_w=true&sampling_r=false&sampling_f=false&sampling_s=false&sampling_u=false&sample_cost=200&nx25b=false&nx10b=false&aviti=false&ns4=false&n6ksp3=false&n6ksp5=false&nanopore=false&custom_sequencing=true&sample_depth=2.5e10&read_length=300&run_cost=16%2C000&sequencing_m=false&sequencing_t=false&sequencing_w=true&sequencing_r=false&sequencing_f=false&sequencing_s=false&sequencing_u=false&processing_delay=4&min_observations=2&sites=1&overhead=25&cost=%241%2C100%2C000&simulations=1%2C000&simulation_label=Sars-CoV-2+Weekly+25B&shedding_values=2.24e-7&outcomes=%5B%7B%22percentile_outcomes%22%3A%5B0.000005262508850475775%2C0.00035013039831699775%2C0.0005539677934226029%2C0.0006592403751944862%2C0.0007942910002135823%2C0.0008606237670282776%2C0.000932590177634337%2C0.0010094748909738628%2C0.0010783229764660689%2C0.0011196921869280304%2C0.001206167069946492%2C0.0012840515292704643%2C0.0013243129469315362%2C0.0014295514750557437%2C0.0014758284002556975%2C0.0015581002352574613%2C0.0016187484056494608%2C0.0017394214082395714%2C0.0017950868835619933%2C0.001851015517911505%2C0.0019523434091187832%2C0.0020102954278765086%2C0.0020651149066003792%2C0.002102762369051062%2C0.002173891277374861%2C0.0022272999837308948%2C0.002285674298357777%2C0.0023323983243191677%2C0.0024005698944308735%2C0.0025088389850358907%2C0.0026312010005914988%2C0.0026891699365285057%2C0.0027591386715779763%2C0.002839342701553078%2C0.0029168094379429456%2C0.002990438244918937%2C0.003065485314459126%2C0.0031729745605903557%2C0.0032703113009364296%2C0.0033687689585165594%2C0.0034411377025951287%2C0.0035219685356038433%2C0.0035985233221575864%2C0.003717509034758795%2C0.003827370618542237%2C0.0039316320077563485%2C0.003990709289948906%2C0.004054780684896747%2C0.004091917177599928%2C0.004141275816745932%2C0.004275351668945321%2C0.004340827147686095%2C0.00449802617558446%2C0.004678014057033108%2C0.004748451295288305%2C0.004869033870297207%2C0.004929564649174094%2C0.0050573363472680806%2C0.005224630334483783%2C0.005331141424154566%2C0.0054800311959266%2C0.005631639326691665%2C0.00572112720109183%2C0.005880850531084691%2C0.005972542412951115%2C0.006078665807409502%2C0.006276453279877126%2C0.006357909266609574%2C0.0065086978576254844%2C0.006698585267868349%2C0.006884275491540985%2C0.007173122218344004%2C0.007280182543276683%2C0.007514970049319321%2C0.0076770704666343685%2C0.007874478994968776%2C0.008101987346892575%2C0.008374298745398108%2C0.0086142331145602%2C0.00884184718081016%2C0.008999996912947313%2C0.009237434604409641%2C0.009576686389449158%2C0.009721010950081294%2C0.009939746420719223%2C0.010187504674730037%2C0.010428547039395705%2C0.010793668706489026%2C0.011223158496947175%2C0.011462817525627078%2C0.01198049987715247%2C0.012777039905914436%2C0.013434062584571728%2C0.014192992533990752%2C0.015302297022760345%2C0.016437685102539488%2C0.01871225271148263%2C0.021909258705095067%2C0.025326764351715485%2C0.03129006960116437%5D%2C%22label%22%3A%22Sars-CoV-2+Weekly+10B%22%2C%22cost%22%3A%22%24820%2C000%22%7D%2C%7B%22percentile_outcomes%22%3A%5B0.00001743487204830763%2C0.00010688932405752227%2C0.0001663681356250754%2C0.00022123983410330707%2C0.00024694464240081394%2C0.00028884815809747047%2C0.00032689842517020254%2C0.00035687737835187746%2C0.000389667832773277%2C0.0004189845465910958%2C0.0004470584737128702%2C0.0004806738375142055%2C0.0004986248023233481%2C0.0005256577481741179%2C0.0005483726698277355%2C0.00056551124828139%2C0.0006025920443414292%2C0.0006245653582654201%2C0.0006583107546139584%2C0.0006850269893037945%2C0.0007135599598022167%2C0.0007444168073241564%2C0.0007924970355380766%2C0.0008140715547606594%2C0.0008412034619546937%2C0.0008667266815467672%2C0.0008852501607847848%2C0.0009176990879969912%2C0.000953369542707264%2C0.0009997764982435536%2C0.0010284273332747697%2C0.0010789359432075284%2C0.0011239529475009493%2C0.0011488205037801628%2C0.0011690586760191466%2C0.001201936019297888%2C0.0012347397303441561%2C0.0012713723546078056%2C0.0013153731139574107%2C0.0013533014159410688%2C0.0013811286115425188%2C0.0014089454906100875%2C0.0014357334987412566%2C0.00145411218644352%2C0.0014749985568934072%2C0.0015020285946854934%2C0.0015278498182468548%2C0.0015550759125585413%2C0.0015947238655996839%2C0.0016545295153036197%2C0.0016932716441840044%2C0.001761236771912779%2C0.0018105298115249776%2C0.0018768107603398148%2C0.0018971034769961642%2C0.0019490327189580093%2C0.0020019141664942763%2C0.0020428784595439044%2C0.002076799376497073%2C0.0021416248152355236%2C0.002197031325613348%2C0.0022649589436599827%2C0.0023066424557648484%2C0.0023662055405575992%2C0.002457966268762358%2C0.0025374121607409034%2C0.002613017712878243%2C0.002689147460153434%2C0.0027309470287936056%2C0.0028245382878056436%2C0.0029127665488701917%2C0.002999190215906366%2C0.003092512439327132%2C0.0031569767021443437%2C0.0032401724585571536%2C0.0033408805332214775%2C0.0034197665756665377%2C0.0035330703696677115%2C0.003644200399070721%2C0.003771308948627312%2C0.0038663557262921602%2C0.004087148519136372%2C0.004194366849282196%2C0.004288469266136038%2C0.004349522889212943%2C0.004475191893143168%2C0.004600019543784398%2C0.004662488245381617%2C0.004841142259797015%2C0.00500219180837363%2C0.00519592738378647%2C0.005382029304705768%2C0.005539312074675934%2C0.006101939630121838%2C0.006474996363017205%2C0.0068774165699407395%2C0.007863563705443187%2C0.008250123848309528%2C0.009840219246018128%2C0.010359790426215093%5D%2C%22label%22%3A%22Sars-CoV-2+Weekly+25B%22%2C%22cost%22%3A%22%241%2C100%2C000%22%7D%5D)) we can get some estimates:

| Scenario | Cumulative Incidence at Detection |   |   |   |
| --- | --- | --- | --- | --- |
| 25th | 50th | 75th | 90th |
| --- | --- | --- | --- | --- |
| Sars-CoV-2 Weekly 25B | 0.1% | 0.2% | 0.3% | 0.5% |

With a hypothetical genetically engineered virus that shed similarly to SARS-CoV-2, in the median case the simulator predicts 0.2% of people would have been infected before an alert were raised. Note that we’ve seen speculation that SARS-CoV-2 is unusually well-suited for wastewater-based detection as respiratory pathogens go, and until we have estimates for additional pathogens we’d recommend taking this with a grain of salt.

We also generated estimates for the cheaper but lower output 10B flow cell:

| Scenario | Cumulative Incidence at Detection |   |   |   |
| --- | --- | --- | --- | --- |
| 25th | 50th | 75th | 90th |
| --- | --- | --- | --- | --- |
| Sars-CoV-2 Weekly 10B | 0.2% | 0.4% | 0.8% | 1.2% |

The limit of detection is a bit over twice as high, but the cost only decreases by 40%, so the deeper sequencing option is better if there is sufficient funding available.

**Future Work**
===============

We see this as a minimum-viable system for detecting genetically engineered pathogens, but there are multiple places we are eager to expand and improve it:

*   The current system has some “holes” in its implementation that keep us from releasing the code publicly. This limits our ability to share it, both for critical evaluation and for external deployment. Most of these holes are avoidable, however, and with some work we think we can get this to a place where we can open source it.
*   The current algorithm is specific to viruses, but bacterial threats are also concerning. Because recombination is much more common with bacteria than viruses, we suspect we’ll need substantial additional development and tuning to get good results with bacterial pathogens.
*   This detection algorithm is one of many potential ways to detect novel pathogens, and we would like to put significant effort into developing additional ones. That process is limited in part by the available data, and running this system at a larger scale will give us exactly the sort of data we need.
*   In our testing the pipeline was on average only 71% as effective as the model predicted. We need to resolve this discrepancy, and to the extent it turns out to be issues with the pipeline instead of the model being too simple we may be able to moderately increase our detection sensitivity.
*   Our sensitivity estimates are based only on SARS-CoV-2, but it would be better to have estimates based on a range of human-infecting viruses. In late Q3 we’re planning to put out a blog post combining the methods from our [relative abundance preprint](https://doi.org/10.1101/2023.12.22.23300450) with the new sequencing data described above, which should let us estimate from Influenza A as well.
*   While we’ve validated this computationally and with a likely lab contaminant, we would also like to run experiments where we “spike” samples with genetically modified viruses before sequencing them and running them through the pipeline.
*   The pipeline is tuned for Illumina data, where each base is called with high confidence. We would like to tune it to work on Nanopore data, which has a much higher error rate. This will become increasingly important as we scale up our [pooled individual sequencing](https://naobservatory.org/blog/updates-spring-2024#pooled-individual-sequencing) efforts.