diff scater-manual-filter.R @ 1:b7ea9f09c02f draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scater commit 61f3899168453092fd25691cf31871a3a350fd3b"
author iuc
date Tue, 03 Sep 2019 14:27:39 -0400
parents e6ca62ac65c6
children 7a365ec81b52
line wrap: on
line diff
--- a/scater-manual-filter.R	Thu Jul 18 11:13:41 2019 -0400
+++ b/scater-manual-filter.R	Tue Sep 03 14:27:39 2019 -0400
@@ -31,6 +31,13 @@
     help = "Minimum library size (mapped reads) to filter cells on"
   ),
   make_option(
+    c("-e", "--expressed-genes"),
+    action = "store",
+    default = 0,
+    type = 'numeric',
+    help = "Minimum number of expressed genes to filter cells on"
+  ),
+  make_option(
     c("-m", "--percent-counts-MT"),
     action = "store",
     default = 100,
@@ -71,6 +78,14 @@
 
 print(paste("After filtering out low library counts: ", ncol(scle), "cells and", nrow(scle), "features."))
 
+
+# Filter low expressed genes
+to_keep <- scle$total_features_by_counts > opt$expressed_genes
+scle <- scle[, to_keep]
+
+print(paste("After filtering out low expressed: ", ncol(scle), "cells and", nrow(scle), "features."))
+
+
 # Filter out high MT counts
 to_keep <- scle$pct_counts_MT < opt$percent_counts_MT
 scle <- scle[, to_keep]