Hello!
I am running a gene expression analysis in a dataset where I have 3 castes and 14 tissues. The aim is to get pairwise comparisons between castes within tissues, but running a DESeq analysis including all data, to benefit from the gene information across tissues. The formula looks like this:
~ flow_cell + tissue*caste
Where 'flow_cell' is a blocking factor accounting for batch effect.
If i then run 'resultsNames' on the DESeq object I obtain:
> resultsNames(dds_atlas_fc)
[1] "Intercept" "flow_cell_50bp_fc2_vs_50bp_fc1"
[3] "flow_cell_75bp_fc1_vs_50bp_fc1" "flow_cell_75bp_fc2_vs_50bp_fc1"
[5] "tissue_BRA_vs_ANT" "tissue_COR_vs_ANT"
[7] "tissue_CRO_vs_ANT" "tissue_EYE_vs_ANT"
[9] "tissue_FAT_vs_ANT" "tissue_LEG_vs_ANT"
[11] "tissue_MAL_vs_ANT" "tissue_MAN_vs_ANT"
[13] "tissue_MUS_vs_ANT" "tissue_NER_vs_ANT"
[15] "tissue_REC_vs_ANT" "tissue_STE_vs_ANT"
[17] "tissue_TER_vs_ANT" "caste_M_vs_F"
[19] "caste_W_vs_F" "tissueBRA.casteM"
[21] "tissueCOR.casteM" "tissueCRO.casteM"
[23] "tissueEYE.casteM" "tissueFAT.casteM"
[25] "tissueLEG.casteM" "tissueMAL.casteM"
[27] "tissueMAN.casteM" "tissueMUS.casteM"
[29] "tissueNER.casteM" "tissueREC.casteM"
[31] "tissueSTE.casteM" "tissueTER.casteM"
[33] "tissueBRA.casteW" "tissueCOR.casteW"
[35] "tissueCRO.casteW" "tissueEYE.casteW"
[37] "tissueFAT.casteW" "tissueLEG.casteW"
[39] "tissueMAL.casteW" "tissueMAN.casteW"
[41] "tissueMUS.casteW" "tissueNER.casteW"
[43] "tissueREC.casteW" "tissueSTE.casteW"
[45] "tissueTER.casteW"
Where 'F' is the reference level for Caste and 'ANT', the reference level for Tissue
If I understood correctly the ?results page and the vignette for interactions, if I wanted to look at the differences in expression between the castes M and F in the tissue CRO I would run:
results(dds, contrast = list(c("tissue_CRO_vs_ANT", "tissueCRO.casteM"))
Is this doing what I think it is doing? Is there an easier way to specify the contrasts within group? I am aware that a possibility is to group caste and tissue into a single factor, but we would rather keep the data structure as it is. Thank you very much!