Open KaBach opened 1 year ago
I experienced the same thing using a different (reference-based) algorithm, where running RCTD itself was still required to obtain a Reference object. See also this issue on specifying cell_type_profiles.
Import_weights
then appeared to re-estimate model parameters by calling set_global_Q_all
(), outputting:
set_global_Q_all: begin
set_global_Q_all: finished
I am not certain if this re-estimates the platform-specific random effect, but you would have the RCTD definition for platform-specific random effect if you first ran it anyway. So if your deconvolution algorithm uses different random effects you can't use them and only import the (normalised) cell type proportions.
For a RCTD.replicates object I implemented it this way:
# load previously estimated RCTD.replicates object from RDS file
RCTD_obj <- readRDS('/path/to/file/RCTD_obj.rds')
# loop over samples
for(sample_id in seq(RCTD_obj@RCTD.reps)){
# load normalised cell type proportions
# matrix of N_locations X N_cell_types+1, 1st column being location barcodes, other columns being cell type-specific proportions per location
norm_prop = read.csv('/path/to/file.csv')
# subset norm_prop to only the spots present in RCTD object
norm_prop <- norm_prop[rownames(RCTD_obj@RCTD.reps[[sample_id]]@results$weights),]
# update RCTD_obj@RCTD.reps[[sample_id]]@results$weights with normalised cell type proportions
RCTD_obj@RCTD.reps[[sample_id]] <- spacexr::import_weights(RCTD_obj@RCTD.reps[[sample_id]], norm_prop)
}
# save to output file
saveRDS(RCTD_obj, '/path/to/output/file.rds')
HI,
I am interested in applying C-SIDE to a dataset where I did the celltype deconvolution without a reference scRNA-seq dataset due to a lack of a good reference. From my reading of the method this should be possible as C-SIDE only requires the cell type proportions per spot, right? However doing this actually with the software has felt a bit hacky and I am not sure this is correct, specifically regarding the following points :
Thanks!