From 8eb24b5c09bec850c1ad47180e3c89790f672f37 Mon Sep 17 00:00:00 2001 From: Stefano Mangiola Date: Fri, 8 Dec 2023 13:34:01 +1100 Subject: [PATCH] add size factor to glmmseq --- R/functions.R | 5 +++++ R/functions_SE.R | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/R/functions.R b/R/functions.R index 0ee421de..ed5d0087 100755 --- a/R/functions.R +++ b/R/functions.R @@ -779,11 +779,16 @@ get_differential_transcript_abundance_glmmSeq <- function(.data, # Make sure the order matches the counts dispersion = dispersion[rownames(counts)] + # Scaling + sizeFactors <- counts |> edgeR::calcNormFactors(method = scaling_method) + + glmmSeq_object = glmmSeq( .formula, countdata = counts , metadata = metadata, dispersion = dispersion, + sizeFactors = sizeFactors, progress = TRUE, method = method |> str_remove("(?i)^glmmSeq_"), ... diff --git a/R/functions_SE.R b/R/functions_SE.R index a9c087fa..557cb5e4 100755 --- a/R/functions_SE.R +++ b/R/functions_SE.R @@ -1154,11 +1154,16 @@ get_differential_transcript_abundance_glmmSeq_SE <- function(.data, # Make sure the order matches the counts dispersion = dispersion[rownames(counts)] + # Scaling + sizeFactors <- counts |> edgeR::calcNormFactors(method = scaling_method) + + glmmSeq_object = glmmSeq( .formula, countdata = counts , metadata = metadata |> as.data.frame(), dispersion = dispersion, + sizeFactors = sizeFactors, progress = TRUE, method = method |> str_remove("(?i)^glmmSeq_" ), ...