batch_de: Produce differential expression analysis in batch

View source: R/batch_DE.R

batch_deR Documentation

Produce differential expression analysis in batch

Description

The goal of this function is to take a csv file or a data.frame describing all the differential expression (DE) analysis to produce and launch them in batches.

Usage

batch_de(
  de_infos,
  txi,
  design,
  outdir = NULL,
  r_objects = NULL,
  force = FALSE,
  cores = 1
)

Arguments

de_infos

A csv file or a data.frame describing the DE analysis to perform.

txi

The txi object returned by the import_kallisto function.

design

A csv file of a data.frame describing the groups for the comparisons.

outdir

The directory where to save DE analysis in csv format. If NULL, the results won't be saved as csv The files will be saved as <outdir>/<id_de>.csv. Default: NULL.

r_objects

The directory where to save dds in rds format. If NULL, the dds won't be saved as rds files. The files will be saved as <r_objects>/<id_de>.rds. Default: NULL.

force

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

cores

Number of cores for the DE analysis. Default: 1

Details

If the r_objects param is used, the dds object will be saved and won't be recalculated if the function is called again, unless the force param is set to TRUE.

The table may contain the following columns, in no specific order: * id_de: unique identifier for this DE analysis. Mandatory. * group: column from the design file to define the group for the current DE analysis. Mandatory. * contrast_1: The first group for the DE analysis. Must be present in the group column. Mandatory. * contrast_2: The first group for the DE analysis. Must be present in the group column. Mandatory. * formula: The formula for the de_analysis. Default: ~ group * filter: Minimum mean number of reads across all samples to be part of the DE analysis * count_matrix: The count matrix to use for the differential analysis. Will use the DESeq2::DESeqDataSetFromMatrix instead of the DESeq2::DESeqDataSetFromTximport function, so will work even if txi object is incomplete (i.e.: length matrix is missing). Default: NA

Value

Invisibly returns a list of all the DE results.

Examples

## Not run: 
de_infos <- get_demo_de_infos_file()
txi <- get_demo_txi()
design <- get_demo_design()
de_list <- batch_de(de_infos, txi, design)

## End(Not run)


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