scATAC Analysis Parameters¶
DNBelab C Series HT scATAC Parameter Configuration Guide
Overview ¶
This document explains the parameter meanings, default behaviors, and common usage patterns for each subcommand of dnbc4tools atac, covering single-sample analysis (run), reference library construction (mkref), and multi-sample task generation (multi).
Tip
Parameter descriptions are based on the current command-line help information. Examples can be used directly as templates and adjusted as needed.
Main Analysis Pipeline (run) ¶
Usage ¶
$ dnbc4tools atac run
dnbc4tools 3.1
Process a single-cell ATAC-seq sample.
Usage: dnbc4tools atac run [OPTIONS]
optional arguments:
--help show this help message and exit
Input Files:
Choose one input method: either `--fastqs` (directory input) or individual FASTQ files (`--fastq1` and `--fastq2`).
--fastqs <DIR> Input directory path containing paired-end FASTQ files. The pipeline automatically detects Read 1 and Read 2 files (e.g., `./fastq_dir`).
--fastq1 <FILE> Read 1 FASTQ file path(s) for the ATAC library. Wildcards and comma-separated lists are supported (e.g., `sample1_L01_R1.fastq.gz,sample1_L02_R1.fastq.gz`).
--fastq2 <FILE> Read 2 FASTQ file path(s) for the ATAC library. Must match the order provided to `--fastq1` (e.g., `sample1_L01_R2.fastq.gz,sample1_L02_R2.fastq.gz`).
Basic Settings:
--name <STR> Unique identifier for the sample. Used for naming output files and reports (e.g., `sample1`).
--genomeDir <DIR> Reference genome directory path. Must contain required index and annotation resources (e.g., `./genome_index`).
--outdir <DIR> Output directory path for results and reports [default: current directory] (e.g., `./output`).
--threads <INT> Number of CPU threads for parallel processing [default: 10].
Library Settings:
--darkreaction <STR> Dark cycle setting for ATAC library [default: auto]. Supported values: `auto`, `R1R2`, `R1`, `R2`, `unset` (e.g., `R1R2`).
--customize <STR> Custom read structure string. Format: `<type>,<read>:<start>-<end>` joined by `;`. (e.g., `cb,R1:1-10;cb,R1:11-20;R1,R1:21-70;R2,R2:1-50`).
Filtering Settings:
--forcecells <INT> Force pipeline to use exactly this number of cells (e.g., `5000`).
--frags_cutoff <INT> Minimum number of unique fragments to retain a cell [default: 1000] (e.g., `1000`).
--tss_cutoff <FLOAT> Minimum TSS proportion threshold to retain a cell [default: 0.0] (e.g., `0.2`).
--jaccard_cutoff <FLOAT> Jaccard similarity threshold for bead merging (e.g., `0.02`).
--merge_cutoff <INT> Minimum number of fragments when merging beads [default: 500] (e.g., `500`).
Analysis Settings:
--need_bam Enable generation of BAM files containing aligned reads.
--sample_read_pairs <INT> Subsample the specified number of read pairs from input FASTQ file(s) (e.g., `1000000`).
Parameter Description¶
Required Parameters¶
Essential parameters that must be specified for a successful analysis
--name (Required)¶
Provide a unique name for this analysis run.
- Function: This name will be used as a prefix for all output files and the HTML report.
- Display: In the final web report, this name will be shown as the Sample ID.
Default: None
Example:
--name sample_001
--genomeDir (Required)¶
Specify the path to the reference genome directory.
- Requirement: The directory must contain the index and annotation resources generated by the
mkrefcommand. - Content: Includes genome sequence, TSS file, alignment index, etc.
Default: None
Example:
--genomeDir /path/to/genome/database
Input File Parameters¶
Choose one input method: directory input or individual FASTQ files
--fastqs (Method 1)¶
Specify the path to the directory containing all FASTQ files.
- Function: The pipeline will automatically detect paired Read 1 and Read 2 files in the directory.
- Directory requirement (ATAC):
--fastqsshould point to a directory that contains only FASTQ files from the current ATAC library, with R1/R2 files placed directly under that directory. - Naming requirement: Automatic detection relies on R1/R2 markers in file names. Supported R1 patterns are
_R1_,_R1,_1, and_read1; supported R2 patterns are_R2_,_R2,_2, and_read2. Supported extensions are.fastq.gz,.fq.gz,.fastq, and.fq. - Note: This is a convenience option and cannot be used simultaneously with
--fastq1/--fastq2.
Recommended directory structure:
fastq_directory/
├── sample_ATAC_L01_R1.fastq.gz
├── sample_ATAC_L01_R2.fastq.gz
├── sample_ATAC_L02_R1.fastq.gz
└── sample_ATAC_L02_R2.fastq.gz
Default: None
Example:
--fastqs ./fastq_directory
--fastq1 (Method 2A)¶
Specify one or more Read 1 FASTQ files individually.
- Support: You can use wildcards (
*) to match files or a comma-separated list for multiple files. - Requirement: Must be used in pairs with the
--fastq2parameter, and the file order must match exactly.
Default: None
Example:
--fastq1 sample1_L01_R1.fastq.gz,sample1_L02_R1.fastq.gz
--fastq2 (Method 2B)¶
Specify one or more Read 2 FASTQ files individually.
- Support: You can use wildcards (
*) to match files or a comma-separated list for multiple files. - Requirement: Must be used in pairs with the
--fastq1parameter, and the file order must match exactly.
Default: None
Example:
--fastq2 sample1_L01_R2.fastq.gz,sample1_L02_R2.fastq.gz
Input Method Selection:
- Method 1: Use
--fastqsto specify a directory containing paired FASTQ files. - Method 2: Use
--fastq1and--fastq2to specify R1 and R2 files respectively.
Compatible aliases
Important Note: Files provided for the same input group must come from the same library and use consistent sequencing mode and dark-reaction settings. Data from different libraries must not be merged for analysis.
Basic Settings¶
--outdir (Optional)¶
Specify the output directory for all analysis results and reports.
- Function: All analysis results will be saved in this directory, and the pipeline will automatically create a structured subdirectory named after the sample.
Default: ./ (current directory)
Example:
--outdir ./output_results
--threads (Optional)¶
Set the number of CPU threads to be used during the analysis.
- Function: Increasing the number of threads can significantly speed up the analysis.
- Recommendation: Adjust based on the number of available CPU cores for optimal performance.
Default: 10
Example:
--threads 16
Library Settings¶
--darkreaction (Optional)¶
Configure the dark cycle settings for the ATAC library to ensure accurate cell barcode identification.
- Function: Guides the software to correctly parse dark reaction cycles generated by the sequencing chemistry (e.g., on MGI platforms).
- Smart Detection: By default, the software automatically detects data characteristics to select the appropriate mode. Recommended for initial analysis.
Detailed Configuration Options
| Option | Description | Use Case |
|---|---|---|
auto |
(Default) Automatically detects dark cycle configuration and applies the optimal setting based on library type. | Applicable to all standard ATAC sequencing data. |
R1R2 |
Both Read 1 and Read 2 contain dark cycle bases. | Applicable for dual-end dark cycle sequencing designs. |
R1 |
Only the Read 1 end contains dark cycle bases. | Applicable for single-end dark cycle (Read 1 direction) sequencing designs. |
R2 |
Only the Read 2 end contains dark cycle bases. | Applicable for single-end dark cycle (Read 2 direction) sequencing designs. |
unset |
The library contains no dark cycle bases; no dark cycle correction is performed. | Applicable for non-MGI platforms or sequencing designs without dark cycles. |
Examples:
# Scenario 1: Initial analysis, using auto-detection
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref
# Scenario 2: Known library has dark cycles only on R1 and auto-analysis fails or identifies incorrectly
dnbc4tools atac run --name sample2 --fastqs ./fq --genomeDir ./ref --darkreaction R1
Important Note: Incorrect settings can lead to cell barcode identification failure or loss of sequence information. Specify manually only if you understand the library structure or if auto-detection fails.
--customize (Advanced)¶
Precisely define the extraction structure for barcodes and effective sequences (reads) for non-standard libraries.
- Function: This parameter provides ultimate control when the preset modes of
--darkreactionare not applicable. It will override any--darkreactionsettings. - Syntax:
"<type>,<read>:<start>-<end>";..., with multiple segments separated by semicolons (;), and coordinates are 1-based.
Parameter Type Details
| Type | Description | Example |
|---|---|---|
cb | Cell Barcode | cb,R1:1-10 |
R1 | Effective DNA sequence in Read 1 | R1,R1:21-70 |
R2 | Effective DNA sequence in Read 2 | R2,R2:1-50 |
Examples:
# Example 1: Assume R1 structure is: Barcode 1 (10bp) -> Barcode 2 (10bp) -> Insert (50bp). R2 structure is: Insert (50bp).
--customize "cb,R1:1-10;cb,R1:11-20;R1,R1:21-70;R2,R2:1-50"
# Example 2: Assume R1 structure is: Fixed (6bp) -> Barcode 1 (10bp) -> Fixed (6bp) -> Barcode 2 (10bp) -> Fixed (33bp) -> Insert (50bp). R2 structure is: Fixed (19bp) -> Insert (50bp).
--customize "cb,R1:7-16;cb,R1:23-32;R1,R1:66-115;R2,R2:20-69"
Notes:
- Must use quotes: The entire string must be enclosed in double quotes due to special characters.
- Accurate coordinates: The coordinate range cannot exceed the actual read length in the FASTQ file, or it will cause a parsing failure.
Filtering Settings¶
--forcecells (Optional)¶
Force the pipeline to use an exact number of cells, overriding the software's automatic cell detection.
- Function: Use when you want to analyze a cell population of a known quantity.
- Priority: This is the highest-priority filtering parameter.
Default: None
Example:
# Force the output of 5000 cells for analysis
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref --forcecells 5000
--frags_cutoff (Optional)¶
Set the minimum number of unique fragments to retain a cell.
- Function: This is a core cell quality control parameter. Cells below this threshold are considered to have poor data quality and will be excluded from subsequent analysis.
- Recommendation: Use the default value for the initial analysis, then determine a more appropriate threshold based on the "Fragments Count Distribution" plot in the "TSS Targeting" section of the web report.
Default: 1000
Example:
# Lower the fragment threshold for cell filtering to 500
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref --frags_cutoff 500
--tss_cutoff (Optional)¶
Set the minimum proportion of fragments in TSS regions to retain a cell.
- Function: TSS enrichment is a key quality metric for ATAC-seq data. Setting this threshold can effectively exclude low-quality cells caused by technical issues like cell damage or nuclear lysis.
Default: 0 (no filtering)
Example:
# Filter out cells with a TSS region fragment proportion below 0.1
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref --tss_cutoff 0.1
--jaccard_cutoff (Optional)¶
The Jaccard similarity threshold for merging multiple barcodes (beads) that potentially belong to the same cell.
- Function: Corrects for "duplicate" cell barcodes arising from loading or amplification biases, based on the similarity of chromatin accessibility patterns.
- Mode: Supports manual threshold setting or using
autoto let the software automatically determine the best threshold based on the OTSU algorithm.
Default: auto
Example:
# Manually set the Jaccard similarity threshold to 0.02
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref --jaccard_cutoff 0.02
--merge_cutoff (Optional)¶
Set the minimum number of fragments required for a bead to be included in the Jaccard merging process.
- Function: Only beads with fragment counts above this threshold will be included in the Jaccard similarity calculation and merging process. The merged valid cell fragments will be used for subsequent peak calling.
- Effect: Filters out low-quality beads before merging, improving the accuracy and efficiency of the merge.
- Recommendation: For samples with low total fragments, you can lower this value appropriately to include more beads for merging, thereby obtaining more valid fragments for subsequent analysis.
Default: 500
Example:
# For a low-fragment sample, lower the threshold to 200 to include more beads for merging
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref --merge_cutoff 200
Analysis Settings¶
--need_bam (Flag)¶
Enable the generation of BAM format files.
- Function: Generates a BAM file containing all aligned reads with valid barcodes, which can be used for visualization in tools like IGV or for other custom analyses.
- Note: Enabling this option will significantly increase computation time and disk space usage, with an expected runtime increase of 30-50%. Additionally, due to differences in how the chromap aligner generates BAM files versus directly outputting BED files, the final results may vary slightly.
Default: If not set, BAM files are not generated.
--sample_read_pairs (Optional)¶
Extract a specified number of read pairs from the input FASTQ files for analysis.
- Function: Used for quick testing of large datasets before a full analysis, or for down-sampling analysis when resources are limited.
Default: None (uses all data)
Example:
--sample_read_pairs 100000000
Analysis Recommendation
For the initial analysis, it is recommended to use the default parameters and then adjust them as needed based on the results report.
Reference Database Construction (mkref) ¶
Usage¶
$ dnbc4tools atac mkref
dnbc4tools 3.1
Build an ATAC reference database.
Usage: dnbc4tools atac mkref [OPTIONS]
optional arguments:
--help show this help message and exit
Input Files:
Input genome FASTA files and gene-annotation GTF files. For mixed-species analysis, separate multiple files with commas.
--fasta <FILE> Reference-genome FASTA file path(s). Separate multiple files with commas (e.g., `genome.fa`).
--ingtf <FILE> Gene-annotation GTF file path(s). Separate multiple files with commas (e.g., `anno.gtf`).
Basic Settings:
--genomeDir <DIR> Output directory path for generated reference files [default: current directory] (e.g., `./ref`).
--species <STR> Species identifier(s). Use commas for mixed-species analysis [default: undefined] (e.g., `Homo_sapiens`).
Advanced Settings:
--tag <TYPE> Feature type used to generate the BED file [default: transcript] (e.g., `exon`).
--chrM <STR> Mitochondrial chromosome identifier in the reference genome [default: auto] (e.g., `MT`).
--chloroplast <STR> Chloroplast chromosome name, primarily for plant references [default: None] (e.g., `Pt`).
--prefix <STR> Filter chromosomes by prefix or full name. This option is not supported for mixed-species references [default: None] (e.g., `chr`).
--kmer <INT> k-mer length, which determines the size of the substrings extracted [default: 17] (e.g., `20`).
--window <INT> Window size, which defines the number of consecutive k-mers within each window [default: 7] (e.g., `10`).
--noindex Generate only ref.json without building the genome index.
Parameter Description¶
Required Parameters¶
--fasta (Required)¶
Provide the reference genome sequence file.
- Requirement: Standard FASTA format, primary assembly version is recommended.
- Dual-species: Supports providing two comma-separated FASTA files for mixed-species analysis.
Default: None
Example:
--fasta Homo_sapiens.GRCh38.dna.primary_assembly.fa
--ingtf (Required)¶
Provide the gene structure annotation file.
- Requirement: Standard GTF format, must contain
geneandtranscripttype annotation entries. - Function: Used to define TSS (Transcription Start Sites) and promoter regions.
Default: None
Example:
--ingtf Homo_sapiens.GRCh38.108.gtf
Output Settings¶
--genomeDir (Optional)¶
Specify the output directory for the generated reference database.
- Function: All generated reference files (index, annotations, etc.) will be stored in this directory.
Example Output Directory Structure
<genomeDir/species>/
├── fasta/
│ ├── genome.fa
│ └── genome.index
├── genes/
│ └── genes.gtf
├── regions/
│ ├── chrom.sizes
│ ├── promoter.bed
│ └── tss.bed
└── ref.json
Default: ./ (current directory)
Example:
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --genomeDir /database/scATAC/GRCh38
--species (Optional)¶
Specify a species name for the reference database.
- Function: This name is recorded in the configuration file for easy identification later.
- Recommendation: Use a standard scientific name format, such as
Homo_sapiens.
Default: undefined
Example:
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --species Homo_sapiens
Genome Settings¶
--tag (Optional)¶
Select the source of information for generating the TSS (Transcription Start Site) file.
- Options:
gene(uses gene start sites) ortranscript(uses transcript start sites). - Recommendation: Using
transcriptmode can yield more accurate TSS enrichment analysis results.
Default: transcript
Example:
# Generate TSS file based on transcript start sites
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --tag transcript
--chrM (Optional)¶
Specify the name of the mitochondrial chromosome.
- Function: Used for cell quality control. An excess of mitochondrial fragments usually indicates poor cell quality. Including mitochondrial fragments in the analysis will affect the statistical accuracy of TSS/peak region fragments.
- Auto-detection: By default, it will automatically identify from common names (e.g.,
chrM,MT).
Default: auto
Example:
# If the mitochondrial chromosome name is "mitochondrion"
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --chrM mitochondrion
--chloroplast (Plant-specific)¶
Specify the name of the chloroplast chromosome, recommended for plant samples.
- Function: Used for specific quality control of plant samples. Including chloroplast fragments in the analysis will affect the statistical accuracy of TSS/peak region fragments.
Default: None
Example:
# Specify chloroplast chromosome name for Arabidopsis genome
dnbc4tools atac mkref --fasta TAIR10.fa --ingtf Athaliana.gtf --chloroplast Pt
--kmer (Optional)¶
Set the k-mer length used during Chromap index construction.
- Function: Affects the accuracy, speed, and memory usage of alignment.
- Recommendation: For standard analysis, the default value is usually the best choice. If you encounter out-of-memory errors, you can try lowering this value.
Default: 17
Example:
# Lower k-mer length to reduce memory usage
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --kmer 15
--window (Optional)¶
Set the window size used during Chromap index construction.
- Function: Defines the number of consecutive k-mers within a window, affecting the sensitivity and specificity of alignment.
- Recommendation: Usually adjusted in conjunction with the
--kmerparameter for optimal results.
Default: 7
Example:
# Adjust window size
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --window 5
--noindex (Flag)¶
If this parameter is set, it will only generate the configuration file without building the genome index.
- Function: Use this parameter to skip the time-consuming index construction step when the index files already exist.
Default: Not set
Example:
# Generate only the configuration file, do not build the index
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --noindex
Database Construction Notes:
- Databases built with Chromap currently cannot handle extremely large genomes. Some species may not be suitable for scATAC analysis with this software, or you may need to adjust
kmerandwindowparameters to fit genome index construction. - After database construction is complete, a
ref.jsonfile will be generated in the database directory to record key information.
ref.json File Example:
{
"species": "Homo_sapiens",
"input_fasta_files": ["genome.fa"],
"input_gtf_files": ["genes.gtf"],
"genome": "/database/scATAC/Homo_sapiens/fasta/genome.fa",
"index": "/database/scATAC/Homo_sapiens/fasta/genome.index",
"gtf": "/database/scATAC/Homo_sapiens/genes/genes.gtf",
"chrmt": "chrM",
"chloroplast": "None",
"chromeSize": "/database/scATAC/Homo_sapiens/regions/chrom.sizes",
"tss": "/database/scATAC/Homo_sapiens/regions/tss.bed",
"promoter": "/database/scATAC/Homo_sapiens/regions/promoter.bed",
"version": "dnbc4tools 3.0",
"blacklist": "None",
"genomesize": "hs"
}
Important Notes:
- Chromosome names listed in the
chromeSizefile will be included infragments.tsv.gzfor analysis; unlisted chromosomes will be excluded. - As of version 2.1.2, the
blacklistparameter has been removed, and a blacklist file is no longer required. You can add it manually if needed. - The number of fragments in blacklist regions is recorded in the
blacklist_region_fragmentscolumn of the metadata fileoutput/singlecell.csv. - The
genomesizevalue is used for MACS2 peak calling. MACS2 uses special identifiers for some species, such ashsfor human.
Multi-sample Operations (multi) ¶
Usage¶
$ dnbc4tools atac multi
dnbc4tools 3.1
Process multiple ATAC-seq samples.
Usage: dnbc4tools atac multi [OPTIONS]
optional arguments:
--help show this help message and exit
Input Files:
--list <FILE> Sample list file path. Each line must contain sample name and FASTQ file path(s).
Basic Settings:
--genomeDir <DIR> Reference genome directory path containing required reference files.
--outdir <DIR> Output directory path for analysis results [default: current directory] (e.g., `./output`).
--threads <INT> Number of CPU threads for parallel processing.
Parameter Description¶
Required Parameters¶
--list (Required)¶
Specify the path to the list file containing information for multiple samples.
- File Format: Tab-separated (
\t) text file, UTF-8 encoding recommended. - Column Structure: The first column is the sample name, and the second column is the path to the corresponding FASTQ data for that sample.
- Multiple fastq files: Use commas (
,) to separate. - R1 and R2 files: Use semicolons (
;) to separate. - Path Type: Both absolute and relative paths are supported.
Path Format Rules
File Content Example
# Scenario 1: Sample A, with one pair of R1/R2 files
SampleA /path/to/SampleA_R1.fastq.gz;/path/to/SampleA_R2.fastq.gz
# Scenario 2: Sample B, with two pairs of R1/R2 files (files for the same Read are comma-separated)
SampleB /path/to/B_L01_R1.fq.gz,/path/to/B_L02_R1.fq.gz;/path/to/B_L01_R2.fq.gz,/path/to/B_L02_R2.fq.gz
Default: None
Parameter Inheritance Note
For other analysis parameter settings, please refer to the corresponding parameters of thednbc4tools atac runcommand.Execution Behavior
dnbc4tools atac multigenerates per-sample execution scripts (for example,sample1.sh) for batch submission and reuse. By default, it does not automatically run all sample analyses serially.
Related Documentation¶
| Resource | Description |
|---|---|
| scATAC Pipeline | Single-cell ATAC analysis workflow guide |
| scATAC Output | Detailed output file interpretation |
Feedback & Support
This document is continuously maintained. If you identify errors or additional information is required, please submit feedback via GitHub Issues.
Document Version: 3.1 | Last Updated: May 15, 2026