Entering edit mode
2.0 years ago
bioinformatics
▴
40
Hi,
I'm trying to perform microarray differential expression analyses in R using this NCBI dataset: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE159659.
These are the commands I have used so far:
library(GEOquery)
library(limma)
library(preprocessCore)
options("download.file.method.GEOquery" = "wget")
obtain GE data ----------------------------------------------------------
load series (expression matrix) and platform data from GEO
gset <- getGEO("GSE159659", GSEMatrix = TRUE, getGPL= TRUE)
length(gset)
gset <- gset[[1]]
subset data for conditions of interest ----------------------------------
gs0 <- pData(gset)$`subtype:ch1`
table(gs0)
However for this command table(gs0)
it returns the following result:
< table of extent 0 >
It should list the different tissue types (adipose, well differentiated liposarcoma, dedifferentiated liposarcoma) and the quantity of samples belonging to each tissue type.
Does anyone know where I have gone wrong?
Thanks!
Thanks, it worked. I just had another question.
differential expression analysis ----------------------------------------
assign samples to groups and set up design matrix
For this command
design <- model.matrix(~group, gset)
I get the following error message: Error incontrasts<-
(`tmp`, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levelsDo you know I might correct this?
I do not have this error with your code
Apologises I have now retried the code and it worked.
Finally, I tried to run this command below to generate a table of p values for differential expression. However I cannot locate the csv file in the working directory.
Do you know where it might be?
The code before this command:
Check current directory with
getwd()
I have checked the desktop and the file is not there. I also get the following error message for write.csv(tT, "output/DEA_resul.csv", row.names = FALSE)
Error in file(file, ifelse(append, "a", "w")) : cannot open the connection In addition: Warning message: In file(file, ifelse(append, "a", "w")) : cannot open file 'output/DEA_resul.csv': No such file or directory
Did you create the folder
output
?No I didn't, thankyou.
Also, after running quality control I received an error message for design <- model.matrix(~group, gset)
Error in
contrasts<-
(*tmp*
, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levelsDo you know how I might correct this?
You changed "well differentiated" to "well-differentiated" which is not present in your dataset. Please check carefully your code before asking such basic question