Mercurial > repos > iuc > scater_normalize
diff scater-manual-filter.R @ 1:946179ef029c draft default tip
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scater commit 61f3899168453092fd25691cf31871a3a350fd3b"
author | iuc |
---|---|
date | Tue, 03 Sep 2019 14:28:53 -0400 |
parents | 87757f7b9974 |
children |
line wrap: on
line diff
--- a/scater-manual-filter.R Thu Jul 18 11:13:05 2019 -0400 +++ b/scater-manual-filter.R Tue Sep 03 14:28:53 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]