sc_correct_bam_bc: sc_correct_bam_bc

View source: R/wrapper_scPipeCPP.R

sc_correct_bam_bcR Documentation

sc_correct_bam_bc

Description

update the cell barcode tag in bam file with corrected barcode output to a new bam file. the function will be useful for methods that use the cell barcode information from bam file, such as 'Demuxlet'

Usage

sc_correct_bam_bc(
  inbam,
  outbam,
  bc_anno,
  max_mis = 1,
  bam_tags = list(am = "YE", ge = "GE", bc = "BC", mb = "OX"),
  mito = "MT",
  nthreads = 1
)

Arguments

inbam

input bam file. This should be the output of sc_exon_mapping

outbam

output bam file with updated cell barcode

bc_anno

barcode annotation, first column is cell id, second column is cell barcode sequence

max_mis

maximum mismatch allowed in barcode. (default: 1)

bam_tags

list defining BAM tags where mapping information is stored.

  • "am": mapping status tag

  • "ge": gene id

  • "bc": cell barcode tag

  • "mb": molecular barcode tag

mito

mitochondrial chromosome name. This should be consistent with the chromosome names in the bam file.

nthreads

number of threads to use. (default: 1)

Value

no return

Examples

data_dir="celseq2_demo"
barcode_annotation_fn = system.file("extdata", "barcode_anno.csv",
    package = "scPipe")
## Not run: 
# refer to the vignettes for the complete workflow
...
sc_correct_bam_bc(file.path(data_dir, "out.map.bam"),
    file.path(data_dir, "out.map.clean.bam"),
    barcode_annotation_fn)
...

## End(Not run)


LuyiTian/scPipe documentation built on Dec. 11, 2023, 8:21 p.m.