Skip to content

Commit 267f510

Browse files
adamgayosoJonathanShor
authored andcommitted
Fix defaults (#127)
* update docstrings to correct defaults, make standard scaling False * update notebook defaults * Clarify standard_scaling parameter usage.
1 parent d6e38c3 commit 267f510

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

doubletdetection/doubletdetection.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ class BoostClassifier:
7777
use; other genes discarded. Will use all genes when zero.
7878
replace (bool, optional): If False, a cell will be selected as a
7979
synthetic doublet's parent no more than once.
80-
use_phenograph (bool, optional): Set to True to use PhenoGraph clustering.
81-
Defaults to False, which uses louvain clustering implemented in scanpy.
80+
use_phenograph (bool, optional): Set to False to disable PhenoGraph clustering
81+
in exchange for louvain clustering implemented in scanpy. Defaults to True.
8282
phenograph_parameters (dict, optional): Parameter dict to pass directly
8383
to PhenoGraph. Note that we change the PhenoGraph 'prune' default to
8484
True; you must specifically include 'prune': False here to change
@@ -97,8 +97,9 @@ class BoostClassifier:
9797
results across runs.
9898
verbose (bool, optional): Set to False to silence all normal operation
9999
informational messages. Defaults to True.
100-
standard_scaling (bool, optional): Set to False to disable standard scaling
101-
of normalized count matrix prior to clustering. Defaults to True.
100+
standard_scaling (bool, optional): Set to True to enable standard scaling
101+
of normalized count matrix prior to PCA. Recommended when not using
102+
Phenograph. Defaults to False.
102103
103104
Attributes:
104105
all_log_p_values_ (ndarray): Hypergeometric test natural log p-value per
@@ -136,7 +137,7 @@ def __init__(
136137
normalizer=None,
137138
random_state=0,
138139
verbose=False,
139-
standard_scaling=True,
140+
standard_scaling=False,
140141
):
141142
self.boost_rate = boost_rate
142143
self.replace = replace

tests/notebooks/PBMC_8k_vignette.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"source": [
7575
"## Run Doublet Detection\n",
7676
"\n",
77-
"Here we show-off the new backend implementation that uses `scanpy`. This new implementation is over 2x faster than version 2.4.0. To use the previous version of DoubletDetection please add the parameters `use_phenograph=True`, `verbose=True` to the classifier and use the thresholds `p_thresh=1e-7`, `voter_thresh=0.8`. We recommend first using these parameters until we further validate the new implementation."
77+
"Here we show-off the new backend implementation that uses `scanpy`. This new implementation is over 2x faster than version 2.4.0. To use the previous version of DoubletDetection please add the parameters (`use_phenograph=True`, `verbose=True`, `standard_scaling=False`) to the classifier and use the thresholds `p_thresh=1e-7`, `voter_thresh=0.8`. We recommend first using these parameters until we further validate the new implementation."
7878
]
7979
},
8080
{
@@ -107,7 +107,7 @@
107107
}
108108
],
109109
"source": [
110-
"clf = doubletdetection.BoostClassifier(n_iters=50, use_phenograph=False)\n",
110+
"clf = doubletdetection.BoostClassifier(n_iters=50, use_phenograph=False, standard_scaling=True)\n",
111111
"doublets = clf.fit(raw_counts).predict(p_thresh=1e-16, voter_thresh=0.5)"
112112
]
113113
},

0 commit comments

Comments
 (0)