where nfg is the number of "real" ("foreground") cells.
this will first convert the mgatk output into CellBender compatible input, using a couple of R functions from Signac to perform feature selection (simply copied here to avoid having to install the entire package). then it will run CellBender itself (GPU support not necessary if we only have a few hundred "genes"), and finally it will convert cellbender output back into a .rds object (but at this point not the raw sample_id.A.txt.gz files etc.)
to remove background counts, run
mgatk
using many (~20k) cells, e.g., like sothe first line selects cells with nonzero mitochondrial counts. to make this work, I replaced
os.popen('ls ' + ...
byglob.glob
inmgatk
.then run
where
nfg
is the number of "real" ("foreground") cells.this will first convert the
mgatk
output intoCellBender
compatible input, using a couple of R functions fromSignac
to perform feature selection (simply copied here to avoid having to install the entire package). then it will runCellBender
itself (GPU support not necessary if we only have a few hundred "genes"), and finally it will convert cellbender output back into a.rds
object (but at this point not the rawsample_id.A.txt.gz
files etc.)additional dependencies:
CellBender
(see here)optparse
,dplyr
,tidyr
,hdf5r