🏠 主页English

🧬 DNBelab C Series HT scATAC 分析参数

🔬 主分析流程 (run)📊 参考数据库构建 (mkref)📋 多样本操作 (multi)


🔬 主分析流程 (run)

📊 用法

$ dnbc4tools atac run --help
Usage: dnbc4tools atac run [OPTIONS]

optional arguments:
  -h, --help            show this help message and exit

Input Files:
  Choose ONE input method: either --fastqs (directory) OR individual FASTQ files (-1 and -2).

  --fastqs <DIR>        Input directory containing paired-end FASTQ files. The pipeline automatically detects Read1/Read2 files. Example: ./fastq_dir
  -1, --fastq1 <FILE> [<FILE> ...]
                        Read1 FASTQ file(s) for the ATAC library (supports wildcards and comma-separated lists). Example: sample1_L01_R1.fastq.gz,sample1_L02_R1.fastq.gz
  -2, --fastq2 <FILE> [<FILE> ...]
                        Read2 FASTQ file(s) for the ATAC library (supports wildcards and comma-separated lists). Must match --fastq1 order. Example: sample1_L01_R2.fastq.gz,sample1_L02_R2.fastq.gz

Basic Settings:
  -n, --name <STR>      Unique identifier for the sample (e.g., sample1). Used for naming output files and reports.
  -g, --genomeDir <DIR>
                        Path to reference genome directory. Must contain the required index and annotation resources.
  -o, --outdir <DIR>    Output directory for results and reports [default: current directory]. Example: ./output
  -t, --threads <INT>   Number of CPU threads for parallel processing [default: 10].

Library Settings:
  Configure sequencing library settings and dark cycles.
  Auto-detection is recommended for dark cycles.
  Use --customize to specify sequence structure patterns when needed.

  --darkreaction <STR>  Dark cycle setting for ATAC library [default: auto]. Options: auto (automatic detection), R1R2 (both reads), R1 (Read1 only), R2 (Read2 only), unset (no dark cycles).
  --customize <STR>     Customize read structure for barcode/sequence extraction, format: <type>,<read>:<start>-<end> separated by ';'. Types: cb (cell barcode), R1 (sequence from Read1), R2 (sequence from Read2). Example:
                        "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, overriding detection (e.g., 5000).
  --frags_cutoff <INT>  Minimum number of unique fragments to retain a cell [default: 1000].
  --tss_cutoff <FLOAT>  Minimum TSS proportion threshold to retain a cell [default: 0] (e.g., 0.2).
  --jaccard_cutoff <FLOAT>
                        Jaccard similarity threshold for merging beads (e.g., 0.02).
  --merge_cutoff <INT>  Minimum number of fragments when merging beads [default: 1000].

Analysis Settings:
  --need_bam            Enable generation of BAM files containing aligned reads. Note: generating BAM files increases computational time and disk space usage.
  --sample_read_pairs <INT>
                        Subsample the specified number of read pairs from the input FASTQ files (e.g., 1000000).

📝 参数说明

🔴 必需参数

⚠️ 成功分析必须指定的基本参数

-n, --name (必需)

为本次分析提供一个唯一的样本名称。

默认值:

示例:

--name sample_001

-g, --genomeDir (必需)

指定参考基因组目录的路径。

默认值:

示例:

--genomeDir /path/to/genome/database

🟢 输入文件参数

📁 选择一种输入方式:基于目录 OR 单独指定文件

--fastqs (方式1)

指定包含所有FASTQ文件的目录路径。

默认值:

示例:

--fastqs ./fastq_directory

-1, --fastq1 (方式2A)

单独指定一个或多个Read1 FASTQ文件。

默认值:

示例:

--fastq1 sample1_L01_R1.fastq.gz,sample1_L02_R1.fastq.gz

-2, --fastq2 (方式2B)

单独指定一个或多个Read2 FASTQ文件。

默认值:

示例:

--fastq2 sample1_L01_R2.fastq.gz,sample1_L02_R2.fastq.gz

⚠️ 输入方式选择:

⚠️ 重要提示: 参数下所有文件必须来自同一文库,测序模式和暗反应设置保持一致,不同文库的数据不能合并分析。


