niekwit/atac-seq

Snakemake workflow for ATAC-seq

Overview

Latest release: v0.4.0, Last update: 2026-11-20

Share link: https://snakemake.github.io/snakemake-workflow-catalog?wf=niekwit/atac-seq

Quality control: linting: failed formatting: passed

Topics: atac-seq bioinformatics-pipeline snakemake-workflow

Workflow Rule Graph

This visualization of the workflow’s rule graph was automatically generated using Snakevision

Rule Graph light

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Conda package manager. It is recommended to install conda via Miniforge. Run

conda create -c conda-forge -c bioconda -c nodefaults --name snakemake snakemake snakedeploy

to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via

conda activate snakemake

For other installation methods, refer to the Snakemake and Snakedeploy documentation.

Step 2: Deploy workflow

With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:

mkdir -p path/to/project-workdir
cd path/to/project-workdir

In all following steps, we will assume that you are inside of that directory. Then run

snakedeploy deploy-workflow https://github.com/niekwit/atac-seq . --tag v0.4.0

Snakedeploy will create two folders, workflow and config. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.

Step 3: Configure workflow

To configure the workflow, adapt config/config.yml to your needs following the instructions below.

Step 4: Run workflow

The deployment method is controlled using the --software-deployment-method (short --sdm) argument.

To run the workflow using apptainer/singularity, use

snakemake --cores all --sdm apptainer

To run the workflow using a combination of conda and apptainer/singularity for software deployment, use

snakemake --cores all --sdm conda apptainer

To run the workflow with automatic deployment of all required software via conda/mamba, use

snakemake --cores all --sdm conda

Snakemake will automatically detect the main Snakefile in the workflow subfolder and execute the workflow module that has been defined by the deployment in step 2.

For further options such as cluster and cloud execution, see the docs.

Step 5: Generate report

After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using

snakemake --report report.zip

Configuration

The following section is imported from the workflow’s config/README.md.

Configuration

The full documentation, including the workflow steps and output files, is at https://atac-seq.readthedocs.io.

Sample sheet

Paired-end reads go in reads/{sample}_R1_001.fastq.gz and reads/{sample}_R2_001.fastq.gz. The sample sheet config/samples.csv has the following layout:

sample

condition

reference

WT_1

wt

yes

WT_2

wt

yes

KO_1

ko

no

KO_2

ko

no

Sample names may only contain letters, numbers and underscores, and must end with _[0-9]. The replicates of a condition are numbered (rep1, rep2, …) in the order of the sample sheet.

reference marks the samples of the reference (control) condition with yes, and all other samples with no. It is the reference level of the DESeq2 model. Without deseq2: contrasts, each other condition with at least 2 replicates is compared to it (positive log2 fold changes: more accessible than in the reference); the reference condition then also needs at least 2 replicates. The column is needed for the DESeq2 analysis of more than one condition, unless all comparisons are listed in deseq2: contrasts.

Parameters

config/config.yaml sets the parameters below. Set at least the genome (genome: ensembl and release) and the effective genome size (macs2: gsize); the other defaults are those of the ENCODE pipeline.

parameter

details

default

genome

ensembl

genome build: hg19, hg38, mm38, mm39 or dm6

mm39

release

Ensembl release

115

mito_chr_name

name of the mitochondrial chromosome

MT

cutadapt

adapter_r1, adapter_r2

adapter sequences of read 1 and read 2

CTGTCTCTTATA

extra

other cutadapt arguments

-e 0.1 -m 5

bowtie2

multimapping

maximum number of alignments of a read; 0: filter on MAPQ instead

4

extra

other bowtie2 arguments

-X2000 –mm

filter

mapq_thresh

minimum MAPQ of the fingerprint (JSD) QC and, when multimapping is 0, of the read filter

30

filter_chrs

chromosomes whose reads are removed after deduplication

[MT]

subsample_reads

number of reads to subsample each replicate to for peak calling, also of the TE module (0: none; min: the reads of the smallest library after deduplication); see Subsampling

0

macs2

gsize

effective genome size (hs, mm or a number)

mm

pval_thresh

p-value threshold

0.01

smooth_win

smoothing window (--extsize; --shift is -smooth_win/2)

150

cap_num_peak

maximum number of peaks

300000

peaks

keep_chr_regex

peaks on chromosomes not matching this (POSIX extended) regex are removed

[0-9]+|X|Y

min_replicate_fraction

fraction of the replicates in which a peak of replicated_peak.narrowPeak is reproducible (rounded up, at least 2)

1

min_overlap

minimum overlap (fraction of either peak) of a pooled peak with a replicate peak, for the overlap replicated_peak.narrowPeak and the TE peaks

0.5

tss_region

promoter window (bp up- and downstream of the TSS) of the ChIPseeker annotation

3000

idr

enable

run IDR (naive overlap is always run)

true

threshold

IDR threshold

0.05

pseudoreplication_random_seed

seed for pseudoreplication (0: tagAlign file size, as ENCODE)

