R/rowlist.R

Defines functions rowlist

rowlist <-
function(genemat,effnum,apvlist,level,posterior=FALSE)
#
# genemat is a p by n matrix of expression values 
# effnum is the column number for the effect of interest
# apvlist is a matrix of p-values from pvadjust or genediff
# the routine returns a list of genes whose FDR p-value is 
#   less than level using either individual gene or posterior 
#   MSE's. This is gene names if rownames(genemat) is not null,
#   and gene numbers otherwise.
#
{
  if(posterior)
  {
    ind <- apvlist$Posterior.FDR[,effnum] < level
  }
  else
  {
    ind <- apvlist$Gene.Specific.FDR[,effnum] < level
  }
  numsig <- sum(ind)
  if (is.null(rownames(genemat)))
  {
    p <- dim(genemat)[1]
    if (numsig > 0)
    {
      return((1:p)[ind])
    }
    else
    {
      return(-1)
    }
  }
  else
  {
    if (numsig > 0)
    {
      return(rownames(genemat)[ind])
    }
    else
    {
      return(-1)
    }
  }
}

Try the LMGene package in your browser

Any scripts or data that you put into this service are public.

LMGene documentation built on April 28, 2020, 8:01 p.m.