Hi!
I'm trying to analyse a specific set of CEL files. In these datasets, the effect of a stress agent (H2O2) on yeast performance was tested. There are two control replicates and 4 tests of stress condition done during different time points (15-30-45 and 90 minutes), all with a single replicate. All quality filtering and annotation steps have been done and saved in the file: file_final
I would like to know how gene expression differ among all the conditions first and if there is any difference between control and each of the 4 tests as among the stress conditions. At the end, I'd like to get a whole view of difference among the control and stress condition. However, I have serious problem in constructing appropriate matrix and I don't know what I must do for my analysis here:
In my phenodata file, the information for $Comment..Sample_source_name.
is:
H2O2 treated S. cerevisiae cells Untreated S. cerevisiae cells Untreated S. cerevisiae cells H2O2 treated S. cerevisiae cells H2O2 treated S. cerevisiae cells H2O2 treated S. cerevisiae cells
And the corresponding $Comment..Sample_characteristics.
is:
4741; oxidative stress; 30 min 4741; untreated; 0 min 4741; untreated; 0 min 4741; oxidative stress; 90 min 4741; oxidative stress; 15 min 4741; oxidative stress; 45 min
My code is:
i_in <- as.character(Biobase::pData(file_final)$Comment..Sample_source_name.)
i_in <- ifelse(individual == "treatment","treated", "untreated")
condition <- str_replace_all(Biobase::pData(file_final)$Comment..Sample_characteristics., " ", "_")
condition <- ifelse(phenotype == "treatment", "control", "h2o2")
condition <- factor(c(1,1,2,3,4,5), levels = c("control", "h15", "h30", "h45", "h90"))
i_in <- factor(c(1,1,1,1, 2, 2), levels = c("treated", "untreated"))
design_gene <- model.matrix(~0 + condition)
colnames(design_gene)<- c("control", "h15", "h30", "h45", "h90")
rownames(design_gene) <- i_in
head(design_gene)
contrast_matrix <- makeContrasts(control-h15, control-h30, control-h90, control-h45, h15-h45, h15-h30, h15-h90, h30-h45, h30-h90, h45-h90, levels = design_gene)
design_gene_fit <- eBayes(contrasts.fit(lmFit(file_final, design = design_gene),
contrast_matrix))
With head(design_gene)
, I get:
control h15 h30 h45 h90
So, there is no row when I type: rownames(design_gene) <- i_in
Error in dimnames(x) <- dn :
length of 'dimnames' [1] not equal to array extent
Any help would be highly appreciated.
Cross-posted to Biostars