# Pangenome (C. elegans)

:::caution JBrowse v5 beta

The tutorials target the JBrowse v5 beta, and the v4.3.0 release
on the [download page](https://jbrowse.org/jb2/download/) lacks some of what they show. To install the
beta of JBrowse Web, run `npm install -g @jbrowse/cli@next`, then
`jbrowse create jbrowse2 --branch v5.0.0-beta.24`. Desktop beta builds for Linux and
macOS are on the [releases page](https://github.com/GMOD/jbrowse-components/releases);
the Windows build waits on code signing.

:::

Geneticists have mapped several traits of the nematode _Caenorhabditis elegans_
to structural variants between the laboratory strain N2 and wild strains: two
selfish toxin-antidote elements that kill part of the progeny of a cross between
strains, a retrotransposon that stops N2 males from leaving a copulatory plug on
their mates, and a deletion of four genes beside _glc-1_ in strains resistant to
the anthelmintic abamectin.

We find each one in long-read assemblies of 39 wild isolates, one per isotype
(CaeNDR's grouping of strains that share a genome), aligned with `minigraph`
into a graph on ce11, the N2 reference. The graph track draws each bubble, a
place where the strains' sequences split and rejoin. A callset made by mapping
every assembly back onto the graph lists which allele each strain has there, one
VCF column per strain. The reference is N2, so an insertion that N2 has appears
in the callset as a deletion in the strains without it. We:

- load ce11 with its RefSeq genes, the graph, its bubbles and the callset as
  tracks in JBrowse
- sort the callset's rows by genotype at the two toxin-antidote elements,
  _peel-1_ with _zeel-1_ and _sup-35_ with _pha-1_
- load each strain's `minimap2` alignment and its walk through the graph, and
  check the _sup-35_ alleles against them as lanes and as threads
- find the strains without N2's retrotransposon in _plg-1_, checking one against
  its reads as alignments tracks, and those with the four-gene deletion beside
  _glc-1_
- check the assemblies, then build the graph, the callset and the walk file from
  them

:::caution Experimental

The graph view is a beta plugin. We welcome your [feedback](https://jbrowse.org/jb2/contact).

:::

## Prerequisites

- the GraphGenomeView plugin, for the `GraphTrack` below, which needs JBrowse 5;
  until JBrowse 5 ships, that is the
  [development build](https://jbrowse.org/code/jb2/main/). In your own JBrowse,
  [install it from the plugin store](https://jbrowse.org/jb2/docs/user_guides/plugin_store)
- to build the graph, the callset and the walk file:
  [`minigraph`](https://github.com/lh3/minigraph), the `k8` JavaScript shell
  that runs minigraph's `mgutils` scripts, bcftools, htslib (`bgzip`, `tabix`),
  gfatools, [`gfa-to-tabix`](https://github.com/GMOD/gfa-to-tabix) 5.2.0 or
  later and NCBI's `datasets`
- to check the assemblies first: minimap2,
  [`purge_dups`](https://github.com/dfguan/purge_dups) and the SRA toolkit, for
  the reads purge_dups reads
- to align a strain's reads: minimap2 and samtools

<!-- BEGIN GENERATED TUTORIAL_INSTALL minigraph,k8,bcftools,htslib,gfatools,gfa-to-tabix,datasets,minimap2,purge_dups,sra-tools,samtools,jbrowse-cli -->

```bash
# Debian/Ubuntu
sudo apt install bcftools tabix minimap2 sra-toolkit samtools
# or conda, which has every tool above
conda install -c bioconda -c conda-forge minigraph k8 bcftools htslib \
  gfatools ncbi-datasets-cli minimap2 purge_dups sra-tools samtools
# or Linux x86_64 binaries for the tools apt lacks
wget -P ~/.local/bin \
  https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/v2/linux-amd64/datasets \
  https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/v2/linux-amd64/dataformat
chmod +x ~/.local/bin/datasets ~/.local/bin/dataformat
# any platform
cargo install gfa-to-tabix
npm install -g @jbrowse/cli@next
```

<!-- END GENERATED TUTORIAL_INSTALL minigraph,k8,bcftools,htslib,gfatools,gfa-to-tabix,datasets,minimap2,purge_dups,sra-tools,samtools,jbrowse-cli -->

## The data

The reference is ce11, which the build takes from NCBI as GCF_000002985.6 and
JBrowse reads as UCSC's copy. The assemblies are NCBI GenBank records: three
panels (Lee et al. 2021, Konan University and the Wellcome Sanger Institute) and
three single submissions, listed with their accessions and the input checks in
the [README](https://jbrowse.org/demos/celegans_pangenome/README.txt) beside the
files.

Nothing to download: the track configs below read the files by URL.
[Check the assemblies](#check-the-assemblies-before-building-the-graph),
[Build the C. elegans graph](#build-the-c-elegans-graph),
[Make the callset](#make-the-callset) and
[Make the walk file](#make-the-walk-file) build them from assemblies of your
own.

<details>
<summary>Read by URL (no download needed)</summary>

| What it is                                                                                       | File                                                                                                                                          |
| ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| ce11 (WBcel235), as 2bit                                                                         | [ce11.2bit](https://hgdownload.soe.ucsc.edu/goldenPath/ce11/bigZips/ce11.2bit)                                                                |
| The graph, as rGFA                                                                               | [celegans-ce11-minigraph.rgfa.gz](https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.rgfa.gz)                               |
| Segments and links, the graph's nodes and edges at their reference coordinates                   | [celegans-ce11-minigraph.graph.bed.gz](https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.graph.bed.gz)                     |
| Bubbles, where the strains' paths split and rejoin                                               | [celegans-ce11-minigraph.bubbles.bed.gz](https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.bubbles.bed.gz)                 |
| The whole-chromosome overview, with variants under 10 kb folded into the reference               | [celegans-ce11-minigraph.fold10000.graph.bed.gz](https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.fold10000.graph.bed.gz) |
| The callset, each strain's allele at every bubble                                                | [celegans-ce11-minigraph.vcf.gz](https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.vcf.gz)                                 |
| The walk file, each strain's route through the graph                                             | [celegans-ce11-minigraph.ce11.walks.gz](https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.ce11.walks.gz)                   |
| Each strain's assembly aligned to ce11 by minimap2, one indexed PAF per strain, such as CB4856's | [CB4856_vs_ce11.pif.gz](https://jbrowse.org/demos/celegans_pangenome/vsref/CB4856_vs_ce11.pif.gz)                                             |
| MY2693's Illumina reads around _plg-1_, aligned to ce11 by minimap2                              | [MY2693_illumina.plg1.bam](https://jbrowse.org/demos/celegans_pangenome/plg1_reads/MY2693_illumina.plg1.bam)                                  |
| MY2693's PacBio HiFi reads around _plg-1_, aligned to ce11 by minimap2                           | [MY2693_hifi.plg1.bam](https://jbrowse.org/demos/celegans_pangenome/plg1_reads/MY2693_hifi.plg1.bam)                                          |

</details>

## Load the genome, the graph and the callset

We'll load ce11 and its RefSeq genes from the UCSC hub on jbrowse.org, whose
alias table maps ce11's NCBI names onto `chrI` and the rest:

```json
{
  "name": "ce11",
  "uri": "https://hgdownload.soe.ucsc.edu/goldenPath/ce11/bigZips/ce11.2bit",
  "refNameAliases": {
    "uri": "https://jbrowse.org/ucsc/ce11/ce11.chromAlias.txt"
  }
}
```

Hosted: genomes.jbrowse.org hosts `ce11`, and this page's ce11 tracks attach to it by that name. The other tabs build the same assembly from its files.

- In JBrowse Desktop, click **Browse hosted genomes** on the start screen and pick ce11, or launch `jbrowse-desktop --genome ce11`.
- On the web, open [ce11 on genomes.jbrowse.org](https://genomes.jbrowse.org/ucsc/ce11/).
- In your own JBrowse Web, `jbrowse add-assembly --genome ce11` adds it to the `config.json` in the current folder.

CLI:

```bash
jbrowse add-assembly https://hgdownload.soe.ucsc.edu/goldenPath/ce11/bigZips/ce11.2bit \
  --name ce11 \
  --refNameAliases https://jbrowse.org/ucsc/ce11/ce11.chromAlias.txt
```

```json
{
  "type": "FeatureTrack",
  "trackId": "ce11_ncbiRefSeq_ucsc",
  "name": "NCBI RefSeq genes (ce11)",
  "assemblyNames": ["ce11"],
  "adapter": {
    "type": "Gff3TabixAdapter",
    "uri": "https://jbrowse.org/ucsc/ce11/ncbiRefSeq.gff.gz",
    "csi": true
  }
}
```

CLI:

```bash
jbrowse add-track-json '{
  "type": "FeatureTrack",
  "trackId": "ce11_ncbiRefSeq_ucsc",
  "name": "NCBI RefSeq genes (ce11)",
  "assemblyNames": ["ce11"],
  "adapter": {
    "type": "Gff3TabixAdapter",
    "uri": "https://jbrowse.org/ucsc/ce11/ncbiRefSeq.gff.gz",
    "csi": true
  }
}'
```

The graph track's `uri` is the file prefix of the segment index and its
overview. The graph names the reference's sequences `ce11#1#chrI`, so
`assemblyNameToPanSN` maps the assembly to that prefix. Swap the `uri`s for your
own build's:

```json
{
  "type": "GraphTrack",
  "trackId": "celegans_minigraph_segments",
  "name": "C. elegans pangenome (rGFA segments)",
  "assemblyNames": ["ce11"],
  "adapter": {
    "type": "GfaTabixAdapter",
    "uri": "https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph",
    "format": 2,
    "assemblyNameToPanSN": { "ce11": "ce11" },
    "coarse": {
      "uri": "https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.fold10000",
      "format": 2,
      "aboveBpPerPx": 1000
    }
  },
  "displays": [
    { "type": "LinearGraphDisplay" },
    { "type": "LinearBasicDisplay" }
  ]
}
```

CLI:

```bash
jbrowse add-track-json '{
  "type": "GraphTrack",
  "trackId": "celegans_minigraph_segments",
  "name": "C. elegans pangenome (rGFA segments)",
  "assemblyNames": ["ce11"],
  "adapter": {
    "type": "GfaTabixAdapter",
    "uri": "https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph",
    "format": 2,
    "assemblyNameToPanSN": { "ce11": "ce11" },
    "coarse": {
      "uri": "https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.fold10000",
      "format": 2,
      "aboveBpPerPx": 1000
    }
  },
  "displays": [
    { "type": "LinearGraphDisplay" },
    { "type": "LinearBasicDisplay" }
  ]
}'
```

```json
{
  "type": "FeatureTrack",
  "trackId": "celegans_minigraph_bubbles",
  "name": "C. elegans pangenome bubbles",
  "assemblyNames": ["ce11"],
  "adapter": {
    "type": "MinigraphBubbleAdapter",
    "uri": "https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.bubbles.bed.gz",
    "csi": true,
    "assemblyNameToPanSN": { "ce11": "ce11" }
  }
}
```

CLI:

```bash
jbrowse add-track-json '{
  "type": "FeatureTrack",
  "trackId": "celegans_minigraph_bubbles",
  "name": "C. elegans pangenome bubbles",
  "assemblyNames": ["ce11"],
  "adapter": {
    "type": "MinigraphBubbleAdapter",
    "uri": "https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.bubbles.bed.gz",
    "csi": true,
    "assemblyNameToPanSN": { "ce11": "ce11" }
  }
}'
```

The callset has a record for each bubble where ce11's own call is the reference
allele, and one haploid genotype per strain, since _C. elegans_ is a selfing
hermaphrodite and each wild strain is inbred. Its alleles are symbolic (`<X:1>`,
`<X:2>`), and the `ALEN` field lists each allele's length, the reference's
first. The display config:

- `rows.field: "haplotype"` draws one row per strain, a color per allele, the
  rarest sharing the last. The track menu's **Rows → Per sample** draws every
  allele other than N2's in one blue, which suits a locus where every alternate
  allele is a path around an insertion N2 has
- `records.labels.name.show: false` hides each record's ID, which names the
  bubble's end segments
- `records.labels.description` writes the allele lengths on each record in the
  band above the rows, followed by the share of the strains with an alternate
  allele

```json
{
  "type": "VariantTrack",
  "trackId": "celegans_pangenome_vcf",
  "name": "C. elegans pangenome callset",
  "assemblyNames": ["ce11"],
  "adapter": {
    "type": "VcfTabixAdapter",
    "uri": "https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.vcf.gz"
  },
  "displays": [
    {
      "type": "LinearVariantDisplay",
      "rows": { "field": "haplotype" },
      "records": {
        "labels": {
          "name": { "show": false },
          "description": "jexl:feature.INFO.ALEN + ' bp'"
        }
      }
    }
  ]
}
```

CLI:

```bash
jbrowse add-track-json '{
  "type": "VariantTrack",
  "trackId": "celegans_pangenome_vcf",
  "name": "C. elegans pangenome callset",
  "assemblyNames": ["ce11"],
  "adapter": {
    "type": "VcfTabixAdapter",
    "uri": "https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.vcf.gz"
  },
  "displays": [
    {
      "type": "LinearVariantDisplay",
      "rows": { "field": "haplotype" },
      "records": {
        "labels": {
          "name": { "show": false },
          "description": "jexl:feature.INFO.ALEN + '\'' bp'\''"
        }
      }
    }
  ]
}'
```

Opens on config <https://jbrowse.org/ucsc/ce11/config.json> at `chrI:2,336,001-2,360,000`

## Sort the callset by genotype at peel-1 and zeel-1

Seidel et al. (2008) found that crosses between N2 and the Hawaiian strain
CB4856 kill embryos through a genetic incompatibility on chromosome I, and
Seidel et al. (2011) traced it to a 19 kb insertion in N2 with two genes: a
sperm-delivered toxin, _peel-1_, and its zygotic antidote, _zeel-1_. An embryo
dies when its father has the element and it inherits no _zeel-1_. Lee et al.
(2021) found the element inside a block of hyper-divergent sequence, where wild
haplotypes differ from N2's at many sites. CB4856 and other strains of the panel
lack the 19 kb.

- Type `chrI:2,336,001-2,360,000` into the location box and turn on the gene
  track, the callset and the graph track.
- Right-click the record over _zeel-1_ and _peel-1_ and pick **Sort rows by
  genotype here**, which groups the rows by allele.
- In the callset's track menu, choose **Rows → Per sample**, so every strain
  without the element is one blue, whichever path it takes instead.
- In the graph track's menu, open **Graph settings...** and set **Bubble
  spread** to **Compress lengths**, so the kb and bp segments fit one pane.

<Figure caption="peel-1 and zeel-1 with the callset sorted at its record over the element, one row per strain: grey rows share N2's element, blue rows lack it. On the graph track, the callout marks the element, which is the arc the strains without it skip." src="/img/pangenome/worm_peel1.png" />

Session spec, on config <https://jbrowse.org/code/jb2/main/test_data/graphgenomeview/pangenome_nonhuman.json>:

```json
{
  "views": [
    {
      "type": "LinearGenomeView",
      "id": "pangenome-worm_peel1-lgv",
      "assembly": "ce11",
      "loc": "chrI:2,336,001-2,360,000",
      "tracks": [
        {
          "trackId": "ce11_ncbiRefSeq_ucsc",
          "height": 70
        },
        {
          "trackId": "celegans_pangenome_vcf",
          "height": 640,
          "sortRowsBy": {
            "refName": "chrI",
            "pos": 2348000
          },
          "rows": {
            "field": "sample"
          }
        },
        {
          "trackId": "celegans_minigraph_segments",
          "type": "LinearGraphDisplay",
          "layoutMode": "force",
          "encoding": {
            "color": {
              "field": "position"
            }
          },
          "bubbleSpread": "compress",
          "maxRegionBp": 26401,
          "height": 260
        }
      ]
    }
  ]
}
```

Each strain without the element takes a short path through the hyper-divergent
block, and the paths differ among groups of strains, so the callset lists them
as separate alleles. **Rows → Per haplotype** draws each of those alleles in a
separate color.

## Read the sup-35 and pha-1 alleles

Ben-David et al. (2017) found a second toxin-antidote element on chromosome III:
a mother with the element loads the toxin SUP-35 into every egg, and an embryo
that inherits no _pha-1_, the antidote, dies with a malformed pharynx. They
assembled DL238 and QX1211 and found there the arrangement other
_Caenorhabditis_ species share, without the inversion N2 has. DL238 lacks
_pha-1_, and ECA36 has a mutated copy.

- Type `chrIII:11,100,001-11,145,000` into the location box and turn off the
  graph track, whose alleles here draw as one knot.
- Choose **Rows → Per haplotype**, so that each allele length takes a separate
  color.
- Right-click the record over _sup-35_ and _pha-1_ and pick **Sort rows by
  genotype here**.

<Figure caption="sup-35 and pha-1 with the callset sorted at its record over both genes, which groups the rows by allele. The callouts give the four shortest alleles' lengths. The rarest alleles share the last color: DL238's 6.5 kb, JU775's 48.6 kb and JU751's 85.3 kb." src="/img/pangenome/worm_sup35_pha1.png" />

Session spec, on config <https://jbrowse.org/code/jb2/main/test_data/graphgenomeview/pangenome_nonhuman.json>:

```json
{
  "views": [
    {
      "type": "LinearGenomeView",
      "id": "pangenome-worm_sup35_pha1-lgv",
      "assembly": "ce11",
      "loc": "chrIII:11,100,001-11,145,000",
      "tracks": [
        {
          "trackId": "ce11_ncbiRefSeq_ucsc",
          "height": 70
        },
        {
          "trackId": "celegans_pangenome_vcf",
          "height": 640,
          "sortRowsBy": {
            "refName": "chrIII",
            "pos": 11120000
          }
        }
      ]
    }
  ]
}
```

The shortest alleles are DL238's, ECA396's, XZ1516's and the one ECA36 shares
with QX1211. Liu and Zheng (2026) found _pha-1_ split in XZ1516.

## Check the sup-35 alleles against each strain's assembly

The callset's alleles come from `minigraph`'s alignment of each assembly to the
graph. We'll read the same locus from two more tracks, each with a lane per
strain: the strain's assembly aligned to ce11 by `minimap2`, an aligner other
than the graph's, and the strain's walk through the graph.

The `minimap2` track reads the alignments the
[assembly check](#check-the-assemblies-before-building-the-graph) makes. A
`MultiPairwiseSyntenyAdapter` lists one indexed PAF per strain, and the track's
`assemblyNames` are the lanes it opens with; the lane picker in its menu offers
the others. Three of the 39 strains:

```json
{
  "type": "SyntenyTrack",
  "trackId": "celegans_strains_vs_ce11",
  "name": "C. elegans strains vs ce11 (minimap2 -cx asm20)",
  "assemblyNames": ["ce11", "CB4856", "DL238", "QX1211"],
  "adapter": {
    "type": "MultiPairwiseSyntenyAdapter",
    "adapters": [
      {
        "type": "PairwiseIndexedPAFAdapter",
        "uri": "https://jbrowse.org/demos/celegans_pangenome/vsref/CB4856_vs_ce11.pif.gz",
        "csi": true,
        "assemblyNames": ["CB4856", "ce11"]
      },
      {
        "type": "PairwiseIndexedPAFAdapter",
        "uri": "https://jbrowse.org/demos/celegans_pangenome/vsref/DL238_vs_ce11.pif.gz",
        "csi": true,
        "assemblyNames": ["DL238", "ce11"]
      },
      {
        "type": "PairwiseIndexedPAFAdapter",
        "uri": "https://jbrowse.org/demos/celegans_pangenome/vsref/QX1211_vs_ce11.pif.gz",
        "csi": true,
        "assemblyNames": ["QX1211", "ce11"]
      }
    ]
  }
}
```

CLI:

```bash
jbrowse add-track-json '{
  "type": "SyntenyTrack",
  "trackId": "celegans_strains_vs_ce11",
  "name": "C. elegans strains vs ce11 (minimap2 -cx asm20)",
  "assemblyNames": ["ce11", "CB4856", "DL238", "QX1211"],
  "adapter": {
    "type": "MultiPairwiseSyntenyAdapter",
    "adapters": [
      {
        "type": "PairwiseIndexedPAFAdapter",
        "uri": "https://jbrowse.org/demos/celegans_pangenome/vsref/CB4856_vs_ce11.pif.gz",
        "csi": true,
        "assemblyNames": ["CB4856", "ce11"]
      },
      {
        "type": "PairwiseIndexedPAFAdapter",
        "uri": "https://jbrowse.org/demos/celegans_pangenome/vsref/DL238_vs_ce11.pif.gz",
        "csi": true,
        "assemblyNames": ["DL238", "ce11"]
      },
      {
        "type": "PairwiseIndexedPAFAdapter",
        "uri": "https://jbrowse.org/demos/celegans_pangenome/vsref/QX1211_vs_ce11.pif.gz",
        "csi": true,
        "assemblyNames": ["QX1211", "ce11"]
      }
    ]
  }
}'
```

The walk track reads the walk file, which lists each strain's route through the
graph. The rGFA has no path lines, so the build maps each assembly onto the
graph once more and turns each contig's alignments into walks, as
[Make the walk file](#make-the-walk-file) shows. `walksUri` is the file's
prefix, and `assemblyNameToPanSN` maps each lane to its walks' PanSN prefix:

```json
{
  "type": "GraphTrack",
  "trackId": "celegans_minigraph_walks",
  "name": "C. elegans strains through the pangenome, read from the walk file",
  "assemblyNames": ["ce11", "CB4856", "DL238", "QX1211"],
  "adapter": {
    "type": "GfaWalksSyntenyAdapter",
    "walksUri": "https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.ce11",
    "assemblyNames": ["ce11"],
    "assemblyNameToPanSN": {
      "ce11": "ce11#1",
      "CB4856": "CB4856#1",
      "DL238": "DL238#1",
      "QX1211": "QX1211#1"
    }
  },
  "displays": [
    { "type": "LinearGraphDisplay" },
    { "type": "MultiWaySyntenyDisplay" }
  ]
}
```

CLI:

```bash
jbrowse add-track-json '{
  "type": "GraphTrack",
  "trackId": "celegans_minigraph_walks",
  "name": "C. elegans strains through the pangenome, read from the walk file",
  "assemblyNames": ["ce11", "CB4856", "DL238", "QX1211"],
  "adapter": {
    "type": "GfaWalksSyntenyAdapter",
    "walksUri": "https://jbrowse.org/demos/celegans_pangenome/celegans-ce11-minigraph.ce11",
    "assemblyNames": ["ce11"],
    "assemblyNameToPanSN": {
      "ce11": "ce11#1",
      "CB4856": "CB4856#1",
      "DL238": "DL238#1",
      "QX1211": "QX1211#1"
    }
  },
  "displays": [
    { "type": "LinearGraphDisplay" },
    { "type": "MultiWaySyntenyDisplay" }
  ]
}'
```

- Turn on **C. elegans strains through the pangenome, read from the walk file**
  and pick **Display types → Multi-way synteny display** in its menu.
- Turn on **C. elegans strains vs ce11 (minimap2 -cx asm20)** below it. Both
  tracks open with a lane each for CB4856, DL238 and QX1211.

<Figure caption="sup-35 and pha-1 with CB4856, DL238 and QX1211 as lanes, read from the walk file (top) and from each assembly's minimap2 alignment (bottom). CB4856's lanes run straight through; DL238's headers read 36 kb replaced by 5.6 kb and 37 kb replaced by 6.4 kb." src="/img/pangenome/worm_sup35_lanes.png" />

Session spec, on config <https://jbrowse.org/code/jb2/main/test_data/graphgenomeview/pangenome_nonhuman.json>:

```json
{
  "views": [
    {
      "type": "LinearGenomeView",
      "id": "worm-sup35-lanes",
      "assembly": "ce11",
      "loc": "chrIII:11,100,001-11,145,000",
      "tracks": [
        {
          "trackId": "ce11_ncbiRefSeq_ucsc",
          "height": 90
        },
        {
          "trackId": "celegans_minigraph_walks",
          "type": "MultiWaySyntenyDisplay",
          "rows": {
            "sort": [
              "CB4856",
              "DL238",
              "QX1211"
            ]
          },
          "height": 290
        },
        {
          "trackId": "celegans_strains_vs_ce11",
          "type": "MultiWaySyntenyDisplay",
          "rows": {
            "sort": [
              "CB4856",
              "DL238",
              "QX1211"
            ]
          },
          "height": 290
        }
      ]
    }
  ]
}
```

CB4856 has ce11's allele in the callset, and both its lanes run collinear with
ce11. DL238's lanes are close in length to its 6.5 kb allele in the callset, and
neither aligns over _pha-1_.

The walk track also draws each route as a thread through the graph:

- Pick **Display types → Graph** in the walk file track's menu.
- Press the button beside **Haplotypes** in the track's key and check `ce11`,
  `CB4856`, `DL238` and `QX1211`.
- Open **Graph settings...** in the track's menu and set **Bubble spread** to
  **Compress lengths**.

<Figure caption="The four routes through sup-35 and pha-1 as threads, a color each. ce11's and CB4856's run together around the loop holding both genes; DL238's passes under it, and QX1211's leaves ce11's route for 27 kb, from Y48A6C.14 into the start of pha-1, then for 2 kb more inside pha-1." src="/img/pangenome/worm_sup35_threads.png" />

Session spec, on config <https://jbrowse.org/code/jb2/main/test_data/graphgenomeview/pangenome_nonhuman.json>:

```json
{
  "views": [
    {
      "type": "LinearGenomeView",
      "id": "pangenome-worm_sup35_threads-lgv",
      "assembly": "ce11",
      "loc": "chrIII:11,100,001-11,145,000",
      "tracks": [
        {
          "trackId": "ce11_ncbiRefSeq_ucsc",
          "height": 90
        },
        {
          "trackId": "celegans_minigraph_walks",
          "type": "LinearGraphDisplay",
          "layoutMode": "force",
          "walks": [
            {
              "walk": "ce11#1#chrIII"
            },
            {
              "walk": "CB4856#1#chrIII"
            },
            {
              "walk": "DL238#1#CAWUDZ010000003.1"
            },
            {
              "walk": "QX1211#1#CAWUEN010000003.1"
            }
          ],
          "bubbleSpread": "compress",
          "heightMode": "fit",
          "height": 560
        }
      ]
    }
  ]
}
```

Threads drawn side by side pass through the same segments, and a thread that
leaves the others passes through segments they skip. DL238's thread skips every
gene of the loop, _pha-1_ among them, as its 6.5 kb allele does in the callset.

## Find the strains without N2's retrotransposon in plg-1

Palopoli et al. (2008) found that males of many wild strains leave a gelatinous
plug over their mate's vulva and N2 males do not, because a Cer1 retrotransposon
sits in an exon of the mucin gene _plg-1_ in N2. They found it at the same site
and orientation in every non-plugging strain they examined, and inferred one
mutation that spread. ce11 has the Cer1, so the plugging strains have a deletion
in the callset.

- Type `chrIII:8,850,501-8,862,500` into the location box and turn the graph
  track back on.
- Right-click the record over _plg-1_ and pick **Sort rows by genotype here**.
- Choose **Rows → Per sample**.

<Figure caption="plg-1 with the callset sorted at the record over the Cer1, one row per strain: grey rows share N2's Cer1, blue rows lack it. On the graph track, the callout marks the Cer1, the arc over the short path the plugging strains take." src="/img/pangenome/worm_plg1.png" />

Session spec, on config <https://jbrowse.org/code/jb2/main/test_data/graphgenomeview/pangenome_nonhuman.json>:

```json
{
  "views": [
    {
      "type": "LinearGenomeView",
      "id": "pangenome-worm_plg1-lgv",
      "assembly": "ce11",
      "loc": "chrIII:8,850,501-8,862,500",
      "tracks": [
        {
          "trackId": "ce11_ncbiRefSeq_ucsc",
          "height": 70
        },
        {
          "trackId": "celegans_pangenome_vcf",
          "height": 640,
          "sortRowsBy": {
            "refName": "chrIII",
            "pos": 8857000
          },
          "rows": {
            "field": "sample"
          }
        },
        {
          "trackId": "celegans_minigraph_segments",
          "type": "LinearGraphDisplay",
          "layoutMode": "force",
          "encoding": {
            "color": {
              "field": "position"
            }
          },
          "bubbleSpread": "compress",
          "maxRegionBp": 13201,
          "height": 260
        }
      ]
    }
  ]
}
```

The record's two alternate alleles are both 1 bp, each stepping past the Cer1
from a different flanking segment, so both mean the strain lacks the
insertion.[^ju310]

To check one plugging strain against its own sequencing data, load MY2693's
Illumina and PacBio HiFi reads aligned to all of ce11, so that reads from Cer1
copies elsewhere in the genome land on those copies. One `minimap2` command
aligns each read set, and `samtools index reads.bam` indexes the result:

```bash
# -ax sr: paired short reads, as SAM; use -ax map-hifi for HiFi reads
minimap2 -ax sr ce11.fa reads_1.fastq reads_2.fastq | samtools sort -o reads.bam
```

Both tracks open as coverage with per-read arcs, which join a pair's mates or a
split read's pieces when they align far apart (**Read connections → Per-read
arcs**), and with the pileup hidden:

```json
{
  "type": "AlignmentsTrack",
  "trackId": "celegans_my2693_illumina",
  "name": "MY2693 Illumina reads (CaeNDR)",
  "assemblyNames": ["ce11"],
  "uri": "https://jbrowse.org/demos/celegans_pangenome/plg1_reads/MY2693_illumina.plg1.bam",
  "displayDefaults": {
    "height": 170,
    "pileup": { "show": false },
    "coverage": {
      "height": 60,
      "encoding": { "y": { "scale": { "domainMin": 0, "domainMax": 100 } } }
    },
    "readConnections": { "show": true, "mark": "link" }
  }
}
```

CLI:

```bash
jbrowse add-track https://jbrowse.org/demos/celegans_pangenome/plg1_reads/MY2693_illumina.plg1.bam \
  --trackId celegans_my2693_illumina \
  --name "MY2693 Illumina reads (CaeNDR)" \
  --assemblyNames ce11 \
  --displayDefaults '{"height":170,"pileup":{"show":false},"coverage":{"height":60,"encoding":{"y":{"scale":{"domainMin":0,"domainMax":100}}}},"readConnections":{"show":true,"mark":"link"}}'
```

Opens on config <https://jbrowse.org/ucsc/ce11/config.json> at `chrIII:8,850,501-8,865,000`

```json
{
  "type": "AlignmentsTrack",
  "trackId": "celegans_my2693_hifi",
  "name": "MY2693 PacBio HiFi reads",
  "assemblyNames": ["ce11"],
  "uri": "https://jbrowse.org/demos/celegans_pangenome/plg1_reads/MY2693_hifi.plg1.bam",
  "displayDefaults": {
    "height": 170,
    "pileup": { "show": false },
    "coverage": {
      "height": 60,
      "encoding": { "y": { "scale": { "domainMin": 0, "domainMax": 40 } } }
    },
    "readConnections": { "show": true, "mark": "link" }
  }
}
```

CLI:

```bash
jbrowse add-track https://jbrowse.org/demos/celegans_pangenome/plg1_reads/MY2693_hifi.plg1.bam \
  --trackId celegans_my2693_hifi \
  --name "MY2693 PacBio HiFi reads" \
  --assemblyNames ce11 \
  --displayDefaults '{"height":170,"pileup":{"show":false},"coverage":{"height":60,"encoding":{"y":{"scale":{"domainMin":0,"domainMax":40}}}},"readConnections":{"show":true,"mark":"link"}}'
```

The walk file track's graph opens cut for its four lanes, so cut it for ce11 and
MY2693 instead, then draw it as a tube map on reference, which runs each
strain's path as a tube through boxed segments at their ce11 positions, in line
with the reads:

- Type `chrIII:8,850,501-8,865,000` into the location box and turn on both read
  tracks and the walk file track.
- Open **Graph settings...** in the walk file track's menu and type
  `ce11#1, MY2693#1` under **Haplotypes**.
- Beside **Layout** in its key, open **more** and pick **Tube map on
  reference**.

<Figure caption="plg-1 with ce11's and MY2693's paths as tubes on ce11's coordinates, above MY2693's Illumina and HiFi reads. The long box on ce11's tube is N2's Cer1." src="/img/pangenome/worm_plg1_reads.png" />

Session spec, on config <https://jbrowse.org/code/jb2/main/test_data/graphgenomeview/pangenome_nonhuman.json>:

```json
{
  "views": [
    {
      "type": "LinearGenomeView",
      "id": "pangenome-worm_plg1_reads-lgv",
      "assembly": "ce11",
      "loc": "chrIII:8,850,501-8,865,000",
      "tracks": [
        {
          "trackId": "ce11_ncbiRefSeq_ucsc",
          "height": 70
        },
        {
          "trackId": "celegans_minigraph_walks",
          "type": "LinearGraphDisplay",
          "layoutMode": "tubemapref",
          "subgraphHaplotypes": [
            "ce11#1",
            "MY2693#1"
          ],
          "height": 220
        },
        {
          "trackId": "celegans_my2693_illumina",
          "height": 170
        },
        {
          "trackId": "celegans_my2693_hifi",
          "height": 170
        }
      ]
    }
  ]
}
```

MY2693's tube passes beneath the Cer1's segment without entering it, from one
end to the other, where the reads' coverage stops and starts again and the
per-read arcs land.

## Find the four-gene deletion beside glc-1

Ghosh et al. (2012) traced CB4856's resistance to abamectin to _glc-1_, a
glutamate-gated chloride channel subunit. O'Connor et al. (2026), in a preprint,
found that resistant strains other than ECA36 also lack four genes upstream of
_glc-1_: _F11A5.18_, _irld-26_, _oac-15_ and _F11A5.16_. ECA36 has all four
genes on a diverged sequence.

- Type `chrV:16,200,001-16,223,000` into the location box.
- Right-click the record over the four genes and pick **Sort rows by genotype
  here**.
- Choose **Rows → Per haplotype**, which tells the deletion from the strains
  that keep the genes on another path.

<Figure caption="glc-1 and the four genes upstream of it, with the callset sorted at the record over those genes: blue rows have the deletion, the other colors keep the genes on paths of their own. The callout on the graph track marks the path that skips them." src="/img/pangenome/worm_glc1.png" />

Session spec, on config <https://jbrowse.org/code/jb2/main/test_data/graphgenomeview/pangenome_nonhuman.json>:

```json
{
  "views": [
    {
      "type": "LinearGenomeView",
      "id": "pangenome-worm_glc1-lgv",
      "assembly": "ce11",
      "loc": "chrV:16,200,001-16,223,000",
      "tracks": [
        {
          "trackId": "ce11_ncbiRefSeq_ucsc",
          "height": 70
        },
        {
          "trackId": "celegans_pangenome_vcf",
          "height": 640,
          "sortRowsBy": {
            "refName": "chrV",
            "pos": 16207000
          }
        },
        {
          "trackId": "celegans_minigraph_segments",
          "type": "LinearGraphDisplay",
          "layoutMode": "force",
          "encoding": {
            "color": {
              "field": "position"
            }
          },
          "bubbleSpread": "compress",
          "maxRegionBp": 25301,
          "height": 260
        }
      ]
    }
  ]
}
```

CB4856 and JU751, both resistant in Ghosh et al. (2012), have the deletion, and
ECA36's allele keeps the genes.

## Check the assemblies before building the graph

We'll check each assembly before `minigraph` reads it, because a duplicated
contig in an input becomes a false allele in the callset. The inputs stay
unmasked, since `minigraph` needs no masking.

Two assemblies in the panel, JU310 and QX1794, hold some regions twice, as two
contigs each. purge_dups tells such a copy from a real duplication by read
depth, so it needs the reads the assembly was built from, mapped onto the
assembly:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# -x map-pb: PacBio CLR reads; map-hifi for HiFi
minimap2 -t 8 -x map-pb asm.fa reads.fa | gzip > reads.paf.gz
```

purge_dups then reads the depth, aligns the assembly to itself and marks the
duplicated stretches:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# pbcstat: per-base read depth (PB.base.cov) and its histogram (PB.stat)
pbcstat reads.paf.gz
# calcuts: the depth cutoffs, from the histogram
calcuts PB.stat > cutoffs
# split_fa: split the assembly at its gaps
split_fa asm.fa > split.fa
# -DP: all-vs-all, keeping every self-overlap
minimap2 -t 8 -x asm5 -DP split.fa split.fa | gzip > split.self.paf.gz
# -2: a second round of chaining, to catch duplicates split across contigs
purge_dups -2 -T cutoffs -c PB.base.cov split.self.paf.gz > dups.bed
# -e: remove duplicates at contig ends only, never splitting a contig;
#   writes purged.fa and the removed copies to hap.fa
get_seqs -e dups.bed asm.fa
```

The other checks start from each assembly's alignment to the reference, which is
also the alignment the `minimap2` lanes above draw:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# -x asm20: assembly to a reference up to about 20% divergent
# --secondary=no: each contig's best placement only
minimap2 -t 8 -cx asm20 --secondary=no ce11.fa asm.fa > asm.vsref.paf
```

From that alignment and an alignment of each assembly's contigs under 2 Mb to
the whole assembly, the build script drops:

- homopolymer contigs, under 5% or over 95% GC, found in some PacBio CLR
  assemblies
- mitochondrial contigs, which only some assemblies include, a few as
  concatemers
- contigs lying within a longer contig of the same assembly at 97% identity or
  more

`qc.dropped.tsv` beside the hosted files lists each dropped contig with its
reason.

## Build the C. elegans graph

We'll rename each assembly's sequences to PanSN, `sample#haplotype#contig`, so
the graph's segments name the strain they came from:

```bash
# prefix every sequence name in CB4856.fa with CB4856#1#
sed 's/^>/>CB4856#1#/' CB4856.fa > CB4856.pansn.fa
```

JBrowse and the callset below strip the reference's prefix from the graph's
sequence names, and the names left (`chrI`) must be sequence names or aliases of
the JBrowse assembly. The build script renames from each assembly's NCBI
sequence report, so the reference's chromosomes read `chrI` to `chrX` and
`chrM`, and a contig-level assembly's contigs keep their GenBank accessions.

One `minigraph` run builds the graph over every chromosome at once, reference
first so that its segments take rank 0, the earliest build order:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# -xggs: incremental graph construction, adding each genome in turn
# -c: base-level alignment, which minigraph recommends for graph generation
minigraph -cxggs -t 8 ce11.pansn.fa CB4856.pansn.fa KR314.pansn.fa ... JU1395.pansn.fa > worm.rgfa
```

`gfa-to-tabix` and `minigraph --call` read the graph bgzipped, and `gfatools`
reads it plain:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# -k: keep worm.rgfa beside worm.rgfa.gz
bgzip -k worm.rgfa
```

Three commands then write the files the tracks read. `gfa-to-tabix` writes the
segment and link index, with each segment at its coordinate on the reference:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# --layout contig: each segment at its SN/SO coordinate; writes
#   worm.graph.bed.gz and its .tbi
gfa-to-tabix worm.rgfa.gz --layout contig -o worm
```

The bubbles come from gfatools:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
gfatools bubble worm.rgfa | sort -k1,1 -k2,2n | bgzip > worm.bubbles.bed.gz
tabix -C -p bed worm.bubbles.bed.gz
```

The overview folds every variant under 10 kb into the reference, for whole
chromosomes:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# --below: the size to fold under; --layout matches the index's
gfa-to-tabix fold worm.rgfa.gz --below 10000 --layout contig -o worm.fold10000
```

## Make the callset

The callset comes from mapping each assembly back onto the graph, whose rGFA
holds no path lines. `minigraph --call` writes the walk one assembly takes
through every bubble. Run it once per assembly, the reference included, since
the merge below reads the reference's own call as allele 0:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# -c: base-level alignment, which --call reads
# -xasm: the assembly-to-graph preset
# --call: one line per bubble, in the same order for every assembly
minigraph -cxasm --call -t 8 worm.rgfa.gz CB4856.pansn.fa > CB4856.call.bed
```

Two scripts in minigraph's
[`misc/`](https://github.com/lh3/minigraph/tree/master/misc) folder, which the
bioconda package leaves out, merge the calls into a VCF. We'll fetch them at the
revision the hosted callset was built with:

```bash
MGUTILS=https://raw.githubusercontent.com/lh3/minigraph/2f569ebe3071fcb242f1bf0eabbb917941b47239/misc
curl -fsSL -o mgutils.js "$MGUTILS/mgutils.js"
curl -fsSL -o mgutils-es6.js "$MGUTILS/mgutils-es6.js"
```

`merge2vcf` copies the `##` lines of its input into the VCF header. Those lines
go in `header.txt`: a `##contig` line per reference chromosome, and the `END`
and `AN` tags `merge2vcf` writes without declaring them, which
`bcftools view -s` otherwise stops on with "Undefined tags in the header".
`ref.chrom.sizes` lists each reference chromosome's name, as the VCF spells it,
and its length:

```bash
# UCSC's ce11 names and lengths, which the RefSeq sequences match
curl -fsSL -o ref.chrom.sizes https://jbrowse.org/ucsc/ce11/ce11.chrom.sizes
```

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
{
  awk '{ printf "##contig=<ID=%s,length=%d>\n", $1, $2 }' ref.chrom.sizes
  echo '##INFO=<ID=END,Number=1,Type=Integer,Description="End of the bubble">'
  echo '##INFO=<ID=AN,Number=1,Type=Integer,Description="Number of called alleles">'
} > header.txt
```

`mgutils.js merge` pastes the call files into one row per bubble, behind the
header:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# samples.txt: one name per line, in the order of the call files, the
#   reference's first
# sed: drop the PanSN prefix on the graph's sequence names, so CHROM is chrI
paste ce11.call.bed CB4856.call.bed KR314.call.bed \
  | k8 mgutils.js merge -s samples.txt - \
  | sed 's/^ce11#1#//' | cat header.txt - > merged.bed
```

`mgutils-es6.js merge2vcf` turns that into the VCF, with the reference's column
as allele 0:

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# -r0: the first column is the reference
# -a: the most alternate alleles a record lists, here one per assembly; a
#   smaller cap merges the rarer alleles into the last one
# annotate --set-id: the bubble's end segments as the record ID
# view -i: keep the records where the reference's own call is allele 0
# view -s ^ce11: drop the reference's own column
k8 mgutils-es6.js merge2vcf -r0 -a "$(wc -l < samples.txt)" merged.bed \
  | bcftools annotate --set-id '%INFO/VS%INFO/VE' -Ou \
  | bcftools view -i 'GT[0]="ref"' -Ou \
  | bcftools view -s ^ce11 -Ou \
  | bcftools sort -Oz -o worm.vcf.gz
tabix -p vcf worm.vcf.gz
```

A strain whose assembly has no contig across a bubble gets a no-call there.

## Make the walk file

The walk file comes from one more mapping of each assembly onto the graph.
`--vc` writes each alignment's path as segment ids, and `gfa-to-tabix from-gaf`
turns each contig's alignments into walks. A walk starts where the alignment
puts its first node, its other nodes follow by their lengths, and it ends where
the contig and the graph part by more than 1 kb, so no node sits more than 1 kb
from where the alignment puts it.

<!-- from: scripts/build_celegans_pangenome.sh -->

```bash
# --vc: the path as segment ids, which from-gaf reads
minigraph -cxasm --vc -t 8 worm.rgfa.gz CB4856.pansn.fa > CB4856.gaf
# one GAF per assembly, the reference left out: its walk comes from the
# rGFA's own tags
gfa-to-tabix from-gaf worm.rgfa.gz CB4856.gaf DL238.gaf -o walks.gfa.gz
# --walks: write worm.ce11.walks.gz and its index, in ce11's coordinates
gfa-to-tabix walks.gfa.gz --walks --refs ce11 -o worm
```

## Reproduce it end to end

[`build_celegans_pangenome.sh`](https://github.com/GMOD/jbrowse-components/blob/main/scripts/build_celegans_pangenome.sh)
runs every step on this page. It runs on Linux, since it needs GNU tools, and
takes about four hours with `THREADS=16`: an hour of `minigraph`, an hour and a
half of calls, most of an hour mapping the assemblies again for the walk file,
and the purge, which downloads 12 GB of PacBio reads. The script:

- downloads ce11 and one assembly per wild isotype from NCBI with their sequence
  reports, and renames their sequences to PanSN
- purges JU310 and QX1794 with their reads, drops homopolymer, mitochondrial and
  contained contigs from every assembly, and stops unless each is 95 to 110 Mb
- builds the graph and stops if a segment's `SN` tag is not a PanSN name, if a
  segment id repeats, or if the rank-0 segments are not ce11's seven sequences
  at their full length
- writes the segment index, the bubbles and the overview, then maps each
  assembly back onto the graph and merges the calls into the callset
- maps each assembly onto the graph once more for the walk file, and indexes the
  assembly check's minimap2 alignments as lanes

```bash
curl -fO https://raw.githubusercontent.com/GMOD/jbrowse-components/main/scripts/build_celegans_pangenome.sh
bash build_celegans_pangenome.sh celegans_pangenome   # writes ./celegans_pangenome/
```

Point each track's `uri` at the files it writes to open your own run.

[`build_celegans_plg1_reads.sh`](https://github.com/GMOD/jbrowse-components/blob/main/scripts/build_celegans_plg1_reads.sh)
makes the two read tracks at _plg-1_. It downloads about 9 GB of MY2693's reads,
then aligns them in about ten minutes with `THREADS=22`. The script:

- downloads ce11 and MY2693's Illumina and HiFi runs from the SRA
- aligns each read set to all of ce11 with `minimap2`
- keeps the reads in a 120 kb window around _plg-1_ and indexes them

```bash
curl -fO https://raw.githubusercontent.com/GMOD/jbrowse-components/main/scripts/build_celegans_plg1_reads.sh
bash build_celegans_plg1_reads.sh celegans_plg1_reads   # writes ./celegans_plg1_reads/
```

## See also

- **Tutorial:** [Pangenome (fly)](https://jbrowse.org/jb2/docs/tutorials/pangenome_fly)
- **Tutorial:** [Pangenome (rice)](https://jbrowse.org/jb2/docs/tutorials/pangenome_rice)
- **Tutorial:** [Pangenome (hosting your own graph)](https://jbrowse.org/jb2/docs/tutorials/pangenome_prepare_graph)

## Citations

- Li et al. (2020).
  [The design and construction of reference pangenome graphs with minigraph](https://doi.org/10.1186/s13059-020-02168-z)
- Guan et al. (2020).
  [Identifying and removing haplotypic duplication in primary genome assemblies](https://doi.org/10.1093/bioinformatics/btaa025)
- Lee et al. (2021).
  [Balancing selection maintains hyper-divergent haplotypes in Caenorhabditis elegans](https://doi.org/10.1038/s41559-021-01435-x)
- Seidel et al. (2008).
  [Widespread genetic incompatibility in C. elegans maintained by balancing selection](https://doi.org/10.1126/science.1151107)
- Seidel et al. (2011).
  [A novel sperm-delivered toxin causes late-stage embryo lethality and transmission ratio distortion in C. elegans](https://doi.org/10.1371/journal.pbio.1001115)
- Palopoli et al. (2008).
  [Molecular basis of the copulatory plug polymorphism in Caenorhabditis elegans](https://doi.org/10.1038/nature07171)
- Blevins et al. (2026).
  [A male expressed copulatory plug increases female fertility in Caenorhabditis nematodes](https://doi.org/10.64898/2026.06.29.735219)
  (preprint)
- Ben-David et al. (2017).
  [A maternal-effect selfish genetic element in Caenorhabditis elegans](https://doi.org/10.1126/science.aan0621)
- Liu and Zheng (2026).
  [sept-1/zina-1 is an ancient toxin-antidote system in Caenorhabditis elegans](https://doi.org/10.1371/journal.pbio.3003563)
- Ghosh et al. (2012).
  [Natural variation in a chloride channel subunit confers avermectin resistance in C. elegans](https://doi.org/10.1126/science.1214318)
- O'Connor et al. (2026).
  [The Caenorhabditis elegans pangenome elucidates hyper-divergent region gene content to reveal extensive gene copy-number variation and a novel anthelmintic resistance locus](https://doi.org/10.64898/2026.11.17.767430)
  (preprint)

[^ju310]:
    JU310's assembly has the whole Cer1 within one contig, flanks included,
    while Blevins et al. (2026) call JU310 plugging from short reads.

