How to make grouping and contrast for multfactor design?
Entering edit mode
anikng • 0
Last seen 8 months ago

Edited:Target frame.

I was referring to edgeR user guide example 3.3.1 to analyze my data which has 2 condition, 2time points and 3 genotypes,and that look like,

         Treat     Time Genotype
Sample1  Control    0h  G 1
Sample2  Control    0h  G 1
Sample3  Control    1h  G 1
Sample4  Control    1h  G 1
Sample5  Control    0h  G 2
Sample6  Control    0h  G 2
Sample7  Control    1h  G 2
Sample8  Control    1h  G 2
Sample9  Control    0h  G 3
Sample10 Control    0h  G 3
Sample11 Control    1h  G 3
Sample12 Control    1h  G 3
Sample13 Stress     0h  G 1
Sample14 Stress     0h  G 1
Sample15 Stress     1h  G 1
Sample16 Stress     1h  G 1
Sample17 Stress     0h  G 2
Sample18 Stress     0h  G 2
Sample19 Stress     1h  G 2
Sample20 Stress     1h  G 2
Sample21 Stress     0h  G 3
Sample22 Stress     0h  G 3
Sample23 Stress     1h  G 3
Sample24 Stress     1h  G 3

As additional factor "Genotype" is included, I am not sure how to make groups and contrast. I was thinking like treatment time for each treatment condition for each genotype is a group,

Group <- factor(paste(targets$Treat,targets$Time,targets$Genotype,sep="."))

In this case, how can I make contrast for identifying genes for ex,that are induced at 1hr drug treatment for only genotype "G 2"?

edger DEGs • 259 views
Entering edit mode

It's not possible to advise you unless you give the whole targets frame. From the limited rows you give, it appears that genotype is entirely confounded with treatment.

Entering edit mode

I edited original question and included full targets frame.

Entering edit mode

From this site, I understand that multiple groups cab be combined by ( group + group) / 2 format. But still I am not sure whether my steps about grouping treat, time and genotye and are correct or not.

Entering edit mode
Last seen 1 hour ago
WEHI, Melbourne, Australia

You have set the levels of Genotype to have spaces in them ("G 1", "G 2" etc) and that is a dangerous thing to do in R. It would be much safer to remove the spaces:

targets$Genotype <- rep( paste0("G",c(1,2,3,1,2,3)), each = 4)

Otherwise, grouping Treat, Time and Genotype into one factor as you have done is just fine. You can follow the process outlined in the edgeR Users Guide or in the edgeR workflows to make any comparison you want. For example you might use:

design <- model.matrix(~ 0 + Group)
colnames(design) <- levels(Group)

To choose genes that are induced at 1hr vs 0hr for Genotype 2, you would use:

Contrast1 <- makeContrasts( Stress.1h.G2 - Stress.0h.G2, levels=design)

On the other hand, to choose genes that are induced at 1h by the treatment relative to the control, you might use:

Contrast2 <- makeContrasts( Stress.1h.G2 - Control.1h.G2, levels=design)

Which of these comparisons is right for your analysis is a scientific decision, not a bioinformatics or software decision, so only you can decide.


Login before adding your answer.

Traffic: 206 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6