diffcyt
diffcyt copied to clipboard
DA for multiple treatments
Hi!
thank you for this package and for the useful tutorials!
I am working on CyTOF generated data, where I have four groups of treatments, and I want to make three pairwise comparisons treatmentA to treatmentAB treatmentC to treatmentCB treatmentCB to treatmentAB
How do I create a design matrix and contrast?
this is what I did, but I am not sure it was the correct thing to do
my results don't show the different comparisons and without any statistical value
thanks!
condition = ei$condition
condition
[1] treatmentA treatmentA treatmentA treatmentA treatmentA treatmentA treatmentAB treatmentAB treatmentAB treatmentC treatmentC treatmentC treatmentC treatmentC treatmentC treatmentC treatmentCB treatmentCB treatmentCB treatmentCB [21] treatmentCB Levels: treatmentA treatmentAB treatmentC treatmentCB
design <- model.matrix(~0+condition)
contrasts <- makeContrasts(
treatmentAB-treatmentA,treatmentCB-treatmentC , treatmentCB -treatmentAB ,
levels=colnames(design))
da_res1 <- diffcyt(sce,
design = design, contrast = contrasts,
analysis_type = "DA", method_DA = "diffcyt-DA-GLMM",
clustering_to_use = "merging")
rowData(da_res1$res)
DataFrame with 11 rows and 3 columns cluster_id p_val p_adj
B cells B cells NA NA CD4 T cells CD4 T cells NA NA CD45- CD45- NA NA CD45- CD11b+ CD11c+ CD45- CD11b+ CD11c+ NA NA CD45+ CD45+ NA NA CD8 T cells CD8 T cells NA NA DCs DCs NA NA Granulocytes Granulocytes NA NA Macrophages Macrophages NA NA Monocytes Monocytes NA NA TCRgd T cells TCRgd T cells NA NA