R/laptopTable.R

Defines functions laptopTable

Documented in laptopTable

laptopTable <- function(res, number=res$med.number, sort.by='L')
{
	lap.lods <- res$lap.lods
	prob <- res$prob
	nondiff_prob <- 1-prob
	Im <- res$Im
	Ip <- res$Ip
	V <- res$estimates$V
	w <- res$estimates$w
	gamma <- res$estimates$gamma
	alpha <- res$estimates$alpha
	if(number <= 0)
		stop('Number of displayed genes must be a positive integer!')
	if(sort.by == 'L')
	{
		ix <- sort(lap.lods, decreasing=TRUE, index.return=TRUE)$ix
		diff.genes <- ix[1:number]
	}
	else if(sort.by == 'M')
	{
		ix <- sort(res$M, decreasing=TRUE, index.return=TRUE)$ix
		diff.genes <- ix[1:number]	
	}
	else
		stop('invalid value given to argument sort.by')
	table <- data.frame(gene=diff.genes, M=res$M[diff.genes], log.odds=lap.lods[diff.genes], row.names=NULL)
	table
}

Try the lapmix package in your browser

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

lapmix documentation built on Nov. 8, 2020, 10:59 p.m.