FLAMES 2.3.1
Changqing Wang, Oliver Voogd, Yupei You
Source:vignettes/FLAMES_vignette.Rmd
FLAMES_vignette.Rmd
FLAMES
The overhauled FLAMES 2.3.1 pipeline provides convenient pipelines for performing single-cell and bulk long-read analysis of mutations and isoforms. The pipeline is designed to take various type of experiments, e.g. with or without known cell barcodes and custome cell barcode designs, to reduce the need of constantly re-inventing the wheel for every new sequencing protocol.

Creating a pipeline
To start your long-read RNA-seq analysis, simply create a pipeline
via either BulkPipeline()
,
SingleCellPipeline()
or
MultiSampleSCPipeline()
. Let’s try
SingleCellPipeline()
first:
outdir <- tempfile()
dir.create(outdir)
# some example data
# known cell barcodes, e.g. from coupled short-read sequencing
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
)
# reference genome
genome_fa <- file.path(outdir, "rps24.fa")
R.utils::gunzip(
filename = system.file("extdata", "rps24.fa.gz", package = "FLAMES"),
destname = genome_fa, remove = FALSE
)
pipeline <- SingleCellPipeline(
# use the default configs
config_file = create_config(outdir),
outdir = outdir,
# the input fastq file
fastq = system.file("extdata", "fastq", "musc_rps24.fastq.gz", package = "FLAMES"),
# reference annotation file
annotation = system.file("extdata", "rps24.gtf.gz", package = "FLAMES"),
genome_fa = genome_fa,
barcodes_file = bc_allow
)
#> Writing configuration parameters to: /tmp/RtmpTP27SR/file3db734d1963c/config_file_15799.json
#> Configured steps:
#> barcode_demultiplex: TRUE
#> genome_alignment: TRUE
#> gene_quantification: TRUE
#> isoform_identification: TRUE
#> read_realignment: TRUE
#> transcript_quantification: TRUE
#> samtools not found, will use Rsamtools package instead
pipeline
#> → A FLAMES.SingleCellPipeline outputting to /tmp/RtmpTP27SR/file3db734d1963c
#>
#> ── Inputs
#> ✔ fastq: ...ibrary/FLAMES/extdata/fastq/musc_rps24.fastq.gz
#> ✔ annotation: /__w/_temp/Library/FLAMES/extdata/rps24.gtf.gz
#> ✔ genome_fa: /tmp/RtmpTP27SR/file3db734d1963c/rps24.fa
#> ✔ barcodes_file: /tmp/RtmpTP27SR/file3db734d1963c/bc_allow.tsv
#>
#> ── Outputs
#> ℹ demultiplexed_fastq: matched_reads.fastq.gz
#> ℹ deduped_fastq: matched_reads_dedup.fastq.gz
#> ℹ genome_bam: align2genome.bam
#> ℹ transcriptome_assembly: transcript_assembly.fa
#> ℹ transcriptome_bam: realign2transcript.bam
#>
#> ── Pipeline Steps
#> ℹ barcode_demultiplex (pending)
#> ℹ genome_alignment (pending)
#> ℹ gene_quantification (pending)
#> ℹ isoform_identification (pending)
#> ℹ read_realignment (pending)
#> ℹ transcript_quantification (pending)
Running the pipeline
To execute the pipeline, simply call
run_FLAMES(pipeline)
. This will run through all the steps
in the pipeline, returning a updated pipeline object:
pipeline <- run_FLAMES(pipeline)
#> ── Running step: barcode_demultiplex @ Mon Jun 23 02:43:12 2025 ────────────────
#> 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 8
#> Search pattern:
#> primer: CTACACGACGCTCTTCCGATCT
#> BC: NNNNNNNNNNNNNNNN
#> UMI: NNNNNNNNNNNN
#> polyT: TTTTTTTTT
#> Setting known barcodes from /tmp/RtmpTP27SR/file3db734d1963c/bc_allow.tsv
#> Number of known barcodes: 143
#> Processing file: /__w/_temp/Library/FLAMES/extdata/fastq/musc_rps24.fastq.gz
#> Searching for barcodes...
#> Number of reads processed: 393
#> Number of reads where at least one barcode was found: 368
#> Number of reads with exactly one barcode match: 364
#> Number of chimera reads: 1
#> All done!
#> ── Running step: genome_alignment @ Mon Jun 23 02:43:14 2025 ───────────────────
#> Creating junction bed file from GFF3 annotation.
#> Aligning sample /tmp/RtmpTP27SR/file3db734d1963c/matched_reads.fastq.gz -> /tmp/RtmpTP27SR/file3db734d1963c/align2genome.bam
#> Your fastq file appears to have tags, but you did not provide the -y option to minimap2 to include the tags in the output.
#> Warning in minimap2_align(fq_in = fastqs[i], fa_file = genome, config =
#> pipeline@config, : samtools not found, using Rsamtools instead, this could be
#> slower and might fail for large BAM files.
#> Sorting BAM files by genome coordinates with 8 threads...
#> Indexing bam files
#> ── Running step: gene_quantification @ Mon Jun 23 02:43:15 2025 ────────────────
#> 02:43:15 AM Mon Jun 23 2025 quantify genes
#> Using BAM(s): /tmp/RtmpTP27SR/file3db734d1963c/align2genome.bam
#> Assigning reads to genes...
#> Writing the gene count matrix ...
#> Plotting the saturation curve ...
#> Generating deduplicated fastq file ...
#> ── Running step: isoform_identification @ Mon Jun 23 02:43:15 2025 ─────────────
#> #### Read gene annotations
#> Removed similar transcripts in gene annotation: Counter()
#> #### find isoforms
#> chr14
#> Import genomic features from the file as a GRanges object ...
#> OK
#> Prepare the 'metadata' data frame ... OK
#> Make the TxDb object ...
#> Warning in .makeTxDb_normarg_chrominfo(chrominfo): genome version information
#> is not available for this TxDb object
#> OK
#> ── Running step: read_realignment @ Mon Jun 23 02:43:16 2025 ───────────────────
#> Checking for fastq file(s) /__w/_temp/Library/FLAMES/extdata/fastq/musc_rps24.fastq.gz
#> files found
#> Checking for fastq file(s) /tmp/RtmpTP27SR/file3db734d1963c/matched_reads.fastq.gz
#> files found
#> Checking for fastq file(s) /tmp/RtmpTP27SR/file3db734d1963c/matched_reads_dedup.fastq.gz
#> files found
#> Realigning sample /tmp/RtmpTP27SR/file3db734d1963c/matched_reads_dedup.fastq.gz -> /tmp/RtmpTP27SR/file3db734d1963c/realign2transcript.bam
#> Warning in minimap2_align(fq_in = fastqs[i], fa_file =
#> pipeline@transcriptome_assembly, : samtools not found, using Rsamtools instead,
#> this could be slower and might fail for large BAM files.
#> Sorting BAM files by 8 with CB threads...
#>
#> ── Running step: transcript_quantification @ Mon Jun 23 02:43:17 2025 ──────────
#> Import genomic features from the file as a GRanges object ... OK
#> Prepare the 'metadata' data frame ... OK
#> Make the TxDb object ...
#> Warning in .makeTxDb_normarg_chrominfo(chrominfo): genome version information
#> is not available for this TxDb object
#> OK
#> Import genomic features from the file as a GRanges object ... OK
#> Prepare the 'metadata' data frame ... OK
#> Make the TxDb object ...
#> Warning in .makeTxDb_normarg_chrominfo(chrominfo): genome version information
#> is not available for this TxDb object
#> OK
pipeline
#> ✔ A FLAMES.SingleCellPipeline outputting to /tmp/RtmpTP27SR/file3db734d1963c
#>
#> ── Inputs
#> ✔ fastq: ...ibrary/FLAMES/extdata/fastq/musc_rps24.fastq.gz
#> ✔ annotation: /__w/_temp/Library/FLAMES/extdata/rps24.gtf.gz
#> ✔ genome_fa: /tmp/RtmpTP27SR/file3db734d1963c/rps24.fa
#> ✔ barcodes_file: /tmp/RtmpTP27SR/file3db734d1963c/bc_allow.tsv
#>
#> ── Outputs
#> ✔ demultiplexed_fastq: matched_reads.fastq.gz [217.1 KB]
#> ✔ deduped_fastq: matched_reads_dedup.fastq.gz [203.9 KB]
#> ✔ genome_bam: align2genome.bam [267.5 KB]
#> ✔ novel_isoform_annotation: isoform_annotated.gff3 [7.4 KB]
#> ✔ transcriptome_assembly: transcript_assembly.fa [8.4 KB]
#> ✔ transcriptome_bam: realign2transcript.bam [392.3 KB]
#>
#> ── Pipeline Steps
#> ✔ barcode_demultiplex (completed in 1.92 sec)
#> ✔ genome_alignment (completed in 0.37 sec)
#> ✔ gene_quantification (completed in 0.79 sec)
#> ✔ isoform_identification (completed in 0.88 sec)
#> ✔ read_realignment (completed in 0.25 sec)
#> ✔ transcript_quantification (completed in 1.26 sec)
If you run into any error, run_FLAMES()
will stop and
return the pipeline object with the error message. After resolving the
error, you can run resume_FLAMES(pipeline)
to continue the
pipeline from the last step. There is also
run_step(pipeline, step_name)
to run a specific step in the
pipeline. Let’s show this by deliberately causing an error via deleting
the input files:
# set up a new pipeline
outdir2 <- tempfile()
pipeline2 <- SingleCellPipeline(
config_file = create_config(outdir),
outdir = outdir2,
fastq = system.file("extdata", "fastq", "musc_rps24.fastq.gz", package = "FLAMES"),
annotation = system.file("extdata", "rps24.gtf.gz", package = "FLAMES"),
genome_fa = genome_fa,
barcodes_file = bc_allow
)
#> Output directory does not exists: one is being created
#> [1] "/tmp/RtmpTP27SR/file3db742982247"
#> Writing configuration parameters to: /tmp/RtmpTP27SR/file3db734d1963c/config_file_15799.json
#> Configured steps:
#> barcode_demultiplex: TRUE
#> genome_alignment: TRUE
#> gene_quantification: TRUE
#> isoform_identification: TRUE
#> read_realignment: TRUE
#> transcript_quantification: TRUE
#> samtools not found, will use Rsamtools package instead
# delete the reference genome
unlink(genome_fa)
pipeline2 <- run_FLAMES(pipeline2)
#> ── Running step: barcode_demultiplex @ Mon Jun 23 02:43:18 2025 ────────────────
#> 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 8
#> Search pattern:
#> primer: CTACACGACGCTCTTCCGATCT
#> BC: NNNNNNNNNNNNNNNN
#> UMI: NNNNNNNNNNNN
#> polyT: TTTTTTTTT
#> Setting known barcodes from /tmp/RtmpTP27SR/file3db734d1963c/bc_allow.tsv
#> Number of known barcodes: 143
#> Processing file: /__w/_temp/Library/FLAMES/extdata/fastq/musc_rps24.fastq.gz
#> Searching for barcodes...
#> Number of reads processed: 393
#> Number of reads where at least one barcode was found: 368
#> Number of reads with exactly one barcode match: 364
#> Number of chimera reads: 1
#> All done!
#> ── Running step: genome_alignment @ Mon Jun 23 02:43:18 2025 ───────────────────
#> Creating junction bed file from GFF3 annotation.
#> Aligning sample /tmp/RtmpTP27SR/file3db742982247/matched_reads.fastq.gz -> /tmp/RtmpTP27SR/file3db742982247/align2genome.bam
#> Your fastq file appears to have tags, but you did not provide the -y option to minimap2 to include the tags in the output.
#> Warning in minimap2_align(fq_in = fastqs[i], fa_file = genome, config =
#> pipeline@config, : samtools not found, using Rsamtools instead, this could be
#> slower and might fail for large BAM files.
#> Warning in value[[3L]](cond): Error in step genome_alignment: argument is
#> missing, with no default, pipeline stopped.
pipeline2
#> ! A FLAMES.SingleCellPipeline outputting to /tmp/RtmpTP27SR/file3db742982247
#>
#> ── Inputs
#> ✔ fastq: ...ibrary/FLAMES/extdata/fastq/musc_rps24.fastq.gz
#> ✔ annotation: /__w/_temp/Library/FLAMES/extdata/rps24.gtf.gz
#> ! genome_fa: /tmp/RtmpTP27SR/file3db734d1963c/rps24.fa [missing]
#> ✔ barcodes_file: /tmp/RtmpTP27SR/file3db734d1963c/bc_allow.tsv
#>
#> ── Outputs
#> ✔ demultiplexed_fastq: matched_reads.fastq.gz [217.1 KB]
#> ℹ deduped_fastq: matched_reads_dedup.fastq.gz
#> ℹ genome_bam: align2genome.bam
#> ℹ transcriptome_assembly: transcript_assembly.fa
#> ℹ transcriptome_bam: realign2transcript.bam
#>
#> ── Pipeline Steps
#> ✔ barcode_demultiplex (completed in 0.17 sec)
#> ✖ genome_alignment (failed: Error in .makeMessage(..., domain = domain): argument is missing, with no default
#> )
#> ℹ gene_quantification (pending)
#> ℹ isoform_identification (pending)
#> ℹ read_realignment (pending)
#> ℹ transcript_quantification (pending)
Let’s then fix the error by re-creating the reference genome file and resume the pipeline:
R.utils::gunzip(
filename = system.file("extdata", "rps24.fa.gz", package = "FLAMES"),
destname = genome_fa, remove = FALSE
)
pipeline2 <- resume_FLAMES(pipeline2)
#> Resuming pipeline from step: genome_alignment
#> ── Running step: genome_alignment @ Mon Jun 23 02:43:19 2025 ───────────────────
#> Aligning sample /tmp/RtmpTP27SR/file3db742982247/matched_reads.fastq.gz -> /tmp/RtmpTP27SR/file3db742982247/align2genome.bam
#> Your fastq file appears to have tags, but you did not provide the -y option to minimap2 to include the tags in the output.
#> Warning in minimap2_align(fq_in = fastqs[i], fa_file = genome, config =
#> pipeline@config, : samtools not found, using Rsamtools instead, this could be
#> slower and might fail for large BAM files.
#> Sorting BAM files by genome coordinates with 8 threads...
#> Indexing bam files
#> ── Running step: gene_quantification @ Mon Jun 23 02:43:19 2025 ────────────────
#> 02:43:19 AM Mon Jun 23 2025 quantify genes
#> Using BAM(s): /tmp/RtmpTP27SR/file3db742982247/align2genome.bam
#> Assigning reads to genes...
#> Writing the gene count matrix ...
#> Plotting the saturation curve ...
#> Generating deduplicated fastq file ...
#> ── Running step: isoform_identification @ Mon Jun 23 02:43:19 2025 ─────────────
#> #### Read gene annotations
#> Removed similar transcripts in gene annotation: Counter()
#> #### find isoforms
#> chr14
#> Import genomic features from the file as a GRanges object ...
#> OK
#> Prepare the 'metadata' data frame ... OK
#> Make the TxDb object ...
#> Warning in .makeTxDb_normarg_chrominfo(chrominfo): genome version information
#> is not available for this TxDb object
#> OK
#> ── Running step: read_realignment @ Mon Jun 23 02:43:20 2025 ───────────────────
#> Checking for fastq file(s) /__w/_temp/Library/FLAMES/extdata/fastq/musc_rps24.fastq.gz
#> files found
#> Checking for fastq file(s) /tmp/RtmpTP27SR/file3db742982247/matched_reads.fastq.gz
#> files found
#> Checking for fastq file(s) /tmp/RtmpTP27SR/file3db742982247/matched_reads_dedup.fastq.gz
#> files found
#> Realigning sample /tmp/RtmpTP27SR/file3db742982247/matched_reads_dedup.fastq.gz -> /tmp/RtmpTP27SR/file3db742982247/realign2transcript.bam
#> Warning in minimap2_align(fq_in = fastqs[i], fa_file =
#> pipeline@transcriptome_assembly, : samtools not found, using Rsamtools instead,
#> this could be slower and might fail for large BAM files.
#> Sorting BAM files by 8 with CB threads...
#>
#> ── Running step: transcript_quantification @ Mon Jun 23 02:43:20 2025 ──────────
#> Import genomic features from the file as a GRanges object ... OK
#> Prepare the 'metadata' data frame ... OK
#> Make the TxDb object ...
#> Warning in .makeTxDb_normarg_chrominfo(chrominfo): genome version information
#> is not available for this TxDb object
#> OK
#> Import genomic features from the file as a GRanges object ... OK
#> Prepare the 'metadata' data frame ... OK
#> Make the TxDb object ...
#> Warning in .makeTxDb_normarg_chrominfo(chrominfo): genome version information
#> is not available for this TxDb object
#> OK
pipeline2
#> ✔ A FLAMES.SingleCellPipeline outputting to /tmp/RtmpTP27SR/file3db742982247
#>
#> ── Inputs
#> ✔ fastq: ...ibrary/FLAMES/extdata/fastq/musc_rps24.fastq.gz
#> ✔ annotation: /__w/_temp/Library/FLAMES/extdata/rps24.gtf.gz
#> ✔ genome_fa: /tmp/RtmpTP27SR/file3db734d1963c/rps24.fa
#> ✔ barcodes_file: /tmp/RtmpTP27SR/file3db734d1963c/bc_allow.tsv
#>
#> ── Outputs
#> ✔ demultiplexed_fastq: matched_reads.fastq.gz [217.1 KB]
#> ✔ deduped_fastq: matched_reads_dedup.fastq.gz [203.9 KB]
#> ✔ genome_bam: align2genome.bam [267.5 KB]
#> ✔ novel_isoform_annotation: isoform_annotated.gff3 [7.4 KB]
#> ✔ transcriptome_assembly: transcript_assembly.fa [8.4 KB]
#> ✔ transcriptome_bam: realign2transcript.bam [392.3 KB]
#>
#> ── Pipeline Steps
#> ✔ barcode_demultiplex (completed in 0.17 sec)
#> ✔ genome_alignment (completed in 0.22 sec)
#> ✔ gene_quantification (completed in 0.34 sec)
#> ✔ isoform_identification (completed in 0.58 sec)
#> ✔ read_realignment (completed in 0.24 sec)
#> ✔ transcript_quantification (completed in 1.08 sec)
After completing the pipeline, a SingleCellExperiment
object is created (or SummarizedExperiment
for bulk
pipeline and list of SingleCellExperiment
for multi-sample
pipeline). You can access the results via
experiment(pipeline)
:
experiment(pipeline)
#> class: SingleCellExperiment
#> dim: 10 137
#> metadata(0):
#> assays(1): counts
#> rownames(10): ENSMUST00000169826.2 ENSMUSG00000025290.17_19_5159_1 ...
#> ENSMUSG00000025290.17_19_5159_8 ENSMUST00000225023.1
#> rowData names(2): transcript_id gene_id
#> colnames(137): AACCATGAGTCGTTTG AACTCTTGTCACCTAA ... TTGTAGGTCAGTGTTG
#> TTTATGCAGACTAGAT
#> colData names(0):
#> reducedDimNames(0):
#> mainExpName: NULL
#> altExpNames(0):
HPC support
Individual steps can be submitted as HPC jobs via crew
and crew.cluster
packages, simply supply a list of crew
controllers (named by step name) to the controllers
argument of the pipeline constructors. For example, we could run the
alignment steps through controllers, while keeping the rest in the main
R session.
# example_pipeline provides an example pipeline for each of the three types
# of pipelines: BulkPipeline, SingleCellPipeline and MultiSampleSCPipeline
mspipeline <- example_pipeline("MultiSampleSCPipeline")
#> Writing configuration parameters to: /tmp/RtmpTP27SR/file3db76dbbfffa/config_file_15799.json
#> Configured steps:
#> barcode_demultiplex: TRUE
#> genome_alignment: TRUE
#> gene_quantification: TRUE
#> isoform_identification: TRUE
#> read_realignment: TRUE
#> transcript_quantification: TRUE
#> samtools not found, will use Rsamtools package instead
# Providing a single controller will run all steps in it:
controllers(mspipeline) <- crew::crew_controller_local()
# Setting controllers to an empty list will run all steps in the main R session:
controllers(mspipeline) <- list()
# Alternatively, we can run only the alignment steps in the crew controller:
controllers(mspipeline)[["genome_alignment"]] <- crew::crew_controller_local(workers = 4)
# Or `controllers(mspipeline) <- list(genome_alignment = crew::crew_cluster())`
# to remove controllers for all other steps.
# Replace `crew_controller_local()` with `crew.cluster::crew_controller_slurm()` or other
# crew controllers according to your HPC job scheduler.
run_FLAMES()
will then submit the alignment step to the
crew controller. By default, run_step()
will ignore the
crew controllers and run the step in the main R session, since it is
easier to debug. You can use
run_step(pipeline, step_name, disable_controller = FALSE)
to prevent this behavior and run the step in crew controllers if
available.
You can tailor the resources for each step by specifying different arguments to the controllers. The alignment step typically benifits from more cores (e.g. 64 cores and 20GB memory), whereas other steps might not need as much cores but more memory hungry.
# An example helper function to create a Slurm controller with specific resources
create_slurm_controller <- function(
cpus, memory_gb, workers = 10, seconds_idle = 10,
script_lines = "module load R/flexiblas/4.5.0") {
name <- sprintf("slurm_%dc%dg", cpus, memory_gb)
crew.cluster::crew_controller_slurm(
name = name,
workers = workers,
seconds_idle = seconds_idle,
retry_tasks = FALSE,
options_cluster = crew.cluster::crew_options_slurm(
script_lines = script_lines,
memory_gigabytes_required = memory_gb,
cpus_per_task = cpus,
log_output = file.path("logs", "crew_log_%A.txt"),
log_error = file.path("logs", "crew_log_%A.txt")
)
)
}
controllers(mspipeline)[["genome_alignment"]] <-
create_slurm_controller(cpus = 64, memory_gb = 20)
See also the crew.cluster
website for more information on the supported job schedulers.
Visualizations
QC plots
Quality metrics are collected throughout the pipeline, and FLAMES
provide visiualization functions to plot the metrics. For the first
demultiplexing step, we can use the plot_demultiplex
function to see how well many reads are retained after
demultiplexing:
# don't have to run the entire pipeline for this
# let's just run the demultiplexing step
mspipeline <- run_step(mspipeline, "barcode_demultiplex")
#> ── Running step: barcode_demultiplex @ Mon Jun 23 02:43:22 2025 ────────────────
#> 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/RtmpTP27SR/file3db76dbbfffa/bc_allow.tsv
#> Number of known barcodes: 143
#> Processing file: /tmp/RtmpTP27SR/file3db76dbbfffa/fastq/sample1.fq.gz
#> Searching for barcodes...
#> Processing file: /tmp/RtmpTP27SR/file3db76dbbfffa/fastq/sample2.fq.gz
#> Searching for barcodes...
#> Processing file: /tmp/RtmpTP27SR/file3db76dbbfffa/fastq/sample3.fq.gz
#> Searching for barcodes...
#> Number of reads processed: 393
#> Number of reads where at least one barcode was found: 368
#> Number of reads with exactly one barcode match: 364
#> Number of chimera reads: 1
#> All done!
#> 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/RtmpTP27SR/file3db76dbbfffa/bc_allow.tsv
#> Number of known barcodes: 143
#> Processing file: /tmp/RtmpTP27SR/file3db76dbbfffa/fastq/sample1.fq.gz
#> Searching for barcodes...
#> Number of reads processed: 100
#> Number of reads where at least one barcode was found: 92
#> Number of reads with exactly one barcode match: 91
#> Number of chimera reads: 1
#> All done!
#> 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/RtmpTP27SR/file3db76dbbfffa/bc_allow.tsv
#> Number of known barcodes: 143
#> Processing file: /tmp/RtmpTP27SR/file3db76dbbfffa/fastq/sample2.fq.gz
#> Searching for barcodes...
#> Number of reads processed: 100
#> Number of reads where at least one barcode was found: 95
#> Number of reads with exactly one barcode match: 94
#> Number of chimera reads: 0
#> All done!
#> 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/RtmpTP27SR/file3db76dbbfffa/bc_allow.tsv
#> Number of known barcodes: 143
#> Processing file: /tmp/RtmpTP27SR/file3db76dbbfffa/fastq/sample3.fq.gz
#> Searching for barcodes...
#> Number of reads processed: 193
#> Number of reads where at least one barcode was found: 181
#> Number of reads with exactly one barcode match: 179
#> Number of chimera reads: 0
#> All done!
plot_demultiplex(mspipeline)
#> $reads_count_plot
#>
#> $knee_plot
#> `geom_smooth()` using formula = 'y ~ x'
#>
#> $flank_editdistance_plot
#>
#> $barcode_editdistance_plot
#>
#> $cutadapt_plot
Session Info
#> R version 4.5.1 (2025-06-13)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.2 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] FLAMES_2.3.3 BiocStyle_2.36.0
#>
#> loaded via a namespace (and not attached):
#> [1] splines_4.5.1 later_1.4.2
#> [3] BiocIO_1.18.0 bitops_1.0-9
#> [5] filelock_1.0.3 tibble_3.3.0
#> [7] R.oo_1.27.1 polyclip_1.10-7
#> [9] basilisk.utils_1.20.0 bambu_3.10.0
#> [11] XML_3.99-0.18 httr2_1.1.2
#> [13] lifecycle_1.0.4 pwalign_1.4.0
#> [15] edgeR_4.6.2 doParallel_1.0.17
#> [17] vroom_1.6.5 processx_3.8.6
#> [19] MASS_7.3-65 globals_0.18.0
#> [21] lattice_0.22-7 magrittr_2.0.3
#> [23] limma_3.64.1 sass_0.4.10
#> [25] rmarkdown_2.29 jquerylib_0.1.4
#> [27] yaml_2.3.10 metapod_1.16.0
#> [29] reticulate_1.42.0 cowplot_1.1.3
#> [31] DBI_1.2.3 RColorBrewer_1.1-3
#> [33] abind_1.4-8 ShortRead_1.66.0
#> [35] GenomicRanges_1.60.0 purrr_1.0.4
#> [37] R.utils_2.13.0 BiocGenerics_0.54.0
#> [39] RCurl_1.98-1.17 yulab.utils_0.2.0
#> [41] rappdirs_0.3.3 tweenr_2.0.3
#> [43] circlize_0.4.16 GenomeInfoDbData_1.2.14
#> [45] IRanges_2.42.0 S4Vectors_0.46.0
#> [47] ggrepel_0.9.6 irlba_2.3.5.1
#> [49] listenv_0.9.1 dqrng_0.4.1
#> [51] parallelly_1.45.0 pkgdown_2.1.3.9000
#> [53] DelayedMatrixStats_1.30.0 codetools_0.2-20
#> [55] DropletUtils_1.28.0 DelayedArray_0.34.1
#> [57] xml2_1.3.8 ggforce_0.5.0
#> [59] scuttle_1.18.0 tidyselect_1.2.1
#> [61] shape_1.4.6.1 UCSC.utils_1.4.0
#> [63] farver_2.1.2 viridis_0.6.5
#> [65] ScaledMatrix_1.16.0 BiocFileCache_2.16.0
#> [67] matrixStats_1.5.0 stats4_4.5.1
#> [69] GenomicAlignments_1.44.0 jsonlite_2.0.0
#> [71] GetoptLong_1.0.5 BiocNeighbors_2.2.0
#> [73] scater_1.36.0 iterators_1.0.14
#> [75] systemfonts_1.2.3 foreach_1.5.2
#> [77] progress_1.2.3 tools_4.5.1
#> [79] ragg_1.4.0 Rcpp_1.0.14
#> [81] glue_1.8.0 gridExtra_2.3
#> [83] SparseArray_1.8.0 mgcv_1.9-3
#> [85] xfun_0.52 MatrixGenerics_1.20.0
#> [87] GenomeInfoDb_1.44.0 dplyr_1.1.4
#> [89] HDF5Array_1.36.0 withr_3.0.2
#> [91] BiocManager_1.30.26 fastmap_1.2.0
#> [93] basilisk_1.20.0 bluster_1.18.0
#> [95] latticeExtra_0.6-30 rhdf5filters_1.20.0
#> [97] digest_0.6.37 rsvd_1.0.5
#> [99] R6_2.6.1 textshaping_1.0.1
#> [101] colorspace_2.1-1 biomaRt_2.64.0
#> [103] jpeg_0.1-11 dichromat_2.0-0.1
#> [105] RSQLite_2.4.1 R.methodsS3_1.8.2
#> [107] h5mread_1.0.1 tidyr_1.3.1
#> [109] generics_0.1.4 data.table_1.17.6
#> [111] rtracklayer_1.68.0 prettyunits_1.2.0
#> [113] httr_1.4.7 htmlwidgets_1.6.4
#> [115] S4Arrays_1.8.1 scatterpie_0.2.5
#> [117] pkgconfig_2.0.3 gtable_0.3.6
#> [119] blob_1.2.4 ComplexHeatmap_2.24.0
#> [121] hwriter_1.3.2.1 SingleCellExperiment_1.30.1
#> [123] XVector_0.48.0 htmltools_0.5.8.1
#> [125] bookdown_0.43 clue_0.3-66
#> [127] scales_1.4.0 Biobase_2.68.0
#> [129] png_0.1-8 nanonext_1.6.0
#> [131] SpatialExperiment_1.18.1 scran_1.36.0
#> [133] ggfun_0.1.9 knitr_1.50
#> [135] tzdb_0.5.0 rjson_0.2.23
#> [137] nlme_3.1-168 curl_6.3.0
#> [139] crew_1.2.1 cachem_1.1.0
#> [141] rhdf5_2.52.1 GlobalOptions_0.1.2
#> [143] stringr_1.5.1 parallel_4.5.1
#> [145] vipor_0.4.7 AnnotationDbi_1.70.0
#> [147] restfulr_0.0.15 desc_1.4.3
#> [149] pillar_1.10.2 grid_4.5.1
#> [151] vctrs_0.6.5 promises_1.3.3
#> [153] BiocSingular_1.24.0 dbplyr_2.5.0
#> [155] beachmat_2.24.0 cluster_2.1.8.1
#> [157] beeswarm_0.4.0 evaluate_1.0.4
#> [159] readr_2.1.5 GenomicFeatures_1.60.0
#> [161] magick_2.8.7 cli_3.6.5
#> [163] locfit_1.5-9.12 compiler_4.5.1
#> [165] Rsamtools_2.24.0 rlang_1.1.6
#> [167] crayon_1.5.3 labeling_0.4.3
#> [169] interp_1.1-6 ps_1.9.1
#> [171] fs_1.6.6 ggbeeswarm_0.7.2
#> [173] stringi_1.8.7 viridisLite_0.4.2
#> [175] deldir_2.0-4 BiocParallel_1.42.1
#> [177] txdbmaker_1.4.1 Biostrings_2.76.0
#> [179] Matrix_1.7-3 dir.expiry_1.16.0
#> [181] BSgenome_1.76.0 hms_1.1.3
#> [183] sparseMatrixStats_1.20.0 bit64_4.6.0-1
#> [185] future_1.58.0 ggplot2_3.5.2
#> [187] Rhdf5lib_1.30.0 KEGGREST_1.48.0
#> [189] statmod_1.5.0 SummarizedExperiment_1.38.1
#> [191] mirai_2.3.0 igraph_2.1.4
#> [193] memoise_2.0.1 bslib_0.9.0
#> [195] bit_4.6.0 xgboost_1.7.11.1