Jiaxin-Fan / MuSiC2

cell type deconvolution for multi-condition bulk RNA-seq data
22 stars 3 forks source link

subscript contains invalid names #6

Open GUnit-Lab opened 1 year ago

GUnit-Lab commented 1 year ago

Hello, I am using music2_prop_t_statistics function to deconvolute ExpressionSet prepared wild type versus mutant bulk RNA-seq against an annotated SingleCellExperiment prepared scRNA-seq dataset that matches the wild type condition and is of same tissue as wild type and mutant bulk RNA-seq. Specifically:

TstatDecon <- music2_prop_t_statistics( bulk.control.mtx = exprControl, bulk.case.mtx = exprCase, sc.sce = soASsce, clusters = 'cellType', samples = 'sampleID', select.ct = NULL, expr_low = 20, prop_r = 0.1, eps_c = 0.05, eps_r = 0.01, n_resample = 20, sample_prop = 0.5, cutoff_expr = 0.05, cutoff_fc = 2, cutoff_c = 0.05, cutoff_r = 0.01, maxiter = 200, markers = NULL, cell_size = NULL, ct.cov = FALSE, centered = FALSE, normalize = FALSE )

Result is error "subscript contains invalid names" I read through the traceback (below) but am very unsure how to fix this problem

12. stop(wmsg(...), call. = FALSE) 11. .subscript_error("subscript contains invalid ", what) 10. NSBS(i, x, exact = exact, strict.upper.bound = !allow.append, allow.NAs = allow.NAs) 9. NSBS(i, x, exact = exact, strict.upper.bound = !allow.append, allow.NAs = allow.NAs) 8. normalizeSingleBracketSubscript(i, xstub) 7. extractCOLS(x, j) 6. extractCOLS(x, j) 5. colData(x)[, clusters] 4. colData(x)[, clusters] 3. music_basis(sc.sce, non.zero = TRUE, markers = sc.markers, clusters = clusters, samples = samples, select.ct = select.ct, cell_size = cell_size, ct.cov = ct.cov, verbose = verbose) 2. music_prop(bulk.mtx = bulk.control, sc.sce = sc.sce, clusters = clusters, samples = samples, select.ct = select.ct, markers = markers, cell_size = cell_size, ct.cov = ct.cov, iter.max = 1000, nu = 1e-04, eps = 0.01, centered = centered, normalize = normalize, ... 1. music2_prop_t_statistics(bulk.control.mtx = exprControl, bulk.case.mtx = exprCase, sc.sce = soASsce, clusters = "cellType", samples = "sampleID", select.ct = NULL, expr_low = 20, prop_r = 0.1, eps_c = 0.05, eps_r = 0.01, n_resample = 20, sample_prop = 0.5, cutoff_expr = 0.05, ...

GUnit-Lab commented 1 year ago

I was able to resolve this by copying the colData rownames, which are samples, as a new column in the colData matrix called sampleID