$ dnbc4tools rna run
usage: dnbc4tools rna run [OPTIONS]
optional arguments:
-h, --help show this help message and exit
Input Files:
Choose ONE input method: either --fastqs (directory) OR all four individual FASTQ files (-c1, -c2, -i1, -i2).
--fastqs <DIR> Directory containing cDNA and oligo FASTQ subfolders (e.g., cDNA/sample_cdna_R1.fastq.gz, oligo/sample_oligo_R1.fastq.gz). The pipeline automatically detects paired-end files. Example: ./fastq_dir
-c1, --cDNAfastq1 <FILE> [<FILE> ...]
Read1 FASTQ file(s) for cDNA (supports wildcards and comma-separated lists). Used for gene expression data. Example: sample1_R1.fastq.gz,sample2_R1.fastq.gz
-c2, --cDNAfastq2 <FILE> [<FILE> ...]
Read2 FASTQ file(s) for cDNA (supports wildcards and comma-separated lists). Must match --cDNAfastq1 order. Example: sample1_R2.fastq.gz,sample2_R2.fastq.gz
-i1, --oligofastq1 <FILE> [<FILE> ...]
Read1 FASTQ file(s) for oligo (supports wildcards and comma-separated lists). Used for barcode merging. Example: sample1_oligo_R1.fastq.gz
-i2, --oligofastq2 <FILE> [<FILE> ...]
Read2 FASTQ file(s) for oligo (supports wildcards and comma-separated lists). Must match --oligofastq1 order. Example: sample1_oligo_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 containing STAR index files. Example: ./genome_index
-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: all available cores] (e.g., 16).
Filtering Settings:
--calling_method <STR>
Cell detection method [default: emptydrops]. Options: barcoderanks, emptydrops.
--expectcells <INT> Expected number of cells to guide detection [default: auto] (e.g., 3000).
--forcecells <INT> Force pipeline to use exactly this number of cells, overriding detection (e.g., 5000).
--minumi <INT> Minimum UMI count per cell to retain [default: 1000].
Library Settings:
Configure sequencing library settings for barcode, UMI, and read structure.
Auto-detection is recommended for chemistry and dark cycles.
Use --customize twice for cDNA and oligo patterns, e.g.,
--customize "cb,R1:1-10;cb,R1:11-20;umi,R1:21-30;R1,R2:1-100" --customize "cb,R1:1-10;cb,R1:11-20;R1,R2:1-30".
--chemistry <STR> Library chemistry version [default: auto]. Options: scRNAv1HT, scRNAv2HT, scRNAv3HT, scRNA5Pv1, auto (automatic detection).
--darkreaction <STR> Dark cycle setting for cDNA and oligo libraries [default: auto]. Provide two comma-separated values: <cDNA>,<oligo> Each field options: auto (automatic detection), R1R2 (both reads), R1 (Read1 only), unset (no
dark cycles). Examples: R1,R1R2; R1,R1; unset,unset.
--customize <STR> Custom read structure for barcode, UMI, or sequence extraction, format: <type>,<read>:<start>-<end> separated by ';'. Types: cb (cell barcode), umi (UMI) R1/R2 (sequence). Examples:
"cb,R1:1-10;cb,R1:11-20;umi,R1:21-30;R1,R2:1-100"
Analysis Settings:
--no_introns Exclude intronic reads from the expression matrix to increase specificity.
--end5 Enable 5'-end scRNA-seq analysis for 5' gene expression profiling.
--no_bam Skip BAM file generation to save time and disk space.
--sample_read_pairs <INT>
Subsample this number of cDNA read pairs for analysis (e.g., 1000000).
⚠️ 成功分析必须指定的基本参数
-n, --name (必需)为本次分析提供一个唯一的样本名称。
默认值: 无
示例:
--name sample_001
-g, --genomeDir (必需)指定参考基因组目录的路径。
mkref 命令生成的索引和注释资源。默认值: 无
示例:
--genomeDir /path/to/genome/database
📁 选择一种输入方式:基于目录 OR 单独指定文件
--fastqs (方式1)指定包含所有FASTQ文件的目录路径。
--cDNAfastq1 / --cDNAfastq2 / --oligofastq1 / --oligofastq2 同时使用。默认值: 无
示例:
--fastqs ./fastq_directory
-c1, --cDNAfastq1 (方式2A)单独指定一个或多个cDNA Read1 FASTQ文件。
*) 匹配文件,使用逗号分隔来指定多个文件。--cDNAfastq2 参数配对使用,且文件顺序必须完全匹配。默认值: 无
示例:
--cDNAfastq1 sample_cDNA_L01_R1.fastq.gz,sample_cDNA_L02_R1.fastq.gz
-c2, --cDNAfastq2 (方式2B)单独指定一个或多个cDNA Read2 FASTQ文件。
*) 匹配文件,使用逗号分隔来指定多个文件。--cDNAfastq1 参数配对使用,且文件顺序必须完全匹配。默认值: 无
示例:
--cDNAfastq2 sample_cDNA_L01_R2.fastq.gz,sample_cDNA_L02_R2.fastq.gz
-i1, --oligofastq1 (方式2C)单独指定一个或多个oligo Read1 FASTQ文件。
*) 匹配文件,使用逗号分隔来指定多个文件。--oligofastq2 参数配对使用,且文件顺序必须完全匹配。默认值: 无
示例:
--oligofastq1 sample_oligo_R1.fastq.gz
-i2, --oligofastq2 (方式2D)单独指定一个或多个oligo Read2 FASTQ文件。
*) 匹配文件,使用逗号分隔来指定多个文件。--oligofastq1 参数配对使用,且文件顺序必须完全匹配。默认值: 无
示例:
--oligofastq2 sample_oligo_R2.fastq.gz
⚠️ 输入方式选择:
- 🔸 方式1: 使用
--fastqs指定包含cDNA和oligo子文件夹的目录- 🔸 方式2: 使用
-c1, --cDNAfastq1,-c2, --cDNAfastq2,-i1, --oligofastq1,-i2, --oligofastq2分别指定R1和R2文件
⚠️ 重要提示: 参数下所有文件必须来自同一文库,测序模式和暗反应设置保持一致,不同文库的数据不能合并分析。
-o, --outdir (可选)指定所有分析结果和报告的输出目录。
默认值: ./ (当前目录)
示例:
--outdir ./output_results
-t, --threads (可选)设置分析过程中可使用的CPU线程数。
默认值: 使用所有可用的CPU核心
示例:
--threads 16
--calling_method (可选)设定细胞识别方法,用于区分真实细胞和空滴。
默认值: emptydrops
示例:
# 切换为barcoderanks方法进行细胞识别
dnbc4tools rna run --name sample1 --fastqs ./fq --genomeDir ./ref --calling_method barcoderanks
--expectcells (可选)设定预期的细胞回收数量。
auto模式,该模式会根据UMI分布特征自动估算细胞数量。若已知有效细胞数量,也可手动设置为该数量的50%作为初步筛选依据。默认值: auto
示例:
# 预期回收3000个细胞
dnbc4tools rna run --name sample1 --fastqs ./fq --genomeDir ./ref --expectcells 3000
--forcecells (可选)强制流程使用确切的细胞数量,此参数会覆盖软件的自动细胞检测结果。
默认值: 无
示例:
# 强制输出5000个细胞进行分析
dnbc4tools rna run --name sample1 --fastqs ./fq --genomeDir ./ref --forcecells 5000
--minumi (可选)设定用于保留细胞的最低UMI数量。
默认值: 1000
示例:
# 将细胞过滤的UMI阈值降低到500
dnbc4tools rna run --name sample1 --fastqs ./fq --genomeDir ./ref --minumi 500
Note
细胞识别是单细胞分析的关键步骤,正确的参数设置和结果解读直接影响后续分析的质量和可信度。
1. 细胞数量异常
细胞数量过低
症状: 检出细胞数 < 预期的50%。
原因: UMI阈值过高、空滴污染严重、文库质量差。
方案: 降低 --minumi,调整 --expectcells,检查原始数据质量。
细胞数量过高
症状: 检出细胞数 > 预期的200%。
原因: 细胞计数不准确、UMI阈值过低、背景噪声高。
方案: 提高 --minumi,使用 --forcecells 限制数量。
UMI分布异常
症状: UMI rank图无明显拐点。
原因: 测序深度不足、文库多样性差、技术失败。
方案: 增加测序深度,重新构建文库。
2. 细胞鉴定曲线图异常
平缓下降无拐点
含义: 真实细胞和背景空滴难以区分。
方案: 使用 --forcecells 设定保守的细胞数量,结合下游质控。
多个拐点
含义: 存在不同细胞群体或双联体污染。
方案: 选择主要拐点对应的细胞数,后续进行双联体检测和去除。
陡峭下降
含义: 高质量细胞与背景区分明显,为理想情况。
方案: 使用默认 emptydrops 算法,可适当降低 --minumi。
噪声波动严重
含义: 技术噪声高,数据质量差。
方案: 增加 --minumi 阈值,考虑重新测序或优化实验条件。
最佳实践提示
首次分析建议使用默认参数获得初步结果,然后根据HTML报告中的统计信息和可视化图表进行针对性的参数调整。
--chemistry (可选)配置scRNA试剂盒的化学反应版本,决定条形码和 UMI 的序列结构。
scRNAv1HT, scRNAv2HT, scRNAv3HT, scRNA5Pv1默认值: auto
示例:
# 场景: 已知文库为scRNAv2HT且自动分析失败
dnbc4tools rna run --name sample2 --fastqs ./fq --genomeDir ./ref --chemistry scRNAv2HT
⚠️ 重要提示:不正确的设置可能导致细胞条形码识别失败。仅在了解文库结构或自动检测失败时手动指定。
--darkreaction (可选)配置cDNA和oligo文库的暗循环(dark cycle)设置。
<cDNA设置>,<oligo设置> (使用逗号分隔)。auto (自动检测), R1R2 (双端), R1 (仅R1), unset (无)。默认值: auto
示例:
# 示例1: cDNA文库R1有暗循环, oligo文库双端有暗循环
--darkreaction R1,R1R2
# 示例2: 两个文库都仅R1有暗循环
--darkreaction R1,R1
# 示例3: 两个文库都无暗循环
--darkreaction unset,unset
⚠️ 重要提示:不正确的设置可能导致细胞条形码识别失败。仅在了解文库结构或自动检测失败时手动指定。
--customize (高级)为非标准文库精确定义条形码(barcode)、UMI和有效序列(read)的提取结构。此参数为高级功能,会覆盖 --chemistry 和 --darkreaction 的设置。
"<type>,<read>:<start>-<end>",多个段落以分号(;)分隔。
cb: 细胞条形码 (Cell Barcode)umi: UMI (唯一分子标识符)R1: Read1 中的有效DNA序列R2: Read2 中的有效DNA序列 (仅适用于双端测序)--customize 参数。示例:
# 以cDNA文库为例,结构: Barcode 1(1-10bp) + Barcode 2(11-20bp) + UMI(21-30bp) in R1; 序列(1-100bp) in R2
--customize "cb,R1:1-10;cb,R1:11-20;umi,R1:21-30;R1,R2:1-100"
# 以cDNA文库为例,结构: Barcode 1(7-16bp) + Barcode 2(23-32bp) + UMI(38-47bp) in R1; 序列(1-100bp) in R2
--customize "cb,R1:7-16;cb,R1:23-32;umi,R1:38-47;R1,R2:1-100"
# 以cDNA文库为例,5端转录本同时利用双端数据
--customize "cb,R1:1-10;cb,R1:11-20;umi,R1:21-30;R1,R1:31-120;R2,R2:1-150"
# 示例: 为cDNA和oligo文库分别自定义序列结构
--customize "cb,R1:1-10;cb,R1:11-20;umi,R1:21-30;R1,R2:1-100" --customize "cb,R1:1-10;cb,R1:11-20;R1,R2:1-30"
⚠️ 风险提示:错误的自定义配置可能导致数据丢失或分析失败,建议仅在标准配置无法满足需求时使用。
--no_introns (标志)启用此参数以在分析过程中过滤掉来自内含子区域的reads。
默认值: 不设置此参数则包含内含子区域的reads
--end5 (标志)启用5'端单细胞转录组数据分析模式。
默认值: 不设置此参数
--no_bam (标志)启用此参数以跳过BAM文件的生成。
默认值: 不设置此参数则生成BAM文件
--sample_read_pairs (可选)从输入的cDNA FASTQ文件中提取指定数量的读段对进行分析。
默认值: 无 (使用全部数据)
示例:
--sample_read_pairs 100000000
💡 分析建议
首次分析时建议使用默认参数,获得结果报告后再根据需要调整参数。
$ dnbc4tools rna mkref -h
usage: dnbc4tools rna mkref [-h]
optional arguments:
-h, --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
--ingtf <FILE> Gene annotation GTF file path(s). Separate multiple files with commas
Basic Settings:
--genomeDir <DIR> Output directory for generated reference files [default: current directory]
--species <STR> Species identifier(s). Use commas for mixed species analysis [default: undefined]
--threads <INT> Number of CPU threads for parallel processing [default: 10]
Advanced Settings:
Advanced configuration options for reference genome building.
Use these settings to customize STAR indexing behavior and resource usage.
Parameters in extra-args will override default parameters if conflicts exist.
Can be a space-separated string of parameters (e.g., "--sjdbOverhang 100 --runThreadN 16").
--chrM <STR> Mitochondrial chromosome identifier in reference genome [default: auto]
--limitram <INT> Maximum RAM (GB) allowed for index generation
--extra-args <STR> Additional STAR parameters to pass directly to STAR index generation
--noindex Skip STAR index generation step
--fasta (必需)提供参考基因组序列文件。
默认值: 无
示例:
--fasta Homo_sapiens.GRCh38.dna.primary_assembly.fa
--ingtf (必需)提供基因结构注释文件。
gene/ transcript, exon 类型的注释条目。gene_id/ gene_name, transcript_id/ transcript_name 属性。默认值: 无
示例:
--ingtf Homo_sapiens.GRCh38.108.gtf
Note
双物种分析配置
如需进行双物种分析,--fasta 和 --ingtf 参数均支持以逗号分隔的方式提供两个物种的文件路径。
--fasta human.fa,mouse.fa --ingtf human.gtf,mouse.gtf--species参数的顺序严格一致,即每个FASTA文件与其对应的GTF文件和物种参数在列表中位置保持一致。--genomeDir (可选)指定生成的参考数据库的输出目录。
genomeDir/ ├── fasta/ │ └── genome.fa # 处理后的基因组序列文件 ├── genes/ │ └── genes.gtf # 处理后的基因注释文件 ├── star/ │ ├── SA # STAR索引文件 │ ├── SAindex # STAR索引核心文件 │ ├── chrLength.txt # 染色体长度信息 │ ├── chrName.txt # 染色体名称信息 │ ├── chrNameLength.txt # 染色体名称和长度 │ ├── chrStart.txt # 染色体起始位置 │ ├── Genome # 基因组序列压缩文件 │ ├── genomeParameters.txt # 基因组参数配置 │ ├── Log.out # STAR索引构建日志 │ ├── sjdbInfo.txt # 剪切位点数据库信息 │ ├── sjdbList.fromGTF.out.tab # GTF提取的剪切位点 │ ├── sjdbList.out.tab # 所有剪切位点列表 │ └── mtgene.list # 线粒体基因列表 └── ref.json # 数据库配置和元信息文件
默认值: ./ (当前目录)
示例:
dnbc4tools rna mkref --fasta genome.fa --ingtf genes.gtf --genomeDir /database/scRNA/GRCh38
--species (可选)为参考数据库指定一个或多个物种名称。
hg38,mm10)。--fasta 和 --ingtf 文件顺序严格一致。hg38_GENE1),并在结果中分离统计信息。为特定物种提供此参数,可启用下游的自动细胞类型注释功能。
Homo_sapiens (或 hg38), Mus_musculus (或 mm10)。默认值: undefined
示例:
# 单物种
--species Homo_sapiens
# 双物种 (人+鼠)
--species hg38,mm10
--threads (可选)设置STAR索引构建过程中可使用的CPU线程数。
默认值: 10
示例:
--threads 16
--chrM (可选)指定线粒体染色体的名称。
chrM, MT)中自动识别。默认值: auto
示例:
# 如果线粒体染色体名称为"mitochondrion"
dnbc4tools rna mkref --fasta genome.fa --ingtf genes.gtf --chrM mitochondrion
--limitram (可选)设定STAR基因组索引生成过程的最大可用内存(以GB为单位)。
默认值: 无
示例:
--limitram 64
--extra-args (高级)直接向STAR索引生成传递额外的命令行参数。
默认值: 无
示例:
--extra-args "--sjdbOverhang 99 --runThreadN 20"
--noindex (标志)如果设置此参数,将只生成配置文件而不构建基因组索引。
默认值: 不设置
示例:
# 仅生成配置文件,不构建索引
dnbc4tools rna mkref --fasta genome.fa --ingtf genes.gtf --noindex
Tip
📋 数据库构建技术说明:
genomeSAindexNbases和genomeChrBinNbits的优化值ref.json文件以记录所有关键配置信息📋 单物种ref.json文件示例:
{
"chrmt": "chrM",
"genome": "/database/scRNA/Homo_sapiens/fasta/genome.fa",
"genomeDir": "/database/scRNA/Homo_sapiens/star",
"gtf": "/database/scRNA/Homo_sapiens/genes/genes.gtf",
"input_fasta_files": [
"genome.fa"
],
"input_gtf_files": [
"genes.gtf"
],
"mtgenes": "/database/scRNA/Homo_sapiens/star/mtgene.list",
"species": "Homo_sapiens",
"version": "dnbc4tools 3.0beta"
}
📋 双物种ref.json文件示例:
{
"chrmt": "hg38_chrM,mm10_chrM",
"genome": "/database/scRNA/hg38_and_mm10/fasta/genome.fa",
"genomeDir": "/database/scRNA/hg38_and_mm10/star",
"gtf": "/database/scRNA/hg38_and_mm10/genes/genes.gtf",
"input_fasta_files": [
"hg38_genome.fa",
"mm10_genome.fa"
],
"input_gtf_files": [
"hg38_genes.gtf",
"mm10_genes.gtf"
],
"mtgenes": "/database/scRNA/hg38_and_mm10/star/mtgene.list",
"species": "hg38_and_mm10",
"version": "dnbc4tools 3.0beta"
}
📋 性能优化建议:
$ dnbc4tools rna multi -h
usage: dnbc4tools rna multi [-h]
optional arguments:
-h, --help show this help message and exit
--list <LIST> Path to the sample list file. Each line should contain sample name, cDNA FASTQ paths, and oligo FASTQ paths.
--genomeDir <DATABASE>
Path to the directory containing genome files.
--outdir <OUTDIR> Output directory. [default: current directory].
--threads <CORENUM> Number of threads used for analysis. [default: 20].
--end5 Perform 5'-end single-cell transcriptome analysis.
--list (必需)指定包含多个样本信息的列表文件路径。
\t)分隔的文本文件,建议UTF-8编码。,)分隔。;)分隔。默认值: 无
# 示例1: SampleA, cDNA和oligo各有1对R1/R2文件
SampleA /path/to/A_cDNA_R1.fq.gz;/path/to/A_cDNA_R2.fq.gz /path/to/A_oligo_R1.fq.gz;/path/to/A_oligo_R2.fq.gz
# 示例2: SampleB, cDNA有2对R1/R2文件, oligo有1对R1/R2文件
SampleB /path/to/B_cDNA_L01_R1.fq.gz,/path/to/B_cDNA_L02_R1.fq.gz;/path/to/B_cDNA_L01_R2.fq.gz,/path/to/B_cDNA_L02_R2.fq.gz /path/to/B_oligo_R1.fq.gz;/path/to/B_oligo_R2.fq.gz
📝 参数继承说明
对于其他分析参数设置,请参考
dnbc4tools rna run命令的相应参数。所有样本应使用相同的参考数据库。
💡 提示
本文档持续更新中,如发现内容错误或需要补充的信息,欢迎反馈。
📝 文档版本: 3.0 beta | 最后更新: 2025年
🧬 DNBelab C Series HT scRNA Analysis Software
高性能单细胞转录组数据分析流程