Skip to content

Indexing

CormacKinsella edited this page Jan 30, 2026 · 7 revisions

Unfiltered graph mode

In this mode (--reference_type unfiltered_graph), a .hapl index will be created for the graph. During the mapping step, this will be used in the production of subsampled graphs appropriate for each sample (ancient vs. modern). Indexing of the subsampled graphs (to produce .dist and .min indexes) is done as part of the mapping module.

vg index

Produces .dist index.

Usage: vg index [options] <graph1.vg> [graph2.vg ...]

Example grave command:

vg index --threads ${task.cpus} ${args} --dist-name ${distname} ${graph}

  • ${args} set by --noNestedDistance, if true provides --no-nested-distance to vg index, & vg index will produce a limited distance index. This should only be set if users run into memory issues with complex graphs, and is mainly intended for debugging purposes

vg gbwt

Produces r-index file.

Usage: vg gbwt [options] [args]

Example grave command: vg gbwt --num-threads ${task.cpus} --r-index ${rindexname} --gbz-input ${graph}

vg haplotypes

Produces the .hapl index. Logic uses the ${types} variable, which is set based on the contents of the samplesheet (i.e., only ancient samples = ancient, only modern samples = modern, a mix = both). Based on this, only the required indexes will be built.

Usage: vg haplotypes [options] -H output.hapl graph.gbz

Example grave command:

vg haplotypes --threads ${task.cpus} --verbosity 2 --kmer-length ${params.aDNAkmerHaplSubSam} --window-length ${params.aDNAwindowHaplSubSam} --haplotype-output ${ahaplname} ${graph}

Filtered graph mode

In this mode (--reference_type filtered_graph), .dist and .min indexes are made for the input graph and used for the mapping.

vg index

Produces .dist index.

Usage: vg index [options] <graph1.vg> [graph2.vg ...]

Example grave command:

vg index --threads ${task.cpus} ${args} --dist-name ${distname} ${graph}

  • ${args} set by --noNestedDistance, if true provides --no-nested-distance to vg index, & vg index will produce a limited distance index. This should only be set if users run into memory issues with complex graphs, and is mainly intended for debugging purposes

vg minimizer

Produces .min index. Logic uses the ${types} variable, which is set based on the contents of the samplesheet (i.e., only ancient samples = ancient, only modern samples = modern, a mix = both). Based on this, only the required indexes will be built.

Usage: vg minimizer [options] -d graph.dist -o graph.min graph

Example grave command:

vg minimizer --threads ${task.cpus} --kmer-length ${params.aDNAkmerMinimizer} --window-length ${params.aDNAwindowMinimizer} --distance-index ${basename}.dist --output-name ${basename}.adna.min ${graph}

Snarl computation

Graph snarls are computed once, and only if required by workflow settings, i.e., either vg deconstruct is set to output variants found in the graph as VCF, and/or vg call is set to genotype mapped sample against graph variants.

vg snarls

Produces .snarls file.

Usage: vg snarls [options] graph > snarls.pb

Example grave command:

vg snarls -t ${task.cpus} --include-trivial ${graph} > ${graph}.snarls

  • --include-trivial report snarls that consist of a single edge (implied snarls between boundary nodes), read more here

Clone this wiki locally