Hello,

I am looking to test the mean effect of the treatment (n=1-5; depending on the case) against NC (negative controls), which can be summarized as:

H0: 1/n(treatment_1—NC)+1/n(treatment_2—NC)…+…1/n(treatment_n—NC)=0.

The DESeq2 code I am running is then:

dds <- DESeqDataSetFromMatrix(countData , DataFrame(treatment), ~0+treatment)

dds <- DESeq(dds, betaPrior=F)

coeff=1/length(treatment)

contrast=c(rep(coeff,length(treatment)),-1) ; for n=2 => contrast= (0.5,0.5,-1)

res=results(dds, contrast=contrast,independentFiltering=T,alpha=0.05)

Now, however, I am also trying to incorporate the ‘RUVg’ weights (W_1 object returned from RUVg) into my design and am not sure what is the best way to handle such situation (as above, am still interested in the mean effect of the treatment) Would the DE steps be as follows?

dds <- DESeqDataSetFromMatrix(countData , DataFrame(treatment), ~0+treatment +W_1)

dds <- DESeq(dds, betaPrior=F, quiet=F)

But now, how do I specify the 'contrast' argument in the 'results' that incorporates the weights?

Below is the example for two groups of treatment (4 samples) against NC (8 samples) and the associated RUVg weights with each sample (all weights add up to 0).

** treatment W_1**

sample1 treatment_1 -0.07130978

sample2 treatment_1 -0.554794325

sample3 treatment_2 0.009349808

sample4 treatment_2 -0.277423111

sample5 NC 0.466231365

sample6 NC -0.115094698

***** **** ******

sample12 NC -0.136884239

Thank you very much for any help in advance.

Best regards,

Jordan

Yes that's correct. The new term gets a 0 in the contrast.