batch_pca | R Documentation |
The goal of this function is to take a csv file or a data.frame
describing all the PCA to produce and launch them in batches.
batch_pca(
pca_infos,
txi,
metadata = NULL,
outdir = NULL,
r_objects = NULL,
force = FALSE,
cores = 1
)
pca_infos |
A csv file or a |
txi |
The |
outdir |
The directory where to save PCA in pdf format. If |
r_objects |
The directory where to save PCA in rds format. If
|
force |
Should the files be re-created if they already exists? Default:
|
cores |
Number of cores for the DE analysis. Default: 1 |
metatada |
The metadata to add to the coordinate table to add color or
shape with the results and the |
The table may contain the following columns, in no specific order: * id_plot: unique identifier for this graph. Mandatory * group: column from the metadata file to subset the txi. If value is NA, all the samples will be used in the PCA. If value is not NA, group_val value must not be NA either. If NA, group_val must also be NA. Default: NA * group_val: Value in the group column to use in current PCA. If group is NA, group_val must also be NA. If group is not NA, group_val must be a valid column name from the metadata table. Default: NA * use_normalisation: "none", "ruvg" or "combat" (txi must be produced in consequence). Default: "none" * min_counts: Mean values of counts (TPM, ruvg or combat) to keep gene for PCA. Default: 5 * id_metadata: Column in metadata table that contains the sample names. Must be present in the colnames of the metadata table. Default: NA * size: The point size. Default: 3 * shape: The column in the metadata file to use to define shapes. Default: NA * color: The column in the metadata file to use to define colors. Default: NA * title: The title of the PCA. Default: NA * legend.position: "left", "right", "top" or "bottom". Default: "right" * legend.box: "horizontal" or "vertical". Default: "vertical" * show_names: Show sample names on PCA? Default: TRUE
Only the id_plot is mandatory. This value is used to name the PCA plots that are created by the batch_pca function and the output and r_objects filename.
If the other columns are absent, they will be automatically created and filled with their default values.
Invisibly returns a list
of all the ggplots.
pca_infos <- get_demo_pca_infos_file()
txi <- get_demo_txi(large = TRUE)
metadata <- get_demo_metadata_file()
gg_list <- batch_pca(pca_infos, txi, metadata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.