[BioC] genefilter (nsFilter function)

Robert Gentleman rgentlem at fhcrc.org
Thu Jun 19 13:46:00 CEST 2008


Hi Anne,

   Perhaps you could tell us the context in which this arose?

Anne wrote:
> Hi,
>  
> A question about gene filtering:
>  
> I was wondering if anyone could explain me how I should interpret the code
> below.
> I am not sure I understand what it means that IQR(x) > 2.5.  
>  
> iqr <- function(x) IQR(x) > 2.5
> filter <- nsFilter(eset, var.filter=TRUE, var.func = iqr, var.cutoff = 0.5) 
>  

  The short answer is that for some input, x, the function iqr will 
return TRUE of FALSE depending on whether the IQR is larger than 2.5 or 
smaller than 2.5 (you could have just tried this).

  > iqr(runif(10))
[1] FALSE

   Somewhat troubling is the use of this function in the call to 
nsFilter since the documentation for nsFilter says:

var.func: A 'function' that will be used to assess the variance of a
           probe set across all samples.  This function should return a
           numeric vector of length one when given a numeric vector as
           input.  Probe sets with a 'var.func' value less than
           'var.cutoff' will be removed. The default is 'IQR'.

  and hence the function supplied is not of the correct form, it is 
unlikely to raise an error (as there are no simple ways to check whether 
a function returns the right kind of value, and logicals can always be 
coerced to numeric), but I don't see an easy way to anticipate what 
nsFilter will do in this setting.  I think you, or whoever wrote this, 
would do a bit better to look at the arguments to the function and use 
them somewhat more appropriately (eg, if you set var.cutoff = 2.5 and 
filterByQuantile=FALSE, and do not specify a var.func value, I think you 
get what is intended).


   best wishes
    Robert

>  
>  
> regards
> Anne
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> 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
> 

-- 
Robert Gentleman, PhD
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
PO Box 19024
Seattle, Washington 98109-1024
206-667-7700
rgentlem at fhcrc.org



More information about the Bioconductor mailing list