The Pre-Workflow can be run from outside the actual Rmarkdown script. When you are using the render function of the rmarkdown
package you can run the script as follows:
rmarkdown::render(
"scrnaseq_hto.Rmd",
output_format = "html_document",
output_dir = ".",
output_file = "test",
params = paramsList)
with paramsList set as:
paramsList = list()
paramsList$project = "HTO_testDataset"
paramsList$path_data = "test_datasets/10x_pbmc_hto_GSE108313/counts"
paramsList$path_out = "test_datasets/10x_pbmc_hto_GSE108313/demultiplexed"
paramsList$hto_names = setNames(c("htoA","htoB","htoC","htoD","htoE","htoF","htoG","htoH"), c("htoA","htoB","htoC","htoD","htoE","htoF","htoG","htoH"))
paramsList$mt = "^MT-"
paramsList$col = "palevioletred"
paramsList$sample_cells = NULL
ID of the project (Default: "HTO_testDataset")
Input directory where data are located (Default: "test_datasets/10x_pbmc_hto_GSE108313/counts")
Path to a mapping statistics file, e.g. "metrics_summary.csv" generated by Cell Ranger, but can be any table or NA
if not available (Default: NA
)
Output directory where the results will be saved (Default: "test_datasets/10x_pbmc_hto_GSE108313/demultiplexed")
HTOs have an ID that is included in the "features.tsv" input file. We additionally ask for readable names that are used throughout the report. Names could look as follows, where HTO1-3
are the IDs included in raw dataset:
param$hto_names = setNames(c("NameA", "NameB", "NameC"), c("HTO1", "HTO2", "HTO3"))
(Default: c("htoA", "htoB", "htoC", "htoD", "htoE", "htoF", "htoG", "htoH"), c("htoA", "htoB", "htoC", "htoD", "htoE", "htoF", "htoG", "htoH")
)
Alternatively, a regular expression can be provided that finds the HTO ids included in the "features.tsv" input file. The hto_names
argument always supersedes the hto_regex
argument so be sure to set it to NULL
or comment it out.
param$hto_regex = "^hto"
(Not used by default.)
Normalisation method used for the HTO counts. Default is the LogNormalize
method of Seurat where the counts of each cell are divided by the total counts for that cell, multiplied by 10,000 and then natural-log transformed. Alternatively, the CLR
(centered log ratio) method can be used where the counts of each cell are divided by the geometric mean of the counts for that cell and then natural-log transformed.
(Default: LogNormalize
)
Prefix of mitochondrial genes (Default: "^MT-")
Main colour(s) to use for plots (Defaults: "palevioletred")
Sample data to at most n
cells (mainly for tests); set to NULL to deactivate (Default: NULL)
Path to to this git repository (Default: ".")
This sets the debugging behaviour in case of errors. When running the script in RStudio, set to default_debugging
to use the default interactive debugger. When running the script on linux system without X11 support, set to terminal_debugger
which will then start the debugger in the terminal. For running the script non-interactively (e.g. on a cluster), set to print_traceback
which will deactivate any interactive debugger and will just print a traceback of the error.
(Default: default_debugging