globaltest in r
1
0
Entering edit mode
10.0 years ago
lkarki2000 • 0

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

R • 2.5k views
ADD COMMENT
0
Entering edit mode
10.0 years ago

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)
ADD COMMENT

Login before adding your answer.

Traffic: 2519 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6