This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq: LFC and results function

Hi everyone,

I am currently processing data regarding DEGs expression. I am referencing a demo script provided to me. However, in their script they use the "source" command to utilise a function unavailable to me.

This function performs both results and lfcShrink together at the same time.

I am just wondering how I can replicate this myself, would I perform lfcShrink first then results, or vice versa?

Below is the script I am referencing, with results_extract being the funciton unavailable to me:

#40min vs Control
slrcr_slc <- results_extract(dds, "group_LeafSusceptibleRecovery_vs_LeafSusceptibleControl", 
                            alpha = padj.cutoff, shrink = TRUE, type = "apeglm")

slrcr_slc_df <- na.omit(data.frame(slrcr_slc)) %>% 
  mutate(pass = ifelse(padj < padj.cutoff & abs(log2FoldChange) >= lfc.cutoff, 
                        ifelse(log2FoldChange >= lfc.cutoff, 'Upregulated', 'Downregulated'), 'Stable'))

Meanwhile, this is my attempt at adapting it:

# 40-minutes vs Control
sl40_slc <- results(dds, name = "group_LeafSusceptible40min_vs_LeafSusceptibleControl", 
                            alpha = 0.05, lfcThreshold = 1, contrast = c("group", "LeafSusceptible40min", "LeafSusceptibleControl"))

shrink_sl40_slc <- lfcShrink(dds, coef = 2, type = "apeglm")


#Try shrinkage step first? 

sl40_slc_df <- na.omit(data.frame(sl40_slc)) %>% 
  mutate(pass = ifelse(padj < padj.cutoff & abs(log2FoldChange) >= lfc.cutoff, 
                        ifelse(log2FoldChange >= lfc.cutoff, 'Upregulated', 'Downregulated'), 'Stable'))

This wont give the same results as the demo script I think.

Any help would be appreciated - thank you!

deseq2

0 answers

No answers yet.

Log in to answer this question.