fit_de_model: Differential feature analysis

View source: R/diff_expression.R

fit_de_modelR Documentation

Differential feature analysis

Description

Find differential TSSs or TSRs.

Usage

fit_de_model(
  experiment,
  formula,
  data_type = c("tss", "tsr"),
  samples = "all",
  method = "DESeq2"
)

Arguments

experiment

TSRexploreR object.

formula

Formula for differenatial feature analysis.

data_type

Whether TSSs ('tss') or TSRs ('tsr') should be analyzed

samples

A vector of sample names to analyze.

method

Build DE model using either 'DESeq2' or 'edgeR'.

Details

This function uses either DESeq2 or edgeR to find differential TSSs or TSRs. 'formula' should be a valid R formula in any form accepted by DESeq2 or edgeR, where the formula components are any columns present in the sample sheet.

Value

TSRexploreR object with stored DE model.

See Also

differential_expression to extract differential TSSs or TSRs from model.

Examples

data(TSSs)
sample_sheet <- data.frame(
  sample_name=c(
    sprintf("S288C_D_%s", seq_len(3)),
    sprintf("S288C_WT_%s", seq_len(3))
  ),
  file_1=rep(NA, 6), file_2=rep(NA, 6),
  condition=c(
    rep("Diamide", 3),
    rep("Untreated", 3)
  )
)

exp <- TSSs %>%
  tsr_explorer(sample_sheet=sample_sheet) %>%
  format_counts(data_type="tss")

exp <- fit_de_model(exp, data_type="tss", formula=~condition, method="edgeR")


zentnerlab/TSRexploreR documentation built on Dec. 30, 2022, 10:27 p.m.