R/GetNg.R

Defines functions GetNg

Documented in GetNg

GetNg<- function(IsoformName, GeneName, TrunThre=3){
	if(length(IsoformName)!=length(GeneName))stop("The length of IsoformName is not the same as the length of GeneName")
	GeneNg = tapply(IsoformName, GeneName, length)
	if(max(GeneNg)<TrunThre)stop("The max Ng is less than the TrunThre")
	IsoformNg = GeneNg[GeneName]
	names(IsoformNg) = IsoformName
	GeneNgTrun=GeneNg
	GeneNgTrun[GeneNgTrun>TrunThre]=TrunThre
	IsoformNgTrun=IsoformNg
	IsoformNgTrun[IsoformNgTrun>TrunThre]=TrunThre
	out=list( GeneNg=GeneNg, GeneNgTrun=GeneNgTrun, IsoformNg=IsoformNg, IsoformNgTrun=IsoformNgTrun)
	}

Try the EBSeq package in your browser

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

EBSeq documentation built on Nov. 8, 2020, 6:52 p.m.