I have a question about the code snippet at the bottom of this script (under “don’t extend labels for query data”)
When mapping a query dataset to a reference using scANVI, why is the query data not allowed to have cell type labels that don’t occur in the reference?
The query data are allowed to have new cell type labels in general, but as far as how scANVI transfer learning works, the classifier is not extended to handle new labels by design. As a result, the architecture cannot handle new labels. Therefore, the labels that scANVI sees at query time should either be unknown or a previous label.