cassiopeia.pp.error_correct_cellbcs_to_whitelist#

cassiopeia.pp.error_correct_cellbcs_to_whitelist(bam_fp, whitelist, output_directory, n_threads=1)[source]#

Error-correct cell barcodes in the input BAM.

The barcode correction procedure used in Cell Ranger by 10X Genomics is used. https://kb.10xgenomics.com/hc/en-us/articles/115003822406-How-does-Cell-Ranger-correct-barcode-sequencing-errors This function can either take a list of whitelisted barcodes or a plaintext file containing these barcodes.

Parameters:
bam_fp str

Input BAM filepath containing raw barcodes

whitelist str | List[str]Union[str, List[str]]

May be either a single path to a plaintext file containing the barcode whitelist, one barcode per line, or a list of barcodes.

output_directory str

The output directory where the corrected BAM will be written to. This directory must exist prior to calling this function.

n_threads int (default: 1)

Number of threads to use. Defaults to 1.

Return type:

str

Returns:

Path to corrected BAM