R/normalize.qpcr.R

Defines functions normalize.qpcr

Documented in normalize.qpcr

normalize.qpcr=function(data,controls,center=T) {
	dln=c()
	for(s in levels(data$sample)){ 
		sub=subset(data,sample==s)
		cm=0
		for(g in controls) {
			cm=cm+mean(sub[sub$gene==g,"count"],na.rm=TRUE)
		}
		nor=round(cm/length(controls),2)
		sub$count=sub$count-nor
		dln=rbind(dln,sub)
	}
	# centering
	if (center==T){
		for(ge in levels(data$gene)){ 
			dln[dln$gene==ge,"count"]=dln[dln$gene==ge,"count"]-round(mean(dln[dln$gene==ge,"count"],na.rm=TRUE),2)
		}
	}
	return(dln)
}

Try the MCMC.qpcr package in your browser

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

MCMC.qpcr documentation built on March 31, 2020, 5:22 p.m.