generate_stage_report | R Documentation |
Render RMarkdown document for a stage of the pipeline.
generate_stage_report(
rmd_file,
out_html_file_name,
output_dir = fs::path_dir(out_html_file_name),
css_file = here("Rmd/common/stylesheet.css"),
params = list(),
message = TRUE,
warning = TRUE,
echo = TRUE,
quiet = TRUE,
other_deps = NULL,
drake_cache_dir = here(".drake"),
...
)
rmd_file |
A character scalar: path to Rmd file to render. |
out_html_file_name |
A character scalar: name of the output HTML file. |
output_dir |
A character scalar: path to directory in which |
css_file |
A character scalar: path to CSS file which will be included in the resulting HTML. |
params |
A list of RMarkdown document parameters:
passed to |
message , warning , echo |
A logical scalar: passed to |
quiet |
A logical scalar: if |
other_deps |
A list of symbols (unquoted): used inside |
drake_cache_dir |
A character scalar: path to |
... |
Passed to |
If you are currently working within a scdrake
project, you can review the Rmd files in the Rmd/
directory.
This is a list of Rmd files currently bundled with the scdrake
package:
fs::dir_tree(system.file("Rmd", package = "scdrake")) #> /home/rstudio/scdrake_source/inst/Rmd #> +-- common #> | +-- _footer.Rmd #> | +-- _header.Rmd #> | +-- cluster_markers.Rmd #> | +-- cluster_markers_table_template.Rmd #> | +-- clustering #> | | +-- cluster_graph_leiden.Rmd #> | | +-- cluster_graph_louvain.Rmd #> | | +-- cluster_graph_walktrap.Rmd #> | | +-- cluster_kmeans.Rmd #> | | +-- cluster_sc3.Rmd #> | | \-- clustering.Rmd #> | +-- contrasts.Rmd #> | +-- contrasts_table_template.Rmd #> | \-- stylesheet.css #> +-- integration #> | +-- 01_integration.Rmd #> | \-- 02_int_clustering.Rmd #> \-- single_sample #> +-- 01_input_qc.Rmd #> +-- 01_input_qc_children #> | +-- cell_filtering_custom.Rmd #> | +-- cell_filtering_qc.Rmd #> | +-- empty_droplets.Rmd #> | +-- empty_droplets_spat.Rmd #> | +-- gene_filtering_custom.Rmd #> | \-- gene_filtering_qc.Rmd #> +-- 01_input_qc_spatial.Rmd #> +-- 02_norm_clustering.Rmd #> \-- 02_norm_clustering_simple.Rmd
A short description of these Rmd files:
Common to single-sample and integration analyses:
Cluster markers: common/cluster_markers.Rmd
(signpost),
common/cluster_markers_table_template.Rmd
(actual table with markers)
Contrasts: common/cluster_markers.Rmd
, common/cluster_markers_table_template.Rmd
Single-sample analysis:
Input QC: single_sample/01_input_qc.Rmd
.
Input data overview, empty droplets detection, cell and gene filtering visualization.
Normalization and clustering: single_sample/02_norm_clustering.Rmd
,
single_sample/02_norm_clustering_simple.Rmd
(only clustering visualization - dimred plots).
Overview of normalization and highly variable genes selection, doublet score plots, selection of principal components,
clustering diagnostics, dimred plots of clusterings and other variables.
Integration analysis:
Integration: integration/01_integration.Rmd
.
Overview of input datasets, highly variable genes selection, selection of principal components, dimred plots
of integration, integration diagnostics.
Clustering: integration/02_int_clustering.Rmd
.
Clustering diagnostics, dimred plots of clusterings and other variables.
All Rmd files are also accompanied with a list of config parameters and runtime information.
Invisibly NULL
.
Each Rmd file for a stage can be rendered (with generate_stage_report()
, not rmarkdown::render()
- see below), or
run interactively in RStudio, both outside of a drake
plan. However, this assumes:
Your working directory is in the root of a scdrake
project.
For interactive usage in RStudio, set Options -> R Markdown -> Basic -> Evaluate chunks in directory
to "Project"
.
Otherwise the working directory will be in the location of a Rmd file while running R code chunks.
Also, all Rmd files are parametrized, i.e. they are referencing a params
list, which is passed to
rmarkdown::render()
by generate_stage_report()
. In order for code chunks to work properly,
you have to create a variable named params_
(it must be available in the global environment) containing a named list.
Currently, this list must contain only a single item: drake_cache_dir
with path to drake
cache which will be
used to load targets inside the Rmd files. Example: params_ <- list(drake_cache_dir = ".drake_my_analysis")
NOTE: It is not recommended to call rmarkdown::render()
directly on a stage's Rmd file,
because generate_stage_report()
also sets some temporary options and passes a proper params
parameter.
## Not run:
generate_stage_report(
rmd_file = here("Rmd/single_sample/01_input_qc.Rmd"),
out_html_file_name = "01_input_qc.html",
output_dir = here("my_output"),
drake_cache_dir = here(".drake_cache")
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.