This repository provides a Snakemake workflow that converts AnchorWave MAFs into per-contig merged gVCFs, splits them into clean/filtered/invariant sets, and produces mask bedfiles for downstream ARG inference.
- Conda (you may need to
module load condaon your cluster) - TASSEL (provided via the
tassel-5-standalonesubmodule) - GATK, Picard, htslib (installed in the conda env defined below)
Clone with submodules so TASSEL is available:
git clone --recurse-submodules <repo>Create and activate the environment (do this before running Snakemake):
module load conda
conda env create -f argprep.yml
conda activate argprepEdit config.yaml to point at your MAF directory and reference FASTA. At minimum you must set:
maf_dir: directory containing*.mafor*.maf.gzreference_fasta: reference FASTA path (plain.fa/.fastaor bgzipped.fa.gz)depth: depth cutoff forsplit.py(defaults to the number of MAF files)
If your reference FASTA does not have an index (.fai), either create one (samtools faidx) or set contigs: explicitly in config.yaml.
The pipeline can be run one of two ways, both from the repo root. It is recommended you first run on the example data provided to ensure the pipeline works on your system.
A default SLURM profile is provided under profiles/slurm/. Edit profiles/slurm/config.yaml to customize sbatch options if needed.
Defaults for account/partition and baseline resources are set in config.yaml (slurm_account, slurm_partition, default_*).
snakemake --profile profiles/slurmsnakemake -j 8 Common options:
-j <N>: number of parallel jobs--rerun-incomplete: clean up partial outputs--printshellcmds: show executed commands--keep-temp: keep temporary intermediates (see Notes)
By default the workflow uses these locations (override in config.yaml):
gvcf/: TASSEL gVCFs (*.gvcf.gz) from MAFsgvcf/cleangVCF/: cleaned gVCFs fromscripts/dropSV.pygvcf/cleangVCF/dropped_indels.bed: bedfile of large indelsgvcf/cleangVCF/split_gvcf/: per-contig gVCFs for mergingresults/combined/combined.<contig>.gvcf.gz: merged gVCF per contigresults/split/combined.<contig>.inv: invariant sitesresults/split/combined.<contig>.filtered: filtered sitesresults/split/combined.<contig>.clean: clean sitesresults/split/combined.<contig>.missing.bed: missing positionsresults/split/combined.<contig>.filtered.bed: merged mask bedresults/summary.md: markdown summary of jobs run, outputs created, and warnings
- If
bgzip_output: true, the.inv,.filtered,.clean, and.missing.bedfiles will have a.gzsuffix. - All gzipped outputs in this pipeline use bgzip (required for
tabix). scripts/dropSV.pyremoves indels larger thandrop_cutoff(if set inconfig.yaml).scripts/split.pysupports--filter-multiallelicand--bgzip-output(toggle viaconfig.yaml).scripts/filt_to_bed.pymerges<prefix>.filtered,<prefix>.missing.bed, anddropped_indels.bedinto a final mask bed.no_merge: trueis for troubleshooting per-sample filtered regions only; it will likely break downstream steps because the combined mask bed is not merged.- If GenomicsDBImport fails with a buffer-size error, increase
genomicsdb_vcf_buffer_sizeandgenomicsdb_segment_sizeinconfig.yaml(set them above your longest gVCF line length). - Large intermediate files are marked as temporary and removed after a successful run (per-sample gVCFs, cleaned gVCFs, per-contig split gVCFs, and the GenomicsDB workspace). Use
snakemake --keep-tempif you want to preserve them for debugging or reruns. - Resource knobs (memory/threads/time) and GenomicsDB buffer sizes are configurable in
config.yaml(e.g.,merge_contig_mem_mb,maf_to_gvcf_*,genomicsdb_*). - To cap the SLURM array concurrency for
scripts/maf_to_gvcf.sh, setmaf_to_gvcf_array_max_jobsinconfig.yaml(default 4).
Use Nate Pope's SINGER Snakemake pipeline with combined.<contig>.clean and combined.<contig>.filtered.bed as inputs.