[BioC] normalize.invariantset

James W. MacDonald jmacdon at med.umich.edu
Fri Mar 24 22:44:40 CET 2006


Daniel Pick wrote:
> Hi,
>    Thank you very much for this informative reply.
>     Are you sure about this behavior?  I have queried the code contributor
> about this, and he didn't express this definitely.  The latest R Language
> definition (version 2.2.0, dated Oct 6, 2005) does not say that the first
> choice in an argument list is used by default.  In fact, it says that a
> default is specified by setting 'symbol = default' construct, as was done
> with 'verbose = FALSE'  That led me to question the actual behavior of the
> call.
>     If you look at the R code for normalize.AffyBatch.invariantset, you
> will see that there are a bunch of 'if' clauses for each baseline type, but
> none of them is set as the default.  So I am really wondering about the
> performance of the call.  It's not at all clear to me that the code behaves
> as you suggest.

You are not looking at the code for the function 
normalize.AffyBatch.invariantset(). You are looking at a function that 
is defined within that function called (of all things) 
do.normalize.AffyBatch.invariantset(). At the end of this function you 
will see two lines:

  type <- match.arg(type)
  baseline.type <- match.arg(baseline.type)

What match.arg() does is to match the argument supplied with a vector of 
choices. From the help for match.arg():

Details:

      In the one-argument form 'match.arg(arg)', the choices are
      obtained from a default setting for the formal argument 'arg' of
      the function from which 'match.arg' was called.

So if you don't specify an argument for type and baseline.type, the 
default will be the first value in the character vector for each 
argument. As further proof:

 > library(affy)
 > data(affybatch.example)
 > debug(normalize.AffyBatch.invariantset)
 > normalize(affybatch.example, method="invariantset")
debugging in: normalize.AffyBatch.invariantset(object, ...)
debug: {
     do.normalize.Affybatch.invariantset <- function(abatch, pms,
         prd.td, baseline.type) {

[Snip]

Browse[1]>
debug: type <- match.arg(type)
Browse[1]>
debug: baseline.type <- match.arg(baseline.type)
Browse[1]>

[Snip]

Browse[1]> type
[1] "separate"
Browse[1]> baseline.type
[1] "mean"

HTH,

Jim



> 
> Dan
> 
> 
>                                                                            
>              "James W.                                                     
>              MacDonald"                                                    
>              <jmacdon at med.umic                                          To 
>              h.edu>                    Daniel Pick                         
>                                        <Daniel.Pick at biogenidec.com>        
>              24-Mar-2006 10:51                                          cc 
>              AM                        bioconductor at stat.math.ethz.ch      
>                                                                    Subject 
>              Message Size: 5.0         Re: [BioC] normalize.invariantset   
>              KB                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
> 
> 
> 
> 
> Daniel Pick wrote:
> 
>>Hello,
>>    The Gentleman book suggests to do variant normalizations one should
> 
> do
> 
>>'normalize(object, method="<some method>").  We would like to know if one
>>selects "invariantset", what does the code use for default settings?  The
> 
> R
> 
>>code for normalize.AffyBatch.invariantset doesn't show a default set, and
>>it seems to indicate that one should specify a baseline type from median,
>>mean, pseudo-median, and pseudo-mean, and a type from separate, pmonly,
>>mmonly, or together.
>>So what does 'normalize(object,method="invariantset") actually do?
> 
> 
> It uses the first option for all arguments that have a character vector
> of choices. For instance, the code says
> 
> function (abatch, prd.td = c(0.003, 0.007), verbose = FALSE,
>      baseline.type = c("mean", "median", "pseudo-mean", "pseudo-median"),
>      type = c("separate", "pmonly", "mmonly", "together"))
> 
> so normalize(object, method="invariantset") will call
> normalize.AffyBatch.invariantset(object, prd.td = c(0.003, 0.007),
> verbose = FALSE, baseline.type = "mean", type = "separate")
> 
> You have to supply an argument for baseline.type and type if you want
> something different.
> 
> HTH,
> 
> Jim
> 
> 
> 
>>Dan
>>
>>_______________________________________________
>>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
> 
> 
> --
> James W. MacDonald, M.S.
> Biostatistician
> Affymetrix and cDNA Microarray Core
> University of Michigan Cancer Center
> 1500 E. Medical Center Drive
> 7410 CCGC
> Ann Arbor MI 48109
> 734-647-5623
> 
> 
> **********************************************************
> Electronic Mail is not secure, may not be read every day, and should not be
> used for urgent or sensitive issues.
> 
> 


-- 
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623


**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.



More information about the Bioconductor mailing list