BED Track Not Rendering Correctly in LocusZoom

19 views
Skip to first unread message

Orod Razeghi

unread,
Dec 8, 2025, 12:39:02 PM12/8/25
to locuszoom
Hi team,

I'm running into an issue with displaying a BED track in LocusZoom, and I’d appreciate your help troubleshooting.

I’ve added a BED12 track using `TabixUrlSource` and the built-in `bed_intervals` panel layout. However, the track either displays only very small intervals or doesn’t render anything at all. I’m not sure whether the issue is with how the BED file is formatted, how it’s being parsed by `makeBed12Parser({ normalize: true })`, or if LocusZoom expects additional required fields.

Here is the BED entry I’m testing with:

```
chr1    173384827    173399827    .    0    .    173384827    173399827    255,0,0
```

(15 kb interval)

And here is how I generated and indexed the file:

```python
bed = pd.DataFrame([
    [1, 173384827, 173384827+15000, '.', 0, '.', 173384827, 173384827+15000, '255,0,0'],
], columns=['chr', 'start', 'end', 'state', 'value', 'strand', 'thickStart', 'thickEnd', 'itemRgb'])
bed.to_csv('data/test.bed', sep='\t', index=False, header=False)

# Sort → bgzip → tabix index
sort -k1,1 -k2,2n data/test.bed > data/test.sorted.bed
bgzip data/test.sorted.bed
tabix -p bed data/test.sorted.bed.gz
```

And the corresponding data source:

```javascript
    const bedParser = LzParsers.makeBed12Parser({normalize: true});

    // Define data sources
    const data_sources = new LocusZoom.DataSources()
      .add("assoc", ["TabixUrlSource", {
        url_data: 'data/gwas_data_for_locuszoom.txt.gz',
        parser_func: gwasParser,
        overfetch: 0,
      }])
      .add("ld", ["LDServer", { url: "https://portaldev.sph.umich.edu/ld/", source: '1000G', population: 'ALL', build: build }])
      .add("recomb", ["RecombLZ", { url: apiBase + "annotation/recomb/results/", build: build }])
      .add("constraint", ["GeneConstraintLZ", { url: "https://gnomad.broadinstitute.org/api/", build: build }])
      .add("gene", ["GeneLZ", { url: apiBase + "annotation/genes/", build: build }])
      .add("intervals", ["TabixUrlSource", {
        // This annotation track is courtesy of the CMDGA: https://cmdga.org/annotations/DSR953RQL/
        url_data: 'data/test.bed.gz',
        //url_data:  'https://locuszoom-web-demos.s3.us-east-2.amazonaws.com/tabix-demo/DFF622JQK.bed.bgz',
        parser_func: bedParser,
        overfetch: 0.0,
        build: build
      }])

    // Get the standard assocation plot layout from LocusZoom's built-in layouts
    var layout = LocusZoom.Layouts.get("plot", "standard_association", {
      state: {
        chr: "1",
        start: 173384827 - 250000,
        end: 173384827 + 250000,
        genome_build: build,
        ldrefvar: '1:173384827_T/C'
      },
      panels: [
        LocusZoom.Layouts.get('panel', 'association', { title: { text: "GWAS" } }),
        LocusZoom.Layouts.get('panel', 'bed_intervals', { title: { text: "Humpy" } }),
        LocusZoom.Layouts.get('panel', 'genes', { show_transcripts: true })
      ],
    });

    // Generate the LocusZoom plot
    window.plot1 = LocusZoom.populate("#lz-plot1", data_sources, layout);
```

Despite this, the interval doesn’t reliably show up in the “bed_intervals” panel.

Could someone confirm:

1. **What exact BED fields LocusZoom requires for BED12?** (e.g., blockCount, blockSizes, blockStarts—are these required for intervals to show?)
2. **Does `makeBed12Parser({ normalize: true })` expect all 12 columns, or is BED9 acceptable?**
3. **Is there a recommended minimal BED format for simple intervals (no exon structure)?**
4. **Any examples of known-working BED files for the “bed_intervals” track?**

Thanks in advance — I’m likely missing something small, and any guidance would be greatly appreciated.

Best,
Orod
Reply all
Reply to author
Forward
0 new messages