Skip to content

new vg combine, adding new options#4965

Open
xinzilan wants to merge 1 commit into
masterfrom
new_vg_combine
Open

new vg combine, adding new options#4965
xinzilan wants to merge 1 commit into
masterfrom
new_vg_combine

Conversation

@xinzilan

Copy link
Copy Markdown

Changelog Entry

To be copied to the draft changelog by merger:

  • vg combine gained options for stitching chunked assemblies and graphs: -f/--connect-fragments (now the default mode), -s/--shared-nodes, -m/--merge, and -u/--fusion.

Description

This PR adds four new options to vg combine to support our chunked-assembly stitching workflow.

  • -f/--connect-fragments (default mode): Treats paths that share the same sample/locus/haplotype/phase block but differ only by subrange — e.g. CHM13#0#chr22 and CHM13#0#chr22[17475777] — as fragments of one path. It sorts the fragments by start offset, concatenates them in order, adds the missing inter-fragment edges, and rewrites the path name to a single [start-end] subrange covering the union. This runs by default whenever none of -c/-p/-m is given.

  • -s/--shared-nodes: Modifies the default (-f) mode so node IDs are not renumbered when merging. Node IDs appearing in both inputs must carry the same sequence; one copy is kept. This is intended for vg chunk output that shares boundary nodes across chunks, where the graph (rather than the assembly) was chunked. Fragments are merged into one path, trimming duplicated boundary steps. Valid only with the default mode; cannot be combined with -c/-p/-m.

  • -m/--merge: Overlap-aware stitching for chunked-assembly graphs that share REFERENCE-sense paths (e.g. CHM13#0#chr22). Inputs are bucketed by REFERENCE identity (sample/locus/haplotype), so chunks of different chromosomes (e.g. CHM13#0#chr21 and CHM13#0#chr22) can be passed together — each reference is stitched independently and kept as a separate path in the output. Within a reference, it sorts inputs by REFERENCE start offset, validates that each chunk boundary is a single chain node shared by every path (and equal to the REFERENCE end), trims each right chunk's leading node by the REFERENCE-offset overlap, connects the left end to the trimmed right start, then merges fragments like -f.

  • -u/--fusion (requires -m): Instead of adding an edge between the left end node and the right chunk's trimmed start node, fuses them into a single node carrying the concatenated sequence.

@faithokamoto

Copy link
Copy Markdown
Contributor

Are we ready to remove vg concat, then? #4932 (comment)

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.

3 participants