Skip to contents

produce a barplot of cell barcode demultiplex statistics

Usage

plot_demultiplex(outdir, stats_file)

Arguments

outdir

folder containing the matched_barcode_stat file, or matched_barcode_stat.SAMPLE files. Ignored if stats_file is provided.

stats_file

matched_barcode_stat file(s) from which the statistics to be plotted.

Value

a ggplot object of the barcode plot

Examples

outdir <- tempfile()
dir.create(outdir)
bc_allow <- file.path(outdir, "bc_allow.tsv")
R.utils::gunzip(filename = system.file("extdata/bc_allow.tsv.gz", package = "FLAMES"), destname = bc_allow, remove = FALSE)
find_barcode(
  fastq = system.file("extdata/fastq", package = "FLAMES"),
  stats_out = file.path(outdir, "bc_stat"),
  reads_out = file.path(outdir, "demultiplexed.fq.gz"),
  barcodes_file = bc_allow
)
#> FLEXIPLEX 0.96.2
#> Setting max barcode edit distance to 2
#> Setting max flanking sequence edit distance to 8
#> Setting read IDs to be  replaced
#> Setting number of threads to 1
#> Search pattern: 
#> primer: CTACACGACGCTCTTCCGATCT
#> BC: NNNNNNNNNNNNNNNN
#> UMI: NNNNNNNNNNNN
#> polyT: TTTTTTTTT
#> Setting known barcodes from /tmp/Rtmpg58CKQ/file1a582dd8de18/bc_allow.tsv
#> Number of known barcodes: 143
#> Searching for barcodes...
#> Number of reads processed: 393
#> Number of reads where a barcode was found: 368
#> Number of reads where more than one barcode was found: 4
#> All done!
#> Skipping TSO trimming...
plot_demultiplex(stats_file = file.path(outdir, "bc_stat"))
#> $knee_plot

#> 
#> $editdistance_plot

#>