detect_samples: Heuristic discovery of samples based on cell labels

View source: R/preprocessing_filtering_reduction.R

detect_samplesR Documentation

Heuristic discovery of samples based on cell labels

Description

Identify a fixed number of common string (samples) in a set of varying strings (cells). E.g. in the set "Sample1_cell1","Sample1_cell2","Sample2_cell1","Sample2_cell2" and with nb_samples=2, the function returns "Sample1","Sample1","Sample2","Sample2".

Usage

detect_samples(barcodes, nb_samples = 1)

Arguments

barcodes

Vector of cell barcode names (e.g. Sample1_cell1, Sample1_cell2...)

nb_samples

Number of samples to find

Value

character vector of sample names the same length as cell labels

Examples


barcodes = c(paste0("HBCx22_BC_",seq_len(100)),
paste0("mouse_sample_XX",208:397))
samples = detect_samples(barcodes, nb_samples=2)


vallotlab/ChromSCape documentation built on Oct. 15, 2023, 1:47 p.m.