🟢 基本设置参数

-o, --outdir (可选)

指定所有分析结果和报告的输出目录。

默认值: ./ (当前目录)

示例:

--outdir ./output_results

-t, --threads (可选)

设置分析过程中可使用的CPU线程数。

默认值: 10

示例:

--threads 16

🟢 文库设置参数

--darkreaction (可选)

配置ATAC文库的暗循环(dark cycle)设置,以确保细胞条形码的精确识别。

示例:

# 场景1: 首次分析,使用自动检测
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref
# 场景2: 已知文库仅在R1端有暗循环且自动分析无法识别或者识别错误
dnbc4tools atac run --name sample2 --fastqs ./fq --genomeDir ./ref --darkreaction R1

⚠️ 重要提示:不正确的设置可能导致细胞条形码识别失败或序列信息丢失。仅在了解文库结构或自动检测失败时手动指定。

--customize (高级)

为非标准文库精确定义条形码(barcode)和有效序列(read)的提取结构。

示例:

# 示例1:假设其R1结构为:Barcode 1 (10bp) -> Barcode 2 (10bp) -> 插入序列 (50bp)。R2结构为:插入序列 (50bp)。
--customize "cb,R1:1-10;cb,R1:11-20;R1,R1:21-70;R2,R2:1-50"
# 示例2:假设其R1结构为:固定序列(6bp) -> Barcode 1 (10bp) -> 固定序列(6bp) -> Barcode 2 (10bp) -> 固定序列(33bp) -> 插入序列 (50bp)。R2结构为:固定序列(19bp) -> 插入序列(50bp)。
--customize "cb,R1:7-16;cb,R1:23-32;R1,R1:66-115;R2,R2:20-69"

⚠️ 注意事项:


🟢 过滤设置参数

--forcecells (可选)

强制流程使用确切的细胞数量,此参数会覆盖软件的自动细胞检测结果。

默认值:

示例:

# 强制输出5000个细胞进行分析
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref --forcecells 5000

--frags_cutoff (可选)

设定用于保留细胞的最低唯一fragments数量。

默认值: 1000

示例:

# 将细胞过滤的fragments阈值降低到500
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref --frags_cutoff 500

--tss_cutoff (可选)

设定用于保留细胞的最低TSS区域片段比例。

默认值: 0 (不过滤)

示例:

# 过滤掉TSS区域片段比例低于0.1的细胞
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref --tss_cutoff 0.1

--jaccard_cutoff (可选)

用于合并潜在属于同一个细胞的多个条形码(beads)的Jaccard相似度阈值。

默认值: auto

示例:

# 手动设置Jaccard相似度阈值为0.02
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref --jaccard_cutoff 0.02

--merge_cutoff (可选)

设定参与Jaccard合并的磁珠(beads)所需的最低fragments数量。

默认值: 500

示例:

# 对于低fragment样本,将阈值降至200以纳入更多磁珠进行合并
dnbc4tools atac run --name sample1 --fastqs ./fq --genomeDir ./ref --merge_cutoff 200

🚩 分析设置参数

--need_bam (标志)

启用BAM格式文件的生成。

默认值: 不设置此参数则不生成BAM文件

--sample_read_pairs (可选)

从输入的FASTQ文件中提取指定数量的读段对进行分析。

默认值: 无 (使用全部数据)

示例:

--sample_read_pairs 100000000

💡 分析建议

首次分析时建议使用默认参数,获得结果报告后再根据需要调整参数。


📊 参考数据库构建 (mkref)

📊 用法

$ dnbc4tools atac mkref --help
Usage: dnbc4tools atac mkref [OPTIONS]
optional arguments:
  -h, --help           show this help message and exit

Input files:
  Input genome FASTA and gene annotation GTF files. For mixed species analysis, use comma to separate multiple files.

  --fasta <FILE>       Path to reference genome FASTA file. Multiple files separated by comma
  --ingtf <FILE>       Path to gene annotation GTF file. Multiple files separated by comma