0

deseq2

enable

compare all samples with DESeq2

true

peak_method

optimal peak sets merged into consensus peaks: overlap or idr

overlap

pca_ntop

number of most variable peaks used for the PCA

500

contrasts

[treatment, control] pairs; empty: each condition against the reference

[]

fdr

adjusted p-value below which a peak is differential

0.05

lfc_threshold

test against this absolute log2 fold change (0: any change)

0

min_count

peaks (and TE subfamilies) with fewer insertions in all samples together are removed before PCA, correlation and testing

10

te

enable

run the transposable element module

false

only

run only the TE module (with the genome, index and read trimming it needs), not the ENCODE peaks, signal tracks, QC and DESeq2 of the peaks

false

classes

RepeatMasker classes to count (empty: all repeats)

LINE, SINE, LTR, DNA, Retroposon, RC, Satellite

normalisation

library size for the DESeq2 comparison of subfamilies: deseq2 (median-of-ratios over the subfamilies) or insertions (all kept insertions of a sample)

deseq2

bigwig_bin_size

bin size (bp) of the TE signal tracks

10

bigwig_normalisation

scaling of the TE signal tracks: cpm (per million kept insertions) or deseq2 (DESeq2 size factors of the TE consensus peaks, needs deseq2: enable); see Transposable elements

cpm

heatmap: classes

list of classes in the heatmap of each contrast; ["all"] for every class

[“LINE”, “SINE”, “LTR”, “DNA”]

heatmap: subfamilies

list of subfamilies in the heatmap; ["all"] for the significant subfamilies of the selected classes. Named subfamilies are plotted whether significant or not (significant ones marked with *)

[“all”]

heatmap: max_per_class

most significant subfamilies per class in the heatmap (with subfamilies: ["all"])

25

profile: subfamilies

subfamilies for the profile over their full-length copies, groups of subfamilies by prefix (e.g. L1MdTf for L1MdTf_I–_III), or family:<repFamily> / class:<repClass> (e.g. family:L1) (empty: no profile)

[]

profile: min_consensus_fraction

fraction of the RepeatMasker consensus a copy must cover to count as full-length

0.9

profile: flank

bp before and after the copies in the profile

2000

profile: body_length

length (bp) to which the copies are scaled in the profile

6000

correlation: datasets

data sets to compare with the differential TE peaks with GAT, as name: BED file (e.g. EM-seq DMRs; UCSC or Ensembl chromosome names)

{}

correlation: gat_samples

number of random placements of the peaks in GAT

10000

rnaseq

integration with RNA-seq (needs deseq2: enable), see Integration with RNA-seq

tables

RNA-seq DESeq2 results table per contrast, as {treatment}_vs_{control}: path (tab-separated, or .csv) or a list of paths (e.g. genes and TEs in separate tables, which are combined); genes and, for the TE module, TE subfamilies

{}

columns: gene_id

column with the gene (or TE) IDs; “”: the first column

“”

columns: log2fc, padj, base_mean

columns with the log2 fold change, adjusted p-value and mean count

log2FoldChange, padj, baseMean

id_type

gene identifiers: ensembl, symbol or auto (whichever matches more rows)

auto

te_separator

TE rows: the ID up to the first separator is the subfamily (e.g. L1MdTf_I:L1:LINE)

“:”

fdr, lfc_threshold

genes with padj < fdr and |log2 fold change| > lfc_threshold are up- or downregulated

0.05, 0

distance_bins

peaks are assigned to the nearest TSS within the largest distance (bp); tests per distance bin

[1000, 10000, 50000, 100000]

tss_profile_flank

TE module: bp up- and downstream of the TSS for the profile of the Tn5 insertions (CPM) at the up-, down- and unchanged genes

3000

pair_lfc_threshold

minimum |log2 fold change| of both the peak and the gene for the peak-gene pairs with a significant change in both (scatter and distance plots)

1

extra

extra command-line arguments of tools run directly as a command, appended to the workflow’s own options (cutadapt and bowtie2: extra in their sections)

bowtie2_build

bowtie2-build (genome index)

“”

fastqc

FastQC

“”

markduplicates

Picard MarkDuplicates

“”

ataqv

ataqv

“”

featurecounts

featureCounts (consensus peaks, TE subfamilies and TE peaks)

“”

multiqc

MultiQC (both reports)

“”

bamcoverage

deepTools bamCoverage (TE signal tracks)

“”

bigwigaverage

deepTools bigwigAverage (TE mean signal tracks)

“”

computematrix

deepTools computeMatrix (TE profiles)

“”

plotprofile

deepTools plotProfile (TE profiles)

“”

Workflow parameters

The following table is automatically parsed from the workflow’s config.schema.y(a)ml file.

Parameter

Type

Description

Required

Default

genome

yes

. ensembl

string

genome build (hg19, hg38, mm38, mm39, dm6 or test)

yes

. release

integer

Ensembl release

yes

mito_chr_name

string

yes

