Skip to content

Commit

Permalink
Fast-forward merge
Browse files Browse the repository at this point in the history
  • Loading branch information
youyupei committed Sep 26, 2023
2 parents 0bace09 + 2706c9c commit 79856e9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion R/BLAZE_demultiplexing.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' fastq1 <- bfc[[names(BiocFileCache::bfcadd(bfc, 'Fastq1', fastq1_url))]]
#' outdir <- tempfile()
#' dir.create(outdir)
#' config = jsonlite::fromJSON(system.file('extdata/blaze_flames.json', package = 'FLAMES'))
#' config = jsonlite::fromJSON(system.file('extdata/template_config.json', package = 'FLAMES'))
#' config$blaze_parameters['output-prefix'] <- outdir
#' \dontrun{
#' blaze(config$blaze_parameters, fastq1)
Expand Down
17 changes: 7 additions & 10 deletions R/minimap2_align.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,17 @@ locate_minimap2_dir <- function(minimap2_dir = NULL) {
}

locate_samtools <- function() {
which_samtools <- base::system2(command="command", args=c("-v", "samtools"));
which_samtools <- base::system2(command = "command", args = c("-v", "samtools"))
if (which_samtools == 0) {
return(
dirname(
base::system2(
command="command",
args=c("-v", "samtools"),
stderr=TRUE, stdout=TRUE
)
base::system2(
command = "command",
args = c("-v", "samtools"),
stderr = TRUE, stdout = TRUE
)
)
}

return(FALSE);
}
return(FALSE)
}

# total mapped primary secondary
Expand Down
6 changes: 5 additions & 1 deletion R/sc_long_multisample_pipeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ sc_long_multisample_pipeline <-
# realign to transcript
if (config$pipeline_parameters$do_read_realignment) {
cat("#### Realign to transcript using minimap2\n")
infqs_realign <- file.path(outdir, paste(samples, "matched_reads_dedup.fastq", sep = "_"))
if (config$pipeline_parameters$do_gene_quantification) {
infqs_realign <- file.path(outdir, paste(samples, "matched_reads_dedup.fastq", sep = "_"))
} else {
infqs_realign <- infqs
}
for (i in 1:length(samples)) {
cat(paste0(c("\tRealigning sample ", samples[i], "...\n")))
minimap2_realign(config, infqs_realign[i], outdir, minimap2_dir, prefix = samples[i],
Expand Down
6 changes: 5 additions & 1 deletion R/sc_long_pipeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ sc_long_pipeline <-
# realign to transcript
if (config$pipeline_parameters$do_read_realignment) {
cat("#### Realigning deduplicated reads to transcript using minimap2\n")
infq_realign <- file.path(outdir, "matched_reads_dedup.fastq")
if (config$pipeline_parameters$do_gene_quantification) {
infq_realign <- file.path(outdir, "matched_reads_dedup.fastq")
} else {
infq_realign <- infq
}
minimap2_realign(config, infq_realign, outdir, minimap2_dir, prefix = NULL,
threads = config$pipeline_parameters$threads)
} else {
Expand Down
2 changes: 1 addition & 1 deletion man/blaze.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vignettes/FLAMES_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This R package was created to simplify installation and execution of the FLAMES
knitr::include_graphics(system.file("images/FLAMESpipeline-01.png", package = "FLAMES"))
```

Input to FLAMES are fastq files generated from the long-read platform. Using a cell barcode allow-list (e.g. barcode list obtained from short-read sequencing), the `find_barcode()` function locates the barcode sequencing in the long-reads and trims the cell barcodes and the flanking UMI sequence. The pipeline then calls `minimap_align()`, a `minimap2` wrapper, to align the demultiplex long-reads to the reference genome. Next, `find_isoform()` is called to identify novel isoforms using the alignment, creating an updated transcript assembly. The demultiplexed reads are then aligned to the transcript assembly by the function `minimap_realign()`. Finally, FLAMES calls `quantify()` to quantify the transcript counts using the (re-)alignment file.
Input to FLAMES are fastq files generated from the long-read platform. Using a cell barcode allow-list (e.g. barcode list obtained from short-read sequencing), the `find_barcode()` function locates the barcode sequencing in the long-reads and trims the cell barcodes and the flanking UMI sequence. The pipeline then calls `minimap_align()`, a `minimap2` wrapper, to align the demultiplex long-reads to the reference genome. Next, `find_isoform()` is called to identify novel isoforms using the alignment, creating an updated transcript assembly. The demultiplexed reads are then aligned to the transcript assembly by the function `minimap_realign()`. Finally, FLAMES calls `quantify_transcript()` to quantify the transcript counts using the (re-)alignment file.

Figure \@ref(fig:workflow) summerise the steps of the pipeline described above. The pipeline functions (`sc_long_pipeline`, `bulk_long_pipeline`, `sc_long_multisample_pipline`) execute the steps sequentially and return `SingleCellExperiment` object, `SummarizedExperiment` object and a list of `SingleCellExperiment` objects respectivly.

Expand Down Expand Up @@ -112,7 +112,7 @@ if (is.character(minimap2_dir)) { # do not run if minimap2 cannot be found
config = config, fq_in = fastq,
outdir = outdir, minimap2_dir = minimap2_dir
)
quantify(annotation = annot, outdir = outdir, config = config)
quantify_transcript(annotation = annot, outdir = outdir, config = config)
sce <- create_sce_from_dir(outdir = outdir, annotation = annot)
}
```
Expand Down

0 comments on commit 79856e9

Please sign in to comment.