[BioC] Is it possible to "filter" genes in topTable on basis of M values?

Francois Pepin fpepin at cs.mcgill.ca
Wed Nov 29 23:23:32 CET 2006


Hi Noah,

My solution is to have a wrapper around topTable where I can give it
additional restrictions.

Francois

topTable2 <- function(fit,contrast=1,p=0.05,p.method='BH', B=NULL,M=NULL,...){
  ##can give the contrast as a string
  if(is.character(contrast))
    contrast<-which(colnames(fit$coefficients)==contrast)

  if(is.null(p))
    p <- 1
  if(is.null(B))
    B <- -Inf
  if(is.null(M))
    M <- 0

  answer <- topTable(fit=fit,coef=contrast, number=nrow(fit$coefficients),
                     adjust.method=p.method,...)
  
  ##this is necessary because limma changed how topTable work.
  ##the new versions have a adj.P.Value as well as P.Value
  if (length(grep('adj.P.Val',names(answer)))==1)
    pval<-answer$adj.P.Val
  else
    pval<-answer$P.Value
  
  answer <- answer[(pval <= p & answer$B >= B & abs(answer$M) >= M),]
  
  return(answer)
}


On Wed, 2006-11-29 at 15:59 -0600, Noah Cohen wrote:
> Hi – I am very much inexperienced and inexpert in use of BioConductor
> for analysis of cDNA microarray data.  With the help of the listserve
> (primarily Dr. Gordon Smyth), I have been able to learn to use limma
> for analysis of data from an equine leukocyte cDNA microarray
> developed by some friends at the University of Georgia.  I have fit a
> linear model to data from 12 microarray slides, each slide
> representing hybridization of cDNA from 1 of 12 horses with laminitis
> against cDNA from a reference sample (pooled cDNA from a group of
> healthy control horses).  
> When I use topTable to try to identify which genes are differentially expressed, the number with an adjusted P value < 0.05 is quite long (several hundred genes).  I’d like to be able to filter the list in various ways; for example, excluding genes whose absolute value of M is < 1.  I know that I can do this manually by using the “sort.by” and “resort.by” options in topTable, but am looking for an alternative solution that is more automated.  Thanks for any help that can be provided.  
> Noah Cohen
> 
> Noah D. Cohen, VMD, MPH, PhD, DACVIMProfessorDepartment of Large Animal Clinical SciencesCollege of Veterinary Medicine and Biomedical SciencesTexas A&M UniversityCollege Station, Texas 77843-4475Telephone: 979-845-3541Fax: 979-847-8863e-mail: ncohen at cvm.tamu.edu
> _______________________________________________Bioconductor mailing listBioconductor at stat.math.ethz.chhttps://stat.ethz.ch/mailman/listinfo/bioconductorSearch the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list