define_clonotypes: Define clonotypes based on V(D)J data

View source: R/import-vdj.R

define_clonotypesR Documentation

Define clonotypes based on V(D)J data

Description

This will assign new clonotype IDs based on the combination of values present in the provided columns

Usage

define_clonotypes(
  input,
  data_cols,
  clonotype_col = "clonotype_id",
  filter_chains = c("productive", "full_length"),
  sep = global$sep
)

Arguments

input

Single cell object or data.frame containing V(D)J data. If a data.frame is provided, the cell barcodes should be stored as row names.

data_cols

meta.data columns containing V(D)J data to use for defining clonotypes

clonotype_col

Name of column to use for storing clonotype IDs

filter_chains

Column(s) to use for filtering chains prior to defining clonotypes (e.g. productive, full_length). The column(s) must contain TRUE or FALSE for each chain. If NULL, all chains are used when defining clonotypes.

sep

Separator used for storing per cell V(D)J data

Value

Single cell object or data.frame with added clonotype IDs

Examples

# Define clonotypes using the CDR3 nucleotide sequence
res <- define_clonotypes(
  vdj_sce,
  data_cols = "cdr3_nt"
)

head(slot(res, "colData"), 1)

# Define clonotypes based on the combination of the CDR3 nucleotide sequence
# and the V and J genes
res <- define_clonotypes(
  vdj_sce,
  data_cols = c("cdr3_nt", "v_gene", "j_gene")
)

head(slot(res, "colData"), 1)

# Modify the name of the column used to store clonotype IDs
res <- define_clonotypes(
  vdj_sce,
  data_cols = "cdr3_nt",
  clonotype_col = "NEW_clonotype_id"
)

head(slot(res, "colData"), 1)

# When defining clonotypes only use chains that are productive
res <- define_clonotypes(
  vdj_sce,
  data_cols = "cdr3_nt",
  filter_chains = "productive"
)

head(slot(res, "colData"), 1)


rnabioco/djvdj documentation built on Oct. 24, 2023, 7:33 p.m.