Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dimension reduction option #46

Closed
bjstewart1 opened this issue Jul 19, 2021 · 2 comments
Closed

Dimension reduction option #46

bjstewart1 opened this issue Jul 19, 2021 · 2 comments

Comments

@bjstewart1
Copy link

bjstewart1 commented Jul 19, 2021

Would be useful to be able to specify a dimensionality reduction in scDblFinder rather than automatically defaulting to PCA.
What if you have some other latent space calculated and want to work there?
What if you have corrected your PCA space with fastMNN or harmony and want to work there?

@plger
Copy link
Owner

plger commented Jul 19, 2021

Since the gene centers and loadings are not in the object, the input reducedDim is not available for artificial doublets, and hence it can't be used for the actual training. It is used only for the initial clustering -- unless you input the clusters, in which case it's not used at all. This means that, for this step, you can use your custom space in the following way:

sce$fastclusters <- fastcluster(sce, rdname="myReducedDimName")
sce <- scDblFinder(sce, clusters="fastclusters")

In multi-sample settings, it's anyway advisable to use global clusters and detect doublets separately (the default multiSampleMode): this is more robust to technical variation and, unless you have very few cells, the classifier wouldn't anyway gain much from the additional samples.
If you wanted to use a different space for the downstream steps (i.e. also on artificial doublets) as well, you can pass a custom function to the processing argument.

@bjstewart1
Copy link
Author

Useful thanks.
I will close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants