Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for parallell runs #115

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ numcodecs
umap-learn
scikit-learn
scikit-network
scipy
scipy==1.11.0
statsmodels
seaborn
tqdm
Expand Down
13 changes: 8 additions & 5 deletions scarf/datastore/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,13 @@ def run_marker_search(
if n_threads is None:
n_threads = self.nthreads
assay = self._get_assay(from_assay)

slot_name = f"{cell_key}__{group_key}"
z = self.zw[assay.name]
if "markers" not in z:
z.create_group("markers")
group = z["markers"].create_group(slot_name, overwrite=True)

markers = find_markers_by_rank(
assay=assay,
group_key=group_key,
Expand All @@ -385,11 +392,7 @@ def run_marker_search(
n_threads=n_threads,
**norm_params,
)
z = self.zw[assay.name]
slot_name = f"{cell_key}__{group_key}"
if "markers" not in z:
z.create_group("markers")
group = z["markers"].create_group(slot_name, overwrite=True)
parashardhapola marked this conversation as resolved.
Show resolved Hide resolved

for i in markers:
g = group.create_group(i)
vals = markers[i]
Expand Down
6 changes: 5 additions & 1 deletion scarf/metadata.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Contains the MetaData class, which is used for storing metadata about cells
and features."""

import re
from typing import List, Iterable, Any, Dict, Tuple, Optional, Union
import numpy as np
Expand Down Expand Up @@ -61,7 +62,10 @@ def _get_size(self, zgrp: zarrGroup, strict_mode: bool = False) -> int:
"""
sizes = []
for i in zgrp.keys():
sizes.append(zgrp[i].shape[0])
try:
sizes.append(zgrp[i].shape[0])
except Exception:
parashardhapola marked this conversation as resolved.
Show resolved Hide resolved
pass
if len(sizes) > 0:
if len(set(sizes)) != 1:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion scarf/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def _scatter_fix_mask(v: pd.Series, mask_vals: list, mask_name: str) -> pd.Serie
def _scatter_make_colors(
v: pd.Series, cmap, color_key: Optional[dict], mask_color: str, mask_name: str
):
from matplotlib.cm import get_cmap
from matplotlib.pyplot import get_cmap

na_idx = v == mask_name
uv = v[~na_idx].unique()
Expand Down
Loading