]> git.donarmstrong.com Git - rsem.git/blobdiff - EBSeq/R/GetNg.R
Included EBSeq for downstream differential expression analysis
[rsem.git] / EBSeq / R / GetNg.R
diff --git a/EBSeq/R/GetNg.R b/EBSeq/R/GetNg.R
new file mode 100644 (file)
index 0000000..9312f9a
--- /dev/null
@@ -0,0 +1,10 @@
+GetNg<- function(IsoformName, GeneName){
+       GeneNg = tapply(IsoformName, GeneName, length)
+       IsoformNg = GeneNg[GeneName]
+       names(IsoformNg) = IsoformName
+       GeneNgTrun=GeneNg
+       GeneNgTrun[GeneNgTrun>3]=3
+       IsoformNgTrun=IsoformNg
+       IsoformNgTrun[IsoformNgTrun>3]=3
+       out=list( GeneNg=GeneNg, GeneNgTrun=GeneNgTrun, IsoformNg=IsoformNg, IsoformNgTrun=IsoformNgTrun)
+       }