[R] Difficult to set a quiet formula in maanova
Marcelo Laia
marcelolaia at gmail.com
Tue Nov 13 23:47:50 CET 2007
Hi,
I am trying to run an analysis with the package maanova and I am not
getting success.
I suppose that I am wrong on set up the formula, so the issue may not
be related to R, properly.
I have two varieties of plants (V1 and V2). A group of each ones were
treated and another was not treated. After treatment, in three
different time RNA was collected from treated and from not treated
plants for both varieties. So, I have:
Var: 2 (varieties)
Trat: 2 (treatment)
Time: 3
Sample: 3 (biological replicate)
Probes: 3575
Spots: 2 for each probe
I used the following code:
> library(vsn)
> todos <- read.matrix("todos_v1_e_v2_back_c.txt",sep="\t")
> todos.norm <- vsn2(todos)
> write.table(exprs(todos.norm),"todos.norm.txt",sep="\t")
> library(maanova)
> fabiana.raw <- read.madata("todos.norm.vsn2.maanova.txt", designfile="design.txt", header=TRUE, spotflag=FALSE,CloneID=1,metarow=2, metacol=3, pmt=4)
> fabiana <- createData(fabiana.raw, n.rep=2, avgreps=1, log.trans=FALSE)
> model.full.mix <- makeModel(data=fabiana, formula=~Var+Trat+Time+Sample+Var:Trat+Var:Time+Trat:Time+Var:Trat:Time, random=~Sample)
> summary(model.full.mix)
Model Summary
This is a mixed effect model
Gene-specific ANOVA model: Var + Trat + Time + Var:Trat +
Var:Time + Trat:Time + Var:Trat:Time + Sample
Gene-specific Random terms: Sample
Gene-specific covariate: None
Class Level Information
Class Levels Effect
1 Var 2 fixed
2 Trat 2 fixed
3 Time 3 fixed
4 Var:Trat 4 fixed
5 Var:Time 6 fixed
6 Trat:Time 6 fixed
7 Var:Trat:Time 3 fixed
8 Sample 2 random
Dimensions
Observations(per gene): 36
Columns in X: 24
Columns in Z: 3
Warning message:
number of rows of result
is not a multiple of vector length (arg 2) in: cbind(1, Class,
Levels, Effect) (I do no what this warning means. my be the error was
here.)
> anova.full.mix <- fitmaanova(fabiana, model.full.mix)
Calculating variance components for fixed model...
Fitting mixed effect model...
Finish gene number 100 ...
(...)
Finish gene number 3500 ...
Error in next.fix:(next.fix + ncols - 1) :
NA/NaN argument
I was inspecting the files of data and there's nothing wrong close to
the probe 3500. Then I calculei the average for each probe in Excel. I
tried to perform the analysis again adjusting the option n.rep = 1 and
avgreps = 0.
There was the same mistake:
Finish gene number 3500 ...
Error in next.fix:(next.fix + ncols - 1) :
NA/NaN argument
Then I decided do a permutation on my data and the error continued
occurring in the same place:
Finish gene number 3500 ...
Error in next.fix:(next.fix + ncols - 1) :
NA/NaN argument
Then I exhausted my knowledge and need a help.
Could you suggest me anything here?
Thank you very much.
--
Marcelo Luiz de Laia
More information about the R-help
mailing list