[BioC] R/Maanova Tutorial

Dejian Zhao zhaodj at ioz.ac.cn
Tue Mar 23 05:12:55 CET 2010

 Thank you for your responses, Ricardo and Juan Pedro. You have proposed 
some evidence for the alphabetical order, but I think they are not 
direct proofs. I am thinking this question may be solved by reading the 
source codes of the functions.

The fitting to the model occurs in the function fitannova(), in which 
the model is constructed by makeModel(), in which parseformula() is 
employed to interprete the input formula. In parseformula(), I feel a 
bit lost. I am not sure which is the next function to be traced. I chose 
terms() finally. However, it turns out to be a generic function, and it 
provides methods for "formula" and directs me further to 
terms.formula(), whose parameter keep.order is FALSE by default. In 
source code of terms.formula(), one line is "terms <- 
.Internal(terms.formula(x, specials, data, keep.order, 
allowDotAsName))", in which x is a formula, and keep.order should be 
FALSE by inheritance. But I don't know where to go next.

During this process, the information is mainly from the source codes 
(type function without parenthesis and enter to see the source codes) 
and the help files (?function) of the involved functions. I don't know 
whether I stray from the right way during the tracing process. Hope 
someone can trace to the origin and find out the exact answer.

During the tracing process, I encounter a function called 
terms.formula(), who has a parameter keep.order = FALSE by default. The 
help file (?terms.formula) says keep.order is a logical value indicating 
whether the terms should keep their positions. If FALSE the terms are 
reordered so that main effects come first, followed by the interactions, 
all second-order, all third-order and so on. Effects of a given order 
are kept in the order specified. It does not depict what will happen if 
there is only one term and what will happen to the levels of the term 
(as in the R/Maanova tutorial). I guess it may be sorted by alphabetial 
order, ASSIC code order, or the order they appear in the term. I think 
it is necessary to know exactly how it is ordered.

Hope this helps.

Juan Pedro Steibel wrote:
> Hello Dejian and Ricardo,
> I always check the term.levels of the fitmaanova object, where "term" 
> is the name of a fixed effects factor in the model.
> That should give the name of each level in the order in which they are 
> arranged in the incidence matrix X.
> Hope this helps
> JP
> Ricardo Verdugo wrote:
>> Dear Dejian:
>> Thank you for your message. I admit Maanova lacks some documentation 
>> about the constructions of the  contrast matrix, and this point is 
>> among the missing items. From my personal experience, I have seen 
>> that the columns are in alphabetical order by levels of the terms in 
>> the 'term' argument to matest. I usually check the X matrix from the 
>> fitmaanova object to make sure. One gets an idea from looking at the 
>> coefficients of this matrix.
>> If somebody else in the maanova list has any further information 
>> about this, please jump in.
>> Ricardo.
>> On Mar 22, 2010, at 10:51 AM, Dejian Zhao wrote:
>>> Thank you for your detailed tutorial, Ricardo. It is a great help to 
>>> me,
>>> but there is still something confusing me. It is about the contrast 
>>> matrix.
>>> Simply speaking, I don't know how to decide the meanings of the columns
>>> in the contrast matrix. You ASSUME the experimental groups are stored
>>> alphabetically (line 199 in YChrom-DE.R), and then construct the
>>> contrast matrix. Are they truely stored in this way? It confused me at
>>> this point when I deal with my own data, because I don't know how my
>>> data is stored. Can you provide a way to decide the actual order of
>>> storage? It will help me build the contrast matrix.
>>> Thanks a lot.
>>> Dejian
>>> Ricardo Verdugo wrote:
>>>> Hello:
>>>> I am at Gary Churchill's group where R/MAanova is developed and
>>>> maintained. After assisting numerous users with similar issues, I
>>>> though it would be better to write a self contained tutorial that
>>>> would walk newbies through a differential expression analysis using
>>>> contrasts.
>>>> You can get the tutorial (data included) and see the expected 
>>>> results at
>>>> http://churchill.jax.org/software/rmaanova/tutorials.shtml
>>>> It is well documented, explained step by step.
>>>> This is work in progress so comments are welcome. If other tutorials
>>>> would be useful, send an email to maanova at jax.org
>>>> Regards,
>>>> Ricardo Verdugo
>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>> Ricardo A. Verdugo S., D.V.M. Ph.D.
>>>> Postdoctoral Fellow
>>>> Gary Churchill Group
>>>> The Jackson Laboratory
>>>> 600 Main Street,
>>>> Bar Harbor, ME 04609
>>>> ricardo.verdugo at jax.org
>>>> +1-207-288-6715
>>>> +1-207-288-6847 Fax
>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: 
>> http://news.gmane.org/gmane.science.biology.informatics.conductor

More information about the Bioconductor mailing list