Entering edit mode
hello R-users,
I'm trying to do time series analysis using the samr package.
I have an excel sheet with 25 columns and 22811 lines. the first row
has the
names of the experiments and the first column contains the names of
the
genes.
I saved this file to a tab-delimited table and tried to read it with
read.table/read.delim with and without the header.
>test_TS <- read.table("test_data_TS.txt" )
#constructing the vector
>y=paste(c(rep(1,12),rep(2,12)),"Time",rep(c(1,24,3,48,6,9),2),sep="")
>start=c(1,7,13,19)
>for(i in start){
>y[i]=paste(y[i],"Start",sep="")}
>for(i in start+5){
>y[i]=paste(y[i],"End",sep="")}
>#p by n matrix of features, one observation per column
>TS_group <- bind(test_TS[,2],test_TS[,4],test_TS[,6],test_TS[,8],
test_TS[,10],test_TS[,12],test_TS[,3],test_TS[,5],test_TS[,7],test_TS[
,9],
test_TS[,11],test_TS[,13],test_TS[,14],test_TS[,16],test_TS[,18],test_
TS[,20],
test_TS[,22],test_TS[,24],test_TS[,15],test_TS[,17],test_TS[,19],test_
TS[,23],test_TS[,25])
>gene_names <- test_TS[,1]
>#data object für die samr Analyse
>data_test=list(x=TS_group,y=y, logged2=TRUE)
>#running samr analysis using the "slope" method
>samr.obj_slope<- samr(data_test, resp.type="Two class unpaired
timecourse", nperms=100, time.summary.type="slope")
I'm getting an error message which I don't understand:
123456789101112131415161718192021222324Error in t(x[, jj, drop = F]) :
(subscript) logical subscript too long
I thought the problem was due to the fact that samr needs a matrix to
work
with, so I tries to convert the data frame to a matrix both using the
data.matrix option
>matrix_test_TS <- data.matrix(test_TS)
and the scan option:
> matrix_test_TS <- matrix(scan(test_TS))
after changing the frame to a matrix with data.matrix i'm getting the
same
error. Using scan I can't even read the file:
Warning message:
In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
:
number of items read is not a multiple of the number of columns
It would be very nice if someone can give me some hints about how to
convert
a data.frame object to a matrix (if it's necessary at all) and how to
run a
samr analysis using the command line and not the excel plugin!
Thank you very very much in advance
Assa
--
Assa Yeroslaviz
Kockelsberg 22
51371 Leverkusen
[[alternative HTML version deleted]]