detect_samples: Heuristic discovery of samples based on cell labels

Description Usage Arguments Value Examples

View source: R/preprocessing_filtering_reduction.R

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

1
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

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

ChromSCape documentation built on Nov. 8, 2020, 6:57 p.m.