Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doubletdetection/doubletdetection.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def __init__(
self.standard_scaling = standard_scaling
self.n_jobs = n_jobs
self.pseudocount = pseudocount
self.rng = np.random.default_rng(self.random_state)

if self.clustering_algorithm not in ["louvain", "phenograph", "leiden"]:
raise ValueError(
Expand Down Expand Up @@ -148,7 +149,7 @@ def fit(self, raw_counts: NDArray | sp_sparse.csr_matrix) -> "BoostClassifier":
raw_counts = check_array(
raw_counts,
accept_sparse="csr",
force_all_finite=True,
ensure_all_finite=True,
ensure_2d=True,
dtype="float32",
)
Expand Down Expand Up @@ -390,8 +391,7 @@ def _createDoublets(self) -> None:
num_synths = int(self.boost_rate * self._num_cells)

# Parent indices
rng = np.random.default_rng(self.random_state)
choices = rng.choice(self._num_cells, size=(num_synths, 2), replace=self.replace)
choices = self.rng.choice(self._num_cells, size=(num_synths, 2), replace=self.replace)
parents = [list(p) for p in choices]

parent0 = self._raw_counts[choices[:, 0], :]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "doubletdetection"
version = "4.3"
version = "4.3.0.post1"
description = "Method to detect and enable removal of doublets from single-cell RNA-sequencing."
readme = "README.md"
requires-python = ">=3.10"
Expand Down