<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Theo Sanderson</title>
    <link>/</link>
      <atom:link href="/index.xml" rel="self" type="application/rss+xml" />
    <description>Theo Sanderson</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Sat, 01 Jun 2030 13:00:00 +0000</lastBuildDate>
    <image>
      <url>/images/icon_hu141e5746c4390abcaff97a6bd8371d9c_4466_512x512_fill_lanczos_center_3.png</url>
      <title>Theo Sanderson</title>
      <link>/</link>
    </image>
    
    <item>
      <title>Example Talk</title>
      <link>/talk/example-talk/</link>
      <pubDate>Sat, 01 Jun 2030 13:00:00 +0000</pubDate>
      <guid>/talk/example-talk/</guid>
      <description>&lt;div class=&#34;alert alert-note&#34;&gt;
  &lt;div&gt;
    Click on the &lt;strong&gt;Slides&lt;/strong&gt; button above to view the built-in slides feature.
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Slides can be added in a few ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create&lt;/strong&gt; slides using Wowchemy&amp;rsquo;s &lt;a href=&#34;https://wowchemy.com/docs/managing-content/#create-slides&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;em&gt;Slides&lt;/em&gt;&lt;/a&gt; feature and link using &lt;code&gt;slides&lt;/code&gt; parameter in the front matter of the talk file&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Upload&lt;/strong&gt; an existing slide deck to &lt;code&gt;static/&lt;/code&gt; and link using &lt;code&gt;url_slides&lt;/code&gt; parameter in the front matter of the talk file&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Embed&lt;/strong&gt; your slides (e.g. Google Slides) or presentation video on this page using &lt;a href=&#34;https://wowchemy.com/docs/writing-markdown-latex/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;shortcodes&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Further event details, including &lt;a href=&#34;https://wowchemy.com/docs/writing-markdown-latex/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;page elements&lt;/a&gt; such as image galleries, can be added to the body of this page.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>A molnupiravir-associated mutational signature in global SARS-CoV-2 genomes</title>
      <link>/publication/2023-molnupiravir/</link>
      <pubDate>Fri, 27 Oct 2023 00:00:00 +0000</pubDate>
      <guid>/publication/2023-molnupiravir/</guid>
      <description></description>
    </item>
    
    <item>
      <title>SVG export from DeckGL</title>
      <link>/post/2023-09-14-deckgl-svg/</link>
      <pubDate>Thu, 14 Sep 2023 00:00:00 +0000</pubDate>
      <guid>/post/2023-09-14-deckgl-svg/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://taxonium.org&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Taxonium&lt;/a&gt;, my tool for exploring large phylogenetic trees, uses  a few tricks to be fast even when exploring trees of 15 million sequences. One is sparsification: there is no need to draw every single node when sometimes thousands are overlapping and occluding those below: where nodes overlap we only draw some of them. But even so, there are tens of thousands of nodes being shown, which means we need a framework for showing them that is faster than classic web approaches. We use &lt;a href=&#34;https://deck.gl&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;DeckGL&lt;/a&gt; which makes use of the GPU to display large numbers of visual elements quickly.&lt;/p&gt;
