cc-mapping 0.2.3__tar.gz → 0.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/PKG-INFO +1 -1
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/pyproject.toml +1 -1
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/thresholding/sequential.py +25 -15
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/LICENSE +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/README.md +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/__init__.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/core.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/feature_selection/__init__.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/feature_selection/_base.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/feature_selection/_persistence.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/feature_selection/_plotting.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/feature_selection/_preprocessing.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/feature_selection/_random_forest.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/feature_selection/_training.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/manifold.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/plot.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/preprocess.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/pseudotime.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/thresholding/__init__.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/thresholding/base.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/thresholding/single.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/utils.py +0 -0
- {cc_mapping-0.2.3 → cc_mapping-0.2.5}/src/cc_mapping/utils_v0.py +0 -0
|
@@ -418,15 +418,26 @@ class SequentialGMM(GaussianMixtureModelBase):
|
|
|
418
418
|
**gmm_kwargs
|
|
419
419
|
)
|
|
420
420
|
gmm.fit(subset_data.reshape(-1, 1))
|
|
421
|
-
|
|
421
|
+
|
|
422
|
+
# Sort GMM components by mean (low -> high) so column index matches the
|
|
423
|
+
# caller's ordered_labels convention (e.g. ['G1','S','G2'] = ascending
|
|
424
|
+
# DNA content). sklearn does NOT order components by mean, so without
|
|
425
|
+
# this sort, argmax(predict_proba) returns raw component indices that
|
|
426
|
+
# don't line up with the user-provided label order.
|
|
427
|
+
sort_order = np.argsort(gmm.means_.flatten())
|
|
428
|
+
sorted_means = gmm.means_.flatten()[sort_order]
|
|
429
|
+
sorted_covs = gmm.covariances_.flatten()[sort_order]
|
|
430
|
+
sorted_weights = gmm.weights_[sort_order]
|
|
431
|
+
sorted_data_probs = gmm.predict_proba(subset_data.reshape(-1, 1))[:, sort_order]
|
|
432
|
+
|
|
422
433
|
# Extract GMM info
|
|
423
434
|
gmm_info = _GaussianMixtureModelInfo(
|
|
424
435
|
gmm_kwargs=gmm_kwargs,
|
|
425
|
-
means=
|
|
426
|
-
covs=
|
|
427
|
-
weights=
|
|
436
|
+
means=sorted_means,
|
|
437
|
+
covs=sorted_covs,
|
|
438
|
+
weights=sorted_weights,
|
|
428
439
|
n_components=n_components,
|
|
429
|
-
data_probs=
|
|
440
|
+
data_probs=sorted_data_probs,
|
|
430
441
|
)
|
|
431
442
|
|
|
432
443
|
# Handle duplicate labels if needed.
|
|
@@ -1244,18 +1255,17 @@ class SequentialGMM(GaussianMixtureModelBase):
|
|
|
1244
1255
|
)
|
|
1245
1256
|
|
|
1246
1257
|
# Filter adata to only include cells with labels from this operation
|
|
1247
|
-
#
|
|
1248
|
-
#
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1258
|
+
# (or any of its descendants). Initial-threshold operations also need
|
|
1259
|
+
# the descendant lookup: by the time we plot, subsequent refinement
|
|
1260
|
+
# stages may have replaced this op's labels with finer-grained ones,
|
|
1261
|
+
# leaving zero cells under the original label strings.
|
|
1262
|
+
# _get_descendant_labels gracefully handles the no-descendants case
|
|
1263
|
+
# by returning the input labels unchanged.
|
|
1264
|
+
labels_to_plot = self._get_descendant_labels(operation_name, ordered_labels)
|
|
1265
|
+
|
|
1256
1266
|
mask = self.adata.obs[obs_label].isin(labels_to_plot)
|
|
1257
1267
|
adata_subset = self.adata[mask, :]
|
|
1258
|
-
|
|
1268
|
+
|
|
1259
1269
|
# Call base class plotting method with explicit parameters
|
|
1260
1270
|
ax = super()._plot_hist_base(
|
|
1261
1271
|
adata=adata_subset,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|