-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Hello,
I'm doing DEG using the pseudoBulkDGE() function. I would like to test the interaction effect of sex * condition. Specifically the contrast of these three:
Disease.Female - Healthy.Female
Disease.Male - Healthy.Male
(Disease.Female-Healthy.Female)-(Disease.Male-Healthy.Male)
The output is like this:
I wonder the pvalue is for which comparison? And how to get the pvalues for each comparison? Thanks a lot for any help!
My code:
library(scran)
library(limma)
library(edgeR)
sce<- SingleCellExperiment(assays=list(counts=rawcount), colData=metadata)
groups<- colData(sce)[, c('cell_type_me', 'individualID')]
summed<- aggregateAcrossCells(sce, groups)
colData(summed)$TS<- paste(colData(summed)$condition, colData(summed)$msex, sep='.')
colData(summed)$TS<- factor(colData(summed)$TS, levels=c('Healthy.Male', 'Healthy.Female', 'Disease.Male', 'Disease.Female'))
design<- model.matrix(~0+TS+genotype+ncells+educ)
contr.matrix<- makeContrasts(
DiseasevsHealthyinF=(TSDisease.Female-TSHealthy.Female),
DiseasevsHealthyinM=(TSDisease.Male-TSHealthy.Male),
Diff=(TSDisease.Female-TSHealthy.Female)-(TSDisease.Male-TSHealthy.Male),
levels = colnames(design))
de.results<- pseudoBulkDGE(summed, label=summed$cell_type_me,
design=~0+TS+genotype+ncells+educ,
condition=summed$TS,
contrast=contr.matrix)
results<- de.results[['celltypeA']]
results<- as.data.frame(results)
results<- results %>% arrange(PValue)