comparison 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
comparison
equal deleted inserted replaced
0:87757f7b9974 1:946179ef029c
27 c("-l", "--library-size"), 27 c("-l", "--library-size"),
28 action = "store", 28 action = "store",
29 default = 0, 29 default = 0,
30 type = 'numeric', 30 type = 'numeric',
31 help = "Minimum library size (mapped reads) to filter cells on" 31 help = "Minimum library size (mapped reads) to filter cells on"
32 ),
33 make_option(
34 c("-e", "--expressed-genes"),
35 action = "store",
36 default = 0,
37 type = 'numeric',
38 help = "Minimum number of expressed genes to filter cells on"
32 ), 39 ),
33 make_option( 40 make_option(
34 c("-m", "--percent-counts-MT"), 41 c("-m", "--percent-counts-MT"),
35 action = "store", 42 action = "store",
36 default = 100, 43 default = 100,
69 to_keep <- scle$total_counts > opt$library_size 76 to_keep <- scle$total_counts > opt$library_size
70 scle <- scle[, to_keep] 77 scle <- scle[, to_keep]
71 78
72 print(paste("After filtering out low library counts: ", ncol(scle), "cells and", nrow(scle), "features.")) 79 print(paste("After filtering out low library counts: ", ncol(scle), "cells and", nrow(scle), "features."))
73 80
81
82 # Filter low expressed genes
83 to_keep <- scle$total_features_by_counts > opt$expressed_genes
84 scle <- scle[, to_keep]
85
86 print(paste("After filtering out low expressed: ", ncol(scle), "cells and", nrow(scle), "features."))
87
88
74 # Filter out high MT counts 89 # Filter out high MT counts
75 to_keep <- scle$pct_counts_MT < opt$percent_counts_MT 90 to_keep <- scle$pct_counts_MT < opt$percent_counts_MT
76 scle <- scle[, to_keep] 91 scle <- scle[, to_keep]
77 92
78 print(paste("After filtering out high MT gene counts: ", ncol(scle), "cells and", nrow(scle), "features.")) 93 print(paste("After filtering out high MT gene counts: ", ncol(scle), "cells and", nrow(scle), "features."))