mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-16 13:27:59 +08:00
* Specialize diffexp for tiledb This patch adds a new diffexp algorithm which is tuned for tiledb. This algorithm was written by Bruce and is adapted here to plug into the current framework. The anndata_adaptor still calls the original algotithm (which was move from diffexp.py to diffexp_generic.py). The cxg_adaptor now calls the new diffexp_tiledb version. Some code is shared between the two. This is part 1 of the diffexp for tiledb. Further tuning and global throttles are still needed. A script to run and time diffexp with various options is also added: test/run_diffexp.py.
31 lines
639 B
Python
31 lines
639 B
Python
from enum import Enum
|
|
|
|
|
|
class AugmentedEnum(Enum):
|
|
def __hash__(self):
|
|
return self.value.__hash__()
|
|
|
|
def __eq__(self, other):
|
|
if isinstance(other, type(self)) or isinstance(other, str):
|
|
return self.value == other
|
|
return False
|
|
|
|
def __str__(self) -> str:
|
|
return self.value
|
|
|
|
|
|
class Axis(AugmentedEnum):
|
|
OBS = "obs"
|
|
VAR = "var"
|
|
|
|
|
|
class DiffExpMode(AugmentedEnum):
|
|
TOP_N = "topN"
|
|
VAR_FILTER = "varFilter"
|
|
|
|
|
|
JSON_NaN_to_num_warning_msg = "JSON encoding failure - please verify all data are finite values (no NaN or Infinities)"
|
|
REACTIVE_LIMIT = 1_000_000
|
|
|
|
MAX_LAYOUTS = 30
|