Irrationone / cellassign

Automated, probabilistic assignment of cell types in scRNA-seq data
Other
191 stars 79 forks source link

Allow integer sce_assay #33

Closed LTLA closed 5 years ago

LTLA commented 5 years ago

extract_expression_matrix fails when doing something like sce_assay=1; this setting is occasionally necessary when assayNames is full of empty strings and/or if you know the input object only has one assay (but not what it's called). This is caused by a custom error check for the validity of sce_assay, but there is no need for that because assay will do this check anyway.

library(SingleCellExperiment)
example(SingleCellExperiment)
assay(sce, "whee")
## Error in assay(sce, "whee") :
##   'assay(<SingleCellExperiment>, i="character", ...)' invalid subscript 'i'
## 'whee' not in names(assays(<SingleCellExperiment>))
Irrationone commented 5 years ago

Thanks @LTLA! Updated in 59564acdb2a130115ebed585c5e3591607134930