Skip to content

scVDJ Analysis Parameters

DNBelab C Series HT scVDJ Parameter Configuration Guide


Main Analysis Pipeline (run)

Usage

$ dnbc4tools vdj run
dnbc4tools 3.1

Process a single-cell V(D)J sample.

Usage: dnbc4tools vdj 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 (e.g., `./fastq_dir`).
  --fastq1 <FILE>              Read 1 FASTQ file path(s). 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). 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`).
  --ref REF                    Reference database: `human`/`mouse`, or a custom reference directory path containing `reference.json` (e.g., `human` or `./custom_vdj_ref`).
  --chain <STR>                VDJ receptor type: `IG` (BCR) or `TR` (TCR) (e.g., `TR`).
  --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: all available cores].
  --beadstrans <FILE>          RNA-analysis `singlecell.csv` file path for cell filtering and bead merging info (e.g., `./singlecell.csv`).

Library Settings:
  --darkreaction <STR>         Dark cycle setting for VDJ library [default: auto] (e.g., `R1`).
  --customize <STR>            Sequence-structure string. Format: `<type>,<read>:<start>-<end>` joined by `;`. (e.g., `cb,R1:1-10;cb,R1:11-20;umi,R1:21-30;R1,R1:31-120;R2,R2:1-150`).
  --enrichment_primers <FILE>  Custom inner enrichment primers file path (one primer sequence per line) (e.g., `./inner_primers.txt`).

Analysis Settings:
  --keep_all_cells             Retain all cells in analysis without RNA-based filtering.
  --r2_only                    Use only Read 2 sequences for VDJ assembly.
  --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_VDJ_001

--ref (Required)

Specify the reference database to be used for VDJ analysis.

  • Function: Specifies the reference database for VDJ analysis.
  • Built-in Support: The software comes with reference databases for human (human) and mouse (mouse).
  • Custom Support: A path to a custom reference directory containing a reference.json file can be provided.

Default: None

Examples:

# Use the built-in human reference database
--ref human
# Use a custom reference database
--ref ./custom_vdj_ref

--chain (Required)

Specify the type of immune receptor to be analyzed.

  • Core Function: Specifies the immune receptor type for analysis, directly impacting the identification and recombination analysis of V(D)J gene segments.
  • TR: T-cell Receptor, for T-cell studies.
  • IG: Immunoglobulin, for B-cell studies.

Default: None

Examples:

# Analyze T-cell receptors
--chain TR
# Analyze B-cell receptors
--chain IG

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 files (R1/R2) within this directory.
  • Directory requirement (VDJ): --fastqs should point to a directory that contains only FASTQ files from the current VDJ 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:

VDJ_fastq_dir/
├── sample_VDJ_L01_R1.fastq.gz
├── sample_VDJ_L01_R2.fastq.gz
├── sample_VDJ_L02_R1.fastq.gz
└── sample_VDJ_L02_R2.fastq.gz

Default: None

Example:

--fastqs ./VDJ_fastq_dir

--fastq1 (Method 2A)

Specify one or more Read 1 FASTQ files for the VDJ library 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 --fastq2 parameter, 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 for the VDJ library 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 --fastq1 parameter, 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 --fastqs to specify a directory containing paired FASTQ files.
  • Method 2: Use --fastq1 and --fastq2 to 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 ./VDJ_analysis_output

--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: Use all available CPU cores

Example:

--threads 16

--beadstrans (Optional)

Provide the singlecell.csv file from a scRNA analysis for cell filtering and information integration.

  • Function: By integrating results from a 5' scRNA analysis, this enables bead merging and cell filtering, thereby establishing a precise correspondence between the single-cell RNA expression profile and the VDJ recombination sequence.
  • Requirement: Using this feature requires providing the singlecell.csv output file from a 5' scRNA analysis of the same sample.
  • Note: If this parameter is not specified, the bead merging step will be skipped, and all detected cells will be retained by default (equivalent to enabling --keep_all_cells).

Default: None

Example:

--beadstrans ./RNA_analysis_output/outs/singlecell.csv

Library Settings

--darkreaction (Optional)

Configure the dark cycle settings for the VDJ library.

  • Function: Guides the software to correctly parse dark reaction cycles generated by the sequencing chemistry.
  • Smart Detection (auto): Default setting. The software automatically identifies the structure by analyzing the sequence. Recommended for initial analysis.
  • Manual Settings: Options are R1 (dark cycle in Read 1) or unset (no dark cycle).

Default: auto

Example:

# Dark cycle present in Read 1
--darkreaction R1

Important Note: Incorrect settings may lead to cell barcode identification failure. Specify manually only if you know the library structure or if auto-detection fails.

--customize (Advanced)

Precisely define the extraction structure for barcodes, UMIs, and effective sequences (reads) for non-standard libraries. This is an advanced feature that overrides --darkreaction settings.

  • Syntax: "<type>,<read>:<start>-<end>", with multiple segments separated by semicolons (;).
    • Parameter Types (type): cb (cell barcode), umi (UMI), R1/R2 (effective sequence).

  • Notes:
    • The entire parameter string must be enclosed in quotes.
    •     <li>Coordinates are 1-based and cannot exceed the read length.</li>
        </ul>
      

    Example:

    # Example of a standard VDJ library configuration
    --customize "cb,R1:1-10;cb,R1:11-20;umi,R1:21-30;R1,R1:31-120;R2,R2:1-150"

    Risk Warning: Incorrect custom configurations can lead to data loss or analysis failure. Use only when standard configurations do not meet your needs.

--enrichment_primers (Optional)

Specify a file containing internal enrichment primers for VDJ region-specific amplification.

  • Application: For VDJ libraries designed for non-human/mouse species or using custom primers.
  • Format: A plain text file with one primer sequence per line.
  • Requirement: This parameter is required when using a custom reference database.

Default: None

Example file content:

GTCCTCGGTGGCCTCCACGTG
AGCACCTGGGGCCTCGGCCAC
CCTGGACTCCTGGGCCCCAG

Analysis Settings

--keep_all_cells (Flag)

Enable this parameter to retain all detected cells without filtering based on RNA data.

  • Function: This behavior is automatically enabled when the --beadstrans parameter is not provided. It is suitable for standalone VDJ analysis or when maximizing cell recovery is desired.

Default: Not set (but enabled by default if --beadstrans is absent)

--r2_only (Flag)

Enable this parameter to use only Read 2 sequences for VDJ assembly.

  • Function: Suitable for library designs where Read 1 contains only barcode and UMI information.
  • Note: The software cannot auto-detect this situation; it must be specified manually based on the library design.

Default: Not set

--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.
  • Note: Subsampling may affect the detection of low-frequency clonotypes. It is recommended to use the full dataset for formal analysis.

Default: None (uses all data)

Example:

--sample_read_pairs 10000000

Resource Description
scVDJ Pipeline Single-cell VDJ analysis workflow guide
scVDJ 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