R/getMethylumiBeta.R

Defines functions getMethylumiBeta

Documented in getMethylumiBeta

getMethylumiBeta <-
function(methylumi){

	fNames <- featureNames(methylumi)
	u <- unmethylated(methylumi)
	m <- methylated(methylumi)

	rm(methylumi)

	#check and "correct" for negative values
	indexNegU <- which(u < 0, arr.ind=TRUE)
	indexNegM <- which(m < 0, arr.ind=TRUE)
	u[indexNegU] <- 0
	m[indexNegM] <- 0

	rm(indexNegU, indexNegM)

	beta <- m/(m + u + 100)
	rm(u, m)

	rownames(beta) <- fNames

	return(beta)
}

Try the wateRmelon package in your browser

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

wateRmelon documentation built on Nov. 8, 2020, 7:47 p.m.