10 day cache (down from 1000)

I can expect a scientist to leave this running over the weekend on their laptop and still expect fast results. If someone leaves it running for a few years the data can probably be safely recalculated.
This commit is contained in:
Charlotte Weaver
2018-08-01 15:48:56 -07:00
parent 69fca7ea8b
commit 0a36fac142

View File

@@ -71,7 +71,7 @@ class ScanpyEngine(CXGDriver):
cell_idx = np.logical_and(cell_idx, key_idx)
return self.data[cell_idx, :]
@cache.memoize(86400000)
@cache.memoize(864000)
def metadata_ranges(self, df=None):
metadata_ranges = {}
if not df:
@@ -91,7 +91,7 @@ class ScanpyEngine(CXGDriver):
}
return metadata_ranges
@cache.memoize(86400000)
@cache.memoize(864000)
def metadata(self, df, fields=None):
"""
Gets metadata key:value for each cells
@@ -105,7 +105,7 @@ class ScanpyEngine(CXGDriver):
metadata[idx]["CellName"] = metadata[idx].pop("cell_name", None)
return metadata
@cache.memoize(86400000)
@cache.memoize(864000)
def create_graph(self, df):
"""
Computes a n-d layout for cells through dimensionality reduction.
@@ -117,7 +117,7 @@ class ScanpyEngine(CXGDriver):
normalized_graph = (graph - graph.min()) / (graph.max() - graph.min())
return np.hstack((df.obs["cell_name"].values.reshape(len(df.obs.index), 1), normalized_graph)).tolist()
@cache.memoize(86400000)
@cache.memoize(864000)
def diffexp(self, cell_list_1, cell_list_2, pval, num_genes):
"""
Computes the top differentially expressed genes between two clusters
@@ -164,7 +164,7 @@ class ScanpyEngine(CXGDriver):
},
}
@cache.memoize(86400000)
@cache.memoize(864000)
def expression(self, cells=None, genes=None):
"""
Retrieves expression for each gene for cells in data frame