Repository navigation
snpArcher v2.3.0
Upgrading from 2.2
- Callable sites coverage mask redesigned.
callable_sites.coverage.min_coverageandmax_coverageare replaced bymax_depth,max_depth_kandmin_sample_depth, and the defaultfractionchanges from 1.0 to 0.25.
A site is now coverage-callable when its depth summed across samples is not an outlier above the genome-wide median (or, with a numericmax_depth, not above that multiple of the median), and at leastfractionof samples havemin_sample_depthreads there.
The old per-sample thresholds kept only a small fraction of the genome in realistic cohorts.
With coverage enabled, configs that still set the old keys skip callable sites, and postprocess with it, with a warning; the rest of the workflow runs. - DeepVariant needs Apptainer. Add
--use-apptainer, oruse-apptainer: Truein your workflow profile. Without it, the run now stops while the job graph is built instead of failing after mapping. - Stricter checks at startup. These used to fail later, or silently do the wrong thing:
ploidyabove 2 with bcftools or Parabricks, or other than 2 with DeepVariant;- an empty Sentieon licence;
- a FASTQ row that isn't exactly one
R1;R2pair, or a FASTQ file or SRA accession listed twice for one sample; - a reference source that isn't an existing file, a URL, or an NCBI accession with its version (
GCF_000002315.6); - a metadata
excludevalue other than true/false, yes/no or 1/0; - a postprocess
mafabove 0.5.
Using v2.3 in an existing project
v2.3 changes many rules, and Snakemake's default rerun triggers rerun any job whose rule changed, including jobs whose temporary outputs were deleted long ago, and everything downstream of them.
In a project started with 2.2, this can mean redoing mapping and variant calling, and re-downloading SRA samples.
Dry-run first (-n) to see what would run, then choose:
- Recompute everything the new code touches: run with the default triggers.
- Keep the existing results: run with
--rerun-triggers mtime. - Recompute only some outputs: delete them, then run with
--rerun-triggers mtime. The outputs with v2.3 fixes worth rebuilding areresults/callable_sites/(new coverage mask),results/postprocess/,results/qc_metrics/and, if you use the QC module,results/qc/.
Long-contig GATK projects started with 2.2 should delete results/intervals/db/ before their first v2.3 run.
Those lists can genotype part of a chromosome twice, and long-contig mode kept the duplicate records, so also check VCFs from those runs for duplicate records at the same position.
Changed outputs
- GATK runs with hard filtering keep
filtered.vcf.gzas the call set, and no longer keepraw.vcf.gz.filtered.vcf.gzhas every raw record, with FILTER set. callable_loci.zarrholds clam population counts (samples with data per site) instead of per-sample masks, with all samples as one population.
Use it withclam statfor a single population; for statistics by population, build a store with your populations fromdepths.zarr(see Filtering).- bcftools and DeepVariant name samples by
sample_id, not the read-groupSMof the sample's BAM. With bcftools, BAMs that shared anSMwere merged into one sample. Sentieon still usesSM, so with Sentieon an external BAM'sSMmust equal itssample_id. - QC: site filters now see only the samples kept by
min_depth, and the MAF filter is two-sided, so QC's SNP set, PCA and ADMIXTURE change. Reruns now give the same PCA and ADMIXTURE. Intermediate files useqcctgNcontig names. - Postprocess: indels whose first base isn't callable are no longer kept, and
callable_sites_filtered.bedno longer contains excluded scaffolds. qc_report.tsv:total_readsand the mapping and duplicate rates count primary records only.- Sample metadata: the
outgroupcolumn is no longer read. It was never used; files that have it still work.
Fixes
Variant calling
- GATK with
intervals.enabled: falseruns; GenomicsDBImport used to reject its interval argument after every HaplotypeCaller job had finished. - bcftools, DeepVariant, Sentieon and GATK runs without intervals deliver an index with the call set; long-contig GATK runs no longer re-genotype every interval on a later
all. - bcftools handles contig names with shell characters (such as NCBI
gi|…|names) and assemblies with more contigs than the open-file limit. snakemake gvcfswith bcftools explains that bcftools writes no per-sample gVCFs.- Long-contig GATK gathers (
picard SortVcf) no longer run out of memory above about 30 samples. - DeepVariant deletes its intermediate files when each sample finishes.
deepvariant.num_shardsandparabricks.num_cpu_threadstake effect; the default profile overrode them.variant_calling.tool: sentieonworks again: it failed to parse under Snakemake 9 and could not find its conda environment.
Callable sites
coverage.bedno longer misplaces callable sites. clam's per-sample masks were decoded in the wrong bit order whenever the number of samples was not a multiple of 8; the masks are no longer used.fractionand a numericmax_depthconvert to exact thresholds: 0.55 of 200 samples requires 110, not 111.- Samples marked
excludein the sample metadata are left out of the coverage mask. - Sample IDs containing a dot keep their full name in
depths.zarr. clam used to cut each name at the first dot, soind.1was stored asind, andind.1withind.2failedclam_collect. - GenMap no longer overwrites or deletes
results/reference/{name}.fa.
Postprocess
- Editing
excludein the sample metadata reruns postprocess with the new samples. exclude_scaffoldsvalues with spaces work, and the excluded scaffolds are removed from the filtered BED as well as the VCF.- Records left with only the
*allele are dropped; records with a real allele beside*are kept. - A run with no SNPs left, or no callable region left, finishes or stops with an explanation instead of a bcftools error.
- The standalone module runs outside a project directory, and
run-postprocess.sh --long-contig-modewrites CSI indexes. - A stray
modules.postprocess.filtering.vcfkey no longer replaces the input VCF.
QC
- Contigs named
chrX,X,Y,MTorchrMno longer crash PLINK, and cohorts of 3–10 samples no longer crash the PCA or the dashboard. - The dashboard no longer counts
PASSrecords as filtered out, handles more than 10 clusters, and renders without writing into the install directory.
Samples, config and downloads
- Building the job graph is no longer quadratic in the number of samples: a 200-sample dry run went from 272 s to 44 s.
- A
library_idorsample_idofNA,nullorNoneis kept as written, instead of being read as missing. - Metadata
excludeaccepts yes/no and 1/0, as documented. - A v2 config with an
intervals:block is no longer mistaken for a v1 config. - SRA re-downloads no longer fail on the previous attempt's files.
- An unpaired external BAM no longer crashes QC metrics.
Documentation
--workflow-profileis required; several pages said it defaulted toworkflow-profiles/default, and their example commands failed without it.- The postprocess missingness default is described correctly everywhere: 0.75 keeps sites where at least 25% of samples are called.