Open ktrns opened 6 months ago
After module 4 (dimensionality reduction), AP wants:
This is already done. BUT for FindMarkers we need to correct the counts:
Seurat::PrepSCTFindMarkers
corrects the counts:We decide to leave this function before RunPrestoAll
, but document it better in the code.
I added the following line to the code in commit 3d4f34f85c3273a72f0a2743ac1013e415819271:
# Prepare SCT for marker detection
if (grepl(pattern="_SCT$", x=default_assay, perl=TRUE)) sc = Seurat::PrepSCTFindMarkers(object=sc, assay=default_assay)
to run the function in case SCT was used.
I will add some more documentation in a next commit and then close the issue.
I found this discussion here https://github.com/satijalab/seurat/issues/6675 which suggests that we move PrepSCTFindMarkers
to the integration or the normalization module.
Basically they say that the results of sctransform are only valid if all datasets have the same sequencing depth. If not then, this needs to be corrected and this is done in PrepSCTFindMarkers
.
Now why only at this step? I checked the source code of Seurat::RunPCA
and indeed you can find something like this:
if (verbose) {
message(paste0("Found ", length(x = levels(x = object[[assay]])),
" SCT models.", " Recorrecting SCT counts using minimum median counts: ",
min_median_umi))
}
So sometimes they do the correction in the functions that use SCTransform results.
My suggestion would be to add to the end of the integration module because I assume that some of the integration functions still work on the different datasets.
Agree?
Suggestion KS: try once directly after SCTransform
and once at the end of the module - do the results differ?
This additional function is necessary if SCTransform was used, otherwise we won't find any markers. We need to read a bit more on this. For now, I added the following code, just above
RunPrestoAll
:@andpet0101 will implement this into the module
dimensionality_reduction
.