mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-05 19:48:13 +08:00
fix for incorrect stats computation in diff exp t-test (#2318)
* 2211 fixes * lint * lint * add missing test and bug found by test * change terminology for count distribution * update scanpy requirement * update scanpy requirement
This commit is contained in:
@@ -8,7 +8,7 @@ import pandas as pd
|
||||
import tiledb
|
||||
from server_timing import Timing as ServerTiming
|
||||
|
||||
from backend.common.constants import Axis
|
||||
from backend.common.constants import Axis, XApproxDistribution
|
||||
from backend.common.errors import DatasetAccessError, ConfigurationError
|
||||
from backend.czi_hosted.common.immutable_kvcache import ImmutableKVCache
|
||||
from backend.common.utils.type_conversion_utils import get_schema_type_hint_from_dtype
|
||||
@@ -37,6 +37,7 @@ class CxgAdaptor(DataAdaptor):
|
||||
self.lsuri_results = ImmutableKVCache(lambda key: self._lsuri(uri=key, tiledb_ctx=self.tiledb_ctx))
|
||||
self.arrays = ImmutableKVCache(lambda key: self._open_array(uri=key, tiledb_ctx=self.tiledb_ctx))
|
||||
self.schema = None
|
||||
self.X_approx_distribution = None
|
||||
|
||||
self._validate_and_initialize()
|
||||
|
||||
@@ -175,6 +176,10 @@ class CxgAdaptor(DataAdaptor):
|
||||
if cxg_version not in ["0.0", "0.1", "0.2.0"]:
|
||||
raise DatasetAccessError(f"cxg matrix is not valid: {self.url}")
|
||||
|
||||
if self.dataset_config.X_approx_distribution == "auto":
|
||||
raise ConfigurationError("X-approx-distribution 'auto' mode unsupported.")
|
||||
self.X_approx_distribution = self.dataset_config.X_approx_distribution
|
||||
|
||||
self.title = title
|
||||
self.about = about
|
||||
self.cxg_version = cxg_version
|
||||
@@ -281,6 +286,9 @@ class CxgAdaptor(DataAdaptor):
|
||||
data = X.multi_index[obs_items, var_items][""]
|
||||
return data
|
||||
|
||||
def get_X_approx_distribution(self) -> XApproxDistribution:
|
||||
return self.X_approx_distribution
|
||||
|
||||
def get_shape(self):
|
||||
X = self.open_array("X")
|
||||
return X.shape
|
||||
|
||||
Reference in New Issue
Block a user