-
Notifications
You must be signed in to change notification settings - Fork 0
Pangenome map
The steps performed for filtered graphs are all included in the more complex haplotype sampling workflow, therefore refer to the specific commands below for information.
Note that only filtered graphs should be used for running aDNA samples. Unfiltered graphs are preferred for highly pure, modern samples (however, filtered graphs will perform fine for both sample categorites).
In unfiltered graph mode, a subset of paths (haplotypes) are extracted from the pangenome graph to create a personalised pangenome reference for each library. This uses k-mer profiles from the reads, and thus should not be used for aDNA samples.
Indexing and mapping settings differ for ancient vs. modern samples, due to the shorter reads in aDNA libraries.
Counts k-mers in FASTQ files to inform haplotype subsampling.
Usage:
kmc [options] <input_file_name> <output_file_name> <working_directory>
Example grave command:
kmc -k${params.aDNAkmerHaplSubSam} -ci${params.kffKmerMinimum} -t${task.cpus} -m${memory} -sm -fq -okff ${reads} ${meta.read_group} .
-
-kk-mer value appropriate to read type (applied automatically based on sample metadata) -
-ciexclude k-mers occurring less than times -
-tthreads -
-mmemory -
-smenforce strict memory -
-fqfastq inputs -
-okff output
Generates the subsampled graph using the k-mer profile. Uses the pre-generated .hapl index rather than auto-generating one, to ensure parameters are also set appropriately for the given sample type.
Usage:
vg haplotypes [options] -i graph.hapl -k kmers.kff -g output.gbz graph.gbz
Example grave command:
vg haplotypes --threads ${task.cpus} --verbosity 2 --include-reference --diploid-sampling --haplotype-input *.adna.hapl --kmer-input ${meta.read_group}.kff --gbz-output ${basename}.${meta.read_group}.gbz ${graph}
-
--include-referenceinclude named and reference paths in the output -
--diploid-samplingchoose the best pair from the sampled haplotypes -
--haplotype-inputpre-generated .hapl index -
--kmer-inputk-mer profile from the sample -
--gbz-outputoutput graph name
Produces .dist index for the subsampled graph.
Usage:
vg index [options] <graph1.vg> [graph2.vg ...]
Example grave command:
vg index --threads ${task.cpus} --dist-name ${basename}.${meta.read_group}.dist ${basename}.${meta.read_group}.gbz
Produces .min index for the subsampled graph.
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}.${meta.read_group}.dist --output-name ${basename}.${meta.read_group}.min ${basename}.${meta.read_group}.gbz
Maps library reads to the subsampled graph, producing a GAM file output. Instead of using the standard workflow with auto index generation, we supply the custom indexes. For ancient samples mapping parameters are modelled after bwa aln settings. For modern samples, settings are modelled after bwa mem.
Usage:
vg giraffe -Z graph.gbz [-d graph.dist [-m graph.withzip.min -z graph.zipcodes]] <input options> [other options] > output.gam
Example grave command:
vg giraffe --progress --mismatch 3 --gap-open 11 --gap-extend 4 --fastq-in ${reads} --gbz-name ${basename}.${meta.read_group}.gbz --dist-name ${basename}.${meta.read_group}.dist --minimizer-name ${basename}.${meta.read_group}.min --output-format GAM --threads ${task.cpus} > ${meta.read_group}.gam
-
--mismatchmismatch penalty -
--gap-opengap open penalty -
--gap-extendgap extension penalty -
--fastq-ininput reads -
--gbz-namesubsampled graph -
--dist-namedist index -
--minimizer-nameminimizer index -
--output-formatspecify output type
Filters GAM files after mapping.
Usage:
vg filter [options] <alignment.gam> > out.gam
Example grave command:
vg filter ${args} ${args2} ${args3} -t ${task.cpus} -x ${basename}.${meta.read_group}.gbz -r ${params.minimumScorePrimaryAlign} -fu -v ${meta.read_group}.gam > ${meta.read_group}.filtered.gam
-
${args}set by--gamDiscardUnmapped:trueprovides--only-mapped, andvg filterwill remove unmapped reads from the GAM -
${args2}set bygamFilterMapQ:trueprovides--min-mapq ${params.minimumMapQFilter}, andvg filterwill remove reads under the threshold MAPQ et by--minimumMapQFilter -
${args3}set by--gamDefrayEnds,trueprovides--defray-ends ${params.defrayEndsLength}, andvg filterwill clip back the ends of ambiguously aligned reads up to N bases set by--defrayEndsLength -
-tthreads -
-xgraph file -
-rminimum primary alignment score (in practice this is fraction identity, due to-fubeing set) -
-funormalises scores based on length & uses substitution count instead of score, in practice, uses fraction identity instead of raw score -
-vverbose
Reports summary statistics for sample mappings, this is done on the filtered GAM.
Usage:
vg stats [options] [<graph file>]
Example grave command:
vg stats --alignments ${meta.read_group}.filtered.gam ${basename}.${meta.read_group}.gbz > ${meta.read_group}_alignment-stats.txt