Skip to content

Commit

Permalink
Attempt to fix #252
Browse files Browse the repository at this point in the history
  • Loading branch information
sjfleming committed Aug 25, 2023
1 parent e8334d9 commit 1919571
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cellbender/remove_background/posterior.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def _get_cell_noise_count_posterior_coo(
# Put the counts into a sparse csr_matrix.
self._noise_count_posterior_coo = sp.coo_matrix(
(log_probs, (m, c)),
shape=[np.prod(self.count_matrix_shape), n_counts_max],
shape=[np.prod(self.count_matrix_shape, dtype=np.uint64), n_counts_max],
)
noise_offset_dict = dict(zip(m, noise_count_offsets))
nonzero_noise_offset_dict = {k: v for k, v in noise_offset_dict.items() if (v > 0)}
Expand Down Expand Up @@ -1527,7 +1527,7 @@ def get_m_indices(self, cell_inds: np.ndarray, gene_inds: np.ndarray) -> np.ndar
if not ((gene_inds >= 0) & (gene_inds < self.total_n_genes)).all():
raise ValueError(f'Requested gene_inds out of range: '
f'{gene_inds[(gene_inds < 0) | (gene_inds >= self.total_n_genes)]}')
return cell_inds * self.total_n_genes + gene_inds
return cell_inds.astype(np.uint64) * self.total_n_genes + gene_inds.astype(np.uint64)

def get_ng_indices(self, m_inds: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
"""Given a list of 'm' index values, return two arrays: cell index values
Expand Down

0 comments on commit 1919571

Please sign in to comment.