Basic settings:
  --genomeDir <DIR>    Output directory for reference files [default: current directory]
  --species <STR>      Species identifier. For mixed species analysis, use comma separated [default: undefined]

Advanced settings:
  --tag <TYPE>         Select type to generate BED file [default: transcript]
  --chrM <STR>         Mitochondrial chromosome identifier in reference genome [default: auto]
  --chloroplast <STR>  Chloroplast chromosome name, particularly recommended for plants, e.g. "Pt"
  --prefix <STR>       Filter chromosomes by prefix or full name. Not supported for mixed species
  --kmer <INT>         k-mer length, this determines the size of the substrings being extracted [default: 17]
  --window <INT>       Window size, this defines the number of consecutive k-mers within a window [default: 7]
  --noindex            Only generate ref.json without building genome index

📝 参数说明

🔴 必需参数

--fasta (必需)

提供参考基因组序列文件。

默认值:

示例:

--fasta Homo_sapiens.GRCh38.dna.primary_assembly.fa

--ingtf (必需)

提供基因结构注释文件。

默认值:

示例:

--ingtf Homo_sapiens.GRCh38.108.gtf

🟢 输出设置参数

--genomeDir (可选)

指定生成的参考数据库的输出目录。

默认值: ./ (当前目录)

示例:

dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --genomeDir /database/scATAC/GRCh38

--species (可选)

为参考数据库指定一个物种名称。

默认值: undefined

示例:

dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --species Homo_sapiens

🟢 基因组设置参数

--tag (可选)

选择生成TSS(转录起始位点)文件的信息来源。

默认值: transcript

示例:

# 基于转录本起始位点生成TSS文件
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --tag transcript

--chrM (可选)

指定线粒体染色体的名称。

默认值: auto

示例:

# 如果线粒体染色体名称为"mitochondrion"
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --chrM mitochondrion

--chloroplast (植物专用)

指定叶绿体染色体的名称,推荐植物样本使用。

默认值:

示例:

# 为拟南芥基因组指定叶绿体染色体名称
dnbc4tools atac mkref --fasta TAIR10.fa --ingtf Athaliana.gtf --chloroplast Pt

--kmer (可选)

设置Chromap索引构建时使用的k-mer长度。

默认值: 17

示例:

# 降低k-mer长度以减少内存使用
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --kmer 15

--window (可选)

设置Chromap索引构建时使用的窗口大小。

默认值: 7

示例:

# 调整窗口大小
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --window 5

--noindex (标志)

如果设置此参数,将只生成配置文件而不构建基因组索引。

默认值: 不设置

示例:

# 仅生成配置文件,不构建索引
dnbc4tools atac mkref --fasta genome.fa --ingtf genes.gtf --noindex

Tip

📋 数据库构建说明

📋 ref.json文件示例

{
    "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": "3.0beta",
    "blacklist": "None",
    "genomesize": "hs"
}

📋 重要说明


📋 多样本操作 (multi)

📊 用法

$ dnbc4tools atac multi 
Usage: dnbc4tools atac multi [OPTIONS]
optional arguments:
  -h, --help         show this help message and exit
  --list <STR>       Path to the sample list file. Each line should contain sample name and FASTQ paths.
  --outdir <DIR>     Output directory. [default: current directory].
  --threads <INT>    Number of threads used for analysis.
  --genomeDir <DIR>  Path to the directory where genome files are stored.

📝 参数说明

🔴 必需参数

--list (必需)

指定包含多个样本信息的列表文件路径。

文件内容示例
# 场景1: 样本A,具有一对R1/R2文件
SampleA /path/to/SampleA_R1.fastq.gz;/path/to/SampleA_R2.fastq.gz
# 场景2: 样本B,具有两对R1/R2文件 (同一Read的文件用逗号分隔)
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

默认值:


📝 参数继承说明
对于其他分析参数设置,请参考dnbc4tools atac run命令的相应参数。

💡 提示

本文档持续更新中,如发现内容错误或需要补充的信息,欢迎反馈。

📝 文档版本: 3.0 beta | 最后更新: 2025年


🔬 DNBelab C Series HT scATAC Analysis Software
高性能单细胞ATAC测序数据分析流程