produce_deliverables: Produce deliverables

View source: R/deliverables.R

produce_deliverablesR Documentation

Produce deliverables

Description

The goal of this function is to parse the variaus infos tables and to produce and save the results in a standardized object and directories format.

Usage

produce_deliverables(
  dir_kallisto,
  anno,
  infos_tables,
  analysis_level = "both",
  file_type = "h5",
  digits = 4,
  ignoreTxVersion = TRUE,
  counts = TRUE,
  add_volcano_labels = NULL,
  report_filename = NULL,
  outdir = "deliverables",
  r_objects = "r_objects",
  force = FALSE,
  ncores = 1,
  verbose = FALSE
)

Arguments

dir_kallisto

Directory with Kallisto quantifications

anno

Path to the anno file matching the reference used for the Kallisto analysis

infos_tables

A list of infos tables, or path the csv files that contains these infos. The list may contains the following tables: pca_infos, de_infos, design_infos, volcano_infos. None of the tables are mandatory, but only the analysis corresponding to the available tables will be performed. See the batch_pca, batch_de, batch_volcano and the produce_report documentation to see the description of each tables.

analysis_level

Should the analysis be done at the "gene", "tx" or "both" level. Default: "both".

file_type

Abundance file format to use (h5 or tsv).

digits

Integer indicating the number of decimal places

ignoreTxVersion

Should the version number in the IDs be ignored during import. Default: TRUE.

counts

Save count tables in the <outdir>/counts folder? Default: TRUE.

add_volcano_labels

Add labels to volcano plots. Must be either NULL or a vector of gene symbols. Default: NULL.

report_filename

The name of the report that will be saved in the outdir/reports/<report_filename>.Rmd. If NULL, the report won't be saved, but the lines will be available in the returned list in the report slot. Default: NULL

outdir

A character string corresponding to the directory to store the output files (pdf, csv, etc.). The outputs will be in <outdir>/counts, <outdir>/PCA, <outdir>/DE, <outdir/Volcanos, <outdir>/report, if their respective tables are present in the infos_tables. If NULL, the results won't be saved on disk. Default: NULL.

r_objects

A character string corresponding to the directory where the rds files will be saved. A standardized data structure will be used. The expected directories are <r_objects>/txi <r_objects>/counts <r_objects>/de and <r_objects>/volcanos, each with a "gene/" and "tx/" folder, except for the txi folder. The folders will only be present if the respective table is present in the infos_tables. If NULL, the rds files won't be saved on disk. It is recommended to use the r_objects param to save files as every steps are completed in case a problem cause the function to stop. That way, you won't have to reprocess the steps that completed correctly. Default: "r_objects".

force

Should the files be re-created if they already exists? Default: FALSE.

ncores

Number of cores to use for de analysis. Default 1.

verbose

Print progression of the analysis? Default: FALSE.

add_volcanos_labels

A vector of the symbols to show on the volcano plots. If NULL, no symbols will be shown. Default: NULL.

Details

The results will be returned as a list with the following slots:

* txi$gene: The txi object at the gene level. * txi$tx: The txi object at the transcript level. * counts$gene: A list of count matrices at the gene level matching the count matrices found in the txi object. * counts$tx: A list of count matrices at the transcript level matching the count matrices found in the txi object. * pca$gene: The list of PCA ggplot objects at the gene level. * pca$tx: The list of PCA ggplot objects at the transcript level. * de$gene: The list of DE results in the gene format. * de$tx: The list of DE results in the transcript format. * de$volcano$gene: The volcano plots produced at the gene level. * de$volcano$tx: The volcano plots produced at the transcript level. * de$report: The lines of the report. * de$infos_tables: The infos tables used to produce the results.

It's the content of the infos_tables that will determine which deliverables will be produced. Some tables are mandatory for other steps to be performed. DE analysis requires de_infos and design_infos tables. Volcano analysis requires the DE analysis to also be performed beforehand.

Value

Invisibly returns a list that contains all the results.


CharlesJB/rnaseq documentation built on Oct. 17, 2023, 5:37 p.m.