Add Odd-barcode–derived metadata to a Seurat object
Add_odd_barcode_metadata.RdsciT datasets often consist of cells from different treatment conditions.
Using Odd barcodes embedded in the full cell barcode, cells can be stratified
by treatment or condition. This function extracts the Odd barcode from the
full barcode stored in the Seurat metadata, matches it to a user-provided
metadata table, and adds both the Odd barcode and the corresponding condition
as new metadata columns to the Seurat object contained within an lseurat
object.
Usage
Add_odd_barcode_metadata(
lseurat,
Odd_barcode_md_file,
full_barcode_col = "BC",
condition_col = "condition",
Odd_barcode_col = "Odd_barcode",
Odd_barcode_position = 2
)Arguments
- lseurat
An object of class
lseuratcontaining a Seurat object inlseurat$seurat.- Odd_barcode_md_file
A comma-separated file linking Odd barcode IDs to metadata (e.g. treatment or condition). Must contain at least two columns: one with Odd barcode identifiers and one with the corresponding condition.
- full_barcode_col
Character string specifying the column name in the Seurat metadata that contains the full cell barcode. Defaults to
"BC".- condition_col
Character string specifying the name of the metadata column to store the condition labels in the Seurat object. Defaults to
"condition".- Odd_barcode_col
Character string specifying the name of the metadata column to store the extracted Odd barcodes in the Seurat object. Defaults to
"Odd_barcode".- Odd_barcode_position
Integer specifying the position of the Odd barcode after splitting the full barcode on underscores (
"_"). Defaults to2.