cell_id_hash: Generate Truncated SHA-256 Hash for Each Row of Two Columns

View source: R/cell_id_hash.R

cell_id_hashR Documentation

Generate Truncated SHA-256 Hash for Each Row of Two Columns

Description

This function generates a truncated SHA-256 hash for each row by concatenating a truncated version of the 'barcode_column' (first 16 characters) with the 'run_column'. The resulting hash is truncated to the specified length.

Usage

cell_id_hash(barcode_column, run_column, length = 16)

Arguments

barcode_column

A character vector containing barcodes.

run_column

A character vector containing run identifiers.

length

An integer specifying the length of the truncated hash. Default is 16.

Value

A character vector of truncated SHA-256 hashes, one for each row.

Examples

# Example usage
barcode_column <- c("ACGTGCTAGCTAGCTA-1", "GTCAGTCAGTCAGTCA-1", "TGCATGCATGCATGCA-1")
run_column <- c("Run1", "Run2", "Run3")
cell_id_hash(barcode_column, run_column)


Terkild/scutility documentation built on Jan. 16, 2025, 5:28 p.m.