Probably my problem is not so complex but reasoning about the appropriate settings to test differential expression is often a source of confusion for me. Briefly, I wanted to test differentially expressed miRNA from miRNA-seq data. My dataset is composed by 8 samples in total, subdivided in 4 classes of 2 samples (replicates) each. I have 4 sample classes since the experimental design has two different factors with two conditions for each factor.
|sample 1 (rep1)||intracellular||Wt|
|sample 2 (rep2)||intracellular||Wt|
|sample 3 (rep1)||intracellular||mut|
|sample 4 (rep2)||intracellular||mut|
|sample 5 (rep1)||exosome||Wt|
|sample 6 (rep2)||exosome||Wt|
|sample 7 (rep1)||exosome||mut|
|sample 8 (rep2)||exosome||mut|
Now I just would like to use DESeq2 package to test DE miRNAs in the following comparisons:
Exosome_wt vs Intracellular_wt
Exosome_mut vs Exosome_wt
Intracellular_mut vs Intracellular_wt
Exosome_mut vs Intracellular_mut
Obviously, the 'intracellular' condition refers to intracellular miRNAs and 'exosome' refers to miRNA expression from exosomes.
My main doubt is how to test these contrasts with DESeq2. Initially I supposed to create the DESeqDataSet object using both the experimental factors:
dds <-DESeqDataSetFromMatrix(countData = ReadCountTable, colData = sampleinfo, design = Cell_component ~ Type).
But then, if I understood correctly, the results function of DESeq2 will extract logFC/pvalue/adj.pval only for comparisons between levels of one factor, for example:
res <- results(dds, contrast = c("cell_component", "exosome", "intracellular") OR
res <- results(dds, contrast=c("type", "mut", "wt")
But in my case, I wanted to test DE between combinations of factors. One solution I have tried: creating a new column in colData containing for each sample the corresponding combination of factors: intracellular_wt, intracellular_wt, intracellular_mut, intracellular_mut, exosome_wt, etc... and then using results to extract each time the output of each comparison on the new column:
res <- results(dds, contrast = c("new_column", "exosome_wt", "intracellular_wt") ).
However, I'm not sure at all this is the correct procedure. Can somebody help me?
Thanks a lot,