cutadapt

yes

. adapter_r1

string

yes

. adapter_r2

string

yes

. extra

string

yes

bowtie2

yes

. multimapping

integer

yes

. extra

string

yes

filter

yes

. mapq_thresh

integer

yes

. filter_chrs

array

yes

subsample_reads

yes

macs2

yes

. gsize

string

yes

. pval_thresh

number

yes

. smooth_win

integer

yes

. cap_num_peak

integer

yes

peaks

yes

. keep_chr_regex

string

yes

. min_replicate_fraction

number

1

. min_overlap

number

0.5

. tss_region

integer

3000

idr

yes

. enable

boolean

yes

. threshold

number

yes

pseudoreplication_random_seed

integer

yes

deseq2

. enable

boolean

. peak_method

string

. pca_ntop

integer

. contrasts

array

. fdr

number

. lfc_threshold

number

. min_count

integer

10

te

. enable

boolean

false

. only

boolean

false

. classes

array

[]

. normalisation

string

deseq2

. bigwig_bin_size

integer

10

. bigwig_normalisation

string

cpm

. heatmap

. . classes

array

[‘LINE’, ‘SINE’, ‘LTR’, ‘DNA’]

. . subfamilies

array

[‘all’]

. . max_per_class

integer

25

. profile

. . subfamilies

array

[]

. . min_consensus_fraction

number

0.9

. . flank

integer

2000

. . body_length

integer

6000

. correlation

. . datasets

{}

. . gat_samples

integer

10000

rnaseq

. tables

[‘object’, ‘null’]

{}

. columns

. . gene_id

[‘string’, ‘null’]

. . log2fc

string

log2FoldChange

. . padj

string

padj

. . base_mean

string

baseMean

. id_type

string

auto

. te_separator

string

:

. fdr

number

0.05

. lfc_threshold

number

0

. distance_bins

array

[1000, 10000, 50000, 100000]

. pair_lfc_threshold

number

1

. tss_profile_flank

integer

3000

h3k9me3

. contrasts

[‘object’, ‘null’]

{}

. columns

. . chr

string

seqnames

. . start

string

start

. . end

string

end

. . log2fc

string

Fold

. . fdr

string

FDR

. flip_fold

boolean

false

. fdr

number

0.05

. profile_flank

integer

5000

. profile_body_length

integer

5000

. min_copies

integer

20

. bigwig_units

string

signal

methylation

. contrasts

[‘object’, ‘null’]

{}

. columns

. . chr

string

chr

. . start

string

start

. . end

string

end

. . diff

string

meth.diff

. . fdr

string

qvalue

. flip_diff

boolean

false

. fdr

number

0.01

. min_diff

number

25

. profile_flank

integer

5000

. profile_body_length

integer

5000

. min_copies

integer

20

multiomics

. enable

boolean

false

. min_copies

integer

20

. max_per_class

integer

10

. max_combinations

integer

25

extra

. bowtie2_build

[‘string’, ‘null’]

. fastqc

[‘string’, ‘null’]

. markduplicates

[‘string’, ‘null’]

. ataqv

[‘string’, ‘null’]

. featurecounts

[‘string’, ‘null’]

. multiqc

[‘string’, ‘null’]

. bamcoverage

[‘string’, ‘null’]

. bigwigaverage

[‘string’, ‘null’]

. computematrix

[‘string’, ‘null’]

. plotprofile

[‘string’, ‘null’]

Linting and formatting

Linting results
 1/home/runner/work/snakemake-workflow-catalog/snakemake-workflow-catalog/.pixi/envs/default/lib/python3.13/site-packages/google/auth/transport/grpc.py:43: FutureWarning: grpcio < 1.83.0 does not support Post-Quantum Cryptography (PQC). Support for non-PQC environments is deprecated. In April 2027, google-auth will raise its minimum requirements to enforce grpcio >= 1.83.0. For more details on Google Cloud's post-quantum security migration, visit: https://cloud.google.com/security/resources/post-quantum-cryptography
 2  warnings.warn(
 3Running workflow version v0.4.0
 4ValueError in file "/tmp/tmp354acnny/niekwit-atac-seq-4fd0666/workflow/rules/common.smk", line 52:
 5Following files not found:
 6reads/Rep_1_R1_001.fastq.gz
 7reads/Rep_1_R2_001.fastq.gz
 8reads/Rep_2_R1_001.fastq.gz
 9reads/Rep_2_R2_001.fastq.gz
10reads/Rep_3_R1_001.fastq.gz
11reads/Rep_3_R2_001.fastq.gz
12reads/Rep_4_R1_001.fastq.gz
13reads/Rep_4_R2_001.fastq.gz
14  File "/tmp/tmp354acnny/niekwit-atac-seq-4fd0666/workflow/Snakefile", line 28, in <module>
15  File "/tmp/tmp354acnny/niekwit-atac-seq-4fd0666/workflow/rules/common.smk", line 52, in samples
Formatting results
All tests passed!