Hi there!
I am trying to perform a gene set enrichment analysis with qusage package in order to incorporate one random effect. I am comparing two groups of patients on one contrast (which is basically my only fixed effect in my design) and I have multiple samples per patient (which is my random effect).
This is my code:
# First I uploaded (1) all Genesets from the MSigDB/Broadway institue, (2) my logcpm matrix constructed with edgeR/limma and (3) my design
library(qusage)
library(nlme)
eset <- top500logcpm
fixedeffects <- Design$SVZstatus
# contrast factor
con.fac <- Design$SVZstatus
contrast = "SVZ - nonSVZ"
sampleID <- Design$Name
subject <- Design$Subject
qusage.result.random<-qgen(eset, Design,
fixed=fixedeffects,
contrast.factor=fixedeffects,
contrast=contrast,
geneSets=geneSets,
random=subject,
design.sampleid="sampleID")
Unfortunately, I get this error:
Error in `[.data.frame`(design, , design.sampleid) :
undefined columns selected
I checked my column names in my design, but there are no typo's... What am I doing wrong? Your help is appreciated!