goodness_of_fit_DESeq2: This function calculates goodness-of-fit pvalues for all...

View source: R/negative_binomial_check.R

goodness_of_fit_DESeq2R Documentation

This function calculates goodness-of-fit pvalues for all genes by looking at how the NB model by DESeq2 fit the data

Description

This function calculates goodness-of-fit pvalues for all genes by looking at how the NB model by DESeq2 fit the data

Usage

goodness_of_fit_DESeq2(
  se,
  count_matrix,
  condition,
  other_variables = NULL,
  num_genes = 500,
  seeding = 13
)

Arguments

se

the se object where all the data is contained

count_matrix

name of the assay with gene expression matrix (in counts)

condition

name of the se colData with the condition status

other_variables

name of the se colData containing other variables of interest that should be considered in the DESeq2 model

num_genes

downsample value, default is 500 (or all genes if less)

seeding

integer to set the seed to for reproducibility; default is 13

Value

a matrix of pvalues where each row is a gene and each column is a level within the condition of interest

Examples

# example code
library(scran)
se <- mockSCE(ncells = 20)
se$Treatment <- as.factor(se$Treatment)
se$Mutation_Status <- as.factor(se$Mutation_Status)
nb_results <- goodness_of_fit_DESeq2(se = se, count_matrix = "counts",
  condition = "Treatment", other_variables = "Mutation_Status")
nb_results[1]
nb_results[2]
nb_results[3]

compbiomed/BatchQC documentation built on Nov. 16, 2024, 5:47 a.m.