hms-dbmi-cellenics / issues

This repository is used to report and track issues
1 stars 0 forks source link

add automated cluster detection for Seurat object uploads #9

Closed alexvpickering closed 10 months ago

alexvpickering commented 11 months ago

Background

Currently Seurat object upload uses scdata$seurat_clusters as the louvain clusters. It is common to have multiple clusterings of a dataset (e.g. from different resolutions, grouping multiple clusters into a single cluster, etc). These additional clusterings of a Seurat object are not currently available to the user without manually overwriting seurat_clusters and uploading as a separate project. The goal of this ticket is to automatically detect these clusterings and make them available to the user.

Approach

Discover cluster columns by exclusion (may need to adjust):

gerbeldo commented 11 months ago

There's an issue with seurat objects downloaded from Cellenics, using the "download rds" button in the Data Management module.

Louvain slot was duplicated, and the values taken as louvain were actually the doublet predictions.

These objects use the cellset key to add the clustering information, which for clusters is "louvain".

In the dataset in question, "louvain" was not the first column in the metadata table, which duplicates the name.

Original:

Image

Re-uploaded:

Image

gerbeldo commented 11 months ago

I tested two other datasets, with and without sample level metadata, but the issue does not reproduce, so it might be a particularly bad dataset.

alexvpickering commented 11 months ago

Thanks for the report @gerbeldo! It should be fixed now. The issue was the following:

There is now an explicit check to make sure that the louvain key isn't used if there is a column with the same name