Skip to content

JSON Configuration Guide

This document explains the JSON configuration used to define the library structure for dnbc4tools.


Library Structures

The configuration accommodates the specific structures of the scRNAv2HT reagent libraries.

cDNA Library Structure

cDNA Library Structure

Oligo Library Structure

Oligo Library Structure


JSON Configuration Explained

The JSON configuration file defines how to parse barcodes, UMIs, and effective read sequences from FASTQ files. The key concepts are:

  • Required Fields: The "cell barcode tag", "cell barcode", and "read 1" fields are mandatory.
  • Tags: In the value field, CB is the suggested tag name for the corrected cell barcode, and UR is for the UMI.
  • Location: The location field specifies the read (R1 or R2) and the base pair coordinates. For example, "R1:1-10" refers to bases 1-10 of Read 1.
  • Barcode Segments: A cell barcode can be composed of multiple segments from different locations (e.g., "R1:1-10" and "R1:17-26").
  • Output: The program will write the parsed barcodes and UMIs to the read name field of the output FASTQ. The sequence specified by "read 1" (e.g., "R2:1-100") is retained in the sequence field.
  • Whitelist Correction: A predefined "white list" can be provided to correct barcode sequences. Barcodes not found in the whitelist are compared against it, and if the Hamming "distance" is within the specified cutoff, the barcode is corrected.

Example JSON Configuration

{
    "cell barcode tag":"CB",
    "cell barcode":[
    {
        "location":"R1:1-10",
            "distance":"1",
            "white list":[
                "TAACAGCCAA",
                "CTAAGAGTCC",
                "..."
            ]
    },
    {
        "location":"R1:11-20",
            "distance":"1",
            "white list":[
                "TAACAGCCAA",
                "CTAAGAGTCC",
                "..."
            ]
    }
    ],
    "UMI tag":"UR",
    "UMI":{
    "location":"R1:21-30"
    },
    "read 1":{
    "location":"R2:1-100"
    }
}

Supported Keys

Here is a list of all supported keys in the configuration file.

Key Comment
cell barcode tagSAM tag for the corrected cell barcode. "CB" is suggested.
cell barcodeA JSON array defining the segments of the cell barcode.
cell barcode raw tagSAM tag for the raw cell barcode sequence. "CR" is suggested.
cell barcode raw qual tagSAM tag for the quality score of the raw cell barcode. "CY" is suggested.
distanceThe minimum Hamming distance for barcode correction.
white listA list of valid barcode sequences for correction.
locationThe sequence location in read 1 or read 2 (e.g., "R1:1-10").
sample barcode tagSAM tag for the sample barcode.
sample barcodeDefines the sample barcode segments.
UMI tagSAM tag for the UMI. "UR" is suggested for raw UMI, "UB" for corrected.
UMI qual tagSAM tag for the UMI sequence quality.
UMIDefines the location of the UMI.
read 1Defines the location of read 1 sequence to keep.
read 2Defines the location of read 2 sequence to keep.

Positional Information Examples

Scenario 1: Dark reaction on cDNA R1 and Oligo R1/R2

  • cDNA - Cell Barcode: R1:1-10,R1:11-20
  • cDNA - UMI: R1:21-30
  • cDNA - Read 1: R2:1-100
  • Oligo - Cell Barcode: R1:1-10,R1:11-20
  • Oligo - Read 1: R2:1-30

Scenario 2: Dark reaction on cDNA R1 and Oligo R1 (Oligo R2 is normal)

  • cDNA - Cell Barcode: R1:1-10,R1:11-20
  • cDNA - UMI: R1:21-30
  • cDNA - Read 1: R2:1-100
  • Oligo - Cell Barcode: R1:1-10,R1:11-20
  • Oligo - Read 1: R2:1-10,R2:17-26,R2:33-42