JBrowse 2 · Linear Genome View examples

Variant sample rows

One row per sample, colored by a samples TSV column.

rows.color is a config setting, read once when sources load, so it goes in displayDefaults, which lands on the display’s config, rather than on the view.tracks entry.

Show source · 32 linesHide source · 32 lines
import { LinearGenomeView } from '@jbrowse/react-linear-genome-view2'

export default function MultiSampleVariants() {
  return (
    <LinearGenomeView
      assembly={{
        name: 'volvox',
        uri: 'https://jbrowse.org/genomes/volvox/volvox.2bit',
      }}
      tracks={[
        {
          type: 'VariantTrack',
          trackId: 'volvox_multisample_sv',
          name: 'volvox multi-sample SV',
          assemblyNames: ['volvox'],
          adapter: {
            type: 'VcfTabixAdapter',
            uri: 'https://jbrowse.org/code/jb2/main/test_data/volvox/volvox.sv.vcf.gz',
            samplesTsvLocation: {
              uri: 'https://jbrowse.org/code/jb2/main/test_data/volvox/volvox.sv.samples.tsv',
            },
          },
          displayDefaults: { rows: { color: 'population' } },
        },
      ]}
      view={{
        loc: 'ctgA:1..50,000',
        tracks: ['volvox_multisample_sv'],
      }}
    />
  )
}