Hi all,
I have a CITE-seq dataset from 5 different donor that I’m trying to integrate using muon and totalVI. I started by concatenating the ADT and RNA data for each donor separately using the concatenate function in scanpy. After that i created a muon object using mu.MuData({“rna”: RNAdata, “protein”: Protdata}).
When I start the training of my model I directly get the following error message:
" INFO Computing empirical prior initialization for protein background.
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[208], line 1 ----> 1 vae = scvi.model.TOTALVI(posdata1) File ~/anaconda3/envs/Scanpy2/lib/python3.11/site-packages/scvi/model/_totalvi.py:142, in TOTALVI.init(self, adata, n_latent, gene_dispersion, protein_dispersion, gene_likelihood, latent_distribution, empirical_protein_background_prior, override_missing_proteins, **model_kwargs) 136 emp_prior = ( 137 empirical_protein_background_prior 138 if empirical_protein_background_prior is not None 139 else (self.summary_stats.n_proteins > 10) 140 ) 141 if emp_prior: → 142 prior_mean, prior_scale = self._get_totalvi_protein_priors(adata) 143 else: 144 prior_mean, prior_scale = None, None File ~/anaconda3/envs/Scanpy2/lib/python3.11/site-packages/scvi/model/_totalvi.py:1163, in TOTALVI._get_totalvi_protein_priors(self, adata, n_cells) 1161 for c in batch_pro_exp: 1162 try: → 1163 gmm.fit(np.log1p(c.reshape(-1, 1))) 1164 # when cell is all 0 1165 except ConvergenceWarning: File ~/anaconda3/envs/Scanpy2/lib/python3.11/site-packages/sklearn/mixture/_base.py:181, in BaseMixture.fit(self, X, y) 155 “”"Estimate model parameters with the EM algorithm.
…
538 ) 539 elif isinstance(accept_sparse, (list, tuple)): 540 if len(accept_sparse) == 0: TypeError: A sparse matrix was passed, but dense data is required. Use X.toarray() to convert to a dense numpy array."
Can any of you make any sense of this? I’ve tried converting my matrixes to dense but i still get the same error message.
Very thankful for any response