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.
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
valuefield,CBis the suggested tag name for the corrected cell barcode, andURis for the UMI. - Location: The
locationfield specifies the read (R1orR2) 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 tag | SAM tag for the corrected cell barcode. "CB" is suggested. |
cell barcode | A JSON array defining the segments of the cell barcode. |
cell barcode raw tag | SAM tag for the raw cell barcode sequence. "CR" is suggested. |
cell barcode raw qual tag | SAM tag for the quality score of the raw cell barcode. "CY" is suggested. |
distance | The minimum Hamming distance for barcode correction. |
white list | A list of valid barcode sequences for correction. |
location | The sequence location in read 1 or read 2 (e.g., "R1:1-10"). |
sample barcode tag | SAM tag for the sample barcode. |
sample barcode | Defines the sample barcode segments. |
UMI tag | SAM tag for the UMI. "UR" is suggested for raw UMI, "UB" for corrected. |
UMI qual tag | SAM tag for the UMI sequence quality. |
UMI | Defines the location of the UMI. |
read 1 | Defines the location of read 1 sequence to keep. |
read 2 | Defines 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