Skip to content

Indexing

CormacKinsella edited this page Sep 9, 2025 · 7 revisions

Haplotype sampling mode

In this mode, 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. 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

vg gbwt

Produces r-index file.

Usage: vg gbwt [options] [args]

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, .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

vg minimizer

Produces .min index.

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

Clone this wiki locally