differentialNbinomWaldTestUMI4C: Differential UMI4C contacts using DESeq2 Wald Test

View source: R/differentialNbinomWaldTestUMI4C.R

differentialNbinomWaldTestUMI4CR Documentation

Differential UMI4C contacts using DESeq2 Wald Test

Description

Using a UMI4C object, infers the differences between conditions specified in design of the smooth monotone fitted values using a Wald Test from DESeq2 package.

Usage

differentialNbinomWaldTestUMI4C(
  umi4c,
  design = ~condition,
  normalized = TRUE,
  padj_method = "fdr",
  query_regions = NULL,
  padj_threshold = 0.05,
  penalty = 0.1,
  alpha = 20
)

Arguments

umi4c

UMI4C object as generated by makeUMI4C or the UMI4C constructor.

design

A formula or matrix. The formula expresses how the counts for each fragment end depend on the variables in colData. See DESeqDataSet.

normalized

Logical indicating if the function should return normalized or raw UMI counts. Default: TRUE.

padj_method

The method to use for adjusting p-values, see p.adjust. Default: fdr.

query_regions

GRanges object or data.frame containing the coordinates of the genomic regions you want to use to perform the analysis in specific genomic intervals. Default: NULL.

padj_threshold

Numeric indicating the adjusted p-value threshold to use to define significant differential contacts. Default: 0.05.

penalty

Amount of smoothing to be applied to the estimated functional parameter. Default: 0.1.

alpha

Approximate number of fragments desired for every basis function of the B-spline basis. floor((max(number of fragments)) / alpha) is passed to create.bspline.basis as nbasis argument. 4 is the minimum allowed value. Default: 20.

Details

This function fits the signal trend of a variance stabilized count values using a symmetric monotone fit for the distance dependency. Then scales the raw counts across the samples to obtain normalized factors. Finally, it detects differences between conditions applying the DESeq2 Wald Test.

Value

UMI4C object with the DESeq2 Wald Test results.

Examples

## Not run: 
 files <- list.files(system.file("extdata", "CIITA", "count", package="UMI4Cats"),
                     pattern = "*_counts.tsv.gz",
                     full.names = TRUE
 )
# Create colData including all relevant information
colData <- data.frame(
  sampleID = gsub("_counts.tsv.gz", "", basename(files)),
  file = files,
  stringsAsFactors = FALSE
)

library(tidyr)
colData <- colData %>%
  separate(sampleID,
           into = c("condition", "replicate", "viewpoint"),
           remove = FALSE
  )
  
# Make UMI-4C object including grouping by condition
umi <- makeUMI4C(
  colData = colData,
  viewpoint_name = "CIITA",
  grouping = NULL,
  bait_expansion = 2e6
)

umi_wald <- differentialNbinomWaldTestUMI4C(umi4c=umi,
                                            design=~condition,
                                            alpha = 100)

## End(Not run)

Pasquali-lab/UMI4Cats documentation built on Nov. 3, 2024, 3:10 p.m.