]> git.donarmstrong.com Git - rsem.git/blobdiff - EBSeq/R/crit_fun.R
Included EBSeq for downstream differential expression analysis
[rsem.git] / EBSeq / R / crit_fun.R
diff --git a/EBSeq/R/crit_fun.R b/EBSeq/R/crit_fun.R
new file mode 100644 (file)
index 0000000..e68ed4b
--- /dev/null
@@ -0,0 +1,15 @@
+crit_fun<-function (PPEE, thre) 
+{
+    y <- cumsum(sort(PPEE))/(1:length(PPEE))
+    mm <- y < thre
+    index <- sum(mm)
+    if (index > 0) {
+        out <- 1 - sort(PPEE)[index]
+           }           
+    if (index == 0) {
+                       out <- 1
+                                   }
+    names(out) <- NULL
+    return(out)
+}
+