diff --git a/HISTORY.rst b/HISTORY.rst index 9f82378..0885519 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,12 @@ History ======= +------ +v0.8.6 +------ + +- bug fixes for cell filtering + ------ v0.8.5 ------ diff --git a/requirements/notesting.txt b/requirements/notesting.txt index 5287986..5bc72e4 100644 --- a/requirements/notesting.txt +++ b/requirements/notesting.txt @@ -1,7 +1,7 @@ # Base requirements # botocore and pyOpenSSL to avoid incompatibility errors -botocore +botocore==1.20.106 pyOpenSSL # Dash and friends. @@ -38,8 +38,9 @@ requests htmllistparse # TODO: we need an fs[._]irods # Access to files through iRODS. -python-irodsclient +python-irodsclient >= 1.0.0 # Documentation sphinx sphinx-rtd-theme +docutils < 0.17 diff --git a/scelvis/callbacks.py b/scelvis/callbacks.py index 9ba49a3..b83c9a6 100644 --- a/scelvis/callbacks.py +++ b/scelvis/callbacks.py @@ -13,6 +13,7 @@ import dash_html_components as html from dash.dependencies import Input, Output, State import pandas as pd +import numpy as np from logzero import logger from werkzeug.utils import secure_filename @@ -606,6 +607,7 @@ def update_filter_cells_controls( + hidden_rangeslider ) + attribute = None if ctx.triggered and "meta" in ctx.triggered[0]["prop_id"]: token = "meta" attribute = meta_attribute @@ -661,8 +663,12 @@ def update_filter_cells_controls( + hidden_rangeslider ) else: - range_min = values.dropna().min() - range_max = values.dropna().max() + if np.any(np.isnan(values)): + range_min = values.dropna().min() + range_max = values.dropna().max() + else: + range_min = values.min() + range_max = values.max() if attribute in filters: val_min = filters[attribute][0] val_max = filters[attribute][1] diff --git a/scelvis/convert.py b/scelvis/convert.py index f8a55bd..656e315 100644 --- a/scelvis/convert.py +++ b/scelvis/convert.py @@ -320,15 +320,11 @@ def _load_expression(self, coords, annotation, markers): "cannot find expression data at %s or %s" % (expression_tsv, expression_mtx) ) logger.info("Combining data") - ad = sc.AnnData( - X=X, - obs=annotation.loc[cells], - var=pd.DataFrame([], index=genes), - ) - coords_types = set([re.sub('[-_][0-9]*$','',c).upper() for c in coords.columns]) + ad = sc.AnnData(X=X, obs=annotation.loc[cells], var=pd.DataFrame([], index=genes)) + coords_types = set([re.sub("[-_][0-9]*$", "", c).upper() for c in coords.columns]) for ct in coords_types: ct_cols = [c for c in coords.columns if ct in c.upper()] - ad.obsm['X_'+ct] = coords.loc[cells, ct_cols].values + ad.obsm["X_" + ct] = coords.loc[cells, ct_cols].values for col in markers.columns: ad.uns["marker_" + col] = markers[col].values diff --git a/scelvis/ui/common.py b/scelvis/ui/common.py index 43d0740..8436fbc 100644 --- a/scelvis/ui/common.py +++ b/scelvis/ui/common.py @@ -198,10 +198,13 @@ def auto_tick(data_range, max_tick=10, tf_inside=False): tick_size_nmlz = list_tick_size_nmlz[i - 1] break tick_size = tick_size_nmlz * scale # tick sizse for the original data - ticks = ( - np.unique(np.arange(data_range[0] / tick_size, data_range[1] / tick_size).round()) - * tick_size - ) # list of ticks + if tick_size > 0: + ticks = ( + np.unique(np.arange(data_range[0] / tick_size, data_range[1] / tick_size).round()) + * tick_size + ) # list of ticks + else: + ticks = data_range[0].round() if tf_inside: # if only allow ticks within the given range ticks = ticks[(ticks >= data_range[0]) * (ticks <= data_range[1])]