{"slug":"pipeline-dnaseseq","title":"pipeline-dnaseseq","summary":"Execute ENCODE DNase-seq pipeline from FASTQ to hotspots and footprints. Child of pipeline-guide. Provides Nextflow execution with Docker and cloud deployment. Use when processing DNase-seq data, calling DNase hypersensitive sites, performing footprinting analysis. Trigger on: DN","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-22T13:25:36.516913Z","repo":{"url":"https://github.com/ammawla/encode-toolkit","stars":21,"forks":5,"license":"AGPL-3.0","updatedAt":"2026-09-27T01:22:42Z"},"bodyHtml":"<hr>\n<h2>name: pipeline-dnaseseq\ndescription: \"Execute ENCODE DNase-seq pipeline from FASTQ to hotspots and footprints. Child of pipeline-guide. Provides Nextflow execution with Docker and cloud deployment. Use when processing DNase-seq data, calling DNase hypersensitive sites, performing footprinting analysis. Trigger on: DNase-seq pipeline, DNase hypersensitive, DHS, Hotspot2, footprinting, DNase I, chromatin accessibility DNase.\"</h2>\n<h1>ENCODE DNase-seq Pipeline: FASTQ to Hotspots and Footprints</h1>\n<h2>When to Use</h2>\n<ul>\n<li>User wants to run a DNase-seq processing pipeline from FASTQ to hotspots and footprints</li>\n<li>User asks about \"DNase-seq pipeline\", \"DNase hypersensitive sites\", \"Hotspot2\", \"footprinting\", or \"DHS\"</li>\n<li>User needs to process DNase-seq data for chromatin accessibility and TF footprint analysis</li>\n<li>Example queries: \"process my DNase-seq FASTQs\", \"call DNase hypersensitive sites\", \"run footprinting analysis on DNase-seq\"</li>\n</ul>\n<p>Execute the ENCODE DNase-seq pipeline for chromatin accessibility profiling,\nproducing DNase hypersensitive sites (DHSs) via Hotspot2 and transcription\nfactor footprints.</p>\n<h2>Pipeline Overview</h2>\n<pre><code>FASTQ -&gt; Trim -&gt; BWA-MEM align -&gt; Filter/dedup -&gt; Hotspot2 -&gt; DHS peaks\n                                       |                        |\n                                    Signal track         Footprinting (HINT)\n</code></pre>\n<h3>ENCODE Repository</h3>\n<ul>\n<li><strong>GitHub</strong>: <code>ENCODE-DCC/dnase-seq-pipeline</code></li>\n<li><strong>Container</strong>: built from <code>scripts/Dockerfile</code> in this skill (<code>docker build -t encode-toolkit/pipeline-dnaseseq:1.0.0 scripts/</code>); override with <code>--container</code></li>\n<li><strong>WDL</strong>: Available for Cromwell execution</li>\n<li><strong>This skill</strong>: Nextflow DSL2 reimplementation for portability</li>\n</ul>\n<h2>Core Tools and Versions</h2>\n<table>\n<thead>\n<tr>\n<th>Tool</th>\n<th>Version</th>\n<th>Purpose</th>\n<th>Citation</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>BWA-MEM</td>\n<td>0.7.18</td>\n<td>Alignment</td>\n<td>Li &amp; Durbin 2009</td>\n</tr>\n<tr>\n<td>samtools</td>\n<td>1.19</td>\n<td>BAM operations</td>\n<td>Li et al. 2009</td>\n</tr>\n<tr>\n<td>Picard</td>\n<td>3.1.1</td>\n<td>Duplicate marking</td>\n<td>Broad Institute</td>\n</tr>\n<tr>\n<td>Hotspot2</td>\n<td>2.1.2</td>\n<td>DHS calling (ENCODE standard)</td>\n<td>John et al. 2011</td>\n</tr>\n<tr>\n<td>modwt</td>\n<td>1.0</td>\n<td>Wavelet smoothing used by Hotspot2</td>\n<td>Stam Lab</td>\n</tr>\n<tr>\n<td>bedtools</td>\n<td>2.31.0</td>\n<td>Genomic arithmetic</td>\n<td>Quinlan &amp; Hall 2010</td>\n</tr>\n<tr>\n<td>BEDOPS</td>\n<td>apt (Ubuntu 22.04)</td>\n<td><code>sort-bed</code> and <code>unstarch</code> for the Hotspot2 starch archives</td>\n<td>Neph et al. 2012</td>\n</tr>\n<tr>\n<td>HINT (RGT)</td>\n<td>1.0.2</td>\n<td>TF footprinting</td>\n<td>Li et al. 2019</td>\n</tr>\n<tr>\n<td>FastQC</td>\n<td>0.12.1</td>\n<td>Read quality</td>\n<td>Andrews (Babraham)</td>\n</tr>\n<tr>\n<td>Trim Galore</td>\n<td>0.6.10</td>\n<td>Adapter and quality trimming</td>\n<td>Krueger (Babraham)</td>\n</tr>\n<tr>\n<td>cutadapt</td>\n<td>4.6</td>\n<td>Adapter removal backend for Trim Galore</td>\n<td>Martin 2011</td>\n</tr>\n<tr>\n<td>MultiQC</td>\n<td>1.21</td>\n<td>Aggregated QC</td>\n<td>Ewels et al. 2016</td>\n</tr>\n</tbody>\n</table>\n<h2>Key Literature</h2>\n<ol>\n<li><p><strong>John et al. 2011</strong> - \"Chromatin accessibility pre-determines glucocorticoid\nreceptor binding patterns\" (Nature Genetics, ~600 citations)\nDOI: 10.1038/ng.759</p>\n</li>\n<li><p><strong>Thurman et al. 2012</strong> - \"The accessible chromatin landscape of the human\ngenome\" (Nature, ~3,000 citations)\nDOI: 10.1038/nature11232</p>\n</li>\n<li><p><strong>Vierstra et al. 2020</strong> - \"Global reference mapping of human transcription\nfactor footprints\" (Nature, ~600 citations)\nDOI: 10.1038/s41586-020-2528-x</p>\n</li>\n<li><p><strong>Amemiya et al. 2019</strong> - \"The ENCODE Blacklist\" (Scientific Reports, ~1,372 citations)\nDOI: 10.1038/s41598-019-45839-z</p>\n</li>\n<li><p><strong>Li et al. 2019</strong> - \"Identification of transcription factor binding sites using\nATAC-seq\" (Genome Biology) -- HINT-ATAC footprinting\nDOI: 10.1186/s13059-019-1642-2</p>\n</li>\n</ol>\n<h2>Execution</h2>\n<h3>Quick Start (Local)</h3>\n<pre><code>nextflow run scripts/main.nf \\\n    -profile local \\\n    --reads '/data/fastq/*_R{1,2}.fastq.gz' \\\n    --bwa_index '/ref/bwa_index/genome.fa' \\\n    --chrom_sizes '/ref/hg38.chrom.sizes' \\\n    --hotspot_center_sites '/ref/hotspot2/hg38.center_sites.n100.starch' \\\n    --hotspot_mappable '/ref/hotspot2/hg38.mappable_only.bed' \\\n    --rgt_data '/ref/rgtdata' \\\n    --blacklist '/ref/hg38-blacklist.v2.bed' \\\n    --outdir results/ \\\n    -resume\n</code></pre>\n<p>Drop <code>--rgt_data</code> and add <code>--skip_footprint</code> to stop after hotspot calling.</p>\n<h3>SLURM HPC</h3>\n<p>The <code>slurm</code> profile runs through Singularity, which cannot resolve the default\nDocker image name, so pass the converted <code>.sif</code> with <code>--container</code>:</p>\n<pre><code>singularity build pipeline-dnaseseq.sif docker-daemon://encode-toolkit/pipeline-dnaseseq:1.0.0\n\nnextflow run scripts/main.nf \\\n    -profile slurm \\\n    --container /path/to/pipeline-dnaseseq.sif \\\n    --reads '/data/fastq/*_R{1,2}.fastq.gz' \\\n    --bwa_index '/ref/bwa_index/genome.fa' \\\n    --chrom_sizes '/ref/hg38.chrom.sizes' \\\n    --hotspot_center_sites '/ref/hotspot2/hg38.center_sites.n100.starch' \\\n    --hotspot_mappable '/ref/hotspot2/hg38.mappable_only.bed' \\\n    --rgt_data '/ref/rgtdata' \\\n    --blacklist '/ref/hg38-blacklist.v2.bed' \\\n    --outdir results/ \\\n    -resume\n</code></pre>\n<h3>Cloud (GCP / AWS)</h3>\n<pre><code># Google Cloud Batch\nnextflow run scripts/main.nf -profile gcp \\\n    --container us-docker.pkg.dev/&lt;project&gt;/&lt;repo&gt;/pipeline-dnaseseq:1.0.0 \\\n    --gcp_project &lt;project&gt; \\\n    --gcp_workdir gs://&lt;bucket&gt;/work \\\n    --reads 'gs://&lt;bucket&gt;/fastq/*_R{1,2}.fastq.gz' \\\n    --bwa_index gs://&lt;bucket&gt;/ref/bwa_index/genome.fa \\\n    --chrom_sizes gs://&lt;bucket&gt;/ref/hg38.chrom.sizes \\\n    --hotspot_center_sites gs://&lt;bucket&gt;/ref/hotspot2/hg38.center_sites.n100.starch \\\n    --hotspot_mappable gs://&lt;bucket&gt;/ref/hotspot2/hg38.mappable_only.bed \\\n    --rgt_data gs://&lt;bucket&gt;/ref/rgtdata \\\n    --blacklist gs://&lt;bucket&gt;/ref/hg38-blacklist.v2.bed \\\n    --outdir gs://&lt;bucket&gt;/results\n\n# AWS Batch\nnextflow run scripts/main.nf -profile aws \\\n    --container &lt;account&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com/pipeline-dnaseseq:1.0.0 \\\n    --aws_queue &lt;job-queue&gt; \\\n    --aws_workdir s3://&lt;bucket&gt;/work \\\n    --reads 's3://&lt;bucket&gt;/fastq/*_R{1,2}.fastq.gz' \\\n    --bwa_index s3://&lt;bucket&gt;/ref/bwa_index/genome.fa \\\n    --chrom_sizes s3://&lt;bucket&gt;/ref/hg38.chrom.sizes \\\n    --hotspot_center_sites s3://&lt;bucket&gt;/ref/hotspot2/hg38.center_sites.n100.starch \\\n    --hotspot_mappable s3://&lt;bucket&gt;/ref/hotspot2/hg38.mappable_only.bed \\\n    --rgt_data s3://&lt;bucket&gt;/ref/rgtdata \\\n    --blacklist s3://&lt;bucket&gt;/ref/hg38-blacklist.v2.bed \\\n    --outdir s3://&lt;bucket&gt;/results\n</code></pre>\n<p><code>--outdir</code> only sets where results are published; Google Batch and AWS Batch\nstage every task through the work directory, and the workflow stops with an\nerror if it or the project/queue is missing.</p>\n<h2>Resource Requirements</h2>\n<table>\n<thead>\n<tr>\n<th>Step</th>\n<th>CPUs</th>\n<th>RAM</th>\n<th>Time (per sample)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>BWA-MEM align</td>\n<td>8</td>\n<td>16 GB</td>\n<td>1-2 hours</td>\n</tr>\n<tr>\n<td>Filter/dedup</td>\n<td>4</td>\n<td>8 GB</td>\n<td>30-60 min</td>\n</tr>\n<tr>\n<td>Hotspot2</td>\n<td>4</td>\n<td>8 GB</td>\n<td>30-60 min</td>\n</tr>\n<tr>\n<td>Signal generation</td>\n<td>2</td>\n<td>4 GB</td>\n<td>15-30 min</td>\n</tr>\n<tr>\n<td>Footprinting</td>\n<td>4</td>\n<td>8 GB</td>\n<td>1-2 hours</td>\n</tr>\n<tr>\n<td><strong>Total</strong></td>\n<td><strong>8</strong></td>\n<td><strong>16 GB</strong></td>\n<td><strong>3-6 hours</strong></td>\n</tr>\n</tbody>\n</table>\n<p>Every process asks for <code>memory { N.GB * task.attempt }</code>, so a task killed for running out\nof memory is retried with more: the second attempt gets twice the figure in the table, the\nthird three times it, bounded by <code>--max_memory</code> (32 GB by default). <code>nextflow.config</code>\nscales the time the same way for <code>BWA_ALIGN</code>, <code>FILTER_DEDUP</code>, <code>HOTSPOT2</code> and\n<code>FOOTPRINTING</code>, bounded by <code>--max_time</code>; the other processes declare no time limit. A task\nis retried only for exit codes 130-145 and 104 (killed for exceeding a limit); any other\nfailure stops the run.</p>\n<h2>Pipeline Parameters</h2>\n<table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Default</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>--reads</code></td>\n<td>required</td>\n<td>Glob pattern to paired FASTQ files (e.g. <code>'/data/*_R{1,2}.fastq.gz'</code>). Paired-end only</td>\n</tr>\n<tr>\n<td><code>--bwa_index</code></td>\n<td>required</td>\n<td>BWA index <strong>prefix</strong>, i.e. the FASTA path. Every file matching <code>&lt;prefix&gt;*</code> (the <code>.fa</code> plus <code>.amb .ann .bwt .pac .sa</code>) is staged</td>\n</tr>\n<tr>\n<td><code>--chrom_sizes</code></td>\n<td>required</td>\n<td>Two-column chromosome sizes file. Used for the bigWig track and converted to BED for Hotspot2 <code>-c</code></td>\n</tr>\n<tr>\n<td><code>--hotspot_center_sites</code></td>\n<td>required</td>\n<td>Hotspot2 center-sites archive (<code>.starch</code>), made once per genome with <code>extractCenterSites.sh</code> (Hotspot2 <code>-C</code>)</td>\n</tr>\n<tr>\n<td><code>--hotspot_mappable</code></td>\n<td><code>null</code></td>\n<td>Mappable-regions BED that the center sites were made from (Hotspot2 <code>-M</code>; recommended)</td>\n</tr>\n<tr>\n<td><code>--blacklist</code></td>\n<td>required</td>\n<td>ENCODE blacklist BED. Applied to the BAM before hotspot calling</td>\n</tr>\n<tr>\n<td><code>--outdir</code></td>\n<td><code>./results</code></td>\n<td>Output directory</td>\n</tr>\n<tr>\n<td><code>--fdr</code></td>\n<td><code>0.05</code></td>\n<td>Hotspot2 hotspot FDR (<code>-f</code>). Names every Hotspot2 output file. <code>-F</code> is passed as <code>max(--fdr, 0.05)</code> because it may not be stricter than <code>-f</code></td>\n</tr>\n<tr>\n<td><code>--skip_footprint</code></td>\n<td><code>false</code></td>\n<td>Skip footprinting analysis</td>\n</tr>\n<tr>\n<td><code>--organism</code></td>\n<td><code>hg38</code></td>\n<td>Genome name registered in the RGT data directory, used by HINT footprinting</td>\n</tr>\n<tr>\n<td><code>--rgt_data</code></td>\n<td>required unless <code>--skip_footprint</code></td>\n<td>RGT data directory with the genome for <code>--organism</code> set up (see below)</td>\n</tr>\n</tbody>\n</table>\n<p>There is no <code>--genome</code>, <code>--single_end</code>, or <code>--fastq_r1/--fastq_r2</code> parameter.</p>\n<h3>Infrastructure parameters (<code>nextflow.config</code>)</h3>\n<table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Default</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>--container</code></td>\n<td><code>encode-toolkit/pipeline-dnaseseq:1.0.0</code></td>\n<td>Image built from <code>scripts/Dockerfile</code>. Pass a registry image for <code>gcp</code>/<code>aws</code>, or a <code>.sif</code> file for <code>slurm</code></td>\n</tr>\n<tr>\n<td><code>--max_cpus</code>, <code>--max_memory</code>, <code>--max_time</code></td>\n<td><code>16</code>, <code>32.GB</code>, <code>24.h</code></td>\n<td>Upper bounds applied to every process</td>\n</tr>\n<tr>\n<td><code>--slurm_queue</code>, <code>--slurm_account</code></td>\n<td><code>normal</code>, none</td>\n<td>SLURM partition and account</td>\n</tr>\n<tr>\n<td><code>--gcp_project</code>, <code>--gcp_workdir</code></td>\n<td>none (both required for <code>-profile gcp</code>)</td>\n<td>Google Cloud project and <code>gs://</code> work directory</td>\n</tr>\n<tr>\n<td><code>--gcp_location</code>, <code>--gcp_disk</code></td>\n<td><code>us-central1</code>, <code>200.GB</code></td>\n<td>Google Batch region and per-task disk</td>\n</tr>\n<tr>\n<td><code>--aws_queue</code>, <code>--aws_workdir</code></td>\n<td>none (both required for <code>-profile aws</code>)</td>\n<td>AWS Batch job queue and <code>s3://</code> work directory</td>\n</tr>\n<tr>\n<td><code>--aws_region</code>, <code>--aws_cli_path</code></td>\n<td><code>us-east-1</code>, <code>/home/ec2-user/miniconda/bin/aws</code></td>\n<td>AWS region, and the AWS CLI path inside the Batch AMI</td>\n</tr>\n</tbody>\n</table>\n<h2>Output Files</h2>\n<pre><code>results/\n  fastqc/                          # FastQC on the raw reads\n  trim_galore/\n    {sample}_R1_val_1.fq.gz        # Trimmed reads\n    {sample}_R2_val_2.fq.gz\n    *_trimming_report.txt          # Trim Galore reports\n    *_fastqc.{html,zip}            # FastQC on the trimmed reads\n  alignment/\n    {sample}.filtered.bam          # Filtered, deduplicated, blacklist-free BAM\n    {sample}.filtered.bam.bai\n    {sample}.flagstat.txt          # samtools flagstat on the filtered BAM\n    {sample}.dup_metrics.txt       # Picard MarkDuplicates metrics\n  hotspots/\n    {sample}.hotspots.fdr0.05.bed  # DHS hotspots (primary output; unstarched)\n    {sample}.peaks.narrowPeak      # Peaks within hotspots (unstarched)\n    {sample}.allcalls.bed          # All site calls before FDR filtering (unstarched)\n    {sample}.SPOT.txt              # SPOT score\n    {sample}.density.bw            # RPM fragment-coverage signal track (bigWig)\n  footprints/\n    {sample}.footprints.bed        # TF footprints (omitted with --skip_footprint)\n  qc/\n    {sample}.insert_sizes.txt      # samtools stats output (insert sizes in the IS block)\n  multiqc/\n    multiqc_report.html\n  pipeline_info/\n    timeline.html\n    report.html\n    trace.txt\n</code></pre>\n<p>The <code>.bed</code>, <code>.narrowPeak</code> and <code>.SPOT.txt</code> files under <code>hotspots/</code> are the\n<code>unstarch</code>-ed forms of the Hotspot2 <code>.starch</code> archives; the raw archives stay in\nthe Nextflow work directory. <code>{sample}.density.bw</code> is the bedtools RPM fragment\ncoverage track, not the per-base cut-count bigWig Hotspot2 writes internally.</p>\n<h2>QC Thresholds (ENCODE Standards)</h2>\n<table>\n<thead>\n<tr>\n<th>Metric</th>\n<th>Pass</th>\n<th>Warning</th>\n<th>Fail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>SPOT score (Signal Portion of Tags)</td>\n<td>&gt;0.4</td>\n<td>0.2-0.4</td>\n<td>&lt;0.2</td>\n</tr>\n<tr>\n<td>Hotspot count</td>\n<td>&gt;50,000</td>\n<td>20,000-50,000</td>\n<td>&lt;20,000</td>\n</tr>\n<tr>\n<td>Mapping rate</td>\n<td>&gt;80%</td>\n<td>60-80%</td>\n<td>&lt;60%</td>\n</tr>\n<tr>\n<td>Duplication rate</td>\n<td>&lt;30%</td>\n<td>30-50%</td>\n<td>&gt;50%</td>\n</tr>\n<tr>\n<td>NRF (Non-Redundant Fraction)</td>\n<td>&gt;0.8</td>\n<td>0.7-0.8</td>\n<td>&lt;0.7</td>\n</tr>\n<tr>\n<td>PBC1 (PCR Bottleneck Coefficient 1)</td>\n<td>&gt;0.9</td>\n<td>0.7-0.9</td>\n<td>&lt;0.7</td>\n</tr>\n<tr>\n<td>Insert size peak</td>\n<td>50-150 bp</td>\n<td>Variable</td>\n<td>Abnormal</td>\n</tr>\n</tbody>\n</table>\n<p>The workflow produces everything the first four rows and the last row need:\nthe SPOT score (<code>hotspots/{sample}.SPOT.txt</code>), the hotspot BED to count, the\nmapping and duplication rates (<code>alignment/{sample}.flagstat.txt</code> and\n<code>{sample}.dup_metrics.txt</code>), and the insert-size distribution\n(<code>qc/{sample}.insert_sizes.txt</code>). NRF, PBC1 and PBC2 are <strong>not</strong> computed;\nderive them manually from the alignment BAM as shown in\n<code>references/03-filtering.md</code>.</p>\n<h3>SPOT Score</h3>\n<p>The SPOT score (Signal Portion of Tags) is the fraction of reads falling\nwithin hotspots. It is the DNase-seq equivalent of FRiP for ChIP-seq.</p>\n<p>Higher SPOT = more enrichment in accessible regions = better library quality.</p>\n<h2>Hotspot2 vs MACS2</h2>\n<p><strong>IMPORTANT</strong>: ENCODE uses Hotspot2 for DNase-seq, NOT MACS2.</p>\n<table>\n<thead>\n<tr>\n<th>Feature</th>\n<th>Hotspot2</th>\n<th>MACS2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Designed for</td>\n<td>DNase-seq</td>\n<td>ChIP-seq</td>\n</tr>\n<tr>\n<td>Background model</td>\n<td>Local tag density + mappability</td>\n<td>Dynamic Poisson</td>\n</tr>\n<tr>\n<td>ENCODE standard</td>\n<td>Yes (DNase-seq)</td>\n<td>Yes (ChIP-seq/ATAC-seq)</td>\n</tr>\n<tr>\n<td>Mappability correction</td>\n<td>Built-in</td>\n<td>Not available</td>\n</tr>\n<tr>\n<td>Output</td>\n<td>Hotspots + peaks</td>\n<td>Peaks only</td>\n</tr>\n</tbody>\n</table>\n<p>Hotspot2 accounts for mappability variation across the genome, which is\ncritical for DNase-seq because DNase I cuts accessible chromatin regardless\nof whether it is uniquely mappable.</p>\n<h2>Critical Pitfalls</h2>\n<h3>DNase-seq vs ATAC-seq</h3>\n<p>These are different assays measuring the same biology (chromatin accessibility):</p>\n<ul>\n<li><strong>DNase-seq</strong>: Uses DNase I enzyme, requires more input material</li>\n<li><strong>ATAC-seq</strong>: Uses Tn5 transposase, works on fewer cells</li>\n<li>Analysis pipelines differ: Hotspot2 for DNase-seq, MACS2 for ATAC-seq</li>\n<li>Data are largely concordant but not identical</li>\n</ul>\n<h3>Fragment Size Distribution</h3>\n<p>DNase-seq produces a characteristic fragment size distribution:</p>\n<ul>\n<li>Peak at ~50-100 bp (sub-nucleosomal fragments at DHS)</li>\n<li>Secondary peak at ~150-200 bp (mononucleosomal fragments)</li>\n<li>Long tail of larger fragments</li>\n<li>If distribution is abnormal, check library preparation protocol</li>\n</ul>\n<h3>Mappability Index</h3>\n<p>Hotspot2 needs a center-sites file, which is derived from a mappable-regions BED. Both are\nread-length and genome-build specific. Create the center sites once per genome with the script\nthat ships with Hotspot2 (it is on the PATH inside the image):</p>\n<pre><code># chrom_sizes.bed is a BED file: chromosome, 0, length\nawk 'BEGIN{OFS=\"\\t\"} {print $1, 0, $2}' hg38.chrom.sizes | sort-bed - &gt; chrom_sizes.bed\nextractCenterSites.sh -c chrom_sizes.bed -M hg38.mappable_only.bed -o hg38.center_sites.n100.starch\n</code></pre>\n<p>Pass the same mappable-regions BED to the workflow as <code>--hotspot_mappable</code> that\nwas used to build the center sites.</p>\n<p>Mappable-regions files:</p>\n<ul>\n<li>hg38 / 36 bp: Use ENCODE-provided index</li>\n<li>hg38 / 76 bp: Use ENCODE-provided index</li>\n<li>hg38 / 150 bp: May need to generate custom index</li>\n<li>Wrong mappability index = incorrect peak calls</li>\n</ul>\n<p>The workflow ends at footprint calling; motif matching against JASPAR is a separate\ndownstream step (see the <code>jaspar-motifs</code> skill).</p>\n<h3>RGT Data Directory (footprinting)</h3>\n<p>HINT reads genome sequence and annotation from an RGT data directory, which is several GB and\nis not part of the image. Create it once, then pass it with <code>--rgt_data</code>:</p>\n<pre><code>pip install RGT==1.0.2            # creates ~/rgtdata with setupGenomicData.py\ncd ~/rgtdata &amp;&amp; python setupGenomicData.py --hg38\n</code></pre>\n<p>Then run with <code>--rgt_data ~/rgtdata</code>, or use <code>--skip_footprint</code> to stop after hotspot calling.</p>\n<h3>Blacklist Filtering</h3>\n<p><code>--blacklist</code> is required and the workflow removes blacklisted reads from the\nBAM (Amemiya et al. 2019) before Hotspot2 runs, so the published peaks are\nalready blacklist-free. Blacklist regions produce artifactual signal in\naccessibility assays.</p>\n<p>Filter at the peak level only when the peaks came from a BAM that was not\nfiltered, or when applying an additional list:</p>\n<pre><code>bedtools intersect -a hotspots.bed -b hg38-blacklist.v2.bed -v &gt; hotspots_filtered.bed\n</code></pre>\n<h2>Footprinting Analysis</h2>\n<p>Transcription factor footprinting detects bound TFs from DNase-seq signal.\nThis is what the workflow runs:</p>\n<h3>HINT Footprinting (DNase-seq mode)</h3>\n<pre><code>rgt-hint footprinting \\\n    --dnase-seq \\\n    --paired-end \\\n    --organism hg38 \\\n    --output-location footprints/ \\\n    --output-prefix sample \\\n    sample.filtered.bam \\\n    sample.peaks.narrowPeak\n</code></pre>\n<p>Use <code>--dnase-seq</code>, not <code>--atac-seq</code>: the two apply different cleavage-bias\nmodels, and the wrong one silently produces wrong footprints.</p>\n<h3>Interpretation</h3>\n<ul>\n<li>Footprints are depressions in the DNase signal where a bound TF protects DNA</li>\n<li>Requires deep sequencing (&gt;100M reads) for reliable footprints</li>\n<li>Sensitivity varies by TF: pioneer factors have shallow footprints</li>\n<li>Vierstra et al. 2020 provides a global reference map for comparison</li>\n</ul>\n<h2>Provenance Integration</h2>\n<p>After pipeline completion, log all outputs:</p>\n<pre><code>encode_log_derived_file(\n    file_path=\"/results/hotspots/sample1.hotspots.fdr0.05.bed\",\n    source_accessions=[\"ENCSR...\", \"ENCFF...\"],\n    description=\"DNase hypersensitive sites from ENCODE DNase-seq pipeline\",\n    file_type=\"DHS_peaks\",\n    tool_used=\"BWA 0.7.18 + Hotspot2 2.1.2\",\n    parameters=\"FDR 0.05, blacklist filtered, ENCODE hg38 mappability index\"\n)\n</code></pre>\n<h2>Reference Files</h2>\n<p>Detailed step-by-step documentation is provided in the <code>references/</code> directory:</p>\n<ol>\n<li><code>01-qc-trimming.md</code> -- Read QC and adapter trimming</li>\n<li><code>02-alignment.md</code> -- BWA-MEM alignment for DNase-seq</li>\n<li><code>03-filtering.md</code> -- BAM filtering, deduplication, blacklist removal</li>\n<li><code>04-hotspot-calling.md</code> -- Hotspot2 DHS detection and signal generation</li>\n<li><code>05-footprinting.md</code> -- TF footprint detection with HINT</li>\n</ol>\n<h2>Walkthrough: Processing ENCODE DNase-seq from FASTQ to Hypersensitive Sites</h2>\n<p><strong>Goal</strong>: Process raw DNase-seq FASTQ files through the ENCODE pipeline to generate DNase I hypersensitive site (DHS) peak calls.\n<strong>Context</strong>: DNase-seq identifies open chromatin via DNase I enzyme digestion. The pipeline uses BWA alignment and Hotspot2 for DHS identification.</p>\n<h3>Step 1: Find DNase-seq experiment</h3>\n<pre><code>encode_search_experiments(assay_title=\"DNase-seq\", biosample_term_name=\"K562\", organism=\"Homo sapiens\")\n</code></pre>\n<p>Expected output:</p>\n<pre><code>{\n  \"results\": [\n    {\"accession\": \"ENCSR000DNS\", \"assay_title\": \"DNase-seq\", \"biosample_summary\": \"K562\", \"status\": \"released\"}\n  ],\n  \"total\": 8,\n  \"limit\": 25,\n  \"offset\": 0,\n  \"has_more\": false,\n  \"next_offset\": null\n}\n</code></pre>\n<h3>Step 2: List and download FASTQ files</h3>\n<pre><code>encode_list_files(experiment_accession=\"ENCSR000DNS\", file_format=\"fastq\")\n</code></pre>\n<p>Expected output (a JSON array of file records; fields abridged):</p>\n<pre><code>[\n  {\"accession\": \"ENCFF500DN1\", \"file_format\": \"fastq\", \"output_type\": \"reads\", \"file_size_human\": \"2.6 GB\", \"biological_replicates\": [1], \"status\": \"released\"},\n  {\"accession\": \"ENCFF501DN2\", \"file_format\": \"fastq\", \"output_type\": \"reads\", \"file_size_human\": \"2.7 GB\", \"biological_replicates\": [1], \"status\": \"released\"}\n]\n</code></pre>\n<pre><code>encode_download_files(file_accessions=[\"ENCFF500DN1\", \"ENCFF501DN2\"], download_dir=\"/data/dnaseseq/fastq\")\n</code></pre>\n<h3>Step 3: Name the FASTQs so a read-pair glob can find them, then run the pipeline</h3>\n<p>ENCODE names every FASTQ after its accession (<code>ENCFF500DN1.fastq.gz</code>), with no <code>_R1</code>/<code>_R2</code>\nin the name, so the two files of a pair share no prefix and the <code>--reads</code> glob cannot pair\nthem. Link them into the shape the glob expects. Which mate an accession is comes from the\nENCODE file record on encodeproject.org, which carries <code>paired_end</code> (1 or 2) and\n<code>paired_with</code>; the MCP file tools do not return those two fields:</p>\n<pre><code>cd /data/dnaseseq/fastq\nln -s ENCFF500DN1.fastq.gz k562_rep1_R1.fastq.gz\nln -s ENCFF501DN2.fastq.gz k562_rep1_R2.fastq.gz\n</code></pre>\n<pre><code>nextflow run scripts/main.nf \\\n  -profile local \\\n  --reads '/data/dnaseseq/fastq/k562_*_R{1,2}.fastq.gz' \\\n  --bwa_index /ref/bwa_index/genome.fa \\\n  --chrom_sizes /ref/hg38.chrom.sizes \\\n  --hotspot_center_sites /ref/hotspot2/hg38.center_sites.n100.starch \\\n  --hotspot_mappable /ref/hotspot2/hg38.mappable_only.bed \\\n  --rgt_data /ref/rgtdata \\\n  --blacklist /ref/hg38-blacklist.v2.bed \\\n  --outdir results/ \\\n  -resume\n</code></pre>\n<p>Key pipeline steps:</p>\n<ol>\n<li>Quality trimming</li>\n<li>BWA-MEM alignment</li>\n<li>Duplicate removal and blacklist filtering</li>\n<li>Hotspot2 DHS calling</li>\n<li>Signal track generation</li>\n<li>Footprint analysis (HINT, DNase-seq mode)</li>\n</ol>\n<h3>Step 4: Validate output quality</h3>\n<table>\n<thead>\n<tr>\n<th>Metric</th>\n<th>Threshold</th>\n<th>Purpose</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>SPOT score</td>\n<td>&gt; 0.4</td>\n<td>Signal portion of tags</td>\n</tr>\n<tr>\n<td>Hotspot count</td>\n<td>&gt; 50,000</td>\n<td>Sensitivity</td>\n</tr>\n<tr>\n<td>Duplicate rate</td>\n<td>&lt; 30%</td>\n<td>Library complexity</td>\n</tr>\n</tbody>\n</table>\n<h3>Step 5: Compare with ATAC-seq</h3>\n<pre><code>encode_search_experiments(assay_title=\"ATAC-seq\", biosample_term_name=\"K562\", organism=\"Homo sapiens\")\n</code></pre>\n<p><strong>Interpretation</strong>: DNase-seq and ATAC-seq both measure accessibility but with different biases. Compare peaks from both assays -- concordant peaks are high confidence.</p>\n<h3>Integration with downstream skills</h3>\n<ul>\n<li>DHS peaks feed into -&gt; <strong>accessibility-aggregation</strong> alongside ATAC-seq peaks</li>\n<li>Footprint data feeds into -&gt; <strong>motif-analysis</strong> for TF binding prediction</li>\n<li>Signal tracks feed into -&gt; <strong>visualization-workflow</strong></li>\n<li>Peaks integrate with -&gt; <strong>regulatory-elements</strong> for cCRE classification</li>\n</ul>\n<h2>Code Examples</h2>\n<h3>1. Survey DNase-seq availability</h3>\n<pre><code>encode_get_facets(assay_title=\"DNase-seq\", organism=\"Homo sapiens\")\n</code></pre>\n<p>Expected output (facet field names are the top-level keys):</p>\n<pre><code>{\n  \"biosample_ontology.organ_slims\": [\n    {\"term\": \"blood\", \"count\": 45},\n    {\"term\": \"brain\", \"count\": 30}\n  ]\n}\n</code></pre>\n<h3>2. Check for existing DHS peaks</h3>\n<pre><code>encode_list_files(experiment_accession=\"ENCSR000DNS\", file_format=\"bed\", output_type=\"peaks\", assembly=\"GRCh38\")\n</code></pre>\n<p>Expected output (a JSON array of file records; fields abridged):</p>\n<pre><code>[\n  {\"accession\": \"ENCFF800DHS\", \"file_format\": \"bed\", \"file_type\": \"bed narrowPeak\", \"output_type\": \"peaks\", \"assembly\": \"GRCh38\", \"file_size_human\": \"1.5 MB\"}\n]\n</code></pre>\n<h3>3. Track DNase-seq experiments</h3>\n<pre><code>encode_track_experiment(accession=\"ENCSR000DNS\", notes=\"K562 DNase-seq for accessibility comparison with ATAC-seq\")\n</code></pre>\n<p>Expected output (the <code>notes</code> you pass are stored, not echoed back; read them with <code>encode_list_tracked</code>):</p>\n<pre><code>{\n  \"tracking\": {\"accession\": \"ENCSR000DNS\", \"action\": \"tracked\"},\n  \"publications_found\": 0,\n  \"publications\": [],\n  \"pipelines_found\": 1,\n  \"pipelines\": [\n    {\"title\": \"DNase-HS pipeline single-end - Version 2\", \"version\": \"2.0\", \"software\": [{\"name\": \"bwa\", \"version\": \"0.7.17\"}], \"status\": \"released\"}\n  ]\n}\n</code></pre>\n<h2>Integration</h2>\n<table>\n<thead>\n<tr>\n<th>This skill produces...</th>\n<th>Feed into...</th>\n<th>Purpose</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>DHS peaks (narrowPeak)</td>\n<td><strong>accessibility-aggregation</strong></td>\n<td>Union merge with ATAC-seq peaks</td>\n</tr>\n<tr>\n<td>TF footprints</td>\n<td><strong>motif-analysis</strong></td>\n<td>Validate motif predictions with footprint evidence</td>\n</tr>\n<tr>\n<td>Signal tracks (bigWig)</td>\n<td><strong>visualization-workflow</strong></td>\n<td>Genome browser display</td>\n</tr>\n<tr>\n<td>Accessible regions</td>\n<td><strong>regulatory-elements</strong></td>\n<td>cCRE classification</td>\n</tr>\n<tr>\n<td>DHS coordinates</td>\n<td><strong>variant-annotation</strong></td>\n<td>Annotate variants in hypersensitive sites</td>\n</tr>\n<tr>\n<td>QC metrics</td>\n<td><strong>quality-assessment</strong></td>\n<td>Validate SPOT score and sensitivity</td>\n</tr>\n<tr>\n<td>Pipeline parameters</td>\n<td><strong>data-provenance</strong></td>\n<td>Record BWA/Hotspot2 versions</td>\n</tr>\n<tr>\n<td>DHS peak regions</td>\n<td><strong>jaspar-motifs</strong></td>\n<td>Scan accessible sites for known TF motifs</td>\n</tr>\n</tbody>\n</table>\n<h2>Related Skills</h2>\n<ul>\n<li><code>pipeline-guide</code> -- Parent skill with compute resource assessment and cloud setup</li>\n<li><code>accessibility-aggregation</code> -- Aggregate DHS data across samples/tissues</li>\n<li><code>quality-assessment</code> -- Evaluate pipeline output quality metrics</li>\n<li><code>data-provenance</code> -- Track all pipeline inputs, outputs, and parameters</li>\n<li><code>download-encode</code> -- Download ENCODE DNase-seq FASTQ files for pipeline input</li>\n<li><code>publication-trust</code> -- Verify literature claims backing analytical decisions</li>\n</ul>\n<h2>Presenting Results</h2>\n<p>When reporting DNase-seq pipeline results:</p>\n<ul>\n<li><strong>Hotspot counts</strong>: Report total Hotspot2 DHS calls at the specified FDR threshold and the number remaining after blacklist filtering</li>\n<li><strong>Signal-to-noise (SPOT score)</strong>: Report the SPOT score prominently (&gt;0.4 pass, 0.2-0.4 warning, &lt;0.2 fail). This is the DNase-seq equivalent of FRiP</li>\n<li><strong>Footprint depth</strong>: If footprinting was performed, report the number of lines in <code>footprints/{sample}.footprints.bed</code> and note the sequencing depth (&gt;100M reads recommended for reliable footprints)</li>\n<li><strong>Key QC metrics</strong>: Present mapping rate (&gt;80%) and duplication rate (&lt;30%) from <code>alignment/{sample}.flagstat.txt</code> and <code>alignment/{sample}.dup_metrics.txt</code>, and the insert size peak from the <code>IS</code> block of <code>qc/{sample}.insert_sizes.txt</code>. NRF (&gt;0.8) and PBC1 (&gt;0.9) are not produced by the workflow -- state that they were computed manually (<code>references/03-filtering.md</code>) or that they are unavailable</li>\n<li><strong>Output paths</strong>: Provide paths to hotspot BED files, narrowPeak files, signal bigWig tracks, and footprint results</li>\n<li><strong>Mappability note</strong>: Confirm which Hotspot2 mappability index was used and that it matches the read length</li>\n<li><strong>Next steps</strong>: Suggest <code>motif-analysis</code> for TF motif enrichment in DHS peaks, or <code>accessibility-aggregation</code> for merging DHS data across samples</li>\n</ul>\n<h2>For the request: \"$ARGUMENTS\"</h2>\n","files":[{"path":"references/01-qc-trimming.md","sizeBytes":3246,"isText":true},{"path":"references/02-alignment.md","sizeBytes":3435,"isText":true},{"path":"references/03-filtering.md","sizeBytes":2955,"isText":true},{"path":"references/04-hotspot-calling.md","sizeBytes":6598,"isText":true},{"path":"references/05-footprinting.md","sizeBytes":5238,"isText":true},{"path":"references/literature.md","sizeBytes":11123,"isText":true},{"path":"scripts/Dockerfile","sizeBytes":3612,"isText":false},{"path":"scripts/main.nf","sizeBytes":11416,"isText":false},{"path":"scripts/nextflow.config","sizeBytes":4410,"isText":false},{"path":"SKILL.md","sizeBytes":24789,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-22T13:26:25.419643Z","sha256":"8050EE8DE8CB807DDFC975D9DA61397CD17D103B02BAC1073FFF17DC651C2718","sizeBytes":30356},"review":null,"source":{"repositoryUrl":"https://github.com/ammawla/encode-toolkit","path":"plugin/skills/pipeline-dnaseseq","license":"AGPL-3.0","commit":"36836c8725fd4d20d9c851ce314f5151aea5f57c","subtreeSha":"5564787698B36915B9B71C6C1DFBA776FA4DB9131CEFF37952F608D621A8AC2D","lastSyncedAt":"2026-09-29T20:56:54.045383Z"},"reviewedAt":"2026-09-22T13:27:50.017166Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/ammawla/encode-toolkit/tree/main/plugin/skills/pipeline-dnaseseq"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install ammawla-encode-toolkit@llmmart"},{"target":"git","command":"git clone https://github.com/ammawla/encode-toolkit.git"}]}