So I'm not sure whether this is a bug or I'm missing something.
I'm using timecourse to look at a bunch of genes over a period of 5 days.
Section 2.2 of the timecourse manual tells me that I either have to assign time and replicate groups orn have my data ordered in a specific way that the package will read in as default.
I select the relevant columns of data from my data frame, I set up time vector detailing the time, the replicates and treatments and run the mb.long()
rawCounts <- rawCounts[,c(2:12,39:57)] M3 <- as.matrix(rawCounts[1:39039,]) assay<-c("rep1","rep1","rep1","rep1","rep1","rep2","rep2","rep2","rep1","rep3","rep3","rep2","rep3","rep1","rep2","rep2","rep3","rep3","rep1","rep2","rep3","rep1","rep2","rep3","rep1","rep2","rep3","rep1","rep2","rep3") trt<-c("Control","Psa","Control","Control","Psa","Control","Psa","Control","Psa","Control","Psa","Control","Control","Psa","Psa","Psa","Psa","Control","Control","Control","Control","Psa","Psa","Psa","Control","Control","Control","Psa","Psa","Psa") time<-c(72,24,48,24,72,72,72,48,48,48,72,24,24,24,24,48,48,72,120,120,120,120,120,120,96,96,96,96,96,96)
This is fine. It works. I get a bunch of genes out the other end. When I switch the order though like this:
rawCounts <- rawCounts[,c(39:57,2:12)] M3 <- as.matrix(rawCounts[1:39039,]) assay<-c("rep2","rep3","rep1","rep2","rep2","rep3","rep3","rep1","rep2","rep3","rep1","rep2","rep3","rep1","rep2","rep3","rep1","rep2","rep3","rep1","rep1","rep1","rep1","rep1","rep2","rep2","rep2","rep1","rep3","rep3") trt<-c("Control","Control","Psa","Psa","Psa","Psa","Control","Control","Control","Control","Psa","Psa","Psa","Control","Control","Control","Psa","Psa","Psa","Control","Psa","Control","Control","Psa","Control","Psa","Control","Psa","Control","Psa") time<-c(24,24,24,24,48,48,72,120,120,120,120,120,120,96,96,96,96,96,96,72,24,48,24,72,72,72,48,48,48,72) MB.paired <- mb.long(M3, method="paired", times=5, reps=size, condition.grp=trt, rep.grp=assay, time.grp=time)
I get a different set of genes. The first 2 or 3 are the same, then they're all different. This second set has the samples 2:12 selected last, the relevant time points/assay/treatments have also been swapped in the set up. So why are they different? Timecourse shouldn't be reading them in in the default settings as the settings have been specified, surely? Either I'm missing something (quite likely) or this is a bug.
Cheers
Ben.
Thanks for the response. Also the catching of the error :)
Sadly it wasn't that though. With the amended assay, I still get different results. Again, the first few genes are ranked the same and then it varies. And whilst the first few are the same, their hotellingT2 stat changes.
For size, for both instances of the test, I was using
size <- matrix(3, nrow=366, ncol=2)
Which, as best I can tell from the manual, is how it's meant to be, one row for each variable, one column for each treatment, with the number of reps in the cells.
Cheers
Ben.