Skip to content

Commit ade6360

Browse files
Fix issues remaining after rebase onto develop
1 parent 3c83036 commit ade6360

File tree

22 files changed

+10188
-11416
lines changed

22 files changed

+10188
-11416
lines changed

opt/scopeserver/bindserver/package-lock.json

Lines changed: 831 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opt/scopeserver/dataserver/modules/gserver/GServer.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,7 @@ def getNextCluster(self, request, context):
274274

275275
search_results: List[CategorisedMatches] = [
276276
result
277-
for result in get_search_results(
278-
cluster_metadata["description"], "all", loom, self.config["dataHashSecret"]
279-
)
277+
for result in get_search_results(cluster_metadata["description"], "all", loom)
280278
if result.category == f"Clustering: {clustering_meta['name']}"
281279
]
282280

@@ -329,7 +327,7 @@ def getCellMetaData(self, request, context):
329327

330328
def getFeatures(self, request, context):
331329
loom = self.lfh.get_loom(loom_file_path=Path(request.loomFilePath))
332-
features = get_search_results(request.query, request.filter, loom, self.config["dataHashSecret"])
330+
features = get_search_results(request.query, request.filter, loom)
333331
return s_pb2.FeatureReply(
334332
features=[
335333
s_pb2.FeatureReply.Feature(

opt/scopeserver/dataserver/modules/gserver/s_pb2.py

Lines changed: 52 additions & 52 deletions
Large diffs are not rendered by default.

opt/scopeserver/dataserver/utils/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
T = TypeVar("T")
1111

1212

13-
def get_99_and_100_percentiles(values: np.ndarray) -> Tuple[np.float, np.float]:
13+
def get_99_and_100_percentiles(values: np.ndarray) -> Tuple[np.ndarray, np.number]:
1414
"""
1515
Compute the 99th and 100th (maximum value) of an array of values
1616
and clamp the 99th percentil value between [0.01, max(values)]

opt/scopeserver/dataserver/utils/labels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def labels() -> Generator[FeatureLabel, None, None]:
5050
yield FeatureLabel(
5151
label=annotation,
5252
colour=colours[i],
53-
coordinate=Coordinate(x=np.mean(coords["x"]), y=np.mean(coords["y"])),
53+
coordinate=Coordinate(x=float(np.mean(coords["x"])), y=float(np.mean(coords["y"]))),
5454
)
5555

5656
return [label for label in labels()]
@@ -85,7 +85,7 @@ def labels() -> Generator[FeatureLabel, None, None]:
8585
yield FeatureLabel(
8686
label=cluster,
8787
colour=colours[i],
88-
coordinate=Coordinate(x=np.mean(coords["x"]), y=np.mean(coords["y"])),
88+
coordinate=Coordinate(x=float(np.mean(coords["x"])), y=float(np.mean(coords["y"]))),
8989
)
9090

9191
return [label for label in labels()]

opt/scopeserver/dataserver/utils/loom.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def __init__(
5555

5656
logger.info(f"New Loom object created for {file_path}")
5757
# Metrics
58-
self.nUMI = None
5958
self.species, self.gene_mappings = self.infer_species()
6059
self.ss_pickle_name = self.abs_file_path.with_suffix(".ss_pkl")
6160
self.ss = ss.load_ss(self)
@@ -758,8 +757,6 @@ def get_gene_names(self) -> Dict[str, str]:
758757
##############
759758

760759
def get_nUMI(self) -> np.ndarray:
761-
if self.nUMI is not None:
762-
return self.nUMI
763760
if self.has_ca_attr(name="nUMI"):
764761
return self.loom_connection.ca.nUMI
765762
if self.has_ca_attr(name="n_counts"):
@@ -768,10 +765,7 @@ def get_nUMI(self) -> np.ndarray:
768765
# TODO: Add case here for large files. Sum across 1mio rows takes a very long time to compute
769766
# Possibly faster fix totals = ds.map([np.sum], axis=1)[0]
770767

771-
calc_nUMI_start_time = time.time()
772-
self.nUMI = self.loom_connection.map([np.sum], axis=1)[0]
773-
logger.debug("{0:.5f} seconds elapsed (calculating nUMI) ---".format(time.time() - calc_nUMI_start_time))
774-
return self.nUMI
768+
return self.loom_connection.map([np.sum], axis=1)[0]
775769

776770
def get_gene_expression_by_gene_symbol(self, gene_symbol: str) -> np.ndarray:
777771
return self.loom_connection[self.get_genes() == gene_symbol, :][0]
@@ -834,7 +828,7 @@ def get_regulon_genes(self, regulon: str) -> np.ndarray:
834828
return self.get_genes()[self.loom_connection.ra.Regulons[regulon] == 1]
835829
except Exception as err:
836830
logger.error(err)
837-
return []
831+
return np.array([])
838832

839833
def has_regulons_AUC(self) -> bool:
840834
return self.has_legacy_regulons() or self.has_motif_regulons() or self.has_track_regulons()

0 commit comments

Comments
 (0)