Closed mistrm82 closed 3 years ago
Generally, I run through the dataset without splitting it to see whether I need to integrate. So if I don't need to integrate, I wouldn't split the object. Therefore, we go through first with the whole dataset, and if we integrate, it would inform whether we regress cell cycle out upon integration.
I am not sure whether we can do cell cycle scoring on the full dataset then split for SCTransform. I imagine that I did not think this was possible before, but we should test it out and see.
Yes, we can do this. In the materials we use seurat_phase
to evaluate cell cycle effects. But when we split the object we use filtered_seurat
.
I used seurat_phase
and it works out fine, we still have all the required metadata and we are not running uneccessary code.
`split_seurat <- SplitObject(seurat_phase, split.by = "sample") split_seurat <- split_seurat[c("ctrl", "stim")]
options(future.globals.maxSize = 4000 * 1024^2)
for (i in 1:length(split_seurat)) { split_seurat[[i]] <- SCTransform(split_seurat[[i]], vars.to.regress = c("mitoRatio")) } `
We don't even really need the for loop, but we could keep it to show them that this would be useful for datasets with larger number of samples.
Updated code
A couple of issues with the SCT lesson.
First, we use the full dataset (merged object with both samples) to check for cellcycle effects. After evaluation, we then decide that we do not need to regress it out. We then perform SCT on the full dataset. Was this all done just for example purposes?
Because next we split the samples into separate objects and run the for loop:
vars.to.regress
should be evaluated for each individual case and then run