Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I make use of DESeq2's normalization factors during import? #27

Closed
lgeistlinger opened this issue Sep 1, 2020 · 1 comment
Closed

Comments

@lgeistlinger
Copy link
Owner

Thank you so much, @lgeistlinger !
Here are the updates:

  1. design = ~ batch + condition worked!
    (Results were not very different with or without age, thanks to you, age is no more covariate of interest in my analysis.)

  2. I could not proceed without normalization:

res <- sbea(method = "gsea", se = se, gs = go.bp.gs, browse = T)
Error in .reorderAssays(se, assay) : 
  Expression dataset (se) does not contain an assay named "norm"

Normalization worked but excluded ~91 % of genes:

se <- normalize(se, norm.method = "vst")
Excluding 8118 genes not satisfying min.cpm threshold

The results were from DESeq2 and not from raw read counts. Considering the vignette, I am not sure if normalization is needed. Also, DESeq2 output already has normalization factors:

image

How can I make use of DESeq2's normalization factors to normalize the count slot and create "norm" slot in an SE?
(I think, it's an important consideration for the import() function.)

Originally posted by @vivek-verma202 in #23 (comment)

@lgeistlinger
Copy link
Owner Author

This is now possible in EnrichmentBrowser v2.19.5.

You can install this version of the package directly from github via:

BiocManager::install("lgeistlinger/EnrichmentBrowser")

Now, importing from DESeq2

> se <- import(dds, res)
> se
class: RangedSummarizedExperiment 
dim: 64102 8 
metadata(4): '' version design dataType
**assays(2): raw norm**
rownames(64102): ENSG00000000003 ENSG00000000005 ... LRG_98 LRG_99
rowData names(27): baseMean FC ... deviance maxCooks
colnames(8): SRR1039508 SRR1039509 ... SRR1039520 SRR1039521
colData names(11): SampleName cell ... sizeFactor GROUP

will automatically attach an additionally assay norm that contains the variance-stabilized expression values that are normalized for differences in library size between samples.

The resulting se can then be used to carry out enrichment methods such as gsea:

> res <- sbea("gsea", se, kegg.gs)
Permutations: 1 -- 100
Processing ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant