scvi-tools icon indicating copy to clipboard operation
scvi-tools copied to clipboard

Allow SCANVI to operate in purely unsupervised setting

Open aribenjamin opened this issue 1 year ago • 0 comments

I'd like to be able to use SCANVI for clustering – i.e. to learn this generative model in a purely unsupervised setting in which I do not yet have any cell type labels.

I believe this would be a rather straightforward application of the model. I don't believe any changes need to be made except that the user would need to manually set the number of discrete categories.

Currently, n_labels is currently set automatically from the AnnDataManager registered to the class:

        n_labels = self.summary_stats.n_labels - 1

(at https://github.com/scverse/scvi-tools/blob/cb17e10b2a82dc95c0c8c261e1aef7781c3b0df9/scvi/model/_scanvi.py#LL119C49-L119C50)

To allow n_labels to be set to some other value, I propose allowing a new optional argument to SCANVI that allows this manual setting, complete with a check that this is greater or equal to self.summary_stats.n_labels - 1.

Apart from this change, would anything else be required by the user in practice?

aribenjamin avatar May 10 '23 18:05 aribenjamin