-
Notifications
You must be signed in to change notification settings - Fork 0
Gam and bam processing
Projects graph alignments to a linear reference assembly (GAM to BAM, against one or several linear reference assemblies depending on the mode).
When graphs contain multiple reference assemblies, grave uses .paths files (path list files), and provides the --into-paths option to vg surject, surjecting into each reference separately.
Usage:
vg surject [options] <aln.gam> >[proj.cram]
Example grave command:
vg surject -t ${task.cpus} -x ${graph} --bam-output ${mapped_gam}
Adds readgroup information to library level BAM files to inform the deduplication step. Adds the readgroup (made up of sample id, library id, and repeat number), plus separate library and sample tags for MarkDuplicates.
Usage:
samtools addreplacerg [options] [-r <@RG line> | -R <existing id>] [-m orphan_only|overwrite_all] [-o <output.bam>] <input.bam>
Example grave command:
samtools addreplacerg --threads ${task.cpus} --output-fmt BAM -r '@RG\\tID:${meta.read_group}\\tLB:${meta.library}\\tSM:${meta.id}'
Coordinate sorts library level BAM files.
Usage:
samtools sort [options...] [in.bam]
Example grave command:
samtools sort --threads ${task.cpus} --output-fmt BAM
Sorted library BAMs are gathered at the sample level and merged, reatining the coordinate sort order. Merge is skipped if only one BAM.
Usage:
samtools merge [options] -o <out.bam> [options] <in1.bam> ... <inN.bam>
Example grave command:
samtools merge --threads ${task.cpus} -p -o ${meta.id}.merge.bam ${bams}
-
-pCombine @PG headers with colliding IDs [alter IDs to be distinct] (simplifies merged SAM header)
Marks duplicate reads in sample level BAM files. Uses readgroup information deduplicate within repeats of the same library.
For ancient samples, MarkDuplicates is configured to replicate the behaviour of the dedup tool, considering both the 5' and 3' mapping positions when duplicate marking. For modern samples, typical duplicate marking is performed, considering only the 5' mapping position.
Usage:
picard MarkDuplicates --INPUT --METRICS_FILE --OUTPUT
Example grave command:
picard -Xms2g -Xmx\${MAX_HEAP_GB}g MarkDuplicates --INPUT ${meta.id}.merge.bam --OUTPUT ${meta.id}.dedup.bam --METRICS_FILE ${meta.id}.dedup_metrics.txt --TAGGING_POLICY ${params.duplicateTaggingPolicy} --REMOVE_DUPLICATES ${params.removeDuplicates} --VALIDATION_STRINGENCY STRICT --ASSUME_SORT_ORDER coordinate ${args}
-
--INPUTinput BAM file -
--OUTPUToutput BAM file -
--METRICS_FILEfile to write duplication metrics to -
--TAGGING_POLICYdetermines how duplicate types are recorded in the DT optional attribute -
--REMOVE_DUPLICATESiftrue, duplicate reads are removed from the output file. Iffalse, they are marked in the BAM file with a flag but not removed. -
--VALIDATION_STRINGENCYstringency of BAM file integrity checks -
--ASSUME_SORT_ORDERassume the input file is sorted in the specified order -
${args}set by--dedupConsiderBothEnds: if true, for aDNA provides--FLOW_MODE --FLOW_USE_END_IN_UNPAIRED_READSto picard MarkDuplicates, which causes the tool to consider both the 5' and 3' mapping positions when marking duplicates
Indexes the BAM file for downstream tools.
Usage:
samtools index -M [-bc] [-m INT] <in1.bam> <in2.bam>...
Example grave command:
samtools index --threads ${task.cpus} ${meta.id}.dedup.bam