Hi everyone.
I am trying to use DESeq2 to find DEGs in my experiment, but I am confused about the usage of the formulas and I would be grateful if somebody could help me to clarify it.
My experiment contain 3 "treatments": plants challenged by both insect vector and pathogen (IP, samples S09-S12), plants challenged with only the insect vector (I, samples S05-08) and healthy plants (H, without insects or pathogen, samples S01-04). Each treatment has 4 replicates, totalling 12 samples (S). I want to find differences between all of the groups (H x I, H x IP, I x IP), since I want to see the effect of both insect feeding and pathogen infection on the host transcriptome.
I created the following design:
>colData
Insect Pathogen
S01 No No
S02 No No
S03 No No
S04 No No
S05 Yes No
S06 Yes No
S07 Yes No
S08 Yes No
S09 Yes Yes
S10 Yes Yes
S11 Yes Yes
S12 Yes Yes
>design=model.matrix(~Vector + Pathogen, colData)
>design
(Intercept) VectorYes PathogenYes
A01 1 0 0
A02 1 0 0
A03 1 0 0
A04 1 0 0
A05 1 1 0
A06 1 1 0
A07 1 1 0
A08 1 1 0
A09 1 1 1
A10 1 1 1
A11 1 1 1
A12 1 1 1
>dds <- DESeqDataSetFromMatrix(countData = countData,
colData = colData,
design = ~ Vector + Pathogen)
Then, I tried to applied DESeq function to further extract differences using contrasts, but I got the following message:
> dds = DESeq(dds)
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
What am I doing wrong? Is this the best design for this type of experiment or should I modify it?
Thanks in advance for any help
I am trying to use DESeq2 to find DEGs in my experiment, but I am confused about the usage of the formulas and I would be grateful if somebody could help me to clarify it.
My experiment contain 3 "treatments": plants challenged by both insect vector and pathogen (IP, samples S09-S12), plants challenged with only the insect vector (I, samples S05-08) and healthy plants (H, without insects or pathogen, samples S01-04). Each treatment has 4 replicates, totalling 12 samples (S). I want to find differences between all of the groups (H x I, H x IP, I x IP), since I want to see the effect of both insect feeding and pathogen infection on the host transcriptome.
I created the following design:
>colData
Insect Pathogen
S01 No No
S02 No No
S03 No No
S04 No No
S05 Yes No
S06 Yes No
S07 Yes No
S08 Yes No
S09 Yes Yes
S10 Yes Yes
S11 Yes Yes
S12 Yes Yes
>design=model.matrix(~Vector + Pathogen, colData)
>design
(Intercept) VectorYes PathogenYes
A01 1 0 0
A02 1 0 0
A03 1 0 0
A04 1 0 0
A05 1 1 0
A06 1 1 0
A07 1 1 0
A08 1 1 0
A09 1 1 1
A10 1 1 1
A11 1 1 1
A12 1 1 1
>dds <- DESeqDataSetFromMatrix(countData = countData,
colData = colData,
design = ~ Vector + Pathogen)
Then, I tried to applied DESeq function to further extract differences using contrasts, but I got the following message:
> dds = DESeq(dds)
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
What am I doing wrong? Is this the best design for this type of experiment or should I modify it?
Thanks in advance for any help
Comment