globaltest in r
I tried to run "globaltest" in my data set. I have expression data with 9 columns (1 column for gene symbols, 4 controls and 4 treatments). I tried to run globaltest with the following code and got following error:
library(globaltest)
data<-read.csv("C:/Users/Desktop/mouse.csv",header=T)
classes <- as.factor(c(rep("CONTROL", times=4), rep("TREATMENT", times=4)))
gt <- gt(classes, data)
Error in .getAlternative(alternative, data, n) :
argument "alternative" could not be coerced into a matrix
Laxman
• 2,849 views
•
link
1 answer
I've never used globaltest, but I think in
gt <- gt(classes, data)
data should be a matrix of expression values (you have gene symbol as first column, hence the error). classes should be the response (e.g. a phenotipic trait?).
This piece of code doesn't throw any error but it might not make sense:
library(globaltest)
data<- data.frame(gene_id= paste('V', 1:200, sep= '_'), matrix(rnorm(1600), 200, 8))
classes<- as.factor(c(rep("CONTROL", times=4), rep("TREATMENT", times=4)))
dat<- t(data[, 2:ncol(data)])
colnames(dat)<- data$gene_id
gt <- gt(classes, dat)
• 0 views
•
link
Log in to answer this question.