Skip to content

Add SPQR metadata and binary indexing - #7

Draft
CMoumard wants to merge 24 commits into
mainfrom
spqri-index
Draft

Add SPQR metadata and binary indexing#7
CMoumard wants to merge 24 commits into
mainfrom
spqri-index

Conversation

@CMoumard

Copy link
Copy Markdown
Collaborator

BubbleFinder already writes the .spqr v0.4 format described in the
SPQR tree file format specification.
Until now, it was mainly an output file. The SPQR decomposition was there, but
some details needed to safely use it again for bubble computation were lost.

This adds two BubbleFinder extension lines to the text format:

  • X GRAPH_PROFILE ... records which graph representation was used before
    building the decomposition. A raw graph, a subdivided graph and an oriented
    doubled graph cannot be interpreted in the same way when loaded back.
  • X BF_EDGE_TYPE ... keeps the + or - type at both ends of a real edge.
    This information cannot always be recovered from the SPQR tree alone.

The regular v0.4 records are still written in the same way. These extra lines
are here so a .spqr can be loaded again without guessing how its graph was
built.

For large files, reading the text and rebuilding all the lookup tables still
takes time. .spqri is the binary indexed form added for this case. It stores
the decomposition in flat, typed sections, together with the indexes needed
to use it directly in RAM. Graph topology, node names and haplotype paths can
also be kept when they are available. Sections can be compressed separately
and read in parallel.

This stays structural data. A .spqri file does not contain snarls,
superbubbles, ultrabubbles or any other computed result.

The index is optional. BubbleFinder can build one from a .spqr, write one
directly while computing the SPQR tree, or keep using the normal graph and
.spqr paths without an index.

@CMoumard CMoumard added the enhancement New feature or request label Jul 15, 2026
@CMoumard CMoumard self-assigned this Jul 15, 2026
@CMoumard
CMoumard force-pushed the spqri-index branch 4 times, most recently from c57700e to 481e0e0 Compare July 24, 2026 14:54
@CMoumard
CMoumard force-pushed the spqri-index branch 8 times, most recently from 8d3d1cc to 856e7c4 Compare July 25, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant