Skip to content

Ultima Genomics support (#166) - #171

Merged
theontho merged 3 commits into
mainfrom
ultima-support
Oct 27, 2026
Merged

theontho merged 3 commits into
mainfrom
ultima-support

Conversation

@theontho

Copy link
Copy Markdown
Owner

Closes #166.

Ultima Genomics (UG 100) reads come from MyHeritage's low-pass WGS and Nebula/DNA360's 30x. They are single-end, ~300 bp, and their errors are mostly homopolymer lengths. Each read carries flow-space probabilities in tp/t0 tags, and its read group has PL:ULTIMA and the flow order (FO). Ultima's and Broad's pipelines need those to call well. WGS Extract now recognizes Ultima data and keeps that information through the whole pipeline.

Detection: an Ultima read group (PL:ULTIMA), or --platform ultima (needed for SRA FASTQs, which have neither). info recognizes Ultima read names.

align / realign:

  • Aligns with BWA-MEM (-Y), as Ultima's and Broad's pipelines do. --gpu, minimap2/pbmm2 and --r2 are refused.
  • tp/t0 ride in the FASTQ comment (samtools fastq -T → bwa -C). A streaming filter reverses them on reverse-strand reads before and after BWA; Picard's ATTRIBUTE_TO_REVERSE does this in Ultima's pipeline, and samtools reset doesn't.
  • Read groups (with the flow order) are kept via bwa -H. realign streams the BAM/CRAM into BWA without writing FASTQs.
  • Duplicates are marked with GATK MarkDuplicates --FLOW_MODE, using Ultima's flags. Without GATK it falls back to samtools markdup and warns.

Callers:

  • vcf snp/indel use bcftools' -X ultima profile and call's default prior. WGS Extract's -P 0 more than halved Ultima indel precision (0.13 vs 0.29 on a chr20 slice).
  • vcf gatk uses --flow-mode ADVANCED.
  • vcf deepvariant uses the ULTIMA model from Google's experimental google/deepvariant:gh1100-ultima image (Support Ultima sequencing data google/deepvariant#1100), configurable as deepvariant_ultima_image.
  • vcf freebayes and the GPU HaplotypeCaller warn. GPU DeepVariant refuses Ultima reads.

bam to-ubam keeps tp, t0, tm, rq and a3 in read orientation.

Example genomes: GIAB HG008 Ultima data (an SRA FASTQ, and the 234x GRCh38 CRAM, which samtools can read over HTTPS by region).

Validation (real data)

GIAB HG008-N-D, whole chr20. Ultima's CRAM was downsampled to ~30x and run through realign to hs38DH's chr20, then each caller. The comparison set is the same tissue's Illumina BAM (~40x, bcftools). Both are scored inside GIAB's "not in any difficult region" stratification (50.8 Mb). Alleles and genotype class must match.

Caller on Ultima reads SNP P SNP R SNP F1 Indel P Indel R Indel F1
bcftools (-X ultima) 0.998 0.994 0.996 0.354 0.984 0.520
GATK --flow-mode ADVANCED 0.985 0.996 0.991 0.396 0.971 0.563
DeepVariant ULTIMA 0.997 0.994 0.995 0.969 0.950 0.959

Also checked:

  • Flow tags after realign match the input exactly: 349k reads, 0 mismatches; reverse-strand reads are flipped correctly.
  • tm/a3 tag counts are preserved.
  • Ultima's DeepVariant pipeline keeps duplicates; duplicate flags made no difference to any caller here.
  • The full unit suite passes (1935 passed). New tests are in tests/test_ultima.py, including real BWA + GATK flow-mode runs.

A whole-genome realign wasn't run: on the shared 8-core host it would take about a day. Whole chr20 at production depth exercised the same code paths.

MyHeritage's 2x low-pass data is too shallow for reliable genotypes without imputation, which is out of scope (noted in the README).

Mac McDonald and others added 2 commits October 26, 2026 22:42
Ultima UG 100 reads (MyHeritage and Nebula/DNA360 WGS) are recognized from
their read group (PL:ULTIMA) or --platform ultima, and keep their flow-space
data through alignment:

- align/realign: BWA-MEM -Y, with tp/t0 carried in the FASTQ comment and
  reversed for reads that change strand (samtools doesn't); read groups and
  the flow order kept; duplicates marked with GATK MarkDuplicates' flow mode.
  realign streams the BAM/CRAM into BWA without FASTQs. --gpu is refused.
- vcf snp/indel: bcftools' -X ultima profile and its default call prior
  (-P 0 more than halved Ultima indel precision); vcf gatk: --flow-mode
  ADVANCED; vcf deepvariant: the ULTIMA model from Google's experimental
  image (deepvariant_ultima_image); freebayes warns.
- bam to-ubam keeps tp, t0, tm, rq, a3 in read orientation.
- info recognizes Ultima read names; example-genome lists GIAB HG008 Ultima
  data.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a3eb6270-3c55-425b-b34b-2cb2e5dfd2f9
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a3eb6270-3c55-425b-b34b-2cb2e5dfd2f9
Copilot AI balanced review requested due to automatic review settings October 27, 2026 05:45
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Ultima handling can incorrectly reverse read-oriented flow arrays and overlook valid FASTQ comment tags, misassigning probabilities to bases or silently dropping flow metadata.

2 open issues
What changed in this PR

Adds Ultima Genomics support across alignment, variant calling, and uBAM conversion, addressing #166 with platform-specific processing and public example datasets.

Changes:

  • Detects Ultima reads and adds BWA alignment with flow-tag preservation and flow-aware duplicate marking.
  • Selects Ultima-specific caller settings and documents unsupported GPU paths.
  • Adds regression tests, GIAB examples, usage guidance, and chr20 validation results.
File Description
tests/​test_ultima.py Tests detection, flow tags, alignment, and model selection.
src/​wgsextract_cli/​core/​ultima.py Adds shared Ultima detection and flow-tag utilities.
src/​wgsextract_cli/​core/​constants.py Recognizes Ultima read names.
src/​wgsextract_cli/​core/​config.py Adds the Ultima DeepVariant image setting.
src/​wgsextract_cli/​commands/​vcf/​deepvariant.py Selects the ULTIMA model and experimental image.
src/​wgsextract_cli/​commands/​vcf/​callers.py Enables GATK flow mode and caller warnings.
src/​wgsextract_cli/​commands/​vcf/​basic.py Applies Ultima bcftools settings and default prior.
src/​wgsextract_cli/​commands/​vcf/​__init__.py Exposes the ULTIMA model option.
src/​wgsextract_cli/​commands/​realign.py Detects Ultima inputs and streams realignment.
src/​wgsextract_cli/​commands/​align.py Adds Ultima alignment and duplicate marking.
src/​wgsextract_cli/​commands/​_microarray_vcf.py Applies the Ultima profile to microarray calling.
src/​wgsextract_cli/​commands/​_examples_catalog.py Adds public GIAB Ultima FASTQ and CRAM examples.
src/​wgsextract_cli/​commands/​_bam_ubam.py Preserves Ultima tags during uBAM conversion.
site_src/​workflows.md Documents Ultima alignment workflows.
README.md Summarizes support, limitations, and validation results.

Review effort: Balanced

Comment thread src/wgsextract_cli/commands/align.py
Comment thread src/wgsextract_cli/core/ultima.py Outdated
…t space-separated FASTQ tags

The flip filter now reads the stream's @rg lines and turns tp/t0 around only
for reads whose read group says tp:reference (Ultima's default), as Ultima's
and Broad's pipelines do; tp:read groups are left alone. A FASTQ comment after
a space, not only a tab, counts as carrying flow tags.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a3eb6270-3c55-425b-b34b-2cb2e5dfd2f9
@theontho
theontho merged commit 06e3aee into main Oct 27, 2026
17 checks passed
@theontho
theontho deleted the ultima-support branch October 27, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ultima Genomics support

2 participants