Removes clones with counts strictly less than the specified threshold.

remove_clones_below_threshold(count_data, threshold, count_column)

Arguments

count_data

A data.table containing clone barcodes and their counts. One row per clone barcode.

threshold

A numeric value indicating the minimum count required for a clone barcode to be retained.

count_column

A character string specifying the column name for clone barcode counts.

Value

A data.table with clones above the threshold.

Examples

library(data.table)

toy_clone_counts <- data.table(
sample_name = c(rep("test1", 2), rep("test2", 3)),
read_count = c(1, 5, 10, 15, 20),
clone_barcodes = c("ACGT", "CATG", "CATG", "ACGT", "ATGC")
)

remove_clones_below_threshold(
  count_data = toy_clone_counts,
  threshold = 2,
  count_column = "read_count"
)
#>    sample_name read_count clone_barcodes
#> 1:       test1          5           CATG
#> 2:       test2         10           CATG
#> 3:       test2         15           ACGT
#> 4:       test2         20           ATGC