Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
gscalia committed Jan 13, 2021
2 parents 9ee3fc4 + a281e84 commit 3faa359
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tangram/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def project_genes(adata_map, adata_sc):
"""
if adata_map.obs.index.equals(adata_sc.obs.index) is False:
raise ValueError('The two AnnDatas need to have same `obs` index.')
X_space = adata_map.X.T @ adata_sc.X.toarray()
if hasattr(adata_sc.X, 'toarray'):
adata_sc.X = adata_sc.X.toarray()
X_space = adata_map.X.T @ adata_sc.X
adata_ge = sc.AnnData(X=X_space, obs=adata_map.var, var=adata_sc.var)
training_genes = adata_map.uns['train_genes_df'].index.values
adata_ge.var['is_training'] = adata_ge.var.index.isin(training_genes)
Expand Down

0 comments on commit 3faa359

Please sign in to comment.