From 6652c0749521e102c518d26aad967919a8cc67d7 Mon Sep 17 00:00:00 2001 From: Charlotte Weaver Date: Fri, 6 Jul 2018 10:26:33 -0700 Subject: [PATCH 1/2] Remove cell ids from engine Previously I just removed them from the driver --- server/app/scanpy_engine/scanpy_engine.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/server/app/scanpy_engine/scanpy_engine.py b/server/app/scanpy_engine/scanpy_engine.py index c5e682b9..b429f5f5 100644 --- a/server/app/scanpy_engine/scanpy_engine.py +++ b/server/app/scanpy_engine/scanpy_engine.py @@ -32,20 +32,9 @@ class ScanpyEngine(CXGDriver): data_schema = parse_schema(os.path.join(data, schema)) return data_schema - def _set_cell_ids(self): - self.data.obs["cxg_cell_id"] = list(range(self.data.obs.shape[0])) - self.data.obs["cell_name"] = list(self.data.obs.index) - self.data.obs.set_index("cxg_cell_id", inplace=True) - def cells(self): return list(self.data.obs.index) - def cellids(self, df=None): - if df: - return list(df.obs.index) - else: - return list(self.data.obs.index) - def genes(self): return self.data.var.index.tolist() From cf12acd47cf323ca6e7f74557a4f54dd72080b23 Mon Sep 17 00:00:00 2001 From: Charlotte Weaver Date: Fri, 6 Jul 2018 10:26:46 -0700 Subject: [PATCH 2/2] Added documentation to filter --- server/app/util/filter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/app/util/filter.py b/server/app/util/filter.py index 52da7def..51b7f8c5 100644 --- a/server/app/util/filter.py +++ b/server/app/util/filter.py @@ -25,7 +25,14 @@ def _convert_variable(datatype, variable): def parse_filter(filter, schema): """ + The filter comes in as arguments from a GET/POST request + For categorical metadata keys filter based on key=value + For continuous metadata keys filter by key=min,max + Either value can be replaced by a * To have only a minimum value key=min, To have only a maximum value key=*,max + They combine via AND so a cell's metadata would have to match every filter + + The results is a matrix with the cells the pass the filter and at this point all the genes :param filter: flask's request.args :param schema: dictionary schema :return: