deseq2 user defined size factors
2
1
Entering edit mode
8.5 years ago

Is it possible to skip the estimateSizeFactor step in Deseq2 and define your own size factors? If I just replace the size factor vector with my own values, will the down-stream DE steps use these values? I am pretty new with R so it would be very helpful if I can see some example code on how to do this.

deseq2 • 11k views
ADD COMMENT
4
Entering edit mode
8.5 years ago

Hi,

Short answer : yes and yes !

As for the example code, see my answer here.

or more to the point :

sizeFactors(cds) = c(my_Values)
ADD COMMENT
0
Entering edit mode

How is this then passed onto another dds object? (I am trying to analyse only a subset of genes from all genes expressed in a dataset because I am focusing on genes which are modulated by eQTLs - but ideally I would like to normalise raw counts to the size factors calculated using the whole dataset to improve the normalisation protocol, right?)

ADD REPLY
0
Entering edit mode

Ooops. I guess it's better I don't do that, actually. Looks like it's better to just use the whole dataset, and perform multiple testing correction on the list of genes I am interested, as it seems tricky to stipulate size factors from one dds object to another. Source: https://support.bioconductor.org/p/79470/#79477

ADD REPLY
2
Entering edit mode
8.5 years ago
ivivek_ngs ★ 5.2k

Yes you can, that is what I can read from the below link

Take a look here and here

There was a post from where Damian you already replied few years back where I can see Jeremy replied that you can set the size factor manually as well with sizeFactors

dds <- estimatesizefactors(dds)<="" code=""> See DESeq for a description of the use of size factors in the GLM. One should call this function after DESeqDataSet unless size factors are manually specified with sizeFactors. Alternatively, gene-specific normalization factors for each sample can be provided using normalizationFactors which will always preempt sizeFactors in calculations. Internally, the function calls estimateSizeFactorsForMatrix, which provides more details on the calculation.

ADD COMMENT

Login before adding your answer.

Traffic: 1938 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6