DTEG.analysis: Run differential TE analysis

Description Usage Arguments Details Value References See Also Examples

View source: R/TE_Analysis.R

Description

Creates a total of 3 DESeq models (given x is design argument input (usually stage or condition) and libraryType is RNA-seq and Ribo-seq):
1. Ribo-seq model: design = ~ x (differences between the x groups in Ribo-seq)
2. RNA-seq model: design = ~ x (differences between the x groups in RNA-seq)
3. TE model: design = ~ x + libraryType + libraryType:x (differences between the x and libraryType groups and the interaction between them)
Using an equal reimplementation of the deltaTE algorithm (see reference). You need at least 2 groups and 2 replicates per group. The Ribo-seq counts will be over CDS and RNA-seq over mRNAs, per transcript.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
DTEG.analysis(
  df.rfp,
  df.rna,
  output.dir = paste0(dirname(df.rfp$filepath[1]), "/QC_STATS/"),
  design = "stage",
  p.value = 0.05,
  RFP_counts = countTable(df.rfp, "cds", type = "summarized"),
  RNA_counts = countTable(df.rna, "mrna", type = "summarized"),
  batch.effect = FALSE,
  plot.title = "",
  width = 6,
  height = 6,
  dot.size = 0.4,
  relative.name = "DTEG_plot.png"
)

Arguments

df.rfp

a experiment of Ribo-seq or 80S from TCP-seq.

df.rna

a experiment of RNA-seq

output.dir

output.dir directory to save plots, plot will be named "TE_between.png". If NULL, will not save.

design

a character vector, default "stage". The columns in the ORFik experiment that represent the comparison contrasts. Usually found in "stage", "condition" or "fraction" column.

p.value

a numeric, default 0.05 in interval (0,1) or "" to not show. What p-value used for the analysis? Will be shown as a caption.

RFP_counts

a SummarizedExperiment, default: countTable(df.rfp, "cds", type = "summarized"), all transcripts. Assign a subset if you don't want to analyze all genes. It is recommended to not subset, to give DESeq2 data for variance analysis.

RNA_counts

a SummarizedExperiment, default: countTable(df.rna, "mrna", type = "summarized"), all transcripts. Assign a subset if you don't want to analyze all genes. It is recommended to not subset, to give DESeq2 data for variance analysis.

batch.effect,

logical, default FALSE. If you believe you might have batch effects, set to TRUE, will use replicate column to represent batch effects. Batch effect usually means that you have a strong variance between biological replicates. Check PCA plot on count tables to verify if you need to set it to TRUE.

plot.title

title for plots, usually name of experiment etc

width

numeric, default 6 (in inches)

height

numeric, default 6 (in inches)

dot.size

numeric, default 0.4, size of point dots in plot.

relative.name

character, Default: "DTEG_plot.png". Relative name of file to be saved in folder specified in output.dir. Change to .pdf if you want pdf file instead of png.

Details

#' If you do not need isoform variants, subset to longest isoform in the returned object (See examples). If you do not have RNA-seq controls, you can still use DESeq on Ribo-seq alone.
The LFC values are shrunken by lfcShrink(type = "normal").

What the deltaTE plot calls intensified is here called mRNA abundance and forwarded is called Buffering.
Remember that DESeq by default can not do global change analysis, it can only find subsets with change in LFC.

Value

a data.table with 9 columns. (log fold changes, p.ajust values, group, regulation status and gene id)

References

doi: 10.1002/cpmb.108

See Also

Other TE: DTEG.plot(), te.table(), te_rna.plot()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Simple example
#df.rfp <- read.experiment("Riboseq")
#df.rna <- read.experiment("RNAseq")
#dt <- DTEG.analysis(df.rfp, df.rna)
## Restrict DTEGs by log fold change (LFC):
## subset to abs(LFC) < 1.5 for both rfp and rna
#dt[abs(rfp) < 1.5 & abs(rna) < 1.5, Regulation := "No change"]

## Only longest isoform per gene:
#tx_longest <- filterTranscripts(df.rfp, 0, 1, 0)
#dt <- dt[id %in% tx_longest,]
## Convert to gene id
#dt[, id := txNamesToGeneNames(id, df.rfp)]
## To get by gene symbol, use biomaRt conversion

ORFik documentation built on March 27, 2021, 6 p.m.