Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A major limitation of the current DoubletFinder version is it's limited ability to scale to larger datasets. The reason for this is that the current implementation computes the distances matrix (over the PC space) for all cells in dataset, resulting in an O(n^2) space complexity.
To improve space complexity, the distance matrix can be computed only for a subset of
batch.size
cells at a time, resulting in an O(n*k) space complexity solution. Default value ofbatch.size
isInf
so to not change default behaviour of algorithm.In addition, I found it beneficial to store for each real cell the ids of artificial nearest neighbours, as well as the real cell identities that were used to generate each artificial cell. Once DoubletFinder is executed over a dataset, this information is useful to interpret the doublet/singlet classification. Both the list of artificial nearest neighbours and the parent idents data frame are stored as a Tool record in the Seurat object.
Lastly, I also called the
LogSeuratCommand
function in order to store the parameters used to run DoubletFinder