&lt;p&gt;DeckGL is inherently raster-based, it works in pixels. You can take screenshots of it in this pixelly form &amp;ndash; but these aren&amp;rsquo;t great for publications, where we much prefer infinitely zoomable vector graphics. DeckGL doesn&amp;rsquo;t have a way to export in a vector format, due to its underlying architecture, this but I&amp;rsquo;ve been thinking for a while that it wouldn&amp;rsquo;t be too hard to hack something together, and have finally got round to trying it.&lt;/p&gt;
&lt;p&gt;And it works pretty nicely:
&lt;img src=&#34;2023-09-14-17-52-05.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Below is an outline of the approach - this isn&amp;rsquo;t a full tutorial  or anything but might provide some inspiration if you&amp;rsquo;re facing a similar issue.&lt;/p&gt;
&lt;p&gt;Normally you build a &lt;code&gt;layers&lt;/code&gt; object for DeckGL layers which might look something like&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;const layers = [
    new ScatterplotLayer({
      data: [
        {position: [-122.45, 37.8], color: [255, 0, 0], radius: 100}
      ],
      getFillColor: d =&amp;gt; d.color,
      getRadius: d =&amp;gt; d.radius
    })
  ]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To be able to output SVG we want to first build an intermediate version which doesn&amp;rsquo;t use the DeckGL layers (there may be an alternative approach where you use them all along, but anyway..), so we use:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;const intermediateLayers =  [
    {
      layerType: &#39;ScatterplotLayer&#39;,
      data: [
        {position: [-122.45, 37.8], color: [255, 0, 0], radius: 100}
      ],
      getFillColor: d =&amp;gt; d.color,
      getRadius: d =&amp;gt; d.radius
    }
  ]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Of course we can easily generate our DeckGL layers from this intermediate version:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;const processedLayers = layers.map((layer) =&amp;gt; {
    switch (layer.layerType) {
      case &amp;quot;ScatterplotLayer&amp;quot;:
        return new ScatterplotLayer(layer);
      case &amp;quot;LineLayer&amp;quot;:
        return new LineLayer(layer);
      case &amp;quot;PolygonLayer&amp;quot;:
        return new PolygonLayer(layer);
      case &amp;quot;TextLayer&amp;quot;:
        return new TextLayer(layer);
      case &amp;quot;SolidPolygonLayer&amp;quot;:
        return new SolidPolygonLayer(layer);
      default:
        console.log(&amp;quot;could not map layer spec for &amp;quot;, layer);
    }
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(You may need to add more cases to this switch statement depending on what layers you are using.)&lt;/p&gt;
&lt;p&gt;But we can also generate SVG from this same intermediate object. &lt;a href=&#34;https://github.com/theosanderson/taxonium/blob/e1758284ecf9bca09593194e74fe3ff52ba372c1/taxonium_component/src/utils/deckglToSvg.js&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Here&lt;/a&gt; is the code I use to do that. It won&amp;rsquo;t work for you out of the box, it uses some viewState parameters called &lt;code&gt;min_x&lt;/code&gt;, &lt;code&gt;max_x&lt;/code&gt;, &lt;code&gt;min_y&lt;/code&gt;, &lt;code&gt;max_y&lt;/code&gt; which I set in other code. But hopefully it may be a source of inspiration in terms of how to go about things.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the function that does the real work:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;
const getSVG = (layers, viewState, svgWidth, svgHeight) =&amp;gt; {
const applyBounds = (point) =&amp;gt; {
    const minY = viewState.min_y;
    const maxY = viewState.max_y;
    const minX = viewState.min_x;
    const maxX = viewState.max_x;
    const initial = point;
    const x = normalise(initial[0], minX, maxX);
    const y = normalise(initial[1], minY, maxY);
    return [x * svgWidth, y * svgHeight];
};
if (!viewState.min_x) {
    window.alert(&amp;quot;Please zoom in and out a little before SVG export&amp;quot;);
    return false;
}
let svgContent = `&amp;lt;svg xmlns=&#39;http://www.w3.org/2000/svg&#39; width=&amp;quot;${svgWidth}&amp;quot; height=&amp;quot;${svgHeight}&amp;quot;&amp;gt;`;

for (const layer of layers) {
    // unless layer id starts with &amp;quot;main&amp;quot;
    if (!layer.id.startsWith(&amp;quot;main&amp;quot;)) {
    continue;
    }

    switch (layer.layerType) {
    case &amp;quot;ScatterplotLayer&amp;quot;:
        for (const point of layer.data) {
        const [x, y] = applyBounds(layer.getPosition(point));
        
        const accessor = layer.getFillColor
            ? layer.getFillColor
            : layer.getColor;
        let color;
        if (!accessor) {
            // make color transparent
            color = &amp;quot;none&amp;quot;;
        } else {
            const initColor = accessOrConstant(accessor, point);
            // if rgba
            if (initColor.length === 4) {
            color = `rgba(${initColor.join(&amp;quot;,&amp;quot;)})`;
            if (initColor[3] === 0) {
                color = &amp;quot;none&amp;quot;;
            }
            }
            // if rgb
            else if (initColor.length === 3) {
            color = `rgb(${initColor.join(&amp;quot;,&amp;quot;)})`;
            } else {
            console.warn(&amp;quot;Unsupported color format&amp;quot;);
            }
        }
        // check if stroked
        let strokeColor, strokeWidth;
        if (layer.stroked) {
            strokeColor = accessOrConstant(layer.getLineColor, point).join(
            &amp;quot;,&amp;quot;
            );
            strokeWidth = accessOrConstant(layer.getLineWidth, point);
        }

        // if getRadius is a fn call it otherwise assume it&#39;s a value
        const radius = accessOrConstant(layer.getRadius, point);
        svgContent += `&amp;lt;circle cx=&amp;quot;${x}&amp;quot; cy=&amp;quot;${y}&amp;quot; r=&amp;quot;${radius}&amp;quot; fill=&amp;quot;${color}&amp;quot;
        ${
            layer.stroked
            ? `stroke=&amp;quot;rgb(${strokeColor})&amp;quot; stroke-width=&amp;quot;${strokeWidth}&amp;quot;`
            : &amp;quot;&amp;quot;
        } /&amp;gt;`;
        }
        break;

    case &amp;quot;LineLayer&amp;quot;:
        for (const line of layer.data) {
        const [x1, y1] = applyBounds(layer.getSourcePosition(line));
        const [x2, y2] = applyBounds(layer.getTargetPosition(line));
        // if either is null, skip this point
        if (x1 === null || y1 === null || x2 === null || y2 === null) {
            continue;
        }
        const colorAccessor = layer.getLineColor
            ? layer.getLineColor
            : layer.getColor;
        // if colorAccessor is a function, call it with the line as an argument, otherwise assume it&#39;s an array
        const color = accessOrConstant(colorAccessor, line).join(&amp;quot;,&amp;quot;);
        const width = accessOrConstant(layer.getWidth, line);
        svgContent += `&amp;lt;line x1=&amp;quot;${x1}&amp;quot; y1=&amp;quot;${y1}&amp;quot; x2=&amp;quot;${x2}&amp;quot; y2=&amp;quot;${y2}&amp;quot; stroke=&amp;quot;rgb(${color})&amp;quot; stroke-width=&amp;quot;${width}&amp;quot; /&amp;gt;`;
        }
        break;

    case &amp;quot;TextLayer&amp;quot;:
        for (const text of layer.data) {
        //const [x, y] = applyModelMatrix(layer.modelMatrix, layer.getPosition(text));
        const original = layer.getPosition(text);
        const adjusted = applyBounds(original);

        const [x, y] = adjusted;
        const size = accessOrConstant(layer.getSize, text);
        const alignment = accessOrConstant(
            layer.getAlignmentBaseline,
            text
        );
        const anchor = accessOrConstant(layer.getTextAnchor, text);
        const pixelOffset = accessOrConstant(layer.getPixelOffset, text);

        const color = accessOrConstant(layer.getColor, text).join(&amp;quot;,&amp;quot;);
        const newContent = `&amp;lt;text x=&amp;quot;${x}&amp;quot; y=&amp;quot;${y}&amp;quot; font-family=&amp;quot;${
            layer.fontFamily
        }&amp;quot; font-weight=&amp;quot;${layer.fontWeight}&amp;quot; fill=&amp;quot;rgb(${color})&amp;quot;
        font-size=&amp;quot;${size}&amp;quot; text-anchor=&amp;quot;${anchor}&amp;quot; alignment-baseline=&amp;quot;${alignment}&amp;quot; dx=&amp;quot;${
            pixelOffset[0]
        }&amp;quot; dy=&amp;quot;${pixelOffset[1]}&amp;quot;
        &amp;gt;${layer.getText(text)}&amp;lt;/text&amp;gt;`;
        svgContent += newContent;
        }
        break;

    // You can extend this with other layer types such as PolygonLayer, SolidPolygonLayer, etc.

    default:
        console.warn(`Unsupported layer type: ${layer.layerType}`);
        break;
    }
}

svgContent += &amp;quot;&amp;lt;/svg&amp;gt;&amp;quot;;
return svgContent;
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There&amp;rsquo;s also a useful function in there that will trigger a download of the SVG.&lt;/p&gt;
&lt;p&gt;You can see it all in action by clicking the 📷 button in the bottom right on &lt;a href=&#34;//cov2tree.org&#34;&gt;Cov2Tree&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Anyway, if you&amp;rsquo;re stuck on this problem hopefully this provides inspiration that a solution is possible. Best of luck!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Independent SARS-CoV-2 staff testing protected academic and health-care institutions in northwest London</title>
      <link>/publication/bailey-2023-independent/</link>
      <pubDate>Mon, 19 Jun 2023 00:00:00 +0000</pubDate>
      <guid>/publication/bailey-2023-independent/</guid>
      <description></description>
    </item>
    
    <item>
      <title>LabGPT</title>
      <link>/post/2023-03-16-labgpt/</link>
      <pubDate>Thu, 16 Mar 2023 00:00:00 +0000</pubDate>
      <guid>/post/2023-03-16-labgpt/</guid>
      <description>&lt;p&gt;Yesterday, &lt;a href=&#34;https://openai.com/research/gpt-4&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;GPT-4&lt;/a&gt; was released.&lt;/p&gt;
&lt;p&gt;I had a play to see how well it might be able to plan and run biological experiments. Scroll to the bottom for some caveats.&lt;/p&gt;
&lt;hr&gt;
&lt;style&gt;
.chat-container {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.chat-speaker {
  grid-column: 1;
}

.chat-message {
  grid-column: 2;
  margin-left: 0;
  /* because of border-box we need to add the padding to the width */
  width: calc(100% - 6rem);
  word-wrap: break-word;
  font-size: 0.8rem;
  color: #666; /* Choose your desired color */
}

.speaker-name {
  background-color: #777; /* Choose your desired color */
  color: white;
  width:100px;
  text-align:center;
  display:inline-block;
  margin-top:10px;
  padding: 2px 5px;
  border-radius: 5px;
}


&lt;/style&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;THEO&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;
&lt;div style=&#34; height: 180px; overflow-y: scroll;&#34;&gt;
&lt;p&gt;You are LabGPT. You are in charge of conducting scientific experiments to achieve a stated goal. You have access to an OpenTrons OT2 robot and a lab helper&lt;/p&gt;
&lt;p&gt;The OpenTrons robot is equipped with a P300 Multi GEN2 (20-300 µL) which has 8 channels in columnar format&lt;/p&gt;
&lt;p&gt;You have access to the following commands:&lt;/p&gt;
&lt;p&gt;Request: enter a request to a user. you can use this for example to get them to set some labware up inside the robot in desired positions.&lt;/p&gt;
&lt;p&gt;ExecuteRobotScript: runs a Python script written in the OT2 API&lt;/p&gt;
&lt;p&gt;After running a command wait for user to respond confirming the action.&lt;/p&gt;
&lt;p&gt;Use the following format:&lt;/p&gt;
&lt;p&gt;Task: the input task you must complete&lt;/p&gt;
&lt;p&gt;Thought: you should always think about what to do&lt;/p&gt;
&lt;p&gt;Thought: [you can think multiple times]&lt;/p&gt;
&lt;p&gt;Thought: [you should describe exactly what the action below will achieve in granular detail and how that helps your objective]&lt;/p&gt;
&lt;p&gt;Action: the action to take, should be one of [Request, ExecuteRobotScript]&lt;/p&gt;
&lt;p&gt;Action Input: The input to the action. Format scripts in ``` blocks&lt;/p&gt;
&lt;p&gt;[at this point wait for a response from the user / robot]&lt;/p&gt;
&lt;p&gt;Thought: OK, now I can move to the next step, I will now [..]&lt;/p&gt;
&lt;p&gt;Plan: The action below will first get some tips from tip rack in slot 5, then pick up compound 1 from the reservoir at 6 then dispense it in column 4. This should result in column 4 having drug. Then it will [..]&lt;/p&gt;
&lt;p&gt;Action [etc.]&lt;/p&gt;
&lt;p&gt;Hints:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;don&amp;rsquo;t mix bleach with compounds that could generate chlorine&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;for serial dilutions don&amp;rsquo;t forget to add media before doing the serial dilution&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;achieve final volumes of 200ul for plate-based assays&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&amp;rsquo;s begin.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;THEO&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Your task is to set up an assay that will allow the IC50 of a malaria drug to be calculated.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You have these reagents:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;drug: the drug in a reservoir&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;media: malaria culture media in a reservoir for diluting the drug&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;parasites: packed RBCs infected with malaria parasites&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can ask the user to set these up as you want (as long as there is one item per slot). You can request whatever extra empty labware you want.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;CHATGPT&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;Task: Set up an assay that will allow the IC50 of a malaria drug to be calculated.&lt;/p&gt;
&lt;p&gt;Thought: First, I need to ask the user to set up the labware and reagents in the appropriate positions on the OT2 robot deck.&lt;/p&gt;
&lt;p&gt;Thought: I should request labware for the drug, media, parasites, a tip rack, an empty 96-well plate for the serial dilutions and assay, and an extra reservoir for waste.&lt;/p&gt;
&lt;p&gt;Request: Please set up the following labware on the OT2 robot deck:&lt;/p&gt;
&lt;p&gt;Place the drug reservoir in slot 1.&lt;/p&gt;
&lt;p&gt;Place the media reservoir in slot 2.&lt;/p&gt;
&lt;p&gt;Place the parasite reservoir in slot 3.&lt;/p&gt;
&lt;p&gt;Place a P300 tip rack in slot 5.&lt;/p&gt;
&lt;p&gt;Place an empty 96-well plate in slot 6 for the serial dilutions and assay.&lt;/p&gt;
&lt;p&gt;Place an empty reservoir in slot 7 for waste disposal.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;THEO&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s done&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;CHATGPT&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;Thought: Great, the labware is set up. Now I can start preparing the serial dilutions of the drug in the 96-well plate.&lt;/p&gt;
&lt;p&gt;Thought: I&amp;rsquo;ll begin by adding 100 µL of media to columns 1-11 of the 96-well plate. This will create a base for the serial dilutions.&lt;/p&gt;
&lt;p&gt;ExecuteRobotScript:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;
from opentrons import protocol_api
metadata = {&#39;apiLevel&#39;: &#39;2.11&#39;}
def run(protocol: protocol_api.ProtocolContext):
    # Labware
    tip_rack = protocol.load_labware(&#39;opentrons_96_tiprack_300ul&#39;, 5)
    media_reservoir = protocol.load_labware(&#39;nest_12_reservoir_15ml&#39;, 2)
    plate = protocol.load_labware(&#39;corning_96_wellplate_360ul_flat&#39;, 6)
    # Pipettes
    p300_multi = protocol.load_instrument(&#39;p300_multi_gen2&#39;, &#39;left&#39;, tip_racks=[tip_rack])
    # Add 100 µL of media to columns 1-11 of the 96-well plate
    p300_multi.pick_up_tip()
    for column in plate.columns()[0:11]:
        p300_multi.aspirate(100, media_reservoir[&#39;A1&#39;])
        p300_multi.dispense(100, column[0])
    p300_multi.drop_tip()

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thought: Once the media is added to the plate, I can proceed with the serial dilutions.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;THEO&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s done&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;CHATGPT&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;Thought: Now that the media is in the 96-well plate, I can start preparing the serial dilutions by adding the drug to column 1 and then performing the dilutions across columns 2-11.&lt;/p&gt;
&lt;p&gt;Thought: First, I&amp;rsquo;ll add 100 µL of the drug to column 1, which will result in a 1:1 dilution.&lt;/p&gt;
&lt;p&gt;ExecuteRobotScript:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;
from opentrons import protocol_api

metadata = {&#39;apiLevel&#39;: &#39;2.11&#39;}

def run(protocol: protocol_api.ProtocolContext):
    # Labware
    tip_rack = protocol.load_labware(&#39;opentrons_96_tiprack_300ul&#39;, 5)
    drug_reservoir = protocol.load_labware(&#39;nest_12_reservoir_15ml&#39;, 1)
    plate = protocol.load_labware(&#39;corning_96_wellplate_360ul_flat&#39;, 6)

    # Pipettes
    p300_multi = protocol.load_instrument(&#39;p300_multi_gen2&#39;, &#39;left&#39;, tip_racks=[tip_rack])

    # Add 100 µL of the drug to column 1 of the 96-well plate
    p300_multi.pick_up_tip()
    p300_multi.aspirate(100, drug_reservoir[&#39;A1&#39;])
    p300_multi.dispense(100, plate[&#39;A1&#39;])
    p300_multi.drop_tip()



&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thought: After adding the drug to column 1, I can perform the serial dilutions across columns 2-11.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;THEO&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s done too :)&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;CHATGPT&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;Thought: The drug has been added to column 1. Now I can perform the serial dilutions across columns 2-11 by transferring 100 µL from one column to the next and mixing.&lt;/p&gt;
&lt;p&gt;ExecuteRobotScript:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;
from opentrons import protocol_api

metadata = {&#39;apiLevel&#39;: &#39;2.11&#39;}

def run(protocol: protocol_api.ProtocolContext):
    # Labware
    tip_rack = protocol.load_labware(&#39;opentrons_96_tiprack_300ul&#39;, 5)
    plate = protocol.load_labware(&#39;corning_96_wellplate_360ul_flat&#39;, 6)

    # Pipettes
    p300_multi = protocol.load_instrument(&#39;p300_multi_gen2&#39;, &#39;left&#39;, tip_racks=[tip_rack])

    # Perform serial dilutions across columns 2-11
    for source_col, dest_col in zip(plate.columns()[0:10], plate.columns()[1:11]):
        p300_multi.pick_up_tip()
        p300_multi.aspirate(100, source_col[0])
        p300_multi.dispense(100, dest_col[0])
        p300_multi.mix(5, 100, dest_col[0])
        p300_multi.blow_out(dest_col[0].top())
        p300_multi.drop_tip()



&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thought: Once the serial dilutions are complete, I can add the parasites to each well and set up the assay.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;THEO&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s done&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;CHATGPT&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;Thought: The serial dilutions are ready. Now, I can add 100 µL of the parasite suspension to each well in columns 1-11 of the 96-well plate to set up the assay.&lt;/p&gt;
&lt;p&gt;ExecuteRobotScript:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;
from opentrons import protocol_api

metadata = {&#39;apiLevel&#39;: &#39;2.11&#39;}

def run(protocol: protocol_api.ProtocolContext):
    # Labware
    tip_rack = protocol.load_labware(&#39;opentrons_96_tiprack_300ul&#39;, 5)
    parasite_reservoir = protocol.load_labware(&#39;nest_12_reservoir_15ml&#39;, 3)
    plate = protocol.load_labware(&#39;corning_96_wellplate_360ul_flat&#39;, 6)

    # Pipettes
    p300_multi = protocol.load_instrument(&#39;p300_multi_gen2&#39;, &#39;left&#39;, tip_racks=[tip_rack])

    # Add 100 µL of parasite suspension to each well in columns 1-11 of the 96-well plate
    p300_multi.pick_up_tip()
    for column in plate.columns()[0:11]:
        p300_multi.aspirate(100, parasite_reservoir[&#39;A1&#39;])
        p300_multi.dispense(100, column[0])
        p300_multi.mix(5, 100, column[0])
    p300_multi.drop_tip()



&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thought: With the parasites added to the wells, the assay is set up and ready for incubation and further analysis.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;chat-container&#34;&gt;
  &lt;div class=&#34;chat-speaker&#34;&gt;
    &lt;span class=&#34;speaker-name&#34;&gt;THEO&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&#34;chat-message&#34;&gt;&lt;/p&gt;
&lt;p&gt;Fantastic &amp;ndash; thanks! I&amp;rsquo;ll stick them in the incubator&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p style=&#34;height: 30px; margin: 0px; padding: 0px;&#34;&gt;&lt;/p&gt;
&lt;p&gt;So: pretty cool. But, to confirm doing it like this is not ready for prime time. Firstly, I haven&amp;rsquo;t actually checked this code runs, though it looks fairly plausible. In my various experiments it definitely sometimes tried to run protocols which didn&amp;rsquo;t quite make sense, and I added some hints to guide it in the prompt. Clearly setting up dilution series is something that will be in the training set already. Also, trying to do more complex stuff &amp;ldquo;set up an assay that would allow me to draw an isobologram&amp;rdquo; didn&amp;rsquo;t go so well.&lt;/p&gt;
&lt;p&gt;However on the other side of the coin, this model has never been remotely fine-tuned for this task. There may well be a lot of low-hanging gains to be made from doing a bit of fine-tuning with some specific tasks. Even just from working out exactly what hints to add to the prompt. With the 32k context length you could imagine a really long prompt with a bunch of examples. Watch this space.&lt;/p&gt;
&lt;p&gt;** Update **&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s better to use the Jupyter-style OT API to avoid the boilerplate above.&lt;/p&gt;
&lt;p&gt;Here it does some maths to figure out how to make up a mastermix:&lt;/p&gt;
&lt;blockquote class=&#34;twitter-tweet&#34;&gt;&lt;p lang=&#34;in&#34; dir=&#34;ltr&#34;&gt;GPT-4 sets up a PCR (pt 1) &lt;a href=&#34;https://t.co/J6NDloCDLW&#34;&gt;pic.twitter.com/J6NDloCDLW&lt;/a&gt;&lt;/p&gt;&amp;mdash; Theo Sanderson (@theosanderson) &lt;a href=&#34;https://twitter.com/theosanderson/status/1636412631216013314?ref_src=twsrc%5Etfw&#34;&gt;March 16, 2023&lt;/a&gt;&lt;/blockquote&gt; &lt;script async src=&#34;https://platform.twitter.com/widgets.js&#34; charset=&#34;utf-8&#34;&gt;&lt;/script&gt;
&lt;blockquote class=&#34;twitter-tweet&#34;&gt;&lt;p lang=&#34;en&#34; dir=&#34;ltr&#34;&gt;(contd.) &lt;a href=&#34;https://t.co/czMfySDs9C&#34;&gt;pic.twitter.com/czMfySDs9C&lt;/a&gt;&lt;/p&gt;&amp;mdash; Theo Sanderson (@theosanderson) &lt;a href=&#34;https://twitter.com/theosanderson/status/1636413656853532674?ref_src=twsrc%5Etfw&#34;&gt;March 16, 2023&lt;/a&gt;&lt;/blockquote&gt; &lt;script async src=&#34;https://platform.twitter.com/widgets.js&#34; charset=&#34;utf-8&#34;&gt;&lt;/script&gt;
</description>
    </item>
    
    <item>
      <title>ProteInfer: deep networks for protein functional inference</title>
      <link>/publication/sanderson-2021-proteinfer/</link>
      <pubDate>Mon, 27 Feb 2023 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2021-proteinfer/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Regulators of male and female sexual development critical for transmission of a malaria parasite</title>
      <link>/publication/russell-2021-regulators/</link>
      <pubDate>Sun, 01 Jan 2023 00:00:00 +0000</pubDate>
      <guid>/publication/russell-2021-regulators/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Taxonium, a web-based tool for exploring large phylogenetic trees</title>
      <link>/publication/sanderson-2022-taxonium/</link>
      <pubDate>Tue, 01 Nov 2022 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2022-taxonium/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Treenome Browser: co-visualization of enormous phylogenies and millions of genomes</title>
      <link>/publication/kramer-2022-treenome/</link>
      <pubDate>Sat, 01 Oct 2022 00:00:00 +0000</pubDate>
      <guid>/publication/kramer-2022-treenome/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Determinants of Spike infectivity, processing, and neutralization in SARS-CoV-2 Omicron subvariants BA. 1 and BA. 2</title>
      <link>/publication/pastorio-2022-determinants/</link>
      <pubDate>Thu, 01 Sep 2022 00:00:00 +0000</pubDate>
      <guid>/publication/pastorio-2022-determinants/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Identifying malaria phenotype papers with GPT-3</title>
      <link>/post/2022-07-07-gpt3/</link>
      <pubDate>Thu, 11 Aug 2022 00:00:00 +0000</pubDate>
      <guid>/post/2022-07-07-gpt3/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Visit &lt;a href=&#34;https://papers.phenoplasm.org&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;papers.phenoplasm.org&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Some years ago I launched &lt;a href=&#34;http://phenoplasm.org&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PhenoPlasm&lt;/a&gt; which aims to catalogue all reported phenotypes in Plasmodium in a systematic machine- (and human-) readable format. At the time I tried to populate it with all reported phenotypes in &lt;em&gt;Plasmodium falciparum&lt;/em&gt; to date, using a series of searches on Google scholar. &lt;a href=&#34;https://www.pberghei.eu/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;RMgmDB&lt;/a&gt; pre-dates Phenoplasm, and provides an amazing curated resource for the rodent malaria databases.&lt;/p&gt;
&lt;p&gt;Since then I have done my best to stay on top of the literature and add new phenotypes to the database as they appear. (Also, anyone can add a phenotype, and I encourage you to!)&lt;/p&gt;
&lt;p&gt;However it isn&amp;rsquo;t always easy to stay on top of the literature, especially in recent years where I have been spending time on SARS-CoV-2 genetics. When the Bushell lab invited me to contribute to a &lt;a href=&#34;https://portlandpress.com/biochemsoctrans/article/doi/10.1042/BST20210281/231360/CRISPR-Cas9-and-genetic-screens-in-malaria&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;review&lt;/a&gt; of the impact of screening in malaria parasites, by pulling out the latest phenotypes from the database, I felt I had better do a substantial update, sifting the literature again for phenotypes I might have missed in recent years. And I decided to do so with the help of machine learning.&lt;/p&gt;
&lt;p&gt;I actually have quite a good training set. Each PhenoPlasm curated phenotype, and each &lt;a href=&#34;https://www.pberghei.eu/index.php&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;RMgmDB&lt;/a&gt; entry, is associated with a Pubmed ID, so I had a list of several hundred Pubmed IDs, representing the sort of papers that I need to read to identify phenotypes. I don&amp;rsquo;t have a list of definite negatives, but just identifying papers that come up in a search for &amp;ldquo;malaria OR plasmodium&amp;rdquo; and aren&amp;rsquo;t in the positives produces a set that are almost all papers that are not of interest.&lt;/p&gt;
&lt;p&gt;I decided to use a process called &amp;ldquo;fine-tuning&amp;rdquo; to train a model, where I&amp;rsquo;d start with a model (GPT-3) already trained to do other tasks in English, and then tweak it to be good at classifying papers according to whether they reported a phenotype. This is helpful because the model can already start with a good knowledge of English, which is helpful if there aren&amp;rsquo;t thousands of positive training examples. If the model really knows what words mean then it may be able to trained on examples that say &amp;ldquo;we deleted gene X&amp;rdquo; and &amp;ldquo;we disrupted gene X&amp;rdquo;, and then generalise to examples it has not seen like &amp;ldquo;we abrogated the function of gene X&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;The downside of using GPT-3 is that it is a commercial offering and you pay for each token (approximately per word) that you use. I have two pieces of data for each PubMed ID: the title and the abstract. I decided to take an approach very like a human who is limited by how much time they can spend reading. I trained one model to classify papers by &lt;em&gt;just their title&lt;/em&gt;. Then I trained a second model to perform classification based on reading the full abstract.&lt;/p&gt;
&lt;p&gt;If the cheap title model gave a reasonable probability that the paper might report a phenotype then I ran it through the abstract model to get more confidence one way or the other.&lt;/p&gt;
&lt;p&gt;Because RMgmDB handles the rodent malaria phenotypes, I don&amp;rsquo;t necessarily need to read those papers, so I also built in a classifier for whether the paper reports a phenotype in &lt;em&gt;P. berghei&lt;/em&gt; or &lt;em&gt;P. falciparum&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;When we look at the 10 titles that the title classifier is most confident report a phenotype they look like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Plasmodium liver stage developmental arrest by depletion of a protein at the parasite-host interface.&lt;/li&gt;
&lt;li&gt;A Plasmodium homolog of ER tubule-forming proteins is required for parasite virulence.&lt;/li&gt;
&lt;li&gt;A role for the Plasmodium falciparum RESA protein in resistance against heat shock demonstrated using gene disruption.&lt;/li&gt;
&lt;li&gt;An essential role of the basal body protein SAS-6 in Plasmodium male gamete development and malaria transmission.&lt;/li&gt;
&lt;li&gt;Disruption of the Plasmodium falciparum PfPMT gene results in a complete loss of phosphatidylcholine biosynthesis via the serine-decarboxylase-phosphoethanolamine-methyltransferase pathway and severe growth and survival defects.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can see that these titles are those with very clear flags of a phenotype (knockdown, essential, etc.)&lt;/p&gt;
&lt;p&gt;In contrast the ten titles least likely to report a phenotype look like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;A critical review of traditional medicine and traditional healer use for malaria and among people in malaria-endemic areas: contemporary research in low to middle-income Asia-Pacific countries.&lt;/li&gt;
&lt;li&gt;Co-infections of Schistosoma spp. and malaria with hepatitis viruses from endemic countries: A systematic review and meta-analysis.&lt;/li&gt;
&lt;li&gt;Same-day antiretroviral therapy initiation for people living with HIV who have tuberculosis symptoms: a systematic review.&lt;/li&gt;
&lt;li&gt;Efficacy and safety of artemisinin-based combination therapies for the treatment of uncomplicated malaria in pediatrics: a systematic review and meta-analysis.&lt;/li&gt;
&lt;li&gt;Aetiology of fever in returning travellers and migrants: a systematic review and meta-analysis.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;These are papers with clear flags of relating to malaria in medicine, rather than molecular biology.&lt;/p&gt;
&lt;p&gt;In general this title model seems to be doing a decent job, and the abstract model adds significant confirmation, as well as identifying the species involved.&lt;/p&gt;
&lt;p&gt;I now run this model over the latest PubMed results each day, and the results are at &lt;a href=&#34;https://papers.phenoplasm.org&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;papers.phenoplasm.org&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>The origins and molecular evolution of SARS-CoV-2 lineage B. 1.1. 7 in the UK</title>
      <link>/publication/hill-2022-origins/</link>
      <pubDate>Wed, 01 Jun 2022 00:00:00 +0000</pubDate>
      <guid>/publication/hill-2022-origins/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Barcoding genetically distinct Plasmodium falciparum strains for comparative assessment of fitness and antimalarial drug resistance</title>
      <link>/publication/carrasquilla-2022-barcoding/</link>
      <pubDate>Sat, 01 Jan 2022 00:00:00 +0000</pubDate>
      <guid>/publication/carrasquilla-2022-barcoding/</guid>
      <description></description>
    </item>
    
    <item>
      <title>CRISPR/Cas9 and genetic screens in malaria parasites: small genomes, big impact</title>
      <link>/publication/ishizaki-2022-crispr/</link>
      <pubDate>Sat, 01 Jan 2022 00:00:00 +0000</pubDate>
      <guid>/publication/ishizaki-2022-crispr/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Emergence of new subgenomic mRNAs in SARS-CoV-2</title>
      <link>/publication/mears-2022-emergence/</link>
      <pubDate>Sat, 01 Jan 2022 00:00:00 +0000</pubDate>
      <guid>/publication/mears-2022-emergence/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Using deep learning to annotate the protein universe</title>
      <link>/publication/bileschi-2022-using/</link>
      <pubDate>Sat, 01 Jan 2022 00:00:00 +0000</pubDate>
      <guid>/publication/bileschi-2022-using/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Genomic reconstruction of the SARS-CoV-2 epidemic in England</title>
      <link>/publication/vohringer-2021-genomic/</link>
      <pubDate>Fri, 01 Oct 2021 00:00:00 +0000</pubDate>
      <guid>/publication/vohringer-2021-genomic/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Two tips for experimental design of barseq experiments</title>
      <link>/post/2021-09-30-tips/</link>
      <pubDate>Thu, 30 Sep 2021 00:00:00 +0000</pubDate>
      <guid>/post/2021-09-30-tips/</guid>
      <description>&lt;p&gt;In my time I&amp;rsquo;ve done various bits of analysis for barcode-sequencing (barseq) experiments (in &lt;em&gt;Plasmodium&lt;/em&gt;), and sometimes have chats with people who are starting for the first time. Basically these chats tend to often hit the same two beats about experimental design so here&amp;rsquo;s a quick blog post about them.&lt;/p&gt;
&lt;h2 id=&#34;tip-1-work-out-how-many-barcodes-you-expect-to-go-into-your-process&#34;&gt;Tip 1: work out how many barcodes you expect to go into your process&lt;/h2&gt;
&lt;p&gt;Probably the biggest contribution I made to the design of barseq experiments I was involved with was to figure out that we simply weren&amp;rsquo;t loading enough barcodes into our PCRs. To figure out whether this could be an issue for you, you just need to work through some simple maths.&lt;/p&gt;
&lt;p&gt;Say you are taking a timecourse of cultured parasites, and at each timepoint you take 1 ml of culture for extraction. If you&amp;rsquo;re working at 2% haematocrit, then that&amp;rsquo;s 20 μl of packed blood. A red blood cell is about 100 femtolitres, so in this sample you have about 200 million RBCs.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;2021-09-30-16-40-48.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;In some of your samples, perhaps parasitaemia is as low as 0.1%? If so then your 200 million RBCs contain 200,000 parasites. Now you take that blood and you put it through a DNA extraction. Suppose this is 50% efficient. Now you are down to 100,000 parasites. You elute in 200 microlitres, so in each microlitre you have just 500 parasites&#39; worth of barcodes.&lt;/p&gt;
&lt;p&gt;Suppose you use 2 μl of template in your barcode amplification PCR, that is 1000 parasites that make it to the PCR. Now suppose you have 20 different barcodes represented in this sample. In an idealised situation where those barcodes are equally abundant you would have 50 barcodes for each of them. In practice however, there is probably quite a range of abundances, perhaps with some barcodes ten times as common as others. So there could easily be barcodes for which we expect only 5 copies to be present in the template.&lt;/p&gt;
&lt;p&gt;Of course although we &amp;ldquo;expect&amp;rdquo; 5, the process of sampling is essentially a binomial distribution and so we could easily by chance end up with 4, or 6, or 3, or 2. (This is the same sort of uncertainty that one gets in opinion polls with small sample sizes). If in one timepoint by chance one has 2 barcodes, and in the next by chance one has 6, that appears to be a three-fold change which might actually not be meaningful at all.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;2021-09-30-17-12-23.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;If one is able to boost the number of barcodes that get into the sample, for instance by extracting into say 10 μl and still loading 2 μl (a twenty-fold boost), one can get a much better signal-to-noise ratio.&lt;/p&gt;
&lt;h2 id=&#34;tip-2-always-perform-technical-duplicate-pcrs&#34;&gt;Tip 2: always perform technical duplicate PCRs&lt;/h2&gt;
&lt;p&gt;We&amp;rsquo;ve seen above that random sampling can potentially create uncertainty in your measurements. One issue is that with a single PCR from each sample, you won&amp;rsquo;t actually be aware of these uncertainties! You&amp;rsquo;ll just have some numbers for barcodes present in each sample.&lt;/p&gt;
&lt;p&gt;This is easy to fix by performing technical duplicate PCRs for each sample (N.B. you can probably do even better with UMI approaches, but I haven&amp;rsquo;t yet). You may worry that duplicates aren&amp;rsquo;t enough to quantify uncertainty and that you need triplicates or more, but because you have so many pairwise comparisons in each sample (one for each barcode), you can improve the estimate of uncertainty for a particular barcode by taking a rolling average with other barcodes of similar abundance. And fundamentally with a scatter-plot you can get a good sense of whether a particular sample has failed. The duplicates hugely add to your ability to interpret your data.&lt;/p&gt;
&lt;p&gt;This approach lets you quantify the sampling-induced uncertainty for each measurement, and you can then &lt;a href=&#34;https://en.wikipedia.org/wiki/Propagation_of_uncertainty&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;propagate that uncertainty&lt;/a&gt; through to all downstream steps where you calculate downstream values of interest based on these measurements.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>FlowAlign</title>
      <link>/project/flowalign/</link>
      <pubDate>Tue, 27 Apr 2021 00:00:00 +0000</pubDate>
      <guid>/project/flowalign/</guid>
      <description>&lt;p&gt;Python package / CLI tool for easy alignment of viral sequences to reference (using minimap2 under the hood)&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>LFD, PCR, PPV, TLA</title>
      <link>/post/2021-04-09-lfds/</link>
      <pubDate>Fri, 09 Apr 2021 10:18:37 +0000</pubDate>
      <guid>/post/2021-04-09-lfds/</guid>
      <description>&lt;p&gt;People are very interested in the &lt;em&gt;positive predictive value&lt;/em&gt; of lateral flow tests. That is, if you receive a positive result from the test, how likely is it that you truly are infected? Personally I think that in terms of measuring whether these tests are helpful to society, this metric is actually not terribly useful - since it is strongly affected by how much virus is circulating in the population. That means that the metric implies that lateral flow testing is useless in countries with very low numbers of cases &amp;ndash; but actually LFDs have exactly the same effect on R whatever the level of virus in the population, and the same number of absolute false positives.&lt;/p&gt;
&lt;p&gt;Nevertheless, it is understandable that people want a test to ideally give them the right answer about their own status. They are now helped by the fact that the government says that all LFD positives should be followed up by confirmatory PCR testing, which both helps an individual to confirm their status, and also has the potential to provide us all with information about the general reliability of these tests. Information has not been released systematically on what proportion of PCR retests confirm LFD results, but today the coronavirus dashboard has changed to exclude cases which were retested and gave negative results. Therefore by comparing today&amp;rsquo;s results with yesterdays we can get a sense of this metric and calculate the minimum possible PPV, assuming that the PCR retest has 100% sensitivity. These sorts of analyses have already been described by &lt;a href=&#34;https://twitter.com/BristOliver/status/1380544543695716353&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Oliver Johnson&lt;/a&gt; and &lt;a href=&#34;https://twitter.com/alexselby1770/status/1380614571791151106&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Alex Selby&lt;/a&gt; amongst others.&lt;/p&gt;
&lt;p&gt;Here is my quick look in R&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;

&lt;span class=&#39;nv&#39;&gt;before&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;https://api.coronavirus.data.gov.uk/v2/data?areaType=nation&amp;amp;areaCode=E92000001&amp;amp;metric=newCasesLFDOnlyBySpecimenDate&amp;amp;metric=changeInNewCasesBySpecimenDate&amp;amp;format=csv&amp;amp;release=2021-04-08&amp;amp;metric=newCasesLFDConfirmedPCRBySpecimenDate&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Parsed with column specification:&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; cols(&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   date = &lt;span style=&#39;color: #0000BB;&#39;&gt;col_date(format = &#34;&#34;)&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   areaType = &lt;span style=&#39;color: #BB0000;&#39;&gt;col_character()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   areaCode = &lt;span style=&#39;color: #BB0000;&#39;&gt;col_character()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   areaName = &lt;span style=&#39;color: #BB0000;&#39;&gt;col_character()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   newCasesLFDOnlyBySpecimenDate = &lt;span style=&#39;color: #00BB00;&#39;&gt;col_double()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   changeInNewCasesBySpecimenDate = &lt;span style=&#39;color: #00BB00;&#39;&gt;col_double()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   newCasesLFDConfirmedPCRBySpecimenDate = &lt;span style=&#39;color: #00BB00;&#39;&gt;col_double()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; )&lt;/span&gt;


&lt;span class=&#39;nv&#39;&gt;after&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;https://api.coronavirus.data.gov.uk/v2/data?areaType=nation&amp;amp;areaCode=E92000001&amp;amp;metric=newCasesLFDOnlyBySpecimenDate&amp;amp;metric=changeInNewCasesBySpecimenDate&amp;amp;format=csv&amp;amp;release=2021-04-09&amp;amp;metric=newCasesLFDConfirmedPCRBySpecimenDate&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Parsed with column specification:&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; cols(&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   date = &lt;span style=&#39;color: #0000BB;&#39;&gt;col_date(format = &#34;&#34;)&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   areaType = &lt;span style=&#39;color: #BB0000;&#39;&gt;col_character()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   areaCode = &lt;span style=&#39;color: #BB0000;&#39;&gt;col_character()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   areaName = &lt;span style=&#39;color: #BB0000;&#39;&gt;col_character()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   newCasesLFDOnlyBySpecimenDate = &lt;span style=&#39;color: #00BB00;&#39;&gt;col_double()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   changeInNewCasesBySpecimenDate = &lt;span style=&#39;color: #00BB00;&#39;&gt;col_double()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   newCasesLFDConfirmedPCRBySpecimenDate = &lt;span style=&#39;color: #00BB00;&#39;&gt;col_double()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; )&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;http://zoo.R-Forge.R-project.org/&#39;&gt;zoo&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; Attaching package: &#39;zoo&#39;&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; The following objects are masked from &#39;package:base&#39;:&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;     as.Date, as.Date.numeric&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;both&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;inner_join&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;before&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;after&lt;/span&gt;,by&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;date&#34;&lt;/span&gt;, suffix&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;_before&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;_after&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2020-12-15&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2021-04-01&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;both&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;both&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;notional_false_positives &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;newCasesLFDOnlyBySpecimenDate_before&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;newCasesLFDOnlyBySpecimenDate_after&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;  &lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;newCasesLFDConfirmedPCRBySpecimenDate_before&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;newCasesLFDConfirmedPCRBySpecimenDate_after&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;arrange&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;notional_false_positives&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/zoo/man/rollmean.html&#39;&gt;rollsum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;notional_false_positives&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;7&lt;/span&gt;,na.pad&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;kc&#39;&gt;T&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,newCasesLFDConfirmedPCRBySpecimenDate_after&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/zoo/man/rollmean.html&#39;&gt;rollsum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;newCasesLFDConfirmedPCRBySpecimenDate_after&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;7&lt;/span&gt;,na.pad&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;kc&#39;&gt;T&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt; notional_proportion_of_positives_false &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;notional_false_positives&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;/&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;notional_false_positives&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;newCasesLFDConfirmedPCRBySpecimenDate_after&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;notional_false_positives&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;both&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;notional_proportion_of_positives_false&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_point&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_smooth&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;coord_cartesian&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;ylim&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Day&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Notional minimum positive predictive value&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;label&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org/reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; 

&lt;span class=&#39;c&#39;&gt;#&amp;gt; `geom_smooth()` using method = &#39;loess&#39; and formula &#39;y ~ x&#39;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-4-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>Mixology: a tool for calculating required masses and volumes for laboratory solutions</title>
      <link>/publication/sanderson-2021-mixology/</link>
      <pubDate>Thu, 01 Apr 2021 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2021-mixology/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Five lines of R</title>
      <link>/post/2021-03-30-us-sgtf/</link>
      <pubDate>Tue, 30 Mar 2021 10:18:37 +0000</pubDate>
      <guid>/post/2021-03-30-us-sgtf/</guid>
      <description>&lt;p&gt;Somebody on Twitter asked me whether B.1.1.7 data from Florida was still compatible with a logistic increase.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s amazing how simple this sort of thing is to look at with the Tidyverse and nicely formatted SGTF data from &lt;a href=&#34;https://github.com/myhelix/helix-covid19db&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Helix&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;http://tidyverse.tidyverse.org&#39;&gt;tidyverse&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/connections.html&#39;&gt;url&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;https://raw.githubusercontent.com/myhelix/helix-covid19db/master/counts_by_state.csv&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;state_selection&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;state&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;summarise&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;total&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/sum.html&#39;&gt;sum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;positive&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;total&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;5000&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;state&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;  &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;percent_sgtf&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;all_SGTF&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;positive&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;state&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%in%&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;state_selection&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;collection_date&lt;/span&gt;, y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;percent_sgtf&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_point&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;stat_smooth&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;method &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;glm&#34;&lt;/span&gt;, method.args &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/list.html&#39;&gt;list&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;family &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;binomial&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, se &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;kc&#39;&gt;FALSE&lt;/span&gt;,  fullrange&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;kc&#39;&gt;TRUE&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/graphics/plot.window.html&#39;&gt;xlim&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;lubridate&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://lubridate.tidyverse.org/reference/ymd.html&#39;&gt;ymd&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2020-12-01&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;lubridate&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://lubridate.tidyverse.org/reference/ymd.html&#39;&gt;ymd&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2021-04-30&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;title&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;US SGTF&#34;&lt;/span&gt;,x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Date&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Percent SGTF&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;facet_wrap&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;~&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;state&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;label&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org/reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-1-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;There are lots of ways one could improve this, bringing in genome data and modelling uncertainty, but it provides a quick look at what&amp;rsquo;s happening.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Addendum&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Despite the title, I decided to extend this a bit. Let&amp;rsquo;s first do as above but take rolling averages of SGTF across 7-day intervals:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;http://tidyverse.tidyverse.org&#39;&gt;tidyverse&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;http://zoo.R-Forge.R-project.org/&#39;&gt;zoo&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/connections.html&#39;&gt;url&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;https://raw.githubusercontent.com/myhelix/helix-covid19db/master/counts_by_state.csv&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;state_selection&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;state&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;summarise&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;total&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/sum.html&#39;&gt;sum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;positive&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;total&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;5000&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;state&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;  &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;state&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%in%&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;state_selection&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;arrange&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;collection_date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;state&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;all_SGTF &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/zoo/man/rollmean.html&#39;&gt;rollsum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;all_SGTF&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;7&lt;/span&gt;,na.pad&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;kc&#39;&gt;T&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,  positive&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/zoo/man/rollmean.html&#39;&gt;rollsum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;positive&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;7&lt;/span&gt;,na.pad&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;kc&#39;&gt;T&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, percent_sgtf&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;all_SGTF&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;positive&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#ggplot(data,aes(x=collection_date, y=percent_sgtf))+geom_point()+ stat_smooth(method = &#34;glm&#34;, method.args = list(family = &#34;binomial&#34;), se = FALSE,  fullrange=TRUE) +xlim(lubridate::ymd(&#34;2020-12-01&#34;),lubridate::ymd(&#34;2021-04-30&#34;))+labs(x=&#34;Date&#34;,y=&#34;Percent SGTF&#34;)+facet_wrap(~state)+theme_bw()+scale_y_continuous(label=scales::percent)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;And now bring in case data from the New York Times and split these cases by likely SGTF status.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;case_data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/connections.html&#39;&gt;url&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-states.csv&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;rename&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;State&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;state&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;case_data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;case_data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;State&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;arrange&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;daily_cases&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;cases&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/lag.html&#39;&gt;lag&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;cases&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;smoothed_daily_cases&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/zoo/man/rollmean.html&#39;&gt;rollmean&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;daily_cases&lt;/span&gt;,k&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;7&lt;/span&gt;,na.pad&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;kc&#39;&gt;T&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;case_data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/connections.html&#39;&gt;url&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;https://raw.githubusercontent.com/jasonong/List-of-US-States/master/states.csv&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;inner_join&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;case_data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; 
&lt;span class=&#39;nv&#39;&gt;together&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;inner_join&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;case_data&lt;/span&gt;,by &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;collection_date&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;date&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;state&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Abbreviation&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;`SGTF cases` &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;percent_sgtf&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;*&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;smoothed_daily_cases&lt;/span&gt;, `non-SGTF cases` &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;percent_sgtf&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;*&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;smoothed_daily_cases&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;select&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;State&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;collection_date&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;`SGTF cases`&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;`non-SGTF cases`&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;  &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;pivot_longer&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;`SGTF cases`&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;`non-SGTF cases`&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;together&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;value&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;collection_date&lt;/span&gt;, y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;value&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;name&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;title&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;US daily cases by SGTF status&#34;&lt;/span&gt;,x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Date&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Daily cases&#34;&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Type&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;facet_wrap&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;~&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;State&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/graphics/plot.window.html&#39;&gt;xlim&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;lubridate&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://lubridate.tidyverse.org/reference/ymd.html&#39;&gt;ymd&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2021-1-01&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;kc&#39;&gt;NA&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_log10&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_color_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;coord_cartesian&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;ylim&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;10&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;10000&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-4-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Note that in the graph above we are relying here on SGTF data from one company, Helix, and then assuming it is representative of all cases in a state. This may not be an accurate assumption, as &lt;a href=&#34;https://twitter.com/DiseaseEcology/status/1377004446639550468&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;noted by Marm Kilpatrick&lt;/a&gt;. Interpret with caution.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Turning a graph back into data</title>
      <link>/post/2021-02-02-ons_extraction/</link>
      <pubDate>Wed, 03 Feb 2021 10:18:37 +0000</pubDate>
      <guid>/post/2021-02-02-ons_extraction/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; The ONS Coronavirus Infection Survey is an immensely valuable scientific project measuring prevalence of coronavirus in the community. However some useful data have been released only in graphical form which makes them hard to re-analyse. Here I describe how I went about turning one of these graphs back into data in R and briefly explore what it can tell us about SGTF in samples today.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;background&#34;&gt;Background&lt;/h3&gt;
&lt;p&gt;The ONS infection survey is an extremely valuable and well-conducted piece of work. As I discussed in &lt;a href=&#34;/post/2021-01-22-ons-data/&#34;&gt;a previous post&lt;/a&gt; sometimes the raw data outputs can be subject to different interpretations.&lt;/p&gt;
&lt;p&gt;One challenge in interpreting this data in that post was that information on the relationship between the number of genes detected and the distribution of Ct values was not available. I resorted to examining this by calculating the Ct value in different regions, and relating this to the area&amp;rsquo;s mean Ct value. But what I really wanted was a line list containing Ct value data for each test, along with how many genes were detected (and ideally further information).&lt;/p&gt;
&lt;p&gt;I have since discovered that some of this data is available in &lt;a href=&#34;https://www.medrxiv.org/content/10.1101/2020.10.25.20219048v1&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;a preprint&lt;/a&gt; published by the survey team in October 2020. Specifically, for me - the most valuable data is the graph below, which depicts individual tests with their Ct values, symptomatic status, and number of genes detected.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;ons_scatterplot.svg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately this data is only presented graphically. But since the graphic is present in a vector format we may be able to get the data back out again without locating every point by hand. Here is how I went about this.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;knitr&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/knitr/man/opts_chunk.html&#39;&gt;opts_chunk&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;set&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;dev.args &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/list.html&#39;&gt;list&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;png &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/list.html&#39;&gt;list&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;type &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;cairo&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;require&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://xml2.r-lib.org/&#39;&gt;xml2&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;http://tidyverse.tidyverse.org&#39;&gt;tidyverse&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;http://lubridate.tidyverse.org&#39;&gt;lubridate&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;http://rvest.tidyverse.org/&#39;&gt;rvest&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;First we will read in the SVG file as XML and look at the straight lines - i.e. the axes, things like the axes and tick-lines.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;theme_set&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_classic&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;doc&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://xml2.r-lib.org/reference/read_xml.html&#39;&gt;read_xml&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;ons_scatterplot.svg&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://xml2.r-lib.org/reference/xml_ns_strip.html&#39;&gt;xml_ns_strip&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;lines&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rvest.tidyverse.org/reference/xml.html&#39;&gt;xml_nodes&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;doc&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;line&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;linesdf&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;tibble&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/lapply.html&#39;&gt;lapply&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://xml2.r-lib.org/reference/xml_attr.html&#39;&gt;xml_attrs&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;lines&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;as.data.frame.list&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate_at&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;x1&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;x2&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;y1&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;y2&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;as.character&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate_at&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;x1&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;x2&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;y1&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;y2&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;as.numeric&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;y1 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;, y2 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y2&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;c&#39;&gt;# y-axis is reversed in SVG - screen format is from top left&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;length &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/MathFun.html&#39;&gt;sqrt&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x2&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;^&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;2&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y2&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;^&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;2&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Let&amp;rsquo;s try drawing this set of lines in ggplot. We&amp;rsquo;ll colour them in by their SVG class to see what class corresponds to which items of the plot.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;linesdf&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;, xend &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x2&lt;/span&gt;, y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;, yend &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y2&lt;/span&gt;, color &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;class&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;geom_segment&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-3-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;OK, so &lt;code&gt;st14&lt;/code&gt; represents the black lines of the axis - lets extract those and mark them each as horizontal or vertical.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;
&lt;span class=&#39;nv&#39;&gt;black_lines&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;linesdf&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;class&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;st14&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;horizontal &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/MathFun.html&#39;&gt;abs&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y2&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;10&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;*&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/MathFun.html&#39;&gt;abs&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x2&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;vertical &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;!&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;horizontal&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;black_lines&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;, xend &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x2&lt;/span&gt;, y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;, yend &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y2&lt;/span&gt;, color &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;horizontal&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;geom_segment&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-4-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;We can also look at the distribution of line lengths to be able to separate out the short &amp;lsquo;ticks&amp;rsquo;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;black_lines&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;length&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;geom_histogram&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-5-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;It looks like any line with length less than 30 will be a tick.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;
&lt;span class=&#39;nv&#39;&gt;ticks&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;black_lines&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;is_tick &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;length&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;30&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;is_tick&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;horiz_limits&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;ticks&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;horizontal&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;max&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;|&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;min&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;vert_limits&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;ticks&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;vertical&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;max&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;|&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;min&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;


&lt;span class=&#39;c&#39;&gt;#ggplot(bind_rows(horiz_limits, vert_limits), aes(x = x1, xend = x2, y = y1, yend = y2, color = horizontal)) +&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#  geom_segment()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now we can extract the positions of the maximum and minimum tick for each axis, and manually write in the real values those correspond to from the label:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;x_min_svg&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;min&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;vert_limits&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;x_max_svg&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;max&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;vert_limits&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;y_min_svg&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;min&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;horiz_limits&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;y_max_svg&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;max&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;horiz_limits&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We&amp;rsquo;ll also manually enter the corresponding real values from the tick labels&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;x_min_real&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://lubridate.tidyverse.org/reference/ymd.html&#39;&gt;ymd&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2020-04-26&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;x_max_real&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://lubridate.tidyverse.org/reference/ymd.html&#39;&gt;ymd&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2020-10-11&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;y_min_real&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;10&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;y_max_real&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;40&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We&amp;rsquo;ve dealt with the axes. Now time to move onto the points. Unfortunately they are not points, they are paths (bezier-curves), drawing circles to represent points!&lt;/p&gt;
&lt;p&gt;Here is a &lt;a href=&#34;https://svg-path-visualizer.netlify.app/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;tool&lt;/a&gt; I found useful for interpreting SVG commands.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;ll extract all the paths.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;paths&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rvest.tidyverse.org/reference/xml.html&#39;&gt;xml_nodes&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;doc&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;path&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;And then try to split up the bezier curves into sub commands, like &lt;code&gt;M&lt;/code&gt; (move to a point), &lt;code&gt;C&lt;/code&gt; draw a curve in absolute coordinates, &lt;code&gt;c&lt;/code&gt; draw a curve in relative coordinates, and so on.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;pathsdf&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;tibble&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/lapply.html&#39;&gt;lapply&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://xml2.r-lib.org/reference/xml_attr.html&#39;&gt;xml_attrs&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;paths&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;as.data.frame.list&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;id &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;:&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;n&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;d &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/grep.html&#39;&gt;gsub&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;S&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;|S&#34;&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;d &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/grep.html&#39;&gt;gsub&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;s&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;|s&#34;&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;d &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/grep.html&#39;&gt;gsub&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;z&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;|z&#34;&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;d &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/grep.html&#39;&gt;gsub&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;c&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;|c:&#34;&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;d &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/grep.html&#39;&gt;gsub&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;C&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;|C:&#34;&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;d &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/grep.html&#39;&gt;gsub&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;M&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;M:&#34;&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;d &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/grep.html&#39;&gt;gsub&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;\n&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;&#34;&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;d &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/grep.html&#39;&gt;gsub&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34; &#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;&#34;&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;d &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/grep.html&#39;&gt;gsub&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;([0-9])-&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;\\1,-&#34;&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;commandsdf&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;pathsdf&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;separate_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;, sep &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;\\|&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;!=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;z&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;separate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;d&lt;/span&gt;, into &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;command&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;parameters&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;:&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Warning: Expected 2 pieces. Missing pieces filled with `NA` in 24 rows [23, 25, 28, 30, 7933, 7935, 7938, 7940, 8673, 8675, 8678, 8680, 16233, 16235, 16238, 16240, 16243, 16245, 16248, 16250, ...].&lt;/span&gt;


&lt;span class=&#39;nv&#39;&gt;commands_processed&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;commandsdf&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;separate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;parameters&lt;/span&gt;, into &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;p1&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;p2&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;p3&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;p4&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;p5&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;p6&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, sep &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;,&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;abs_x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;case_when&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;command&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;M&#34;&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;~&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;p1&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;command&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;C&#34;&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;~&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;p5&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, abs_y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;case_when&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;command&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;M&#34;&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;~&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;p2&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;command&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;C&#34;&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;~&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;p6&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;rel_x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;case_when&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;command&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;c&#34;&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;~&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;p5&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, rel_y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;case_when&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;command&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;c&#34;&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;~&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;p6&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Warning: Expected 6 pieces. Missing pieces filled with `NA` in 3796 rows [1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, ...].&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;These circles in SVG form curves, with 4 control points. If we take the average of these we can find the position of the point. One of the points is absolute, from the &lt;code&gt;M&lt;/code&gt; coordinates, but 3 are from &lt;code&gt;c&lt;/code&gt; commands, and they only have relative coordinates, so we need to calculate the cumulative sums of these, and then add them to the &lt;code&gt;M&lt;/code&gt; coordinates. Then we&amp;rsquo;ll average out, and add back the class metadata.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;lowercase_cs&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;commands_processed&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;id&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;command&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;c&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;rel_x_sum &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/cumsum.html&#39;&gt;cumsum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;rel_x&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, rel_y_sum &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/cumsum.html&#39;&gt;cumsum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;rel_y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;select&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;id&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;rel_x_sum&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;rel_y_sum&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;zeroes&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;lowercase_cs&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;id&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;summarise&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;rel_x_sum &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;, rel_y_sum &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; `summarise()` ungrouping output (override with `.groups` argument)&lt;/span&gt;


&lt;span class=&#39;nv&#39;&gt;full_relative_set&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;lowercase_cs&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;zeroes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;uppercase_cs&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;commands_processed&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;command&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;C&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;select&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;id&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;command&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;abs_x&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;abs_y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;abs_x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/numeric.html&#39;&gt;as.numeric&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;abs_x&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, abs_y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/numeric.html&#39;&gt;as.numeric&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;abs_y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;both&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;inner_join&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;uppercase_cs&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;full_relative_set&lt;/span&gt;, by &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;id&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;abs_x&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;rel_x_sum&lt;/span&gt;, y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;abs_y&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;rel_y_sum&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;point_types&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;pathsdf&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;select&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;id&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;class&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;points&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;both&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;id&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;summarise&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/mean.html&#39;&gt;mean&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/mean.html&#39;&gt;mean&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;inner_join&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;point_types&lt;/span&gt;, by &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;id&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;class&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%in%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;st10&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;st7&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;st9&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;st12&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;st11&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;st5&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; `summarise()` ungrouping output (override with `.groups` argument)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Above you can see I have filtered to only some of the classes. This is because some points were represented by two curves, one a stroke and one a fill. Now let&amp;rsquo;s plot the points.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;black_lines&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;, xend &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x2&lt;/span&gt;, y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;, yend &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y2&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;geom_segment&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;geom_point&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;data &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;points&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x2 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;, y2 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x&lt;/span&gt;, y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;, color &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;class&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;scale_color_brewer&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;type &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;qual&#34;&lt;/span&gt;, palette &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;Paired&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-12-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Conveniently, the points in the key are still there, so we can easily label these classes with their correct metadata&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;, &lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;, &lt;span class=&#39;m&#39;&gt;2&lt;/span&gt;, &lt;span class=&#39;m&#39;&gt;2&lt;/span&gt;, &lt;span class=&#39;m&#39;&gt;3&lt;/span&gt;, &lt;span class=&#39;m&#39;&gt;3&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;symptoms&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;yes&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;no&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;yes&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;no&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;yes&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;no&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;classes&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;st9&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;st12&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;st7&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;st11&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;st5&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;st10&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;class_info&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;tibble&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;class &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;classes&lt;/span&gt;, symptoms &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;symptoms&lt;/span&gt;, genes_detected &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;points_detail&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;points&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;inner_join&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;class_info&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;genes_detected &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/factor.html&#39;&gt;as.factor&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Joining, by = &#34;class&#34;&lt;/span&gt;


&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;black_lines&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;, xend &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x2&lt;/span&gt;, y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;, yend &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y2&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;geom_segment&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;geom_point&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;data &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;points_detail&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x2 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;, y2 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x&lt;/span&gt;, y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;, color &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;, shape &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;symptoms&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;scale_color_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;black&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_shape_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;16&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-13-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;We&amp;rsquo;re getting there! We have recreated the chart within our ggplot.&lt;/p&gt;
&lt;p&gt;Now we just need to transform ourselves into the right axes:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;
&lt;span class=&#39;nv&#39;&gt;transform&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;kr&#39;&gt;function&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;vector&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;a_in&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;a_out&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;b_in&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;b_out&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&#39;nv&#39;&gt;scaling&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;b_out&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;a_out&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;/&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;b_in&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;a_in&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
  &lt;span class=&#39;nv&#39;&gt;vector&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;vector&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;a_in&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;*&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;scaling&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;a_out&lt;/span&gt;
  &lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/function.html&#39;&gt;return&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;vector&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;o&#39;&gt;&amp;#125;&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;ytransform&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;partial&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;transform&lt;/span&gt;, a_in &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y_min_svg&lt;/span&gt;, a_out &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y_min_real&lt;/span&gt;, b_in &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y_max_svg&lt;/span&gt;, b_out &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y_max_real&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;xtransform&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;partial&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;transform&lt;/span&gt;, a_in &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x_min_svg&lt;/span&gt;, a_out &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x_min_real&lt;/span&gt;, b_in &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x_max_svg&lt;/span&gt;, b_out &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x_max_real&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;new_axes&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;black_lines&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;y1 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;ytransform&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, y2 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;ytransform&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y2&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, x1 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;xtransform&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, x2 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;xtransform&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x2&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;points_transformed&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;points_detail&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;ytransform&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;xtransform&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;new_axes&lt;/span&gt;, &lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;geom_segment&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x1&lt;/span&gt;, xend &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x2&lt;/span&gt;, y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y1&lt;/span&gt;, yend &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y2&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;geom_point&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;data &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;points_transformed&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x2 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://lubridate.tidyverse.org/reference/ymd.html&#39;&gt;ymd&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2020-01-01&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, y2 &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://lubridate.tidyverse.org/reference/ymd.html&#39;&gt;ymd&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2020-01-01&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x&lt;/span&gt;, y &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;, color &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;, shape &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;symptoms&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;scale_color_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;black&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_shape_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;16&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-14-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;OK, the coordinates look right. At this point we can throw away the old axes and just focus on the points.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;values&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;points_transformed&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;Date &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;x&lt;/span&gt;, Ct &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;select&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;x&lt;/span&gt;, &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;, &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;class&lt;/span&gt;,&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;id&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nf&#39;&gt;write_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;values&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;ons_ct_value_genes_detected_and_symptoms.csv&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;values&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 1,886 x 4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;    symptoms genes_detected Date          Ct&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;    &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;fct&amp;gt;&lt;/span&gt;&lt;span&gt;          &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;date&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 1&lt;/span&gt;&lt;span&gt; yes      3              2020-04-28  26.8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 2&lt;/span&gt;&lt;span&gt; yes      3              2020-04-28  21.7&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 3&lt;/span&gt;&lt;span&gt; yes      3              2020-05-07  22.9&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 4&lt;/span&gt;&lt;span&gt; yes      3              2020-05-09  29.4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 5&lt;/span&gt;&lt;span&gt; yes      3              2020-05-10  21.8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 6&lt;/span&gt;&lt;span&gt; yes      3              2020-05-10  27.3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 7&lt;/span&gt;&lt;span&gt; yes      3              2020-05-11  18.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 8&lt;/span&gt;&lt;span&gt; yes      3              2020-05-11  16.8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 9&lt;/span&gt;&lt;span&gt; yes      3              2020-05-11  27.3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;10&lt;/span&gt;&lt;span&gt; yes      3              2020-05-13  19.3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# … with 1,876 more rows&lt;/span&gt;&lt;/span&gt;m
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;There&amp;rsquo;s our &lt;a href=&#34;ons_ct_value_genes_detected_and_symptoms.csv&#34;&gt;dataset&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And here&amp;rsquo;s our graph.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;values&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Date&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Ct&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;,shape&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;symptoms&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;scale_color_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;black&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_shape_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;16&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_point&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;theme&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;legend.position&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;bottom&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-16-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;as compared to: &lt;img src=&#34;ons_scatterplot.svg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Now we can see what this data can tell us about Ct value distributions:&lt;/p&gt;
&lt;p&gt;What is the distribution of 1, 2, and 3 gene positives at different Ct values?&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;values&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Ct&lt;/span&gt;,fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;..count..&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;scale_fill_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;black&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;geom_density&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;alpha&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.3&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-17-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;What is the distribution of Ct values with and without symptoms?&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;values&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Ct&lt;/span&gt;,fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;symptoms&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;..count..&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;geom_density&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;alpha&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.3&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-18-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Does symptomatic Ct distribution vary over time?&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;values&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Date&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Ct&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;symptoms&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;geom_smooth&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; `geom_smooth()` using method = &#39;gam&#39; and formula &#39;y ~ s(x, bs = &#34;cs&#34;)&#39;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-19-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;(yes, it does &amp;ndash; which I hadn&amp;rsquo;t especially expected &amp;ndash; this may be because it includes symptoms either side of the test at any length of time, so at times of high Ct perhaps people aren&amp;rsquo;t mostly symptomatic at the time of testing)&lt;/p&gt;
&lt;p&gt;Crucially from the point of view of assessing B.1.1.7 proportions, we can calculate how we expect the number of genes detected to change with Ct value for wild-type SARS-CoV2.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;values&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Ct&lt;/span&gt;,fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;..count..&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;scale_fill_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;black&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;geom_density&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;alpha&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.5&lt;/span&gt;,position&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;stack&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-20-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;This dataset gives us a sense of how much &amp;lsquo;false positive B.1.1.7&amp;rsquo; we might see from random S dropout at a range of different Ct values (i.e. the &lt;code&gt;2&lt;/code&gt; values might be predominantly this).&lt;/p&gt;
&lt;p&gt;And we can even simulate what B.1.1.7 would look like under these conditions. We know that it is very rare to see the &lt;code&gt;S&lt;/code&gt; positive unless &lt;code&gt;OR&lt;/code&gt; and &lt;code&gt;N&lt;/code&gt; are both also positive. So essentially B.1.1.7 SGTF would just turn &lt;code&gt;3&lt;/code&gt; into &lt;code&gt;2&lt;/code&gt; here.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;simul_b117&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;values&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;genes_detected&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/ifelse.html&#39;&gt;ifelse&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;3&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;2&#34;&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;


&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;simul_b117&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Ct&lt;/span&gt;,fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;genes_detected&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;..count..&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;
  &lt;span class=&#39;nf&#39;&gt;scale_fill_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;, &lt;span class=&#39;s&#39;&gt;&#34;black&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;geom_density&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;alpha&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.5&lt;/span&gt;,position&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;stack&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-21-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;We can see that at high Ct, we see a lot of the single gene &lt;code&gt;OR&lt;/code&gt; or &lt;code&gt;N&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;With the median Ct value around &lt;code&gt;31&lt;/code&gt; in recent weeks, this can help to explain the presence of single gene positive samples that were previously called as &lt;code&gt;not-compatible with the new variant&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;/div&gt;
&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;We&amp;rsquo;ve been able to convert a valuable dataset generated by the ONS Infection Survey team into a machine-readable form, which permits insights into the apparent relative decline of B.1.1.7 in the recent report. Hopefully this can provide a useful building block in downstream analyses of Ct, gene dropout, and temporal dynamics.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;If you enjoyed this exploration of how to extract data from vector-graphics in R, you might also want to see my &lt;a href=&#34;https://theosanderson.github.io/adhoc_covid/phe_graph/analysis.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;extraction of data from a rasterised chloropleth map&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Looking again at Maccabi data for efficacy after initial Pfizer dose</title>
      <link>/post/2021-01-31-maccabi-2/</link>
      <pubDate>Sun, 31 Jan 2021 10:18:37 +0000</pubDate>
      <guid>/post/2021-01-31-maccabi-2/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Update(2021-02-03):&lt;/strong&gt; Maccabi have also now released a &lt;a href=&#34;https://kinstitute.org.il/wp-content/uploads/2021/02/linkedin-post-28-days-01.02-3-PDF.pdf&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;different report&lt;/a&gt; looking at a cohort, which gives a less rosy picture of initial efficacy. The explanation may be the older age group in the cohort. I think the calculations below still stand, but am flagging this important further data for context.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Maccabi have now released a &lt;a href=&#34;https://www.medrxiv.org/content/10.1101/2021.01.27.21250612v1&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;preprint&lt;/a&gt; on Pfizer vaccine efficacy after the first dose. Let&amp;rsquo;s take a look at it.&lt;/p&gt;
&lt;p&gt;Firstly a little complaint. If you go to the `Data&#39; tab on bioRxiv, it says:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;data_availability.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Now of course one understands that there may be lots of underlying patient data that can&amp;rsquo;t be released for regulatory reasons. But some data definitely can, because they release it in this preprint, in graphical form.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;maccabi.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;At bare minimum, we should demand that the data directly plotted in graphs are released in numerical form to permit further analysis. There can be no regulatory justification for not doing so.&lt;/p&gt;
&lt;p&gt;Fortunately, the data are there, we just need to extract them. For this image file I did that by hand with &lt;a href=&#34;https://apps.automeris.io/wpd/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;WebPlotDigitizer&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;maccabi&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;maccabi.csv&#34;&lt;/span&gt;,col_names &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#39;Day&#39;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#39;CumulativeIncidence&#39;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;Day&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Round.html&#39;&gt;round&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; 

&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;maccabi&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;CumulativeIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Day&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Cumulative Incidence&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;,limits&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;kc&#39;&gt;NA&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-2-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Looks like we&amp;rsquo;ve pretty much got it. Now let&amp;rsquo;s convert that cumulative incidence into a daily incidence (something not done in the Maccabi preprint).&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;perday&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;maccabi&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;arrange&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;CumulativeIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;summarise&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;CumulativeIncidence&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;max&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;CumulativeIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;DailyIncidence&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;CumulativeIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/lag.html&#39;&gt;lag&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;CumulativeIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,type&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Vaccinated&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; 

&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;perday&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;DailyIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Day&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Daily Incidence&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;,limits&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;kc&#39;&gt;NA&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; 

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-3-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Now we have a fair idea of what went on. On day 1 after vaccination, 0.024% of those vaccinated tested positive. That proportion seems to have risen until about day 8, when 0.06% of those vaccinated tested positive. It then fell until day 25, when just 0.005% tested positive.&lt;/p&gt;
&lt;p&gt;Now, to properly calculate vaccine efficacy we would need some control group who have not been vaccinated. In the original trials that was a randomly selected half who were given a placebo injection. We compared how many cases they developed, as compared to those who were vaccinated.&lt;/p&gt;
&lt;p&gt;There is no placebo group here. No set of matching people who were not vaccinated. So to have any way of calculating an efficacy value we essentially have to invent one and imagine what the incidence would have been in it.&lt;/p&gt;
&lt;p&gt;Doing this for the first ~10 days, seems pretty easy. We really don&amp;rsquo;t expect to see the vaccine have any effect here, so the control group might look something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;control_group&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;tibble&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;Day&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;:&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;10&lt;/span&gt;,DailyIncidence&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/seq.html&#39;&gt;seq&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.00032&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;0.00059&lt;/span&gt;,length.out&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;10&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,type&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Synthetic control&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;control_group&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;perday&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;DailyIncidence&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;&#34;&lt;/span&gt;,x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Day&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Daily Incidence&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;,limits&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;kc&#39;&gt;NA&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_color_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-4-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The reason for this not being a horizontal line would have to be some genuine rise in cases over this period. One possibility is the general increasing number of cases in Israel, which continued up to around 15 Jan. &lt;/p&gt;
&lt;p&gt;Unforunately, having this synthetic control line for the first 7 days isn&amp;rsquo;t especially useful. By construction this shows ~0% efficacy in that period, because that&amp;rsquo;s what we designed it to. What I&amp;rsquo;m really interested is that the efficacy around Day 24. So how should we extend the line?&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve illustrated 3 possible scenarios below, one where cases continue to rise in the placebo group, another where they stay flat, and another where they fall :&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt; &lt;span class=&#39;nv&#39;&gt;syn_control&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;kr&#39;&gt;function&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;final&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;name&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;offset&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;#123;&lt;/span&gt;
&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/function.html&#39;&gt;return&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;tibble&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;Day&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;:&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;10&lt;/span&gt;,DailyIncidence&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/seq.html&#39;&gt;seq&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.00032&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;offset&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;0.00059&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;offset&lt;/span&gt;,length.out&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;10&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,type&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;name&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,
                  &lt;span class=&#39;nf&#39;&gt;tibble&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;Day&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;10&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;:&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;25&lt;/span&gt;,DailyIncidence&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/seq.html&#39;&gt;seq&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.00059&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;offset&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;final&lt;/span&gt;,length.out&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;16&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,type&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;name&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;o&#39;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;combo&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;syn_control&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.0010&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;Synthetic control: Growth&#34;&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;0.00001&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;syn_control&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.00059&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;Synthetic control: flat&#34;&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;syn_control&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.00029&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;Synthetic control: decreasing&#34;&lt;/span&gt;,&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0.00001&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;perday&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;combo&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;DailyIncidence&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;&#34;&lt;/span&gt;,x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Day&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Daily Incidence&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;,limits&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;kc&#39;&gt;NA&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_color_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;pink&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;darkred&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-5-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;These choices have a substantial effect on the efficacy we measure for days 23-25, which range from 82% (placebo cases fall) to 94% (placebo cases rise).&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;combo&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;22&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;summarise&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;Incidence &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/mean.html&#39;&gt;mean&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;DailyIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;efficacy_percent &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;100&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;*&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;min&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Incidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Incidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;!=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Vaccinated&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;select&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Incidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; `summarise()` ungrouping output (override with `.groups` argument)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 3 x 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   type                          efficacy_percent&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;                                    &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt; Synthetic control: decreasing             82.4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;2&lt;/span&gt;&lt;span&gt; Synthetic control: flat                   90.8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;3&lt;/span&gt;&lt;span&gt; Synthetic control: Growth                 94.4&lt;/span&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;So what did Maccabi do? Well something quite different to any of these. They used the period from days 0 to 12 as the control for days 13 to 24. That looks like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;control_group&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;perday&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;Day&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;12&lt;/span&gt;, type&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;Synthetic control&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;25&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;maccabi_analysis&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;control_group&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;perday&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;25&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;maccabi_analysis&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;DailyIncidence&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;&#34;&lt;/span&gt;,x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Day&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Daily Incidence&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;,limits&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;kc&#39;&gt;NA&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_color_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-7-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;If again you look at day 23-24 efficacy here, you get an efficacy of 88%.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;maccabi_analysis&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;22&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;summarise&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;Incidence &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/mean.html&#39;&gt;mean&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;DailyIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;efficacy_percent &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;100&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;*&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;min&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Incidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Incidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;!=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Vaccinated&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;select&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Incidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; `summarise()` ungrouping output (override with `.groups` argument)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 1 x 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   type              efficacy_percent&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;                        &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt; Synthetic control             87.5&lt;/span&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Maccabi however looked across the entire period. If you do that you get an efficacy close to 50% (they got 51%, I got 56%, possibly due to slight differences in the weighting of different days based on the number of people in them).&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;maccabi_analysis&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;12&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;summarise&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;Incidence &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/mean.html&#39;&gt;mean&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;DailyIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;efficacy_percent &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;100&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;*&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;min&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Incidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Incidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;!=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Vaccinated&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;select&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Incidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; `summarise()` ungrouping output (override with `.groups` argument)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 1 x 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   type              efficacy_percent&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;                        &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt; Synthetic control             56.1&lt;/span&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;So, what to conclude? Essentially the way Maccabi analysed this data was one relatively arbitrary possibility among many. Efficacy estimates are quite sensitive to the guesses one makes about how many cases there would have been in the control group. Maccabi&amp;rsquo;s decision here is quite conservative in that it includes as a control group the day 10 to 12 period where some cases may well have been averted by vaccination.&lt;/p&gt;
&lt;p&gt;The decision to look at the entire day 12-24 period rather than the end of it, will yield a result lower than the true efficacy towards the end of this period, given the clear evidence for an increase in efficacy over the period. This is incredibly valuable data, and all in all, things look pretty good.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;perday&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;DailyIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;black&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Day&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Daily Incidence&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;,limits&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;kc&#39;&gt;NA&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_smooth&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; `geom_smooth()` using method = &#39;loess&#39; and formula &#39;y ~ x&#39;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-10-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;perday&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 26 x 4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;      Day CumulativeIncidence DailyIncidence type      &lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;    &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt;               &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt;          &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 1&lt;/span&gt;&lt;span&gt;     0           0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;025&lt;/span&gt;&lt;span&gt;1      &lt;/span&gt;&lt;span style=&#39;color: #BB0000;&#39;&gt;NA&lt;/span&gt;&lt;span&gt;        Vaccinated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 2&lt;/span&gt;&lt;span&gt;     1           0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;269&lt;/span&gt;&lt;span&gt;        0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;244&lt;/span&gt;&lt;span&gt; Vaccinated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 3&lt;/span&gt;&lt;span&gt;     2           0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;626&lt;/span&gt;&lt;span&gt;        0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;357&lt;/span&gt;&lt;span&gt; Vaccinated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 4&lt;/span&gt;&lt;span&gt;     3           0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;990&lt;/span&gt;&lt;span&gt;        0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;363&lt;/span&gt;&lt;span&gt; Vaccinated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 5&lt;/span&gt;&lt;span&gt;     4           0.001&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;49&lt;/span&gt;&lt;span&gt;         0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;501&lt;/span&gt;&lt;span&gt; Vaccinated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 6&lt;/span&gt;&lt;span&gt;     5           0.001&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;97&lt;/span&gt;&lt;span&gt;         0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;476&lt;/span&gt;&lt;span&gt; Vaccinated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 7&lt;/span&gt;&lt;span&gt;     6           0.002&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;47&lt;/span&gt;&lt;span&gt;         0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;501&lt;/span&gt;&lt;span&gt; Vaccinated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 8&lt;/span&gt;&lt;span&gt;     7           0.003&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;03&lt;/span&gt;&lt;span&gt;         0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;564&lt;/span&gt;&lt;span&gt; Vaccinated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 9&lt;/span&gt;&lt;span&gt;     8           0.003&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;65&lt;/span&gt;&lt;span&gt;         0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;614&lt;/span&gt;&lt;span&gt; Vaccinated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;10&lt;/span&gt;&lt;span&gt;     9           0.004&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;13&lt;/span&gt;&lt;span&gt;         0.000&lt;/span&gt;&lt;span style=&#39;text-decoration: underline;&#39;&gt;489&lt;/span&gt;&lt;span&gt; Vaccinated&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# … with 16 more rows&lt;/span&gt;&lt;/span&gt;m


&lt;span class=&#39;nv&#39;&gt;incidence_data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;data_from_chart.csv&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; 

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Parsed with column specification:&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; cols(&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   Day = &lt;span style=&#39;color: #00BB00;&#39;&gt;col_double()&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;   VaccinatedCohort = &lt;span style=&#39;color: #00BB00;&#39;&gt;col_double()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; )&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;cohort_size&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;132015&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;incidence_data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;CumulativeIncidence&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/cumsum.html&#39;&gt;cumsum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;incidence_data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;VaccinatedCohort&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;cohort_size&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;incidence_data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;Incidence plot&#34;&lt;/span&gt;



&lt;span class=&#39;nv&#39;&gt;maccabi_offset&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;maccabi&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;3&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;CumulativeIncidence &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;CumulativeIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/Extremes.html&#39;&gt;min&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;CumulativeIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, type&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Kaplan-Meier plot&#34;&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
 


&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;incidence_data&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;maccabi_offset&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;, group&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;, x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;CumulativeIncidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Day&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Cumulative Incidence&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;,limits&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;kc&#39;&gt;NA&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_color_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;darkgreen&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-11-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;
&lt;span class=&#39;nf&#39;&gt;ggsave&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;comparison.png&#34;&lt;/span&gt;,type&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;cairo&#34;&lt;/span&gt;,width&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;7&lt;/span&gt;,height&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;3&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>Analysing Maccabi data on initial efficacy of first vaccine dose</title>
      <link>/post/2021-01-022-maccabi/</link>
      <pubDate>Fri, 22 Jan 2021 22:18:37 +0000</pubDate>
      <guid>/post/2021-01-022-maccabi/</guid>
      <description>&lt;p&gt;This exciting chart has emerged from the Maccabi study, providing evidence for efficacy of the Pfizer vaccine after the first dose.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;chart.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;As Eran Segal &lt;a href=&#34;https://twitter.com/segal_eran/status/1352696339377885187&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;pointed out on Twitter&lt;/a&gt;, the blue line actually includes the green line. I was interested to see what this would look like replotted as a Kaplan-Meier curve like the Pfizer graph.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;pfizer.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;size_of_cohort&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;50777&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;size_of_all_members&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;480000&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;size_of_unvaccinated&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;size_of_all_members&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;size_of_cohort&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;new_infections_all_members &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;AllMembersNormalised&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;*&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;size_of_all_members&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;size_of_cohort&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;new_infections_unvaccinated &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;new_infections_all_members&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;-&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;VaccinatedCohort&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;daily_incidence_unvaccinated &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;new_infections_unvaccinated&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;size_of_unvaccinated&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;daily_incidence_vaccinated &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;VaccinatedCohort&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;size_of_cohort&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;graphdata&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;select&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;contains&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;daily_incidence&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;pivot_longer&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,names_to&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;group&#34;&lt;/span&gt;,values_to&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;daily_incidence&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;separate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;group&lt;/span&gt;,into&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;bla&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;bla2&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;condition&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,sep&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;_&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;select&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;contains&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;bla&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;condition&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;arrange&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;cumulative_incidence&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/cumsum.html&#39;&gt;cumsum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;daily_incidence&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;


&lt;span class=&#39;nv&#39;&gt;graphdata&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;condition&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/ifelse.html&#39;&gt;ifelse&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;graphdata&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;condition&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;unvaccinated&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;Control cohort&#34;&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;graphdata&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;condition&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;graphdata&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Day&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;cumulative_incidence&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;condition&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_classic&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;caption&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Caveats: based on 7-day-moving average data so sharpness of start of initial efficacy will be understated. \n Control cohort may contain vaccinated people&#34;&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Condition&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Cumulative Incidence&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_color_manual&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;values&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;red&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;blue&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_point&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-2-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;There are a lot of caveats about whether this is comparing like-for-like in terms of endpoint. In some respects it is definitely not, and everything is smoothed out by the 7 day moving average. In addition, this is a much older age group where we&amp;rsquo;d very much expect the immune response to take longer. Another really important &lt;a href=&#34;https://twitter.com/gbpolitics/status/1352764070668201985&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;caveat&lt;/a&gt; is that the blue line likely includes people who were vaccinated later on.&lt;/p&gt;
&lt;p&gt;In general the top plot presented by Maccabi is much more useful for getting a sense of what is going on (what direction the lines are pointing at the end of the Kaplain-Meier plot).&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>New-variant compatibility in the ONS infection survey</title>
      <link>/post/2021-01-22-ons-data/</link>
      <pubDate>Fri, 22 Jan 2021 14:18:37 +0000</pubDate>
      <guid>/post/2021-01-22-ons-data/</guid>
      <description>&lt;p&gt;&lt;small&gt;Code behind this analysis: &lt;a href=&#34;https://github.com/theosanderson/theo.io/tree/master/content/post/2021-01-22-ons-data&#34; class=&#34;uri&#34;&gt;&lt;a href=&#34;https://github.com/theosanderson/theo.io/tree/master/content/post/2021-01-22-ons-data&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://github.com/theosanderson/theo.io/tree/master/content/post/2021-01-22-ons-data&lt;/a&gt;&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;The ONS infection survey has come out and there has been a lot of discussion on the apparent decrease in proportion of &amp;ldquo;new variant compatible&amp;rdquo; cases.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;ons.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;To try to understand these patterns we need to go into a bit more detail. How are &amp;ldquo;new variant compatible&amp;rdquo; cases defined?&lt;/p&gt;
&lt;p&gt;The TaqPath tests that produce this data amplify parts of three genes in the SARS-CoV2 genome:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The N gene&lt;/li&gt;
&lt;li&gt;ORF1ab&lt;/li&gt;
&lt;li&gt;The S gene&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We know that B.1.1.7 often gives complete loss of the S-gene amplicon (data from Portugal suggest it doesn&amp;rsquo;t &lt;a href=&#34;https://virological.org/t/tracking-sars-cov-2-voc-202012-01-lineage-b-1-1-7-dissemination-in-portugal-insights-from-nationwide-rt-pcr-spike-gene-drop-out-data/600&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;always&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;When B.1.1.7 was emerging the ONS defined a fairly conservative definition of &amp;ldquo;new variant compatible&amp;rdquo; tests. They said that these must be positive for N, &lt;em&gt;and&lt;/em&gt; ORF1AB, but not for S. That is what we would expect to see for B.1.1.7 when there a lot of virions in the sample. But if a sample has a low number of virions, one or other of these genes might randomly drop below the detection threshold. Fortunately the ONS also report the data split out by each of the possible amplicon combinations, so we can examine this.&lt;/p&gt;
&lt;p&gt;First let&amp;rsquo;s convince ourselves that, irrespective of B.1.1.7, dropouts of amplicons can occur for various reasons. Let&amp;rsquo;s look at the distribution of amplicons period of time in September, before B.1.1.7 had really emerged.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;subset&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2020-09-21&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;RegionType&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;EnglandRegion&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;AmpliconType &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;case_when&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;
 &lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%in%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;N only&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;N+S&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;OR only&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;OR+S&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;S only&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;~&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;Random dropout&#34;&lt;/span&gt;,
  &lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;OR+N+S&#34;&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;~&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;Definite non-B.1.1.7&#34;&lt;/span&gt;,
  &lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;==&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;OR+N&#34;&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;~&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;Likely(?) B.1.1.7&#34;&lt;/span&gt;
&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
                                                                                                
                                                                                                
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;subset&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;AmpliconType&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Count&lt;/span&gt;,fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_bar&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;stat&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;identity&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;facet_wrap&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;~&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;theme&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;axis.text.x &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;element_text&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;angle &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;90&lt;/span&gt;, vjust &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;0.5&lt;/span&gt;, hjust&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-2-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;I&amp;rsquo;ve separated out the &lt;code&gt;OR+N&lt;/code&gt; amplicon types, which the ONS considers new variant compatible. Let&amp;rsquo;s ignore these for now. We can see that there is a substantial variation in the other amplicon groups. If there were no random dropout (and no other variants that compromise an assay), we would expect everything else to be &lt;code&gt;OR+N+S&lt;/code&gt;. But in the South West these make up a minority of the total positives identified. Instead it seems that some of these amplicons are randomly dropping out there.&lt;/p&gt;
&lt;p&gt;We can also see a lot of geographical heterogeneity in the level of this random dropout. What drives this? We also have the mean Ct values for each region so we can test the hypothesis that high Ct values (low number of virions), due to a higher proportion of infections being identified longer after the original infection, are responsible for the &amp;ldquo;random dropout&amp;rdquo;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;c&#39;&gt;# Exclude suspected B.1.1.7 from the data&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;subset&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2020-09-21&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;RegionType&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;EnglandRegion&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;!=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;OR+S&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#Calculate the proportion with &#34;no random dropout&#34;, then invert to get proportion of &#34;random dropout&#34;&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;subset&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;subset&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;proportion &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;Count&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/sum.html&#39;&gt;sum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Count&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;OR+N+S&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;RandomDropout&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;proportion&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;subset_cts&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data_ct&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2020-09-21&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;RegionType&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;EnglandRegion&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;both&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;inner_join&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;subset&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;subset_cts&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; 

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Joining, by = c(&#34;Region&#34;, &#34;RegionType&#34;, &#34;week&#34;)&lt;/span&gt;


&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;both&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Mean&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;RandomDropout&lt;/span&gt;,label&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_point&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Mean Ct value&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Proportion of &#39;random dropout&#39;&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/ggrepel/man/geom_text_repel.html&#39;&gt;geom_text_repel&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Relationship between Ct and levels of random dropout in September&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-3-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Having convinced ourselves that random dropouts can occur at different levels due to differences in Ct values (and that Ct values &lt;a href=&#34;https://www.medrxiv.org/content/10.1101/2020.10.08.20204222v1&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;can differ due to epidemiological dynamics&lt;/a&gt;)), we can examine whether an increased rate of random dropouts in the N or ORF1ab genes (or both!) might cause an underestimation of B.1.1.7 prevalence when considering only &lt;code&gt;OR+N+S&lt;/code&gt; as compatible with the new variant.&lt;/p&gt;
&lt;p&gt;Now lets look at the trajectories of all amplicon groups over time in England.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;group_by&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;proportion &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;Count&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/sum.html&#39;&gt;sum&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Count&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; 

&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;England&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;proportion&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-4-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;

&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/factor.html&#39;&gt;factor&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/character.html&#39;&gt;as.character&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,levels &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;S only&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;OR+S&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;N+S&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;OR+N+S&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;N only&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;OR only&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;OR+N&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;p&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;England&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;!=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;S only&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;proportion&lt;/span&gt;,fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_area&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;expand&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_fill_brewer&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;type&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;qual&#34;&lt;/span&gt;,palette&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;4&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Date&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Proportion&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_x_date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;expand&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nf&#39;&gt;ggsave&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;plot.pdf&#34;&lt;/span&gt;,width&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;5&lt;/span&gt;,height&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;3&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;An annotated version of that plot: &lt;img src=&#34;illustrated_plot-01.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;RegionType&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;EnglandRegion&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;!=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;S only&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, &lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;proportion&lt;/span&gt;,fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_area&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;expand&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_fill_brewer&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;type&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;qual&#34;&lt;/span&gt;,palette&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;4&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Date&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Proportion&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_x_date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;expand&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;,&lt;span class=&#39;m&#39;&gt;0&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;facet_wrap&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;~&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-5-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;
&lt;span class=&#39;nf&#39;&gt;ggsave&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;plotregion.png&#34;&lt;/span&gt;,width&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;7&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;*&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1.2&lt;/span&gt;,height&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;4&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;*&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1.2&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We can see a rise in &lt;code&gt;OR+N&lt;/code&gt; over time. But this seems to tail off to at least horizontal at the end. Does this mean that B.1.1.7 is no longer increasing at the expense of other variants? Well I don&amp;rsquo;t think we have evidence for this. &lt;code&gt;OR+N&lt;/code&gt; may be horizontal, but &lt;code&gt;OR+N+S&lt;/code&gt; seems likely to be decreasing faster. It is likely that this is due to a general change in the epidemic stage, as lockdown controls new infections and a higher proportion of old detections are detected.&lt;/p&gt;
&lt;p&gt;Again if we want to look for an explanation we can investigate the Cts.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data_ct&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;RegionType&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;EnglandRegion&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;, y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Mean&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;title&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Regions&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;facet_wrap&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;~&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Mean Ct value&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-6-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;In all regions we see an increase in mean Ct over January, which we&amp;rsquo;d expect to cause more random dropouts, and reduce the number of both WT viruses that appear as &lt;code&gt;OR+N+S&lt;/code&gt; and of B.1.1.7 viruses that appear as &lt;code&gt;OR+N&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;One (imperfect) way to try to get a handle on this is to just plot the ratio of &lt;code&gt;OR+N+S&lt;/code&gt; to &lt;code&gt;OR+N&lt;/code&gt;, because both of these are affected by random drop out.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;England&#34;&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%in%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;OR+N+S&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;OR+N&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;, fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Count&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_bar&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;stat&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;identity&#34;&lt;/span&gt;,position&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;fill&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;title&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;England&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-7-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;RegionType&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;EnglandRegion&#34;&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%in%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;OR+N+S&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;OR+N&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;, fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Count&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_bar&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;stat&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;identity&#34;&lt;/span&gt;,position&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;fill&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;title&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Regions&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;facet_wrap&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;~&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-7-2.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Similarly we can also plot how the proportion of B.1.1.7 incompatible cases (those that do show S amplification) has changed.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;mutate&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;B117_incompatible &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/grep.html&#39;&gt;grepl&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#39;S&#39;&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;England&#34;&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%in%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;OR+N+S&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;OR+N&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;, fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;B117_incompatible&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Count&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_bar&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;stat&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;identity&#34;&lt;/span&gt;,position&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;fill&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;title&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;England&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-8-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;data&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;RegionType&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;==&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;EnglandRegion&#34;&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;Amplicons&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%in%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;OR+N+S&#34;&lt;/span&gt;,&lt;span class=&#39;s&#39;&gt;&#34;OR+N&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;week&lt;/span&gt;, fill&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;B117_incompatible&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Count&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_bar&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;stat&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;identity&#34;&lt;/span&gt;,position&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;fill&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_continuous&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;title&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Regions&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;facet_wrap&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;~&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-8-2.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;to be continued&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Investigating the latest round of REACT</title>
      <link>/post/2021-01-21-react/</link>
      <pubDate>Thu, 21 Jan 2021 17:58:37 +0000</pubDate>
      <guid>/post/2021-01-21-react/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;https://spiral.imperial.ac.uk/handle/10044/1/85583&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;latest round of the REACT study&lt;/a&gt; has come out, and been quite controversial. Let&amp;rsquo;s examine some of the raw data behind it.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;http://tidyverse.tidyverse.org&#39;&gt;tidyverse&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Let&amp;rsquo;s download the REACT data and process it into a nice format:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;positive&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/connections.html&#39;&gt;url&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;https://raw.githubusercontent.com/mrc-ide/reactidd/master/inst/extdata/positive.csv&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Warning: Missing column names filled in: &#39;X1&#39; [1]&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;total&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/connections.html&#39;&gt;url&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;https://raw.githubusercontent.com/mrc-ide/reactidd/master/inst/extdata/total.csv&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Warning: Missing column names filled in: &#39;X1&#39; [1]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;positive&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;positive&#34;&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;total&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;total&#34;&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;positive&lt;/span&gt;, &lt;span class=&#39;nv&#39;&gt;total&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/colnames.html&#39;&gt;colnames&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;[&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;]&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;Date&#34;&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;pivot_longer&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/c.html&#39;&gt;c&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Date&lt;/span&gt;,&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,names_to&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Region&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;pivot_wider&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;names_from&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;type&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 1,485 x 4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;    Date       Region                   positive total&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt;    &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;date&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;                       &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 1&lt;/span&gt;&lt;span&gt; 2020-05-05 South East                      0   113&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 2&lt;/span&gt;&lt;span&gt; 2020-05-05 North East                      0    13&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 3&lt;/span&gt;&lt;span&gt; 2020-05-05 North West                      1    73&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 4&lt;/span&gt;&lt;span&gt; 2020-05-05 Yorkshire and The Humber        0    33&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 5&lt;/span&gt;&lt;span&gt; 2020-05-05 East Midlands                   1    77&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 6&lt;/span&gt;&lt;span&gt; 2020-05-05 West Midlands                   0    51&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 7&lt;/span&gt;&lt;span&gt; 2020-05-05 East of England                 0    93&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 8&lt;/span&gt;&lt;span&gt; 2020-05-05 London                          0    39&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 9&lt;/span&gt;&lt;span&gt; 2020-05-05 South West                      0    42&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;10&lt;/span&gt;&lt;span&gt; 2020-05-06 South East                      0    62&lt;/span&gt;&lt;/span&gt;
&lt;span class=&#39;c&#39;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# … with 1,475 more rows&lt;/span&gt;&lt;/span&gt;m
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now we can calculate binomial confidence intervals by location for each date and plot them.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;!&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/NA.html&#39;&gt;is.na&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;positive&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;!&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/NA.html&#39;&gt;is.na&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;total&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;binom&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;nv&#39;&gt;cis&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/binom/man/binom.confint.html&#39;&gt;binom.confint&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;positive&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;total&lt;/span&gt;, method&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;exact&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;


&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;lower&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;cis&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;lower&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;mean&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nv&#39;&gt;cis&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;mean&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;upper&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;cis&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;upper&lt;/span&gt;

&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;all&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/stats/filter.html&#39;&gt;filter&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;2020-12-15&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Date&lt;/span&gt;,ymin&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;lower&lt;/span&gt;,ymax&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;upper&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;mean&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_pointrange&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;black&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;facet_wrap&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;~&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;Region&lt;/span&gt;,scales&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;free_y&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;scale_y_log10&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;labels &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;scales&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://scales.r-lib.org//reference/label_percent.html&#39;&gt;percent&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;theme_bw&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Probability of testing positive&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Warning: Transformation introduced infinite values in continuous y-axis&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Warning: Transformation introduced infinite values in continuous y-axis&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-4-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;

&lt;span class=&#39;nf&#39;&gt;ggsave&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;plot.png&#34;&lt;/span&gt;,width&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;9&lt;/span&gt;,height&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;5&lt;/span&gt;, type&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;cairo&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Warning: Transformation introduced infinite values in continuous y-axis&lt;/span&gt;

&lt;span class=&#39;c&#39;&gt;#&amp;gt; Warning: Transformation introduced infinite values in continuous y-axis&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This looks to accord well with the table of R values that REACT provide in Table 3: &lt;img src=&#34;react-table.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;This isn&amp;rsquo;t especially surprising, but I think the visualisation helps to make sense of how these values came to be calculated (even though they are probably based on a more complex analysis weighting for various demographic factors).&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s it for now.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>The virus vs. the vaccine</title>
      <link>/post/2021-01-21-vaccine-virus/</link>
      <pubDate>Thu, 21 Jan 2021 16:58:37 +0000</pubDate>
      <guid>/post/2021-01-21-vaccine-virus/</guid>
      <description>&lt;p&gt;One framing for thinking about COVID is as a race between vaccination and infection, since we expect the former to have at least some mitigating effect on the latter. To get a sense for this I plot the cumulative infection estimates from the &lt;a href=&#34;https://www.mrc-bsu.cam.ac.uk/tackling-covid-19/nowcasting-and-forecasting-of-covid-19/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MRC Biostatistics Nowcasting Reports&lt;/a&gt; against the vaccination numbers from &lt;a href=&#34;https://coronavirus.data.gov.uk/details/healthcare&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PHE&lt;/a&gt; (with historical data filled in from &lt;a href=&#34;https://ourworldindata.org/covid-vaccinations&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Our World in Data&lt;/a&gt;).&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/try.html&#39;&gt;try&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;http://tidyverse.tidyverse.org&#39;&gt;tidyverse&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;, silent&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;kc&#39;&gt;TRUE&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;https://arxiv.org/abs/1403.2805&#39;&gt;jsonlite&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;kr&#39;&gt;&lt;a href=&#39;https://rdrr.io/r/base/library.html&#39;&gt;library&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;&lt;a href=&#39;http://github.com/jrnold/ggthemes&#39;&gt;ggthemes&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;a&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/jsonlite/man/fromJSON.html&#39;&gt;fromJSON&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;mrc_biostats.json&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;df&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;tibble&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;date&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;a&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;[[&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;]&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;]&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;a&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;[[&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;2&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;]&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;]&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;df&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;lubridate&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://lubridate.tidyverse.org/reference/ymd.html&#39;&gt;ymd&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;df&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;


&lt;span class=&#39;nv&#39;&gt;df&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;label&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;People infected&#34;&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;b&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;read_csv&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;vaccinations.csv&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;b&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;b&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;numFirstDose&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;b&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;lubridate&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;::&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;http://lubridate.tidyverse.org/reference/ymd.html&#39;&gt;dmy&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;b&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;b&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;label&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;People vaccinated&#34;&lt;/span&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;df&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;b&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1000000&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;label&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;size&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Date&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Number of people (millions)&#34;&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Type&#34;&lt;/span&gt;,title&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Infection and vaccination levels in England&#34;&lt;/span&gt;,caption&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Data sources: MRC Biostatistics Unit (cumulative infection estimates)\nOur World In Data &amp;amp; PHE (vaccination figures – at least one dose)&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/ggthemes/man/theme_hc.html&#39;&gt;theme_hc&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;+
  &lt;span class=&#39;nf&#39;&gt;theme&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;plot.title &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;element_text&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;hjust &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;0.5&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-1-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;&lt;span class=&#39;nf&#39;&gt;ggsave&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;plot.png&#34;&lt;/span&gt;,width&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;7.3&lt;/span&gt;,height&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;4&lt;/span&gt;, type &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;cairo&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;If we literally were to imagine vaccination and infection to be mutually exclusive (which clearly isn&amp;rsquo;t true in either direction), we could plot a graph like this to look at where they might meet.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;

&lt;span class=&#39;nv&#39;&gt;c&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;b&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;c&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;label&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;People unvaccinated&#34;&lt;/span&gt;
&lt;span class=&#39;nv&#39;&gt;c&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;56000000&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;-&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;c&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;$&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;
&lt;span class=&#39;nf&#39;&gt;ggplot&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;bind_rows&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;df&lt;/span&gt;,&lt;span class=&#39;nv&#39;&gt;c&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;,&lt;span class=&#39;nf&#39;&gt;aes&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;date&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;y&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;/&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1000000&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;nv&#39;&gt;label&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;geom_line&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;size&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;1&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; &lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;labs&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;x&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Date&#34;&lt;/span&gt;,y&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Number of people (millions)&#34;&lt;/span&gt;,color&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Type&#34;&lt;/span&gt;,title&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Infection and vaccination levels in England&#34;&lt;/span&gt;,caption&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;Data sources: MRC Biostatistics Unit (cumulative infection estimates)\nOur World In Data &amp;amp; PHE (vaccination figures – at least one dose)&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;&lt;span class=&#39;nf&#39;&gt;&lt;a href=&#39;https://rdrr.io/pkg/ggthemes/man/theme_hc.html&#39;&gt;theme_hc&lt;/a&gt;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;+&lt;/span&gt;+
  &lt;span class=&#39;nf&#39;&gt;theme&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;plot.title &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;nf&#39;&gt;element_text&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;hjust &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;m&#39;&gt;0.5&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-2-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;pre class=&#39;chroma&#39;&gt;&lt;code class=&#39;language-r&#39; data-lang=&#39;r&#39;&gt;

&lt;span class=&#39;nf&#39;&gt;ggsave&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;(&lt;/span&gt;&lt;span class=&#39;s&#39;&gt;&#34;plot2.png&#34;&lt;/span&gt;,width&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;7.3&lt;/span&gt;,height&lt;span class=&#39;o&#39;&gt;=&lt;/span&gt;&lt;span class=&#39;m&#39;&gt;4&lt;/span&gt;, type &lt;span class=&#39;o&#39;&gt;=&lt;/span&gt; &lt;span class=&#39;s&#39;&gt;&#34;cairo&#34;&lt;/span&gt;&lt;span class=&#39;o&#39;&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>An apicoplast-resident folate transporter is essential for sporogony of malaria parasites</title>
      <link>/publication/korbmacher-2021-apicoplast/</link>
      <pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate>
      <guid>/publication/korbmacher-2021-apicoplast/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Chronumental: time tree estimation from very large phylogenies</title>
      <link>/publication/sanderson-2021-chronumental/</link>
      <pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2021-chronumental/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Clinical outcomes of COVID-19 in long-term care facilities for people with epilepsy</title>
      <link>/publication/balestrini-2021-clinical/</link>
      <pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate>
      <guid>/publication/balestrini-2021-clinical/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Covince</title>
      <link>/project/covince/</link>
      <pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate>
      <guid>/project/covince/</guid>
      <description>&lt;p&gt;I built the first version of the Covince lineage explorer and then led a small team of two that continued its development. The Covince lineage explorer was developed to power the &lt;a href=&#34;//covid19.sanger.ac.uk/lineages/raw&#34;&gt;Sanger dashboard&lt;/a&gt; and was probably the main tool for understanding dynamics of SARS-CoV-2 evolution in the UK. Screenshots featured in countless of &lt;a href=&#34;https://www.thesun.co.uk/news/15189367/shock-maps-rapid-spreadf-indian-variant-weeks/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;media&lt;/a&gt; &lt;a href=&#34;https://www.dailymail.co.uk/health/article-11328917/Dont-panic-vaccine-resistant-Covid-strain-ever.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;articles&lt;/a&gt;. The Guardian and Sky News built their own pipelines that ingested data we provided in a machine-readable format.&lt;/p&gt;
&lt;p&gt;We later repurposed Covince to display global SARS-CoV-2 data at &lt;a href=&#34;//covglobe.org&#34;&gt;CovGlobe&lt;/a&gt;, and researchers at Queens University Belfast used our &lt;a href=&#34;https://github.com/covince/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;open-source code&lt;/a&gt; to &lt;a href=&#34;https://www.qub.ac.uk/News/Allnews/2022/ResourcelaunchedillustratingCOVID-19variantsacrossNorthernIreland.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;launch their own version&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Estimating the effectiveness of routine asymptomatic PCR testing at different frequencies for the detection of SARS-CoV-2 infections</title>
      <link>/publication/hellewell-2021-estimating/</link>
      <pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate>
      <guid>/publication/hellewell-2021-estimating/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Systematic Errors Associated with Some Implementations of ARTIC V4 and a Fast Workflow to Prescreen Samples for New Problematic Sites</title>
      <link>/publication/sanderson-2021-systematic/</link>
      <pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2021-systematic/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Using Plasmodium knowlesi as a model for screening Plasmodium vivax blood-stage malaria vaccine targets reveals new candidates</title>
      <link>/publication/ndegwa-2021-using/</link>
      <pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate>
      <guid>/publication/ndegwa-2021-using/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Variation at Spike position 142 in SARS-CoV-2 Delta genomes is a technical artifact caused by dropout of a sequencing amplicon</title>
      <link>/publication/sanderson-2021-variation/</link>
      <pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2021-variation/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Genomic and transcriptomic evidence for descent from Plasmodium and loss of blood schizogony in Hepatocystis parasites from naturally infected red colobus monkeys</title>
      <link>/publication/2020-hepatocystis/</link>
      <pubDate>Sat, 01 Aug 2020 00:00:00 +0000</pubDate>
      <guid>/publication/2020-hepatocystis/</guid>
      <description></description>
    </item>
    
    <item>
      <title>COVID-19 and the categorical imperative</title>
      <link>/blog/2020/04/21/covid-19-and-the-categorical-imperative/</link>
      <pubDate>Tue, 21 Apr 2020 13:26:41 +0000</pubDate>
      <guid>/blog/2020/04/21/covid-19-and-the-categorical-imperative/</guid>
      <description>&lt;p&gt;I recently asked on Twitter:&lt;figure class=&#34;wp-block-image is-resized&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style=&#34;border:1px solid #DDD&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image.png&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;And got reassuring results:&lt;figure class=&#34;wp-block-image is-resized&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style=&#34;border:1px solid #DDD&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-1.png&#34; alt=&#34;&#34; class=&#34;wp-image-377&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-1.png 476w, /post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-1-300x67.png 300w&#34; sizes=&#34;(max-width: 476px) 85vw, 476px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Then I asked another question. Have a think about how you might answer it.&lt;figure class=&#34;wp-block-image is-resized&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style=&#34;border:1px solid #DDD&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-2.png&#34; alt=&#34;&#34; class=&#34;wp-image-378&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-2.png 475w, /post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-2-300x171.png 300w&#34; sizes=&#34;(max-width: 475px) 85vw, 475px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Here is how Twitter responded:&lt;figure class=&#34;wp-block-image&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style=&#34;border:1px solid #DDD&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-4.png&#34; alt=&#34;&#34; class=&#34;wp-image-381&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-4.png 425w, /post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-4-300x62.png 300w&#34; sizes=&#34;(max-width: 425px) 85vw, 425px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Quite a difference! Not surprising perhaps. The risk of passing on COVID-19 is lower by a factor of 12,000. Nevertheless, I think that the good people of Twitter are wrong, and will explain why a little further down.&lt;/p&gt;
&lt;p&gt;The people of Twitter are not alone though, and these sorts of decisions aren’t just thought experiments. The UK government first required people with coughs or fever to isolate themselves on 12 March, long after the virus arrived in the UK. This was part of the government’s strategy of introducing “the right measures at the right time”, and Sir Patrick Vallance gave this as an example, saying that prior to 12 March a very small proportion of people with symptoms would have COVID-19, so it would not make sense to isolate them.&lt;/p&gt;
&lt;p&gt;I’ve seen a similar argument made against mask use. After lockdown a small proportion of people will have COVID, the argument goes, so the chance of any particular mask stopping an infection is tiny:&lt;figure class=&#34;wp-block-image&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-5.png&#34; alt=&#34;&#34; class=&#34;wp-image-385&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-5.png 477w, /post/archive_posts/old_wp_images/wp-content/uploads/2020/04/image-5-300x126.png 300w&#34; sizes=&#34;(max-width: 477px) 85vw, 477px&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We do this sort of risk analysis all the time. When you go somewhere in a car there is some small chance you could cause an accident in which someone is hurt, but if that risk were 12,000 times higher you would never drive again.&lt;/p&gt;
&lt;p&gt;Even some experts appear to agree:&lt;figure class=&#34;wp-block-image is-resized&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://pbs.twimg.com/media/EWHRh0OXQAAnd01?format=jpg&amp;name=large&#34; alt=&#34;Image&#34; width=&#34;426&#34; height=&#34;292&#34; /&gt; &lt;figcaption&gt;From &lt;a href=&#34;https://www.thetimes.co.uk/article/facemasks-for-public-risk-nhs-shortage-q5bkzvzql&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;The Times, 21st April&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;But this argument does not apply for a contagious virus.&lt;/p&gt;
&lt;h3 id=&#34;investigating-with-a-simple-model&#34;&gt;Investigating with a simple model&lt;/h3&gt;
&lt;p&gt;Practically, someone who stays home in Scenario A (when there is a 99.999% chance they have a cold), has the same impact as someone who stays home when there is a 12% chance they have COVID. One way to see this is to simulate an epidemic, and imagine that we institute an intervention for only a week, either early in the epidemic or late in the epidemic.&lt;/p&gt;
&lt;p&gt;Let’s consider the mass-masking scenario. Without any interventions, each infected person passes the virus on to 2.5 additional people. We’ll exaggerate the effect of masks and imagine that everyone wearing masks reduces that number (R) to 0.8. In reality this magnitude of effect could only be achieved with a package of many interventions. But it makes it easier to see what’s going on with a graph.&lt;/p&gt;
&lt;p&gt;If we plot the epidemic with a logarithmic y-axis, then the steepness of the line is a reflection of how many people each infected person passes the virus to. So if we don’t implement any interventions, this graph goes up with a constant slope.&lt;figure class=&#34;wp-block-image&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/step1.gif&#34; alt=&#34;&#34; class=&#34;wp-image-396&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;What happens if we wait until lots of people have the virus, and then bring in masks for 2 weeks to try to stop them passing it on? Well, it’s as you’d expect. The graph goes up as normal, then goes down as R falls to 0.8 for 2 weeks, then starts going up at the same rate again, but reaches a lower point after 80 days than without the two week intervention.&lt;figure class=&#34;wp-block-image&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/step2.gif&#34; alt=&#34;&#34; class=&#34;wp-image-397&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In this case we decided to bring in the 2 week intervention only after at least 1% of people were infected. This seems to make sense. Surely there is no point in making people wear masks when only 0.001% of them have the virus? But let’s check, what happens if we bring in the two weeks much earlier in the epidemic?&lt;figure class=&#34;wp-block-image&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2020/04/step3.gif&#34; alt=&#34;&#34; class=&#34;wp-image-398&#34; /&gt; &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;It turns out that the two weeks early in the epidemic has exactly the same effect on the number of infections on day 80! What matters is that it has the same effect on R in either case. Even though a far lower absolute number of infected people are wearing masks, R is reduced to 0.8 in both cases.&lt;/p&gt;
&lt;h3 id=&#34;ethics-how-should-we-each-act-in-the-time-of-covid-19&#34;&gt;Ethics: how should we each act in the time of COVID-19?&lt;/h3&gt;
&lt;p&gt;As COVID-19 was spreading in our communities, many people advocated for social-distancing measures. One model for doing this is to think about the absolute chance you have of spreading the virus. For example, someone made a graph to discourage people from holding large events by showing that if there are a lot of infections in the community there is a good chance that large events will cause transmission events:&lt;figure class=&#34;wp-block-image&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://pbs.twimg.com/media/EV5HbwjVAAYZbz0?format=jpg&amp;amp;name=4096x4096&#34; alt=&#34;Image&#34;&gt; &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Interestingly this graph suggests that if one holds a large event when there is a low level of COVID in the community, there is a less negative effect than when there is a high level. But we’ve seen from the models above that this isn’t correct.&lt;/p&gt;
&lt;p&gt;So how can we decide how to shape our behaviour? I think it makes sense to follow Kant’s “&lt;a href=&#34;https://en.wikipedia.org/wiki/Categorical_imperative&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Categorical Imperative&lt;/a&gt;“.&lt;/p&gt;
&lt;blockquote class=&#34;wp-block-quote&#34;&gt;
  &lt;p&gt;
    &lt;strong&gt;Act only according to that&amp;nbsp;maxim&amp;nbsp;whereby you can, at the same time, will that it should become a universal law.&lt;/strong&gt;
  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So imagine if everyone acted as you intend to, and work out what the effect on R would be. If everyone wears masks then, regardless of the level of COVID in the community, R is reduced. If everyone holds large events then, regardless of the level of COVID in the community, R is increased.&lt;/p&gt;
&lt;p&gt;In the absence of evidence on seroprevalence and immunity, we must aim to keep R below 1 until we have a vaccine. This will drive the level in the community down to near zero. It will allow vulnerable people to go about their lives as normal. However to achieve these levels we must sustain our measures &lt;em&gt;even as levels in the community drop&lt;/em&gt;. Even as we believe that only 30 people in the whole country are infected, we must all wear masks. It’s counter-intuitive, but it will work.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Community testing for COVID-19: reaching 25  million tests per week</title>
      <link>/blog/2020/04/19/community-testing-for-covid-19-reaching-25-million-tests-per-week/</link>
      <pubDate>Sun, 19 Apr 2020 13:28:46 +0000</pubDate>
      <guid>/blog/2020/04/19/community-testing-for-covid-19-reaching-25-million-tests-per-week/</guid>
      <description>&lt;p&gt;Until recently, the strategy for COVID testing in many countries has been focused on people who have a significantly likelihood of having COVID-19. The need to impose unpleasant social distancing measures, and ultimately complete lock-downs, trades off against how much testing you do in the community. With sufficient community testing, you could suppress COVID in a population without any social distancing measures. This post is an outline of one way one might go about testing 25 million people per week in order to achieve this.&lt;/p&gt;
&lt;h3 id=&#34;decentralised-testing&#34;&gt;&lt;strong&gt;Decentralised testing&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Reaching this sort of scale quickly is likely to require a decentralised approach levering existing organisations. The most obvious candidates to do this are schools and larger businesses. Thirteen million people are employed by businesses with more than 50 employees, and there are twelve million children in schools. If these businesses and schools could test everyone within them each week, 25 million tests would be carried out.&lt;/p&gt;
&lt;p&gt;It’s important to note that this sort of testing is completely different from the testing of symptomatic, or likely infected, individuals. Symptomatic testing rightly requires specialist training, uncomfortable nasopharyngeal swabs, and full PPE for the person testing and the person being tested. This is because there is a high risk of exposure to COVID-19, and because getting a test result wrong could have major implications for care.&lt;/p&gt;
&lt;p&gt;Testing random individuals from a population with low incidence of COVID-19 poses no greater risk than interacting with them in any other way, as colleagues or students. And in this setting a significant rate of false-negatives or false-positives can be tolerated without major consequences.&lt;/p&gt;
&lt;h3 id=&#34;testing-procedure&#34;&gt;Testing procedure&lt;/h3&gt;
&lt;p&gt;In this proposal all of these businesses and schools would be supplied with: simple nasal swabs, frozen plates containing COVID-19 RT-PCR mix, a basic one-button thermocycler, a blue light transilluminator.&lt;/p&gt;
&lt;p&gt;The employee responsible for testing takes one of the frozen plates out of the freezer and thaws it.&lt;/p&gt;
&lt;p&gt;Students and employees go up, one by one, to the testing station. Each person takes a nasal swab and swabs their nostril (front-of-nose, not nasopharyx), then places the swab into a well of the plate, and cuts off the swab’s shaft and discards it. They also write their name on a sheet in a box representing this well, then wash their hands.&lt;/p&gt;
&lt;p&gt;Once the plate is full of samples the employee responsible for testing takes the plate. They seal it, load it into the one-button-thermocycler, and press the button. The thermocycler runs an RT-PCR programme for an hour.&lt;/p&gt;
&lt;p&gt;The employee takes the plate out of the machine and examines it with the blue light transilluminator. Any positive wells (including a pre-loaded control well) will glow brightly. Negative wells will be dull.&lt;/p&gt;
&lt;p&gt;If the employee notices any positive wells (a very rare occurence) they immediately look at the sheet of names and contact the person in question to ask them to report to public health authorities for confirmatory testing. If this test comes back positive then contact-tracing begins.&lt;/p&gt;
&lt;p&gt;The aim would be to test each person at these schools and businesses once each week.&lt;/p&gt;
&lt;h3 id=&#34;costs-and-availability&#34;&gt;Costs and availability&lt;/h3&gt;
&lt;p&gt;The reagents for this test cost much less that £1 per tested person.&lt;/p&gt;
&lt;p&gt;A thermocycler is a simple device which can be currently be purchased for £3,200, and likely manufactured for much less. Unlike ventilators, these could be relatively easily produced by other manufacturers. There would be a definite need to scale up production to achieve this scale.&lt;/p&gt;
&lt;p&gt;A blue light transilluminator can be made for less than £40 from commonly available materials.&lt;/p&gt;
&lt;p&gt;It seems likely that, despite their low-cost, global supplies of RT-PCR enzymes are insufficient for this scale of testing at present. But there is no reason I am aware of to think that this could not easily be scaled up. The quantities of primers needed are readily available.&lt;/p&gt;
&lt;p&gt;There might be a need to scale up the production of the DNA-binding dye.&lt;/p&gt;
&lt;p&gt;All of these costs are minuscule compared to the economic losses averted by preventing a lock-down.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Controlled infection with COVID-19 as a safer means of establishing herd immunity</title>
      <link>/blog/2020/03/14/controlled-infection-with-covid-19-as-a-safer-means-of-establishing-herd-immunity/</link>
      <pubDate>Sat, 14 Mar 2020 13:04:28 +0000</pubDate>
      <guid>/blog/2020/03/14/controlled-infection-with-covid-19-as-a-safer-means-of-establishing-herd-immunity/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Update: it seems (although clarity is lacking) that the UK has moved away from the herd-immunity strategy.&lt;/strong&gt; &lt;strong&gt;I very much welcome this. It renders the argument below irrelevant, except as an illustration of the weaknesses of a strategy that seeks to vaccinate a population using an epidemic.&lt;/strong&gt;&lt;/p&gt;
&lt;p style=&#34;background-color:#fffce9&#34; class=&#34;has-background&#34;&gt;
  Disclaimer: I am neither a virologist, nor an immunologist, nor an epidemiologist. This post is written with confidence, because too many caveats hinder clarity, but should be understood to be the thoughts of a layperson.
&lt;/p&gt;
&lt;p&gt;This week the policy of the UK government on COVID-19, under advice from scientists, has been articulated clearly for the first time. The government intends for around 60% of the population to be infected with COVID-19 in the anticipation that after the majority who survive recover, the population as a whole will have ‘herd immunity’ to the virus, since if only 40% of the population can pass on the virus it will be unable to spread.&lt;/p&gt;
&lt;p&gt;One can argue about the wisdom of the policy, which is in disagreement with the position of the WHO and many other countries. This post is not about that. What I am interested in is: &lt;strong&gt;given this policy (to allow 60% of the population to become infected)&lt;/strong&gt;, what is the least bad way to achieve this? For instance, should you let the virus spread at random through the population or should you actively infect people with the virus under very controlled conditions to minimise the risks?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style=&#34;text-decoration: underline;&#34;&gt;The current approach&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The government’s approach is to allow the virus to spread with relatively few restrictions initially. At a point before it overwhelms the healthcare system, it will introduce further social-distancing measures to attempt to “flatten the curve” and spread the 40 million infections over a longer time. There will also be some measures to try to ensure that the most vulnerable – older and immunocompromised people – are isolated, but it is unclear how effectively this can be achieved.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style=&#34;text-decoration: underline;&#34;&gt;Risks of the current approach&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;**Infecting the vulnerable. ~**20% of the UK population is over 65. The fatality rate appears at least 10x higher in this demographic group, hence the government’s attempts to isolate them. At a point where a substantial portion of the population has the virus it is likely to be very difficult to achieve this. If the 60% of the 3.2 million people over 80 became infected, and the fatality rate of 14% for this age-group from China applied then that would represent 270,000 deaths in this age group alone.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Overloading the healthcare system.&lt;/strong&gt; Exponential growth is a powerful adversary and small miscalculations could result in overloading the healthcare system with the result that many people die simply because there are no ventilators available to keep them alive. There is concern among some experts that it will not be possible to flatten the curve enough to ensure that  everyone receives adequate care. Exponential growth is difficult to avoid in natural infections because people who get the virus will not initially know that they have it, and so will unknowingly spread it to others.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Viral load.&lt;/strong&gt; There are &lt;a href=&#34;https://pubmed.ncbi.nlm.nih.gov/29277291-adaptive-evolution-influences-the-infectious-dose-of-mers-cov-necessary-to-achieve-severe-respiratory-disease/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;reasons&lt;/a&gt; &lt;a href=&#34;https://jamanetwork.com/journals/jama/fullarticle/2763136&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;to&lt;/a&gt; expect that the more particles  of virus a person is exposed to initially, the more likely they are  to experience severe disease. In the government’s approach there is no control over this and so it is possible that young and healthy people may develop severe symptoms due to exposure to a large viral load.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style=&#34;text-decoration: underline;&#34;&gt;An alternative approach&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We have seen that the government actively intends for 60% of people to get the virus. It is almost as if it were to simply go and infect people, as at a &lt;a href=&#34;https://en.wikipedia.org/wiki/Pox_party&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;chicken-pox party&lt;/a&gt;.  So why not actually do this? Could there be advantages to actively exposing 60% of people in a controlled way to the virus to generate the same herd immunity?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style=&#34;text-decoration: underline;&#34;&gt;Advantag&lt;/span&gt;&lt;/strong&gt;&lt;span style=&#34;text-decoration: underline;&#34;&gt;&lt;strong&gt;es the controlled exposure approach&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not infecting the vulnerable &lt;/strong&gt; – only fit and healthy people would be selected to receive the virus. Almost no children under 10 have developed severe symptoms from COVID-19. It would therefore seem very safe to put all immunocompetent children into the 60% who get the virus. Other young people are also comparatively resilient to the virus, and so a utilitarian argument would suggest they would  be the safest people to inoculate with the virus. We will see below that this approach may be safer &lt;em&gt;for the people  who get infected&lt;/em&gt;, than the alternative policy of letting the virus pass through the population.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Not overloading the healthcare system &lt;/strong&gt; – there are two ways in which this controlled approach would avoid overloading the healthcare system. Firstly, by avoiding exponential growth: those infected would know they had been infected and could be isolated afterwards until they were no longer shedding virus. Once resistant, they could go out into the population, and safely work in crucial roles where they were likely to be exposed to the virus. Secondly by reducing the hospitalisation rate: because these people would be drawn from a much more resilient population the chances of them developing severe symptoms would be much lower. The end result of this would be fewer people in hospitals, meaning that the small(er) number of people who did develop severe symptoms would be able to get adequate care. The end result might be that a 100% chance of being infected, and receiving adequate care if required, might be safer than a 60% chance of being infected with the possibility of developing severe symptoms in a degraded healthcare system, which is dealing with exponential growth and vulnerable patients.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Controlled viral load, and possibility of an attenuated strain&lt;/strong&gt; – there are several lines of evidence to suggest that the amount of virus one is initially exposed to may be a determinant of whether someone develops severe symptoms. By controlling the infection one could minimise the amount of virus someone is exposed to (while ensuring they develop an immune response). This  might again substantially reduce the risk compared to a 60% chance of receiving a random viral load (determined by how near you are to an infected person and how much virus they are shedding). Finally, although proper “no-risk” vaccines are unlikely to be available for some time, my non-expert brain wonders whether it is possible to rapidly develop a version of the virus that would be expected to be mildly attenuated by, for example, leaving the proteins the virus is encoding exactly the same, but &lt;a href=&#34;https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4508661/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;altering the “codons”&lt;/a&gt; of DNA such that these proteins are likely to be produced less rapidly. The effectiveness of this could not be guaranteed, but on the balance of probabilities it seems very unlikely to be more dangerous than the wild-type virus.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style=&#34;text-decoration: underline;&#34;&gt;Summary&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The government are conducting an experiment in which  they will allow 60% of people to be infected. To my mind this is in substance the same as the government randomly choosing 60% of people and actively infecting them with a random load of wild-type virus, but not telling them they are infected with the result that they may spread it to vulnerable people. An alternative approach in which selected resilient people were infected in a controlled manner with a low-dose of an attenuated virus might be safer &lt;em&gt;for the people infected&lt;/em&gt;, as well as society at large, than the current strategy.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style=&#34;text-decoration: underline;&#34;&gt;Disclaimer&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I am neither a virologist, nor an immunologist, nor an epidemiologist. I would welcome explanations of where this argument falls down from such people, or anyone else. Furthermore, I am not arguing for this approach as superior to a containment strategy, merely as superior to a strategy of natural infection. Finally, this is a suggestion for an organised governmental approach, &lt;strong&gt;not&lt;/strong&gt; a DIY ‘chicken-pox party approach’ which would not control viral load and would therefore have great risk.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Critiquing protein family classification models using sufficient input subsets</title>
      <link>/publication/carter-2020-critiquing/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      <guid>/publication/carter-2020-critiquing/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Defining multiplicity of vector uptake in transfected Plasmodium parasites</title>
      <link>/publication/carrasquilla-2020-defining/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      <guid>/publication/carrasquilla-2020-defining/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Genomic and transcriptomic evidence for descent from Plasmodium and loss of blood schizogony in Hepatocystis parasites from naturally infected red colobus monkeys</title>
      <link>/publication/aunin-2020-genomic/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      <guid>/publication/aunin-2020-genomic/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Pandemic peak SARS-CoV-2 infection and seroconversion rates in London frontline health-care workers</title>
      <link>/publication/houlihan-2020-pandemic/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      <guid>/publication/houlihan-2020-pandemic/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Scalable and Robust SARS-CoV-2 Testing in an Academic Center</title>
      <link>/publication/consortium-2020-scalable/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      <guid>/publication/consortium-2020-scalable/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Standard operating procedures for SARS-CoV-2 detection by a clinical diagnostic RT-LAMP assay</title>
      <link>/publication/buck-2020-standard/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      <guid>/publication/buck-2020-standard/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Using Plasmodium knowlesi as a model for screening Plasmodium vivax blood-stage malaria vaccine targets reveals new candidates</title>
      <link>/publication/ndegwa-2020-using/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      <guid>/publication/ndegwa-2020-using/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Slides</title>
      <link>/slides/example/</link>
      <pubDate>Tue, 05 Feb 2019 00:00:00 +0000</pubDate>
      <guid>/slides/example/</guid>
      <description>&lt;h1 id=&#34;create-slides-in-markdown-with-wowchemy&#34;&gt;Create slides in Markdown with Wowchemy&lt;/h1&gt;
&lt;p&gt;&lt;a href=&#34;https://wowchemy.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Wowchemy&lt;/a&gt; | &lt;a href=&#34;https://owchemy.com/docs/managing-content/#create-slides&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Documentation&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;features&#34;&gt;Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Efficiently write slides in Markdown&lt;/li&gt;
&lt;li&gt;3-in-1: Create, Present, and Publish your slides&lt;/li&gt;
&lt;li&gt;Supports speaker notes&lt;/li&gt;
&lt;li&gt;Mobile friendly slides&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;controls&#34;&gt;Controls&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Next: &lt;code&gt;Right Arrow&lt;/code&gt; or &lt;code&gt;Space&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Previous: &lt;code&gt;Left Arrow&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Start: &lt;code&gt;Home&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Finish: &lt;code&gt;End&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Overview: &lt;code&gt;Esc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Speaker notes: &lt;code&gt;S&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Fullscreen: &lt;code&gt;F&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Zoom: &lt;code&gt;Alt + Click&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/hakimel/reveal.js#pdf-export&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PDF Export&lt;/a&gt;: &lt;code&gt;E&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;code-highlighting&#34;&gt;Code Highlighting&lt;/h2&gt;
&lt;p&gt;Inline code: &lt;code&gt;variable&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Code block:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;porridge = &amp;quot;blueberry&amp;quot;
if porridge == &amp;quot;blueberry&amp;quot;:
    print(&amp;quot;Eating...&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&#34;math&#34;&gt;Math&lt;/h2&gt;
&lt;p&gt;In-line math: $x + y = z$&lt;/p&gt;
&lt;p&gt;Block math:&lt;/p&gt;
&lt;p&gt;$$
f\left( x \right) = ;\frac{{2\left( {x + 4} \right)\left( {x - 4} \right)}}{{\left( {x + 4} \right)\left( {x + 1} \right)}}
$$&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;fragments&#34;&gt;Fragments&lt;/h2&gt;
&lt;p&gt;Make content appear incrementally&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{% fragment %}} One {{% /fragment %}}
{{% fragment %}} **Two** {{% /fragment %}}
{{% fragment %}} Three {{% /fragment %}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Press &lt;code&gt;Space&lt;/code&gt; to play!&lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;fragment &#34; &gt;
One
&lt;/span&gt;
&lt;span class=&#34;fragment &#34; &gt;
&lt;strong&gt;Two&lt;/strong&gt;
&lt;/span&gt;
&lt;span class=&#34;fragment &#34; &gt;
Three
&lt;/span&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;A fragment can accept two optional parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;class&lt;/code&gt;: use a custom style (requires definition in custom CSS)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;weight&lt;/code&gt;: sets the order in which a fragment appears&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;speaker-notes&#34;&gt;Speaker Notes&lt;/h2&gt;
&lt;p&gt;Add speaker notes to your presentation&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-markdown&#34;&gt;{{% speaker_note %}}
- Only the speaker can read these notes
- Press `S` key to view
{{% /speaker_note %}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Press the &lt;code&gt;S&lt;/code&gt; key to view the speaker notes!&lt;/p&gt;
&lt;aside class=&#34;notes&#34;&gt;
  &lt;ul&gt;
&lt;li&gt;Only the speaker can read these notes&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;S&lt;/code&gt; key to view&lt;/li&gt;
&lt;/ul&gt;

&lt;/aside&gt;
&lt;hr&gt;
&lt;h2 id=&#34;themes&#34;&gt;Themes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;black: Black background, white text, blue links (default)&lt;/li&gt;
&lt;li&gt;white: White background, black text, blue links&lt;/li&gt;
&lt;li&gt;league: Gray background, white text, blue links&lt;/li&gt;
&lt;li&gt;beige: Beige background, dark text, brown links&lt;/li&gt;
&lt;li&gt;sky: Blue background, thin dark text, blue links&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;ul&gt;
&lt;li&gt;night: Black background, thick white text, orange links&lt;/li&gt;
&lt;li&gt;serif: Cappuccino background, gray text, brown links&lt;/li&gt;
&lt;li&gt;simple: White background, black text, blue links&lt;/li&gt;
&lt;li&gt;solarized: Cream-colored background, dark green text, blue links&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;

&lt;section data-noprocess data-shortcode-slide
  
      
      data-background-image=&#34;/media/boards.jpg&#34;
  &gt;

&lt;h2 id=&#34;custom-slide&#34;&gt;Custom Slide&lt;/h2&gt;
&lt;p&gt;Customize the slide style and background&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-markdown&#34;&gt;{{&amp;lt; slide background-image=&amp;quot;/media/boards.jpg&amp;quot; &amp;gt;}}
{{&amp;lt; slide background-color=&amp;quot;#0000FF&amp;quot; &amp;gt;}}
{{&amp;lt; slide class=&amp;quot;my-style&amp;quot; &amp;gt;}}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2 id=&#34;custom-css-example&#34;&gt;Custom CSS Example&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s make headers navy colored.&lt;/p&gt;
&lt;p&gt;Create &lt;code&gt;assets/css/reveal_custom.css&lt;/code&gt; with:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-css&#34;&gt;.reveal section h1,
.reveal section h2,
.reveal section h3 {
  color: navy;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h1 id=&#34;questions&#34;&gt;Questions?&lt;/h1&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/wowchemy/wowchemy-hugo-modules/discussions&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Ask&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://wowchemy.com/docs/managing-content/#create-slides&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Documentation&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>PubTweet</title>
      <link>/blog/2019/01/25/pubtweet/</link>
      <pubDate>Fri, 25 Jan 2019 03:43:22 +0000</pubDate>
      <guid>/blog/2019/01/25/pubtweet/</guid>
      <description>&lt;p&gt;There are a lot of tweets to PubMed pages – not least from @MalariaPapers. I made &lt;a href=&#34;http://pubtweet.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PubTweet&lt;/a&gt; to enable these to have nice info-boxes, like this:&lt;/p&gt;
&lt;blockquote class=&#34;twitter-tweet&#34; data-lang=&#34;en&#34;&gt;
  &lt;p lang=&#34;en&#34; dir=&#34;ltr&#34;&gt;
    Evaluation of automated malaria diagnosis using the Sysmex XN-30 analyser in a clinical setting. &lt;a href=&#34;https://t.co/ZA0vb59FzQ&#34;&gt;https://t.co/ZA0vb59FzQ&lt;/a&gt;
  &lt;/p&gt;
  &lt;p&gt;
    &amp;mdash; Malaria Papers (@MalariaPapers) &lt;a href=&#34;https://twitter.com/MalariaPapers/status/1088393873339154433?ref_src=twsrc%5Etfw&#34;&gt;January 24, 2019&lt;/a&gt;
  &lt;/p&gt;
&lt;/blockquote&gt;
</description>
    </item>
    
    <item>
      <title>eMotion 5075 teardown</title>
      <link>/blog/2019/01/05/emotion-5075-teardown/</link>
      <pubDate>Sat, 05 Jan 2019 17:38:35 +0000</pubDate>
      <guid>/blog/2019/01/05/emotion-5075-teardown/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2019/01/epmotion.jpg&#34; alt=&#34;&#34;&gt;
In my PhD lab we had an epMotion 5075 pipetting robot. I had a like/hate relationship with this machine. Like: it’s an impressive, precision-engineered, piece of hardware. Hate: the software is appalling. Writing protocols for it was slow, frustrating and generally awful, and there was a general lack of flexibility in what one could make it do.&lt;/p&gt;
&lt;p&gt;Recently I heard that the lab was having a clear out, including disposing of this (pricey when purchased) robot and I asked if I could adopt it in preference to the scrapheap, which I was kindly allowed to. I’m not in a wet-lab at the moment so for now it will live in a garage, but I did want to have a peek inside to have a better understanding of how it works, and to work out whether it would be possible to customise it to be more flexible.&lt;/p&gt;
&lt;p&gt;If I were buying my own scientific hardware I would always go for the upstart companies like &lt;a href=&#34;http://opentrons.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OpenTrons&lt;/a&gt; and &lt;a href=&#34;https://incuvers.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Incuvers&lt;/a&gt; which tell you how their hardware works and allow you to do whatever you want with it. With the epMotion, by contrast, if you want to use new labware you have to send a physical version of it to the company which they measure to generate a proprietary calibration file.&lt;/p&gt;
&lt;p&gt;I was given some hope that it might be possible to customise the robot from this video, in which someone has replaced all the electronics of the robot with a standard board for a CNC machine:&lt;/p&gt;
&lt;p&gt;&lt;iframe src=&#34;https://www.youtube.com/embed/IDlZ_FIUgjM&#34; width=&#34;560&#34; height=&#34;315&#34; frameborder=&#34;0&#34; allowfullscreen=&#34;allowfullscreen&#34;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;But other than that I could find very little on the internet about what is inside these robots. I think that’s a shame, and now I have one at my disposal, without a warranty. So here is a run-down of what happens when you take it apart, in case it is useful to anyone in a similar position.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First steps&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The back panels come off very easily with a hex-key and expose the computer that runs the machine. This runs some version of Windows, maybe Windows CE. It has USB and ethernet ports although to my knowledge with my version of this robot these can’t be used for anything useful. In general I doubt there is any easy way to make this computer do anything other than what Eppendorf has programmed it to do, without access to the underlying source code.&lt;/p&gt;
&lt;p&gt;Removing the top required in my case removing a little bit of double sided tape at either side, in addition to two hex-key bolts.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2019/01/epmotionteardown1.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;There is a heavy-duty belt for the X axis with a big stepper motor.  My robot had been essentially unused for several years and the rail over which the X-carriage runs had become covered with a sticky substance. This caused the motors to stall mid-run, but cleaning them off with some alcohol resolved this issue.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2019/01/P1010610-1200x1600.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;figcaption id=&#34;caption-attachment-321&#34; class=&#34;wp-caption-text&#34;&gt;The computer that is the brains of the operation &amp;#8211; unfortunately unlikely to be easily repurposable.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Basics&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Each of the X, Y and Z axes is controlled by a stepper motor (the X-axis one is &lt;a href=&#34;https://catalog.orientalmotor.com/item/all-categories/tegories-pk-series-2-phase-stepping-motors-legacy-/pk266-03a&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;this&lt;/a&gt;). They each have optical endstops with 4 wires. In the video above these endstops have been replaced with mechanical switches but it really should be possible to use them as-is.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2019/01/P1010626-e1546707506491-1200x1600.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;figcaption id=&#34;caption-attachment-322&#34; class=&#34;wp-caption-text&#34;&gt;X-belt and optical end-stop&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2019/01/P1010690-1200x900.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;figcaption id=&#34;caption-attachment-317&#34; class=&#34;wp-caption-text&#34;&gt;Y-axis stepper motor, belt, and optical end-stop.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Cabling&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;One of the challenges of making a many-axis robot is that signals have to be carried to each successive axis, all of which are connected together. So flexible cabling is needed -but at the same time it has to not get in the way or fall into the samples. In the case of the epMotion this is carried out with ribbon cables like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2019/01/ribboncable-1200x900.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;But it quickly becomes apparent that this cable doesn’t have enough wires to be simply directly connected at the other end to stepper motors / endstops / etc. Instead it seems that this is some sort of serial cable that carries data signals to a series of other microprocessors, one on the robot’s pipetting arm, and one for each of the Y and Z axes, which then interface with the Y motor, Z motor, the tool locking motor, the pipetting motor, the tip-ejecting actuator, and the range-detector.&lt;/p&gt;
&lt;p&gt;If you want to hack this thing you’ll have to decide whether you want to have to make and mount 4 separate pieces of control hardware, or to replace the cabling with a much thicker set of wires.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pipetting arm&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2019/01/pipettearm2-1200x872.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;p&gt;Lurking under the metal cover of the tool arm is a profusion of electronics. There’s a lot to do. An (infrared?) sensor to measure distance, and actuation of grabbing a tool, identifying it, pipetting up and down, and ejecting a tip.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Selecting/using tools&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;One of the very impressive things about the epMotion robot is its ability to change tools during operation. It can choose from a variety of single channel and multichannel pipettes, and even a plate gripper.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2019/01/P1010677-1200x900.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;figcaption id=&#34;caption-attachment-326&#34; class=&#34;wp-caption-text&#34;&gt;Tools&lt;/figcaption&gt;
&lt;p&gt;How does this process work?&lt;/p&gt;
&lt;p&gt;The tool arm has two coaxial motors. One is, I believe, a simple DC motor with a very low gearing. It rotates a bit of metal internal to the arm which causes it to firmly grip whichever tool it is currently over. I’m not quite sure how the robot knows when this rotation is finished. My suspicion is that it detects the change in current flowing through the motor when the motor stalls at the end. Certainly if you disconnect this motor, the robot is able to detect that ‘the engine is not responding’, and informs you so.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2019/01/insidetoolarm-1200x900.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;figcaption id=&#34;caption-attachment-325&#34; class=&#34;wp-caption-text&#34;&gt;Looking up at the inside of the tool gripper to see how it works.&lt;/figcaption&gt;
&lt;p&gt;When one examines the pipettes themselves one notices they have electrical contacts, but these are simply used to tell the robot which tool is in what place. The pipettes are in fact mechanical rather than electronic devices. They all have the same rotatable top-piece, and as this is spun by a stepper motor in the tool arm they aspirate/dispense liquid (or in the case of the gripper, grab and release). As this piece is rotated the tool begins to extend a rod out from it. Inside the tool-gripper this rod must make contact with a switch, and this is used to “home” the pipette to ensure the robot knows the position of the plunger.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2019/01/P1010651-1200x900.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;
&lt;figcaption id=&#34;caption-attachment-327&#34; class=&#34;wp-caption-text&#34;&gt;Homed tool with thin rod extended to make contact with switch. Electrical contacts for tool ID visible to the right.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Prospects for customisation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I’m going to pause my hardware work here, because it isn’t yet clear exactly what the application of the robot will be for me and I don’t want to destroy any necessary functionality.&lt;/p&gt;
&lt;p&gt;If I had continued I would have one way or another tried to marry up the epMotion hardware with the open-source &lt;a href=&#34;https://github.com/Opentrons&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OpenTrons robot-control software&lt;/a&gt;. This basically means adapting the hardware such that one knows how to control it and then writing a custom driver for the OpenTrons software.&lt;/p&gt;
&lt;p&gt;I do think this is completely achievable. The video above already shows how 3-axis control is possible, using a standard CNC board. Controlling aspirate/dispense as a fourth axis should be similarly simple. If my understanding of how the tool interlock works is correct than that also wouldn’t be too challenging – one would just need to measure the current flowing through the motor. An even simpler strategy would just be to keep one tool locked onto the machine.&lt;/p&gt;
&lt;p&gt;One decision one would have to make would be whether to have a single control board and have lots and lots of wires running to the tool-arm, or to use the existing ribbon cables and have a separate controller on the tool arm controlled over serial. I suspect the latter might be the better approach.&lt;/p&gt;
&lt;p&gt;More generally, if I do this I will have to consider whether I want to be limited to expensive epMotion robot tips, the only ones compatible with any of these tools. I suspect the answer is no. In that case I might end up bolting an &lt;a href=&#34;http://opentrons.com/pipettes&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OT-2 electronic pipette&lt;/a&gt; to the pipetting arm, though this again loses the advantages of tool-changing. Or maybe I’ll go with something completely different like a vacuum pump and a peristaltic pump – we’ll see.&lt;/p&gt;
&lt;p&gt;In general none of this looks trivial, and one is almost certainly better off just buying an inexpensive &lt;a href=&#34;http://opentrons.com/ot-2&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OT2&lt;/a&gt;. Still, it’s nice to have a better understanding of what is going on inside this intricately engineered machine.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It has just occurred to me (another useful reason for writing things down) that there may be an easier and less invasive way to get control of this thing. If one can reverse engineer the serial control that the computer uses to control the Y-axis, Z-axis, tool interlock, aspiration tip ejection (and distance measuring) then one can get control of all of these without messing with their hardware. It seems possible that this could be achieved relatively simply (if they are sent in a text-based format) and when I have access to the machine again in 6 months time I will investigate. The 8 leads in the ribbon cable &lt;em&gt;could&lt;/em&gt; be: V+, GND, Y-out, Y-in, Z-out, Z-in, pipette-out, pipette-in.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Genome-scale identification of essential metabolic processes for targeting the Plasmodium liver stage</title>
      <link>/publication/stanway-2019-genome/</link>
      <pubDate>Tue, 01 Jan 2019 00:00:00 +0000</pubDate>
      <guid>/publication/stanway-2019-genome/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Landscape of the Plasmodium interactome reveals both conserved and species-specific functionality</title>
      <link>/publication/hillier-2019-landscape/</link>
      <pubDate>Tue, 01 Jan 2019 00:00:00 +0000</pubDate>
      <guid>/publication/hillier-2019-landscape/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Plasmodium knowlesi as a model system for characterising Plasmodium vivax drug resistance candidate genes</title>
      <link>/publication/verzier-2019-plasmodium/</link>
      <pubDate>Tue, 01 Jan 2019 00:00:00 +0000</pubDate>
      <guid>/publication/verzier-2019-plasmodium/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Quantitation of vector uptake reveals non-Poissonian transfection dynamics in Plasmodium falciparum</title>
      <link>/publication/carrasquilla-2019-quantitation/</link>
      <pubDate>Tue, 01 Jan 2019 00:00:00 +0000</pubDate>
      <guid>/publication/carrasquilla-2019-quantitation/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Using deep learning to annotate the protein universe</title>
      <link>/publication/bileschi-2019-using/</link>
      <pubDate>Tue, 01 Jan 2019 00:00:00 +0000</pubDate>
      <guid>/publication/bileschi-2019-using/</guid>
      <description></description>
    </item>
    
    <item>
      <title>BigGAN interpolations</title>
      <link>/blog/2018/11/13/biggan-interpolations/</link>
      <pubDate>Tue, 13 Nov 2018 14:51:57 +0000</pubDate>
      <guid>/blog/2018/11/13/biggan-interpolations/</guid>
      <description>&lt;p&gt;The state of the art in image generation is &lt;a href=&#34;https://arxiv.org/abs/1809.11096&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;BigGAN&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now, some &lt;a href=&#34;https://colab.research.google.com/github/tensorflow/hub/blob/master/examples/colab/biggan_generation_with_tf_hub.ipynb&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;trained models&lt;/a&gt; have been made available, including the capacity to interpolate between classes. I made &lt;a href=&#34;https://colab.research.google.com/drive/1MhfEAOBwhGu1A-F2NSVxGQrkJ4vk7w4V#scrollTo=dSAyfDfnVugs&amp;amp;forceEdit=true&amp;amp;offline=true&amp;amp;sandboxMode=true&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;a colab&lt;/a&gt; to easily create animations from these.&lt;/p&gt;
&lt;p&gt;They are pretty fun.&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;aligncenter size-full wp-image-263&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/11/cat.gif&#34; alt=&#34;&#34; width=&#34;256&#34; height=&#34;256&#34; /&gt;&lt;/p&gt;
&lt;p&gt;What is more, they make it clear that the latent space clearly captures very meaningful shared properties across classes. The poses of quite different animals are conserved, and “cat eyes” clearly map onto “dog eyes” during interpolation. These sort of properties suggest that the network ‘understands’ the scene it is generating.&lt;/p&gt;
&lt;p&gt;Here are some more:&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;aligncenter size-full wp-image-278&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/11/cattohusky.gif&#34; alt=&#34;&#34; width=&#34;256&#34; height=&#34;256&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;aligncenter size-full wp-image-280&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/11/leopard.gif&#34; alt=&#34;&#34; width=&#34;256&#34; height=&#34;256&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;aligncenter size-large wp-image-264&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/11/goose2.gif&#34; alt=&#34;&#34; width=&#34;256&#34; height=&#34;256&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;aligncenter size-large wp-image-267&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/11/dog.gif&#34; alt=&#34;&#34; width=&#34;256&#34; height=&#34;256&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;aligncenter&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/11/panda2.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;aligncenter size-large wp-image-267&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/11/tiger.gif&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;(this one moves in latent space as well as class space, hence the change of pose:)&lt;br&gt;
&lt;img class=&#34;aligncenter size-large wp-image-267&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/11/bulldog.gif&#34; alt=&#34;&#34; /&gt;&lt;br&gt;
Churches to mosques:&lt;/p&gt;
&lt;center&gt;
  &lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/11/mosque2.gif&#34; alt=&#34;&#34; width=&#34;256&#34; height=&#34;256&#34; /&gt; &lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/11/mosque.gif&#34; alt=&#34;&#34; width=&#34;256&#34; height=&#34;256&#34; /&gt;
&lt;/center&gt;
&lt;center&gt;
&lt;/center&gt;
&lt;center&gt;
&lt;/center&gt;
&lt;center&gt;
&lt;/center&gt;</description>
    </item>
    
    <item>
      <title>Adventures with InfoGANs: towards generative models of biological images (part 2)</title>
      <link>/blog/2018/10/02/adventures-with-infogans-towards-generative-models-of-biological-images-part-2/</link>
      <pubDate>Tue, 02 Oct 2018 10:05:06 +0000</pubDate>
      <guid>/blog/2018/10/02/adventures-with-infogans-towards-generative-models-of-biological-images-part-2/</guid>
      <description>&lt;p&gt;In &lt;a href=&#34;http://theo.io/blog/2018/10/02/adventures-with-infogans-towards-generative-models-of-biological-images/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;the last post&lt;/a&gt; I introduced neural networks, generative adversarial networks (GANs) and InfoGANs.&lt;/p&gt;
&lt;p&gt;In this post I’ll describe the motivation and strategy for creating a GAN which generates images of biological cells, like this:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Motivation&lt;/strong&gt;&lt;br&gt;
Two microscopic of cells from an identical cell-line are never going to be pixel-for-pixel identical, yet they still share key similarities in terms of morphology. One way to get a computer to demonstrate it “understands” these morphological properties is to force it to create images of new cells. When a model is capable of generating any image that might be taken of a specific cell one might argue that it has gained some knowledge about the cell.&lt;/p&gt;
&lt;p&gt;This is an appealing approach as it is is easy to acquire large numbers of static images of cells, for instance by using an imaging flow cytometer. This device flows cells past a camera and acquires thousands of images each second, each with a large number of fluorescent channels. These are static images of course, but if they come from an synchronous population they should contain representatives of every stage in the cell cycle. If our generative model was sufficiently capable of truly understanding the structure in the data (and there is &lt;a href=&#34;https://twitter.com/ericjang11/status/1046124500369047553&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;evidence that such models do&lt;/a&gt;) then provided if we could generate a model where one dimension in our generator corresponded to pseudotime we could generate timecourse “videos” from models trained on these single images. This would, apart from anything else, have practical utility, avoiding the problems of photobleaching in imaging.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What I did&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;From my work at the &lt;a href=&#34;https://www.sanger.ac.uk/science/groups/rayner-group&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Rayner lab&lt;/a&gt; at the Sanger Institute I have access to a large dataset of images of infected red blood cells acquired with an imaging flow cytometer. These images contain both a brightfield transmitted light channel and a fluorescent channel showing DNA in the parasite. I used some filtering (with a classification network) to isolate only images containing single cells which were fully visible. I then trained an InfoGAN in much the same way as in the digit dataset described in the last post.&lt;/p&gt;
&lt;p&gt;I tried a couple of different versions, one with a large number of “communicated” values – which is what you see above.&lt;/p&gt;
&lt;p&gt;The network learns about quite a few aspects of &lt;em&gt;Plasmodium&lt;/em&gt;&lt;br&gt;
biology, and also some basic optics:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It learns about red blood cell morphology and to produce images of plausible cells&lt;/li&gt;
&lt;li&gt;It learns that the nucleus in the DAPI channel is always within the bounds of the RBC in the brightfield channel.&lt;/li&gt;
&lt;li&gt;It learns that there are a subset of cells (schizonts) which have both black haemozoin, and widespread, bright DAPI nuclei (often arranged in a circular shape)&lt;/li&gt;
&lt;li&gt;It learns that cells can appear in front of or behind the focal plane and how to render both types.&lt;/li&gt;
&lt;li&gt;I could go on.. the images produced by the network are almost all entirely plausible images that a biologist would be unable to distinguish from true parasites.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As an aside I really like watching this network cycle between samples, it is strikingly similar to watching a motile cell wriggling:&lt;br&gt;
&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/09/cell_gan.gif&#34; alt=&#34;&#34; width=&#34;480&#34; height=&#34;160&#34; class=&#34;alignnone size-full wp-image-215&#34; /&gt;&lt;/p&gt;
&lt;p&gt;I also trained a &lt;a href=&#34;http://theo.io/GAN/plasmodium_gan2/test.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;second version&lt;/a&gt;, with many fewer communicated variables, which really lets us see what the network sees as the most salient features. Unsurprisingly, these are mostly about the location and orientation of the red blood cell. Interestingly this network makes one of the parameters the focal position of the cell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/09/focus.gif&#34; alt=&#34;&#34; width=&#34;480&#34; height=&#34;232&#34; class=&#34;alignnone size-full wp-image-216&#34; /&gt;&lt;/p&gt;
&lt;p&gt;For any cell you look at, one end of this variable produces one type of halo, and the other the opposite, just as if this parameter was controlling the focus of a microscope.&lt;/p&gt;
&lt;p&gt;This property illustrates the sort of property it would be really exciting to get the network to learn. In an ideal world the sliders would represent something like: focus, cell orientation and parasite lifecycle stage. So if you had a young ring stage parasite and you wanted to watch it mature you could just drag the slider across. Or if you wanted to focus on the far side of the cell you could just drag another slider. Such an idea may sound fanciful, but I don’t think it’s too far away.&lt;/p&gt;
&lt;p&gt;There are a number of simple ways I could improve the work I’ve done here. The network has to capture the complete distribution of cellular images presented as “real”. In this case you can see that these are in many different orientations, and different positions in the image. So a vast amount of the networks efoort goes into recapturing that, not very interesting, spatial variation. I made some basic attempts to align the images presented to the network, but this is something I could definitely improve. Something you will see as the cells dance from one space in the network to another is that while the nucleus tends to move smoothly around the black haemozoin will often fade out in one location and appear in another. The lack of smoothness here is an example of “modal collapse” that often haunts GANs, but there are a number of ways to tackle it.&lt;/p&gt;
&lt;p&gt;In short, this work just scratches the surface of what what I suspect is possible with generative models of biological cells.&lt;/p&gt;
&lt;p&gt;In some organisms there are genome-wide fluorescent-tag libraries available. Building a generative model using these (possibly with the need for some pairwise imaging) could allow the creation of a synthetic cell in which every protein can be simultaneously visualised. It’s an exciting prospect, and I think it’s nearer than it seems.&lt;/p&gt;
&lt;p&gt;&lt;small&gt;P.S. I belatedly looked for similar published work, and found two &lt;a href=&#34;https://www.biorxiv.org/content/early/2017/12/02/227645&#34;&gt;cool&lt;/a&gt; &lt;a href=&#34;https://arxiv.org/pdf/1708.04692.pdf&#34;&gt;papers&lt;/a&gt;. The second of these introduces a star-shaped network designed to allow alignment in much the way I imagine at the end of this post. And more generally there are a ton of GAN papers applying the technique to super-resolution microscopy, in silico staining, etc.&lt;/small&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Adventures with InfoGANs: towards generative models of biological images (part 1)</title>
      <link>/blog/2018/10/02/adventures-with-infogans-towards-generative-models-of-biological-images/</link>
      <pubDate>Tue, 02 Oct 2018 09:00:46 +0000</pubDate>
      <guid>/blog/2018/10/02/adventures-with-infogans-towards-generative-models-of-biological-images/</guid>
      <description>&lt;p&gt;I recently began an &lt;a href=&#34;https://ai.google/research/join-us/ai-residency/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;AI Residency&lt;/a&gt; at Google, which I am enjoying a great deal. I have been experimenting with deep-learning approaches for a few years now, but am excited to immerse myself in this world over the coming year. Biology increasingly generates very large datasets and I am convinced that novel machine-learning approaches will be essential to make the most of them.&lt;/p&gt;
&lt;p&gt;At the beginning of my residency, I was advised to complete a &lt;em&gt;mini-project&lt;/em&gt; which largely reimplements existing work, as an introduction to new tools.  In this post I’m going to describe what I got up to during that first few weeks, which culminated in the tool below that conjures up new images of red blood cells infected with malaria parasites:&lt;/p&gt;
&lt;p&gt;&lt;script&gt;
	  function resizeIframe(obj) {
	    obj.style.height = obj.contentWindow.document.body.scrollHeight + &#39;px&#39;;
	  }
	&lt;/script&gt;&lt;br /&gt;
&lt;iframe src=&#34;http://static.theo.io/GAN/plasmodium_gan/test.html&#34; style=&#34;width:100%; height:500px&#34;  frameborder=&#34;0&#34; scrolling=&#34;no&#34; onload=&#34;resizeIframe(this)&#34; &gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;I’m going to try to explain it from first principles, which might take a while, so if you have a background in machine-learning, &lt;a href=&#34;http://theo.io/blog/2018/10/02/adventures-with-infogans-towards-generative-models-of-biological-images-part-2/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;skip to the next post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Neural net-what?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Deep learning is based around things called neural networks. A neural network takes a series of numbers in, does some processing to them, and ultimately spits out another set of numbers. A system like this is in theory capable of undertaking a great many tasks: for example the first series of numbers could be the brightness values for each pixel in an image, and the number outputted could be the probability that the image contains a cat. If the network can map those sets of numbers to each other successfully, then you have a cat-recognition network.&lt;/p&gt;
&lt;figure id=&#34;attachment_221&#34; aria-describedby=&#34;caption-attachment-221&#34; style=&#34;width: 833px&#34; class=&#34;wp-caption aligncenter&#34;&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/09/cat-01.png&#34; alt=&#34;&#34; width=&#34;833&#34; height=&#34;342&#34; class=&#34;size-full wp-image-221&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/09/cat-01.png 833w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/09/cat-01-300x123.png 300w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/09/cat-01-768x315.png 768w&#34; sizes=&#34;(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px&#34; /&gt;&lt;figcaption id=&#34;caption-attachment-221&#34; class=&#34;wp-caption-text&#34;&gt;A hypothetical classification network to detect images of cats&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;But what determines whether the network will recognise cats,  koalas, or fail to recognise anything at all? Each network contains a vast array of &lt;em&gt;parameters&lt;/em&gt;, which determine how the input numbers are processed to produce the output. These are knobs which can be twiddled to make the network do different things.&lt;/p&gt;
&lt;p&gt;The magic that makes neural networks powerful is a process called &lt;em&gt;back-propagation&lt;/em&gt;, which allows the system to automatically twiddle these knobs until the network produces the desired output for each input. This requires a large amount of labelled data. For our cat network we might give it 1,000 photos of cats, and 1,000 photos of dogs. The system will start off by setting the parameters to random values. It will then feed in the first cat photo and see what number it gets out. With these random values, the network will most likely output 0.5 as the cat probability, even though the true value is 1 (it’s a cat!). But with back-propagation the system can observe this error (0.5 – 1 = -0.5) and calculate which direction it needs to turn each knob (and by how much) to make the error smaller. If we repeat this process over and over and over again (which is called &lt;em&gt;training&lt;/em&gt;), we will eventually we find we have a network that can reliably distinguish cats and dogs. And it turns out that the graphics cards in our computers can be commandeered to make that process happen pretty quickly. In an hour or so we can have our cat recognition network – jubilations.&lt;/p&gt;
&lt;p&gt;With those basic principles one can build a network to do any sort of classification problem. If you have searched your own photos based on what they contain  (e.g. on Google photos) then you have interacted with just such a network.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Making computers creative&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You might think at this point that our network has a pretty good idea what a cat looks like, but unfortunately with this approach you can’t ask it to draw one.&lt;/p&gt;
&lt;p&gt;One &lt;em&gt;can&lt;/em&gt; imagine a neural network which could draw, however: this time the &lt;em&gt;output&lt;/em&gt; would be a series of numbers, which we will convert into to the brightness values of pixels in an image. What should the input be? It turns out we can just use random numbers:  for each image we can sample say 10 values from a normal distribution, and feed them in. That way, in theory, the network can draw on this randomness to generate a different picture each time, and act as an image &lt;em&gt;generator&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;There is a problem of course. The network still has no idea what cats look like. When it is created, with its knobs set to random positions, it will generate images that resemble those on an un-tuned TV. In theory we could train it ourselves, by letting it know whenever it produced noise that had the faintest of resemblance to a cat, until it was coaxed into doing what we wanted. In practice however, this would take an eternity.&lt;/p&gt;
&lt;p&gt;So what to do? Well, there’s a trick, &lt;a href=&#34;https://arxiv.org/abs/1406.2661&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;invented&lt;/a&gt; just four years ago, which has been revolutionary. We can introduce a second network, called a &lt;em&gt;discriminator&lt;/em&gt;. This is a classification network, like the one we imagined above. But this time its task is not to distinguish cats from dogs, but to distinguish real photos of actual cats, from fake cats imagined by the generator. We feed it some real cats, and some fake ‘cats’ that the generator has produced, and we train it. Initially it has a very easy job here, since remember the generator is just displaying the images of an untuned TV. But wait..&lt;/p&gt;
&lt;p&gt;Once the discriminator starts to do a decent job we can take our &lt;em&gt;back-propagation&lt;/em&gt; one step further. The system can backpropagate from the final result (“fake” or “real”) back to the pixel values produced by the generator, and then all the way back through the generator to the random variables that made these fake images. Then it can ask &lt;em&gt;“what directions should I turn the knobs of the generator so that it produces an output that the discriminator thinks is real?”&lt;/em&gt;. In this way, the generator can be trained to fool the discriminator, and in doing so, the images it produces will become a bit more cat-like.&lt;/p&gt;
&lt;p&gt;The discriminator can now be trained again, to be more expert in telling these synthetic cats from their real counterparts. In fact we bounce back and forth, training generator and then discriminator in a continual loop. They have opposing goals, the generator wants to make realistic cat images and the discriminator wants to tell these apart from &lt;em&gt;true&lt;/em&gt; cat images, and so this architecture is called a &lt;em&gt;generative adversarial network&lt;/em&gt; or GAN. After a long period of training these networks can produce  results like these:&lt;/p&gt;
&lt;figure id=&#34;attachment_180&#34; aria-describedby=&#34;caption-attachment-180&#34; style=&#34;width: 288px&#34; class=&#34;wp-caption alignnone&#34;&gt;&lt;img class=&#34; wp-image-180&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/08/Screenshot-from-2018-08-27-21-19-48.png&#34; alt=&#34;&#34; width=&#34;288&#34; height=&#34;293&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/08/Screenshot-from-2018-08-27-21-19-48.png 663w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/08/Screenshot-from-2018-08-27-21-19-48-296x300.png 296w&#34; sizes=&#34;(max-width: 288px) 85vw, 288px&#34; /&gt;&lt;figcaption id=&#34;caption-attachment-180&#34; class=&#34;wp-caption-text&#34;&gt;Results of a cat GAN. (This figure comes from a [paper][4] by Alexia Jolicoeur-Martinea about a novel type of discriminator)&lt;/figcaption&gt;&lt;/figure&gt;
&lt;figure id=&#34;attachment_179&#34; aria-describedby=&#34;caption-attachment-179&#34; style=&#34;width: 512px&#34; class=&#34;wp-caption alignnone&#34;&gt;&lt;img class=&#34;wp-image-179 size-full&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/08/representative_image_512x256.png&#34; alt=&#34;&#34; width=&#34;512&#34; height=&#34;256&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/08/representative_image_512x256.png 512w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/08/representative_image_512x256-300x150.png 300w&#34; sizes=&#34;(max-width: 512px) 85vw, 512px&#34; /&gt;&lt;figcaption id=&#34;caption-attachment-179&#34; class=&#34;wp-caption-text&#34;&gt;And with some extensions of the GAN approach [Nvidia][5] were able to hallucinate these wholly imaginary celebrities.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Not bad, eh?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;InfoGAN – images that communicate information&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This approach can produce realistic images. But the relationship between the random noise at the beginning and the image at the end is not generally clear. If we increase value 3 by 50% what will happen? It is generally difficult to predict, and does not correspond in a useful way to a semantically meaningful property of the image.&lt;/p&gt;
&lt;p&gt;There would be a lot of value to a network which, without being specifically trained to, could actually understand the structure in these images (e.g. that there are different breeds of cat) and that at the end could generate an image of any breed of your choice.&lt;/p&gt;
&lt;p&gt;Some people came up with a very clever way of doing this, called an InfoGAN. This approach is very similar to the original GAN. The generator still draws on random noise to produce its image. However the generator is also given some &lt;em&gt;extra noise&lt;/em&gt;, which it is tasked with encoding into the image it produces. For instance in the original InfoGAN paper the researchers produced a network which made images of hand-written digits. The extra noise they added was a discrete ‘one-hot’ variable with ten possible values. The idea was to create a network where each of these values corresponded to a different digit. To get this to happen they created an additional training objective for both the generator and the discriminator. As before, the discriminator still wants to distinguish real images from fake images and the generator still wants to fool the discriminator. However &lt;em&gt;both the discriminator and the generator&lt;/em&gt; are also rewarded if the discriminator is able to successfully reconstruct the extra random variable that was fed to the generator.&lt;/p&gt;
&lt;p&gt;This means the generator now has to encode &lt;em&gt;information&lt;/em&gt; (a variable with ten possible values) into an image, but that image has to be a plausible member of the set of hand-written digit images. The strategy that it ends up taking is to encode each value as a separate digit, and tada, we have achieved our goal. We can now ask the network to generate any specific digit we like. We can choose threes and generate an infinite number of different threes in different styles. The researchers also showed that if they added two more continuous variables to be communicated, these ended up mapped to the angle, and the width, of the digit produced.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;figure id=&#34;attachment_190&#34; aria-describedby=&#34;caption-attachment-190&#34; style=&#34;width: 639px&#34; class=&#34;wp-caption alignnone&#34;&gt;&lt;img class=&#34;wp-image-190 size-full&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/09/1_kyyjNnuNaOscjucBpql2AA.png&#34; alt=&#34;&#34; width=&#34;639&#34; height=&#34;390&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/09/1_kyyjNnuNaOscjucBpql2AA.png 639w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/09/1_kyyjNnuNaOscjucBpql2AA-300x183.png 300w&#34; sizes=&#34;(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px&#34; /&gt;&lt;figcaption id=&#34;caption-attachment-190&#34; class=&#34;wp-caption-text&#34;&gt;Figure from the InfoGAN paper showing the three properties the network has learnt (digit type, angle and width)&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I began by reimplementing some of what these researchers had achieved, focusing on this hand-written digit task. Here are the images my network produced evolving over time:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/09/image3.gif&#34; alt=&#34;&#34; width=&#34;140&#34; height=&#34;168&#34; class=&#34;aligncenter size-full wp-image-223&#34; /&gt;&lt;/p&gt;
&lt;p&gt;You can see the network gradually deciding how it will encode each value. It is undecided about what should be a five and what should be a zero for a long time, but it eventually comes to a conclusion. So without labelling any of the data, the system has learnt to partition it into ten appropriate categories, and has built a system for arbitrarily generation members of each of these categories.&lt;/p&gt;
&lt;p&gt;There are a near-infinite number of possible threes that can be drawn – cleaner or curlier, thicker or thinner, but all are united in being threes. I think that a very similar property applies in biological cells and in the &lt;a href=&#34;http://theo.io/blog/2018/10/02/adventures-with-infogans-towards-generative-models-of-biological-images-part-2/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;next post&lt;/a&gt; I’ll describe my forays into this area, and the promise I think such an approach holds.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://theo.io/blog/2018/10/02/adventures-with-infogans-towards-generative-models-of-biological-images-part-2/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&amp;raquo;&amp;raquo; Part 2&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>How I stumbled upon a novel genome for a malaria-like parasite of primates</title>
      <link>/blog/2018/04/23/how-i-stumbled-upon-a-novel-genome-for-a-malaria-like-parasite-of-apes/</link>
      <pubDate>Mon, 23 Apr 2018 17:39:10 +0000</pubDate>
      <guid>/blog/2018/04/23/how-i-stumbled-upon-a-novel-genome-for-a-malaria-like-parasite-of-apes/</guid>
      <description>&lt;p&gt;&lt;span style=&#34;color: gray;&#34;&gt;Sometimes in science you come across things that are definitely interesting, and useful, but which you don’t have time to write up properly for one reason or another. I’m going to try to get into the habit of sharing these as blog-posts rather than letting them disappear. Here is one such story.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update: we &lt;a href=&#34;https://journals.plos.org/plospathogens/article?id=10.1371/journal.ppat.1008717&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;published a paper with a fully annotated genome&lt;/a&gt; in a big collaboration between the data generators at the University of Oregon and bioinformaticians at the Sanger Institute.&lt;/b&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Not long ago I was searching for orthologs of a malaria gene of interest on the NCBI non-redundant database, which allows one to search across the entire (sequenced) tree of life. Here is a recreation of what I saw:&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;alignnone size-full wp-image-121&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.27.51.png&#34; alt=&#34;&#34; width=&#34;780&#34; height=&#34;236&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.27.51.png 780w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.27.51-300x91.png 300w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.27.51-768x232.png 768w&#34; sizes=&#34;(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px&#34; /&gt;&lt;/p&gt;
&lt;p&gt;I was surprised to see that nestled among the &lt;em&gt;Plasmodium&lt;/em&gt; species was a sequence from a species called &lt;em&gt;Piliocolobus tephrosceles&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;A web search revealed this to be the linnaean name for the &lt;a href=&#34;https://en.wikipedia.org/wiki/Ugandan_red_colobus&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Ugandan red colobus&lt;/a&gt; monkey. Odd that this monkey should have a gene so similar to one from a parasite, eh? But there are some weird misannotations on NCBI. However a bit later I saw the same thing happen again with another gene, and thought something must be going on. I tried more malaria genes and found I could almost always find a strong match in the colobus assembly.&lt;/p&gt;
&lt;p&gt;I navigated through NCBI to find some more about this particular monkey.&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;alignnone size-full wp-image-122&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.33.54.png&#34; alt=&#34;&#34; width=&#34;504&#34; height=&#34;302&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.33.54.png 504w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.33.54-300x180.png 300w&#34; sizes=&#34;(max-width: 504px) 85vw, 504px&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.ncbi.nlm.nih.gov/biosample/SAMN07735529/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;The page&lt;/a&gt; tells us that this monkey from which this genome was sequenced was found here, in the depths of Kibale National Park (it was sequenced for a &lt;a href=&#34;http://molecular-anthro.uoregon.edu/index.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;University of Oregon&lt;/a&gt; genome study, &lt;a href=&#34;https://twitter.com/MolecAnth/status/942838967342264320&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;in prep.&lt;/a&gt;):&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;alignnone size-full wp-image-123&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.37.08.png&#34; alt=&#34;&#34; width=&#34;380&#34; height=&#34;266&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.37.08.png 380w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.37.08-300x210.png 300w&#34; sizes=&#34;(max-width: 380px) 85vw, 380px&#34; /&gt;&lt;/p&gt;
&lt;p&gt;It also tells us that the sequence came from whole blood. This methodology seemed to be consistent with researchers serendipitously acquiring sequence from a blood-borne parasite in the process of sequencing the monkey genome.&lt;/p&gt;
&lt;p&gt;Just how much of this genome is there in the colobus sample? I downloaded the assembly to find out. The assembly was broken up into 47,644 contigs. My hypothesis was that some of these represented monkey sequence and others represented this sequence of a malaria-like parasite. I calculated the GC content of each contig and plotted a distribution:&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;alignnone size-full wp-image-124&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.55.22.png&#34; alt=&#34;&#34; width=&#34;398&#34; height=&#34;298&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.55.22.png 398w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-21.55.22-300x225.png 300w&#34; sizes=&#34;(max-width: 398px) 85vw, 398px&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Plasmodium spp.&lt;/em&gt; have a much lower GC-content than mammalian species, and from this it looks like whatever species we have here shows this same bias. Just to be sure I also searched each “colobus” contig with Diamond (a faster Blast-like tool) against all protein sequences of the rhesus macaque and of &lt;em&gt;P. vivax&lt;/em&gt;. If a contig had a significantly higher score in &lt;em&gt;P. vivax&lt;/em&gt; than rhesus it was assigned to that species and vice versa. Overlaying this data was pretty compelling:&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;alignnone size-full wp-image-125&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-22.07.52.png&#34; alt=&#34;&#34; width=&#34;754&#34; height=&#34;317&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-22.07.52.png 754w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/04/Screen-Shot-2018-04-22-at-22.07.52-300x126.png 300w&#34; sizes=&#34;(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px&#34; /&gt;&lt;/p&gt;
&lt;p&gt;I decided that by taking contigs which were either significantly better matches to &lt;em&gt;P. vivax&lt;/em&gt;, or alternatively had a GC content below 24%, I would get a genome which was almost entirely this intriguing species. This gave me 13,460 contigs representing about 30 Mbp of sequence (&lt;em&gt;Plasmodium&lt;/em&gt; genomes are 20-30 Mbp so this could potentially be a genome’s worth – although I don’t always get BLAST matches, so I suspect it is somewhat less). I also got in touch with the person named in the NCBI accession to see if they were already investigating these:&lt;/p&gt;
&lt;blockquote class=&#34;twitter-tweet&#34; data-lang=&#34;en&#34;&gt;
  &lt;p dir=&#34;ltr&#34; lang=&#34;en&#34;&gt;
    hey &lt;a href=&#34;https://twitter.com/theosanderson?ref_src=twsrc%5Etfw&#34;&gt;@theosanderson&lt;/a&gt; not specifically on the hepatocystis seqs in the assembly, though collaborators in our group have done some interesting work on hepatocystis in red colobus themselves &lt;a href=&#34;https://t.co/yLs6ycTYrv&#34;&gt;https://t.co/yLs6ycTYrv&lt;/a&gt;
  &lt;/p&gt;
  &lt;p&gt;
    — Noah Simons (@noahdsimons) &lt;a href=&#34;https://twitter.com/noahdsimons/status/981977413314736128?ref_src=twsrc%5Etfw&#34;&gt;April 5, 2018&lt;/a&gt;
  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;My home institute has released a rather neat web tool called &lt;a href=&#34;https://companion.sanger.ac.uk/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Companion&lt;/a&gt;, which allows you to upload a series of genomic contigs and have them annotated with reference to a known genome using a whole pipeline of analysis. (Unfortunately it only accepts up to 3,000 sequences. But you can download it as a Docker container to circumvent that restriction).&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://companion.sanger.ac.uk/jobs/dcf60d31de2b43c841a62928&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Here&lt;/a&gt; are the results from its run on these sequences. Companion identifies &amp;gt;2000 genes, including such favourites as circumsporozoite protein, GAP50, PTEX88 and the SERAs. It nicely annotates a pseudochromosome-based version of the genome (although I’m not sure it’s taking full advantage of the synteny at the moment).&lt;/p&gt;
&lt;p&gt;So what is this mysterious species?&lt;/p&gt;
&lt;p&gt;It clearly isn’t an already sequenced &lt;em&gt;Plasmodium&lt;/em&gt; species. A bit of googling suggested to me that it might be some species of &lt;em&gt;Hepatocystis&lt;/em&gt;, which are &lt;a href=&#34;https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3676718/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;known to infect red Colobus&lt;/a&gt;. Hepatocystis seems in some ways to be an unnecessary genus, since the latest phylogenies show that evolutionarily it lies nested within &lt;em&gt;Plasmodium,&lt;/em&gt; being more closely related to mammalian &lt;em&gt;Plasmodium&lt;/em&gt; species than is the avian malaria parasite &lt;em&gt;Plasmodium gallinaceum&lt;/em&gt;. But there are reportedly important differences of approach between the groups – hepatocystis seems to lack the asexual cycle, with replication occurring only in the liver. One might hypothesise that this would lead to substantial loss of intra-erythrocytic genes. Also these beasts are transmitted by midges rather than mosquitoes (that data the result of a &lt;a href=&#34;https://www.cabdirect.org/cabdirect/abstract/19522901249&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;decade&lt;/a&gt;–&lt;a href=&#34;https://www.ncbi.nlm.nih.gov/pubmed/13443413&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;long&lt;/a&gt; &lt;a href=&#34;https://www.ncbi.nlm.nih.gov/pubmed/13897017&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;search&lt;/a&gt;). There are no other genome-scale sequencing datasets available for hepatocystis.&lt;/p&gt;
&lt;p&gt;I searched GenBank for targeted hepatocystis sequences, and found a few, including the caseinolytic protease C gene which has been sequenced from numerous &lt;a href=&#34;https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5537238/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;bat&lt;/a&gt; &lt;a href=&#34;https://www.ncbi.nlm.nih.gov/pubmed/18248741&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;isolates&lt;/a&gt;. I found the matching sequences for these in the Colobus assembly and then Blasted those sequences back against GenBank to recover a set of sequences to analyse. Constructing a tree with &lt;a href=&#34;http://www.phylogeny.fr/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Phylogeny.fr&lt;/a&gt; seemed to demonstrate clearly that this is some species of hepatocystis:&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;alignnone size-full wp-image-141&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/analysis-copy.png&#34; alt=&#34;&#34; width=&#34;709&#34; height=&#34;1146&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/04/analysis-copy.png 709w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/04/analysis-copy-186x300.png 186w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/04/analysis-copy-634x1024.png 634w&#34; sizes=&#34;(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px&#34; /&gt;&lt;/p&gt;
&lt;p&gt;The closest relative found here is from a &lt;a href=&#34;https://www.ncbi.nlm.nih.gov/nuccore/eu254616.1&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;em&gt;Cynopterus brachyotis&lt;/em&gt; bat from Singapore&lt;/a&gt; – bats seem to pick up everything!&lt;/p&gt;
&lt;p&gt;This is about as far as I’ve got with this. Some thoughts at this point:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you are interested in what a specific gene looks like in hepatocystis it is likely that you can find at least part of it in these colobus contigs to compare to. It is very easy to run &lt;a href=&#34;https://www.ncbi.nlm.nih.gov/assembly/1441961&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;a BLAST search at NCBI to check&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Early data-release is awesome! Parasitologists will really benefit from the University of Oregon primate researchers making this data available.&lt;/li&gt;
&lt;li&gt;Someone should really see if we can get a really decent genome from these short read sequences. The library was prepared with Chromium technology and assembled with SuperNova, a 10X assembler. Is it possible these methods are optimised for diploid sequences and that assembling the raw data might enable a better parasite assembly? Or maybe the current assembly is pretty good – apart from the gaps – and missing _Plasmodium _genes are truly missing due to the differences in the hepatocystis lifecycle?&lt;/li&gt;
&lt;li&gt;The depositors of the assembly might wish to partition it into its monkey and hepatocystis portions as I have above, lest a lot of parasite researchers are going to get confused when they find their parasite to be so closely related to a monkey 🙂 Happy to share my assignments!&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    
    <item>
      <title>Saving 99.5%: automating a manual microscope with a 3D printed adapter</title>
      <link>/blog/2018/02/01/save-99-5-upgrading-a-manual-microscope-with-an-automated-stage-for-60/</link>
      <pubDate>Thu, 01 Feb 2018 14:30:41 +0000</pubDate>
      <guid>/blog/2018/02/01/save-99-5-upgrading-a-manual-microscope-with-an-automated-stage-for-60/</guid>
      <description>&lt;p&gt;**TL;DR: **Some 3D-printing hackery can create an automated microscope stage from a manual stage for ~0.5% of the cost from the manufacturer.&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;alignnone size-full wp-image-80&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/01/giphy3.gif&#34; alt=&#34;&#34; width=&#34;480&#34; height=&#34;270&#34; /&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;I have always wanted access to a microscope with an automated stage. The ability to scan an entire slide/plate for a cell of interest seems to unlock a wealth of new possibilities.&lt;/p&gt;
&lt;p&gt;Sadly, these systems cost quite a bit. The lab I work in now has a Leica DMi8 microscope with automated movement in Z. But XY movement is (on our model) still manual. It is possible to purchase an automated XY stage for this microscope, but the list-price quote is around £12,000 (including stage, and control hardware and software).&lt;/p&gt;
&lt;p&gt;I’m not going to argue that this price is unreasonable. I am sure that the manufacturers of scientific equipment spend a lot of time and money innovating, and that money has to be made back by selling devices which have relatively small production runs. Nevertheless, the result is that the costs of kit that makes it to market are fairly staggering – and this prevents someone like me from being able to play around with an automated stage.&lt;/p&gt;
&lt;p&gt;But I still wanted to experiment with an automated stage! So I wondered how easy this would be to do myself. After all, we have a manual stage, and we move it by rotating two knobs. Couldn’t I just get motors to turn those instead of doing it with my hand?&lt;/p&gt;
&lt;p&gt;As I thought this through further I realised it was slightly complicated than this. Firstly, the knobs are co-axial, making them rather harder to deal with than would be two separate shafts. And secondly, as you rotate the X-knob, the shaft moves in X.&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;alignnone wp-image-62 size-full&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/01/ezgif-1-2c888ba693.gif&#34; alt=&#34;&#34; width=&#34;600&#34; height=&#34;338&#34; /&gt;&lt;/p&gt;
&lt;p&gt;So the motors need to be able to move with it. But they also need to be to rotate and exert a twisting force on the knob – so they need to move linearly but be locked in one orientation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hardware: 3D printed pieces, 2 stepper motors and a RAMPS controller&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I made a quick design in OpenSCAD&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;alignnone size-medium wp-image-64&#34; src=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/01/design-300x289.png&#34; alt=&#34;&#34; width=&#34;300&#34; height=&#34;289&#34; srcset=&#34;/post/archive_posts/old_wp_images/wp-content/uploads/2018/01/design-300x289.png 300w, /post/archive_posts/old_wp_images/wp-content/uploads/2018/01/design.png 500w&#34; sizes=&#34;(max-width: 300px) 85vw, 300px&#34; /&gt;&lt;/p&gt;
&lt;p&gt;Basically the first knob,which controls movement in Y, is simply connected to the mechanism by a (red) sleeve which connects to a motor below. The knob above, which controls movement in X, is placed inside a (blue) sleeve which covers it in a gear. That gear is turned by a (turquoise) gear turned by a second motor. Both motors are mounted on a (transparent) piece which also connects them to a LM6LUU linear bearing which allows them to slide but keeps their orientation constant.&lt;/p&gt;
&lt;p&gt;I printed out these 3 pieces – then tweaked the dimensions a little to be more snug on the knobs and printed them again. The final STL files, and the SCAD file that generated them are available on &lt;a href=&#34;https://www.thingiverse.com/thing:2778053&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Thingiverse&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To control it I connected the steppers to a trusty RAMPS 3D printer controller. These cost £30 with a screen and a rocker controller (the Leica hardware to control a stage is ~£3k). Since the 3D printer controller is also all set up to control the temperature of a hot-end and a heated bed, if you want to add warm stage down the line this might be ideal.&lt;/p&gt;
&lt;p&gt;Initial tests controlling the position using the system using the RAMPS controller went well, and let me calibrate the number of steps per micrometer.&lt;/p&gt;
&lt;p&gt;&lt;iframe src=&#34;https://www.youtube.com/embed/qiW8ZmzKFb0&#34; width=&#34;560&#34; height=&#34;315&#34; frameborder=&#34;0&#34; allowfullscreen=&#34;allowfullscreen&#34;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3 id=&#34;software-micromanager&#34;&gt;Software: MicroManager&lt;/h3&gt;
&lt;p&gt;Regrettably, the Leica software isn’t going to allow you to easily hook it up to an Arduino-based controller. But, as ever, open-source software comes to the rescue. &lt;a href=&#34;https://micro-manager.org&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Micro-Manager&lt;/a&gt; is a very advanced ImageJ plugin that can connect to the Leica camera, and to the microscope itself to control filter cube positions, Z-focusing, etc.&lt;/p&gt;
&lt;p&gt;Don’t expect quite the user-friendliness of Leica software from Micro-Manager, but _do _expect a wealth of packages to perform common operations in automated-microscopy (Leica charges ~£2.5k for the software to revisit a position multiple times – which was included in the quote given above).&lt;/p&gt;
&lt;p&gt;Theoretically, MicroManager &lt;em&gt;even&lt;/em&gt; allows you to control XY position using a RAMPS controller – someone has already written a package for exactly this board. This step, which should have been trivial, was actually the most complicated. The device adapter is designed to ask the RAMPS controller for its version, and somehow I could never make my board submit a response that the software was happy with. I had to download the MicroManager source and remove the code that checked the version. Successfully setting up the build environment for Windows took an age. Do get in touch if you have a similar project and want the DLL I built [update: DLL &lt;a href=&#34;/post/archive_posts/old_wp_images/wp-content/mmgr_dal_RAMPS.dll&#34;&gt;here&lt;/a&gt;, I offer no guarantees at all that it will work. This is an x64 build which will only work with a &lt;a href=&#34;http://valelab4.ucsf.edu/~MM/nightlyBuilds/1.4/Windows/MMSetup_64bit_1.4.23_20180131.exe&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;recent nightly build&lt;/a&gt;] [update 2: &lt;a href=&#34;https://twitter.com/nvladimus/status/1050047856135073792&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Nikita Vladimirov&lt;/a&gt; has followed up on this and released the &lt;a href=&#34;https://github.com/nvladimus/micro-manager&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;changes&lt;/a&gt; he had to make to MicroManager]. Anyway, to cut a long story short I got MicroManager to talk to the RAMPS board successfully.&lt;/p&gt;
&lt;h3 id=&#34;testing-by-making-a-100x-oil-immersion-slide-scanner&#34;&gt;Testing by making a 100X oil immersion slide scanner&lt;/h3&gt;
&lt;p&gt;Now to put it into practice.&lt;/p&gt;
&lt;p&gt;I wrote a Beanshell script to scan a slide in X and Y and capture images. In this case I captured images in a grid 40 microscope images wide by 30 microscope images high, for a total of 1200 images.&lt;/p&gt;
&lt;p&gt;&lt;iframe src=&#34;https://www.youtube.com/embed/hqaQOWkytuY&#34; width=&#34;560&#34; height=&#34;315&#34; frameborder=&#34;0&#34; allowfullscreen=&#34;allowfullscreen&#34;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;This took a few minutes – try doing that by hand.. Then I stitched them together with the &lt;a href=&#34;https://www.nature.com/articles/s41598-017-04567-y&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;MIST plugin&lt;/a&gt;. The result is a 27,000 x 12,000 pixel image, featuring a whole lot of red blood cells. You can zoom in on the version below. This was taken with a 100X oil immersion objective, at which magnification the smallest motion of the stage is a substantial fraction of the image, but still allows enough overlap for stitching.&lt;/p&gt;
&lt;p&gt;&lt;script src=&#34;https://scripts.sirv.com/sirv.js&#34;&gt;&lt;/script&gt;&lt;/p&gt;
&lt;div class=&#34;Sirv&#34; style=&#34;height: 400px; width: 100%;&#34; data-effect=&#34;zoom&#34;&gt;&lt;img data-src=&#34;https://smoncett.sirv.com/huge2%20copy.jpg&#34; /&gt;&lt;/div&gt;
&lt;p&gt;Fun! Still a bit more experimenting to do, but I’m hoping to get this acquiring tagged proteins from 96-well plates.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Caveat for anyone who tries to implement this: obviously be very careful not to create significant non-twisting forces on the coaxial knobs – you don’t want to damage your stage and ruin the alignment.&lt;/em&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>PlasmoTron: an open-source platform for automated culture of malaria parasites</title>
      <link>/publication/sanderson-2018-plasmotron/</link>
      <pubDate>Mon, 01 Jan 2018 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2018-plasmotron/</guid>
      <description></description>
    </item>
    
    <item>
      <title>New beginnings</title>
      <link>/blog/2017/11/25/hello-world/</link>
      <pubDate>Sat, 25 Nov 2017 12:54:07 +0000</pubDate>
      <guid>/blog/2017/11/25/hello-world/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://theo.io/Investigating the Plasmodium invadome using high-throughput reverse genetics.pdf&#34; data-wplink-url-error=&#34;true&#34;&gt;Thesis PDF&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Functional profiling of a Plasmodium genome reveals an abundance of essential genes</title>
      <link>/publication/2017-functional_profiling/</link>
      <pubDate>Sat, 01 Jul 2017 00:00:00 +0000</pubDate>
      <guid>/publication/2017-functional_profiling/</guid>
      <description></description>
    </item>
    
    <item>
      <title>PhenoPlasm: a database of disruption phenotypes for malaria parasite genes</title>
      <link>/publication/2017-phenoplasm/</link>
      <pubDate>Sat, 01 Jul 2017 00:00:00 +0000</pubDate>
      <guid>/publication/2017-phenoplasm/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Petition grapher</title>
      <link>/blog/2017/01/15/petition-grapher/</link>
      <pubDate>Sun, 15 Jan 2017 23:45:58 +0000</pubDate>
      <guid>/blog/2017/01/15/petition-grapher/</guid>
      <description>&lt;p&gt;The houses of parliament in the UK host a website of petitions. When a particularly popular petition is trending it can be addictive to refresh the page and watch the numbers going up behind your eyes. But of course what one really wants is a graph.&lt;/p&gt;
&lt;p&gt;So I built &lt;a href=&#34;http://splasho.com/petitions/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;this tool&lt;/a&gt; which regularly queries the parliament API and stores historical petition signatures in a database which it uses to draw graphs.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Functional profiling of a Plasmodium genome reveals an abundance of essential genes</title>
      <link>/publication/bushell-2017-functional/</link>
      <pubDate>Sun, 01 Jan 2017 00:00:00 +0000</pubDate>
      <guid>/publication/bushell-2017-functional/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Open hardware for random access plate storage</title>
      <link>/publication/sanderson-2017-open/</link>
      <pubDate>Sun, 01 Jan 2017 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2017-open/</guid>
      <description></description>
    </item>
    
    <item>
      <title>PhenoPlasm: a database of disruption phenotypes for malaria parasite genes</title>
      <link>/publication/sanderson-2017-phenoplasm/</link>
      <pubDate>Sun, 01 Jan 2017 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2017-phenoplasm/</guid>
      <description></description>
    </item>
    
    <item>
      <title>PlasmoTron: an open-source platform for automated culture of malaria parasites</title>
      <link>/publication/sanderson-2017-plasmotron/</link>
      <pubDate>Sun, 01 Jan 2017 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2017-plasmotron/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Synergistic malaria vaccine combinations identified by systematic antigen screening</title>
      <link>/publication/bustamante-2017-synergistic/</link>
      <pubDate>Sun, 01 Jan 2017 00:00:00 +0000</pubDate>
      <guid>/publication/bustamante-2017-synergistic/</guid>
      <description></description>
    </item>
    
    <item>
      <title>CiteAnything</title>
      <link>/project/citeanything/</link>
      <pubDate>Wed, 27 Apr 2016 00:00:00 +0000</pubDate>
      <guid>/project/citeanything/</guid>
      <description>&lt;p&gt;Automatically generate citations from free text with GPT-3&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Codon2Nucleotide</title>
      <link>/project/codon2nucleotide/</link>
      <pubDate>Wed, 27 Apr 2016 00:00:00 +0000</pubDate>
      <guid>/project/codon2nucleotide/</guid>
      <description>&lt;p&gt;A small tool to look up nucleotides from codon positions for SARS-CoV-2 and vice-versa.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>EvenSampling</title>
      <link>/project/evensampling/</link>
      <pubDate>Wed, 27 Apr 2016 00:00:00 +0000</pubDate>
      <guid>/project/evensampling/</guid>
      <description>&lt;p&gt;I was seconded to the Wellcome Sanger Institute at a time when almost every positive SARS-CoV-2 sample was being sent there for potential genomic surveillance. Sequencing capacity was capped at a certain number of samples per day, and I was tasked with developing an algorithm which would select plates for sequencing in order to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;provide geographical coverage across local authorities such that the number of samples sequenced was proportional to the number of cases (despite sometimes biased arrival of samples to the lab)&lt;/li&gt;
&lt;li&gt;prioritise samples in key government priority areas such as those from care homes, and those from people arriving from abroad&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I used OR-tools to find the optimal plate selection according to these priorities and constraints. The algorithm, called &lt;a href=&#34;https://github.com/theosanderson/evensampling&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;evensampling&lt;/a&gt; was implemented in Python and was run daily with sample manifests from the latest samples to select the plates for cherry-picking each day. This algorithm was responsible for selecting millions of samples during the pandemic, and evolved in response to changing priorities. We showed that the balance of samples selected improved substantially after its implementation.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Gensplore</title>
      <link>/project/gensplore/</link>
      <pubDate>Wed, 27 Apr 2016 00:00:00 +0000</pubDate>
      <guid>/project/gensplore/</guid>
      <description>&lt;p&gt;Automatically generate citations from free text with GPT-3&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Mixology</title>
      <link>/project/mixology/</link>
      <pubDate>Wed, 27 Apr 2016 00:00:00 +0000</pubDate>
      <guid>/project/mixology/</guid>
      <description>&lt;p&gt;Mixology is a tool to help you calculate the required masses and volumes of laboratory solutions.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>SRAstats</title>
      <link>/project/srastats/</link>
      <pubDate>Wed, 27 Apr 2016 00:00:00 +0000</pubDate>
      <guid>/project/srastats/</guid>
      <description>&lt;p&gt;A visualisation of the ever expanding number of bases in the sequence read archive&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>The Up-Goer Five Text Editor</title>
      <link>/project/ug5editor/</link>
      <pubDate>Wed, 27 Apr 2016 00:00:00 +0000</pubDate>
      <guid>/project/ug5editor/</guid>
      <description>&lt;p&gt;Prompted by a friend to explain my PhD in the style of &lt;a href=&#34;https://xkcd.com/1133/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;XKCD #1133&lt;/a&gt;, I built the &lt;a href=&#34;https://splasho.com/upgoer5&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Up-Goer Five Text Editor&lt;/a&gt;. It has been (and &lt;a href=&#34;https://twitter.com/search?q=splasho.com%2Fupgoer5&amp;amp;src=typed_query&amp;amp;f=live&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;continues to be&lt;/a&gt;) widely used as a tool for thinking about science-communication, including with &lt;a href=&#34;https://www.youtube.com/results?search_query=up&amp;#43;goer&amp;#43;five&amp;amp;sp=CAI%253D&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;conference sessions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.theguardian.com/science/life-and-physics/2013/jan/19/upgoerfive-particlephysics&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Guardian article&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Investigating the Plasmodium invadome with high-throughput reverse genetics</title>
      <link>/publication/sanderson-2015-investigating/</link>
      <pubDate>Thu, 01 Jan 2015 00:00:00 +0000</pubDate>
      <guid>/publication/sanderson-2015-investigating/</guid>
      <description></description>
    </item>
    
    <item>
      <title>Plasmodium knowlesi genome sequences from clinical isolates reveal extensive genomic dimorphism</title>
      <link>/publication/pinheiro-2015-plasmodium/</link>
      <pubDate>Thu, 01 Jan 2015 00:00:00 +0000</pubDate>
      <guid>/publication/pinheiro-2015-plasmodium/</guid>
      <description></description>
    </item>
    
    <item>
      <title>How synthetic biology will reconsider natural bioluminescence and its applications</title>
      <link>/publication/reeve-2014-synthetic/</link>
      <pubDate>Wed, 01 Jan 2014 00:00:00 +0000</pubDate>
      <guid>/publication/reeve-2014-synthetic/</guid>
      <description></description>
    </item>
    
    <item>
      <title>The Up-Goer Five Text Editor</title>
      <link>/blog/2013/01/15/the-up-goer-five-text-editor/</link>
      <pubDate>Tue, 15 Jan 2013 20:30:09 +0000</pubDate>
      <guid>/blog/2013/01/15/the-up-goer-five-text-editor/</guid>
      <description>&lt;p&gt;When Randall Monroe released the amazing &lt;a href=&#34;https://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=5&amp;amp;ved=0ahUKEwiL_IDW7YzYAhWpDsAKHUphCa4QFgg_MAQ&amp;amp;url=https%3A%2F%2Fxkcd.com%2F1133%2F&amp;amp;usg=AOvVaw34iEgfQhC5LA5KI54OHFCk&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Up-Goer Five comic&lt;/a&gt;, I was inspired to hack together a &lt;a href=&#34;http://splasho.com/upgoer5/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;customised editor&lt;/a&gt; so that I could explain my own research in the limited vocabulary of the thousand most common words.&lt;/p&gt;
&lt;p&gt;For me the most exciting bit about this was that I got an email from Mr. xkcd himself. It also became a bit of a science-communication craze. A lot of scientists got in on the action (some kind people have made a collection &lt;a href=&#34;http://tenhundredwordsofscience.tumblr.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;here&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The editor has featured in &lt;a href=&#34;https://www.theguardian.com/technology/shortcuts/2013/jan/22/up-goer-five-thing-on-computer&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;The Guardian&lt;/a&gt; (and &lt;a href=&#34;https://www.theguardian.com/science/life-and-physics/2013/jan/19/upgoerfive-particlephysics&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;again&lt;/a&gt;). More recently it’s even been used for &lt;a href=&#34;https://www.youtube.com/watch?v=eqOK8SOhSTc&amp;amp;index=2&amp;amp;list=PLxxOU26Ed0qfQYwboB9WpaXpxZdZMG2ae&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;conference sessions&lt;/a&gt;, which are pretty fantastic. (The &lt;a href=&#34;https://www.youtube.com/watch?v=D7BtHOGEXhc&amp;amp;index=9&amp;amp;list=PLxxOU26Ed0qfQYwboB9WpaXpxZdZMG2ae&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;9th talk&lt;/a&gt; in that playlist is particularly excellent). It’s also quite popular as a science communication training exercise, although it goes without saying that no-one is suggesting that this is the best way to communicate.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>(Social) media</title>
      <link>/project/socialmedia/</link>
      <pubDate>Wed, 27 Apr 2011 00:00:00 +0000</pubDate>
      <guid>/project/socialmedia/</guid>
      <description>&lt;p&gt;During the SARS-CoV-2 pandemic I attempted to make data on variants, antibodies, and other things accessible to a general audience, partly through &lt;a href=&#34;https://theo.io/media&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;the traditional media&lt;/a&gt;, and also by sharing graphs and multimedia through social media. Some of my animated figures, though not traditionally published, entered presentations from the deputy CMO and others.&lt;/p&gt;
&lt;p&gt;Some of the more popular content can be seen &lt;a href=&#34;https://twitter.com/search?q=from%3Atheosanderson%20min_retweets%3A60%20filter%3Amedia&amp;amp;src=typed_query&amp;amp;f=live&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;here&lt;/a&gt;, which have received &amp;gt;40 million views&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>iGEM</title>
      <link>/blog/2010/08/15/igem/</link>
      <pubDate>Sun, 15 Aug 2010 19:33:04 +0000</pubDate>
      <guid>/blog/2010/08/15/igem/</guid>
      <description>&lt;p&gt;The international genetic engineered machine competition (iGEM) was my first taste of proper experimental science, and I still have a fondness for synthetic biology. I was part of the &lt;a href=&#34;http://2010.igem.org/Team:Cambridge&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Cambridge Team&lt;/a&gt; for 2010. This was an exciting team project where we got to define our own genetic engineering project and work on it over a summer.&lt;/p&gt;
&lt;p&gt;We focused on bioluminescence, building modular genetic components (BioBricks) from firefly luciferase, in a number of colours, and also from the bacterium &lt;em&gt;Vibrio fischeri&lt;/em&gt;. The exciting thing about the bacterial luciferase is that this permits ‘autoluminescence’, i.e. the bacteria produce light without adding any other chemicals. We exploited this to light ourselves in the photo below.&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;alignnone size-medium&#34; src=&#34;http://2010.igem.org/wiki/images/7/70/Front.jpg&#34; width=&#34;738&#34; height=&#34;240&#34; /&gt;&lt;/p&gt;
&lt;p&gt;In the project we achieved a Gold Medal, were finalists in the competition and won the prize for Best Wiki, which I designed. As part of the project I built &lt;a href=&#34;http://2010.igem.org/Team:Cambridge/Tools/GenBank&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;BioBrick2GenBank&lt;/a&gt;, a small tool which converts BioBricks to GenBank format for editing in standard cloning software. This has been used &amp;gt;350,000 times to date.&lt;/p&gt;
&lt;p&gt;Our BioBricks have been used by a number of future teams, including by a &lt;a href=&#34;http://2012.igem.org/Team:Peking/Project/Communication&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;team from Peking&lt;/a&gt;, who used this part in one bacterium, combined with a light sensitive-system in bacteria in a separate tube, to allow cell-cell communication!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Gibson assembly&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We were also early users of the revolutionary Gibson Assembly protocol, and I penned the lyrics to the &lt;a href=&#34;https://www.youtube.com/watch?v=WCWjJFU1be8&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;embarassing music-video we made to promote it&lt;/a&gt;, earning us the (dubious?) distinction of a &lt;a href=&#34;https://twitter.com/jcventer/status/26709268422&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Craig Venter tweet&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Media&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;On the back of this project I was quoted in &lt;a href=&#34;https://www.newscientist.com/article/mg20827885-000-glowing-trees-could-light-up-city-streets/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;New Scientist&lt;/a&gt;, and later by &lt;a href=&#34;http://www.bbc.co.uk/news/technology-22433866&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;the&lt;/a&gt; &lt;a href=&#34;http://www.bbc.co.uk/news/science-environment-21144766&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;BBC&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Book chapter&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Ben Reeve and I later wrote a &lt;a href=&#34;https://www.ncbi.nlm.nih.gov/pubmed/25216951&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;chapter&lt;/a&gt; about the application of bioluminescence in synthetic biology.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title></title>
      <link>/contacts/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/contacts/</guid>
      <description>&lt;p&gt;You can find me at &lt;a href=&#34;https://mstdn.science/@theosanderson&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://mstdn.science/@theosanderson&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title></title>
      <link>/media/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/media/</guid>
      <description>&lt;h2 id=&#34;in-the-media&#34;&gt;In the media&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://www.newscientist.com/article/2393799-covid-19-drug-may-be-creating-new-variants-with-distinctive-mutations/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.newscientist.com/article/2393799-covid-19-drug-may-be-creating-new-variants-with-distinctive-mutations/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.theguardian.com/world/2023/sep/25/use-of-antiviral-molnupiravir-evolution-covid-virus-mutations&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.theguardian.com/world/2023/sep/25/use-of-antiviral-molnupiravir-evolution-covid-virus-mutations&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.independent.co.uk/news/science/university-of-cape-town-university-of-cambridge-francis-crick-institute-university-of-liverpool-nature-b2418152.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.independent.co.uk/news/science/university-of-cape-town-university-of-cambridge-francis-crick-institute-university-of-liverpool-nature-b2418152.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://news.sky.com/story/molnupiravir-covid-drug-linked-to-mutations-that-could-spread-the-illness-scientists-say-12969805&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://news.sky.com/story/molnupiravir-covid-drug-linked-to-mutations-that-could-spread-the-illness-scientists-say-12969805&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.france24.com/en/live-news/20230925-anti-covid-drug-may-have-led-to-virus-mutations-study&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.france24.com/en/live-news/20230925-anti-covid-drug-may-have-led-to-virus-mutations-study&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://thebulletin.org/2023/09/mercks-covid-drug-may-be-creating-transmissible-mutated-viruses/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://thebulletin.org/2023/09/mercks-covid-drug-may-be-creating-transmissible-mutated-viruses/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.nature.com/articles/d41586-023-00347-z&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.nature.com/articles/d41586-023-00347-z&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.nature.com/articles/d41586-023-00901-9&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.nature.com/articles/d41586-023-00901-9&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.verywellhealth.com/merck-covid-antiviral-variants-7107973&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.verywellhealth.com/merck-covid-antiviral-variants-7107973&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.science.org/content/article/could-popular-covid-19-antiviral-supercharge-pandemic&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.science.org/content/article/could-popular-covid-19-antiviral-supercharge-pandemic&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.bloomberg.com/news/articles/2023-02-01/merck-s-mrk-covid-drug-linked-to-viable-spreading-mutants-study-says&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.bloomberg.com/news/articles/2023-02-01/merck-s-mrk-covid-drug-linked-to-viable-spreading-mutants-study-says&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.nzdoctor.co.nz/article/news/supplier-wants-officials-rethink-their-advice-against-covid-antiviral&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.nzdoctor.co.nz/article/news/supplier-wants-officials-rethink-their-advice-against-covid-antiviral&lt;/a&gt;&lt;/p&gt;














  


&lt;video controls &gt;
  &lt;source src=&#34;https://theo.nyc3.cdn.digitaloceanspaces.com/media/radio.mp4&#34; type=&#34;video/mp4&#34;&gt;
&lt;/video&gt;
&lt;p&gt;&lt;a href=&#34;https://audioboom.com/posts/6623953-malaria-genetic-barcodes-ft-theo-sanderson&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://audioboom.com/posts/6623953-malaria-genetic-barcodes-ft-theo-sanderson&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.theverge.com/2020/12/30/22206522/coronavirus-test-variant-contagious-uk-gene&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.theverge.com/2020/12/30/22206522/coronavirus-test-variant-contagious-uk-gene&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://news.rambler.ru/science/45670958-pochemu-novye-shtammy-sars-cov-2-tak-stremitelno-rasprostranyayutsya-po-vsemu-miru/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://news.rambler.ru/science/45670958-pochemu-novye-shtammy-sars-cov-2-tak-stremitelno-rasprostranyayutsya-po-vsemu-miru/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.sciencealert.com/a-new-omicron-variant-has-been-found-and-it-s-now-even-harder-to-identify&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.sciencealert.com/a-new-omicron-variant-has-been-found-and-it-s-now-even-harder-to-identify&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://education.nationalgeographic.org/resource/everlasting-light&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://education.nationalgeographic.org/resource/everlasting-light&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.businessinsider.com/ba-2-omicron-lineage-covid-harder-track-s-gene-dropout-2021-12?r=US&amp;amp;IR=T&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.businessinsider.com/ba-2-omicron-lineage-covid-harder-track-s-gene-dropout-2021-12?r=US&amp;IR=T&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.bild.de/ratgeber/gesundheit/gesundheit/erste-zahlen-omikron-verlaeufe-wohl-auch-in-europa-milder-78596684.bild.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.bild.de/ratgeber/gesundheit/gesundheit/erste-zahlen-omikron-verlaeufe-wohl-auch-in-europa-milder-78596684.bild.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.telegraph.co.uk/global-health/science-and-disease/new-vaccine-needed-omicron-variant-long-will-take-arrive/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.telegraph.co.uk/global-health/science-and-disease/new-vaccine-needed-omicron-variant-long-will-take-arrive/&lt;/a&gt; &lt;a href=&#34;https://archive.is/220l5&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://archive.is/220l5&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.nature.com/articles/d41586-021-03784-w&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.nature.com/articles/d41586-021-03784-w&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.ibtimes.com/bioluminescence-city-how-glowing-eels-green-jellyfish-could-light-future-1310621&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.ibtimes.com/bioluminescence-city-how-glowing-eels-green-jellyfish-could-light-future-1310621&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.popularmechanics.com/science/green-tech/g706/6-bright-ideas-for-bioluminescence-tech/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.popularmechanics.com/science/green-tech/g706/6-bright-ideas-for-bioluminescence-tech/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.dw.com/de/neue-corona-variante-kommt-aus-indien/a-57262449&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.dw.com/de/neue-corona-variante-kommt-aus-indien/a-57262449&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.bbc.co.uk/news/science-environment-21144766&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.bbc.co.uk/news/science-environment-21144766&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.bbc.co.uk/news/world-44569277&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.bbc.co.uk/news/world-44569277&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.bbc.co.uk/news/technology-22433866&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.bbc.co.uk/news/technology-22433866&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.theguardian.com/world/live/2021/dec/31/covid-news-live-south-africa-says-fourth-wave-has-peaked-us-will-soon-see-viral-blizzard-expert-warns?page=with:block-61ceaa738f08b7d6158b80c5#block-61ceaa738f08b7d6158b80c5&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.theguardian.com/world/live/2021/dec/31/covid-news-live-south-africa-says-fourth-wave-has-peaked-us-will-soon-see-viral-blizzard-expert-warns?page=with:block-61ceaa738f08b7d6158b80c5#block-61ceaa738f08b7d6158b80c5&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.theguardian.com/technology/shortcuts/2013/jan/22/up-goer-five-thing-on-computer&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.theguardian.com/technology/shortcuts/2013/jan/22/up-goer-five-thing-on-computer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.theguardian.com/science/life-and-physics/2013/jan/19/upgoerfive-particlephysics?CMP=twt_fd&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.theguardian.com/science/life-and-physics/2013/jan/19/upgoerfive-particlephysics?CMP=twt_fd&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.dailymail.co.uk/sciencetech/article-1333334/How-trees-glow-like-fireflies-day-replace-streetlights.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.dailymail.co.uk/sciencetech/article-1333334/How-trees-glow-like-fireflies-day-replace-streetlights.html&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;graphs&#34;&gt;Graphs&lt;/h2&gt;














  


&lt;video controls &gt;
  &lt;source src=&#34;https://theo.nyc3.cdn.digitaloceanspaces.com/media/graph_on_german_tv_1.mp4&#34; type=&#34;video/mp4&#34;&gt;
&lt;/video&gt;














  


&lt;video controls &gt;
  &lt;source src=&#34;https://theo.nyc3.cdn.digitaloceanspaces.com/media/graph_on_german_tv_2.mp4&#34; type=&#34;video/mp4&#34;&gt;
&lt;/video&gt;
</description>
    </item>
    
    <item>
      <title></title>
      <link>/medialist/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/medialist/</guid>
      <description></description>
    </item>
    
    <item>
      <title></title>
      <link>/post/2023-07-28/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/post/2023-07-28/</guid>
      <description></description>
    </item>
    
    <item>
      <title></title>
      <link>/recent_invited_talks/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/recent_invited_talks/</guid>
      <description>&lt;p&gt;UKHSA VTG
UKHSA Other
WHO TAG-VE
DIB Seminar series LSHTM
International Society for Influenza and Other Respiratory Viruses, Antiviral Special Interest group
NIH-SAVE&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title></title>
      <link>/reviewing/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/reviewing/</guid>
      <description>&lt;p&gt;I have performed reviewing activity for journals including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;JAMA&lt;/li&gt;
&lt;li&gt;Communications Biology&lt;/li&gt;
&lt;li&gt;Virus Evolution&lt;/li&gt;
&lt;li&gt;iScience&lt;/li&gt;
&lt;li&gt;GigaScience&lt;/li&gt;
&lt;li&gt;Genome Research&lt;/li&gt;
&lt;li&gt;PeerJ&lt;/li&gt;
&lt;li&gt;Bioinformatics Advances&lt;/li&gt;
&lt;li&gt;Microbial Genomics&lt;/li&gt;
&lt;li&gt;Nucleic Acids Research&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Scidep - a dependency tree for scientific discovery</title>
      <link>/garden/scidep/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/garden/scidep/</guid>
      <description>&lt;h4 id=&#34;the-problem&#34;&gt;The problem&lt;/h4&gt;
&lt;blockquote&gt;``It has not escaped our notice that the specific pairing we have postulated immediately suggests a possible copying mechanism for the genetic material.&#39;&#39;&lt;/blockquote&gt;
&lt;p&gt;Thus Watson and Crick concluded their short article revealing the structure of DNA in 1953. In writing this they were part of a scientific tradition that is alive and well to this day, the fear that others may get the credit for trivial extensions of one&amp;rsquo;s own hard work.&lt;/p&gt;
&lt;p&gt;Despite huge changes in the landscape of scientific research since, this fear is as alive as ever. And in many circumstances, it may be justified. Scientists applying for jobs and funding are assessed on their publication records, and publications, especially in &amp;ldquo;top&amp;rdquo; journals often rely on narratives and mechanisms, rather than raw data.&lt;/p&gt;
&lt;p&gt;Yet disseminating data by waiting for publication in journals, or even for the writing of narrative manuscripts would, and does, drastically reduce scientific progress. An especially dramatic example of this was the release of the first SARS-CoV2 genome on a Discourse group on January 10 by Yong-Zhen Zhang, via Eddie Holmes. This genome set in train the development of PCR tests and vaccines (Moderna&amp;rsquo;s had been designed just two days later). Each day of delay in posting this sequence would have led at minimum to tens of thousands of additional lives lost, considering vaccination alone.&lt;/p&gt;
&lt;p&gt;In many ways the pandemic has brought out the best in the scientific community, with many sharing data &lt;a href=&#34;Menachery&#34;&gt;in real time on Twitter&lt;/a&gt;, and elsewhere, without  worrying too much about being &amp;ldquo;scooped&amp;rdquo;. A shining light has been the sharing of sequence data, deposited on the GISAID database, and made explorable in real time by initiatives such as Nextstrain.&lt;/p&gt;
&lt;p&gt;But this data sharing has not always been completely smooth. Sometimes those who have done the hard, expensive, work required to generate these sequence data have complained that others have published relatively trivial analyses of these data without involving these originators.&lt;/p&gt;
&lt;p&gt;These complainants have a point. The GISAID terms and conditions, accepted by anyone in order to access the data, require acknowledgement of the originating laboratories in any analyses of their data. They also require &amp;lsquo;best efforts&amp;rsquo; be made to collaborate with these laboratories, though the FAQ explicitly states that permission from the originating laboratories is not required for publications.&lt;/p&gt;
&lt;p&gt;Fundamentally, the argument that many critics are making is that the originators of the data should have the right to make the first narrative descriptions of the events that these data describe: the emergence of a particular variant, its spread in a new country. I suspect that at the root of this argument is a valid fear, that more prestige and recognition may be associated with the statistical description.&lt;/p&gt;
&lt;p&gt;But what&amp;rsquo;s the point of sharing data in real time on a platform like GISAID? Ultimately it has to be to allow others to analyse it. And those analyses are not of any use unless they are communicated. And the traditional way in which scientific analyses are communicated is by publishing them in journals (I think more efficient alternatives may exist, but this is the current system).&lt;/p&gt;
&lt;p&gt;The use of GISAID requires acknowledgements, which at least some of these criticised papers complied wtih, providing a table of all the laboratories contributing sequences. But this wasn&amp;rsquo;t enough to assuage the concerns. Because being listed in the acknowledgements of a paper describing an important phenomenon doesn&amp;rsquo;t confer the same prestige as having written that paper. Fundamentally this is the problem. Someone can generate the data needed to understand a key scientific issue, deposit it, and not get the credit for the insights it leads to.&lt;/p&gt;
&lt;h4 id=&#34;a-remedy&#34;&gt;A remedy?&lt;/h4&gt;
&lt;p&gt;How can we incentivise scientists to create and deposit valuable data? In my view by recording the use of that data, and giving them credit. When another group publishes the first analysis of a set of valuable data, their paper will accrue citations. I think that isn&amp;rsquo;t in itself a problem, and isn&amp;rsquo;t really what causes the resentment. The problem is that those citations, valuable scientific prestige, occur at the expense of the originators of the data.&lt;/p&gt;
&lt;p&gt;What if those citations were transitive &amp;ndash; if they flowed from the analysis paper straight down to the originators of the data? The original researchers would gain kudos from there being more analyses of their data out in the world.&lt;/p&gt;
&lt;p&gt;This is is in essence the notion of a dependency tree. An analysis of SARS-CoV2 genome sequences has many dependencies: the originators of the sequences, the bioinformatic tools for analysing them. Those dependencies each in turn have their own dependencies (generation of a genome may rely on a sequencing protocols like ARTIC).&lt;/p&gt;
&lt;p&gt;Fundamentally, I think that if we recorded these dependencies, we would incentivise a better sort of science. Dependencies are different from citations in that they are not limited in number, do not have to be associated with a particular sentence, and are not limited to pointing to, or featuring in publications.&lt;/p&gt;
&lt;h4 id=&#34;implementation&#34;&gt;Implementation&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;SciDep&lt;/em&gt; would be a dependency tree of scientific contributions. It would allow the creation of unique IDs for any object desired:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Publications&lt;/li&gt;
&lt;li&gt;Repositories&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;scratchpad&lt;/p&gt;
&lt;p&gt;Proposal: GISAID (and other databases) provide a unique ID (rather like a DOI) for each genome / datapoint. scidep.gisaid.11154 . GISAID mandates that you can use that data, but only if you create an entity for your paper scidep.pubmed.115343 which includes as dependencies each of the genomes you used in your analysis.&lt;/p&gt;
&lt;p&gt;The supercharged version is that the license requires that you apply the same feature to your paper. If you, or a publisher, want to cite it, they in turn have to create a scidep entity for their publication&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
