utils.helper.plot_tSNE
- utils.helper.plot_tSNE(latent, labels, cmap=<matplotlib.colors.ListedColormap object>, perform_tsne=True)[source]
Adoptd from:
Lopez R, Regier J, Cole MB, Jordan MI, Yosef N. Deep generative modeling for single-cell transcriptomics. Nat Methods. 2018 Dec;15(12):1053-1058. doi: 10.1038/s41592-018-0229-2.
Given a latent space and class labels, the function will calculate the tSNE of the latent space and make a graph of the tSNE latent space using the classes.
Parameters
- latent_spacenumpy ndarray
The latent space matrix.
- labelsa numpy array or a list
The batch (or cluster) number of each sample in the latent space matrix.
- cmappylot instance
a colormap instance (see Matplotlib doc for more info).
- perform_tsneBoolean
If True the function will perform the tSNE. Otherwise, tSNE will not be performed on the latent space.
Returns
- latentnumpy ndarray
The latent space of the tSNE.