Skip to content

Commit

Permalink
enforce column vector in consolidate
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-kuo committed Sep 12, 2024
1 parent f20818d commit 1c46f1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/scimilarity/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ def consolidate_duplicate_symbols(
dup_genes_data = []
for k in dup_genes:
idx = [i for i, x in enumerate(adata.var.index.values) if x == k]
counts = csr_matrix(adata.layers["counts"][:, idx].sum(axis=1))
counts = csr_matrix(
np.array(adata.layers["counts"][:, idx].sum(axis=1)).flatten()[:, None]
)
gene_data = anndata.AnnData(
X=csr_matrix(counts.shape),
var=pd.DataFrame(index=[k]),
Expand Down

0 comments on commit 1c46f1e

Please sign in to comment.