diff --git a/scelvis/callbacks.py b/scelvis/callbacks.py index 4b38993..9ba49a3 100644 --- a/scelvis/callbacks.py +++ b/scelvis/callbacks.py @@ -661,8 +661,8 @@ def update_filter_cells_controls( + hidden_rangeslider ) else: - range_min = values.min() - range_max = values.max() + range_min = values.dropna().min() + range_max = values.dropna().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 31fddd0..f8a55bd 100644 --- a/scelvis/convert.py +++ b/scelvis/convert.py @@ -11,6 +11,7 @@ import attr import scanpy as sc import scipy.sparse +import re import scipy.io import pandas as pd from logzero import logger @@ -321,9 +322,13 @@ def _load_expression(self, coords, annotation, markers): logger.info("Combining data") ad = sc.AnnData( X=X, - obs=pd.concat([coords.loc[cells], annotation.loc[cells]], axis=1), + 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 for col in markers.columns: ad.uns["marker_" + col] = markers[col].values diff --git a/tox.ini b/tox.ini index be50d41..f89f62d 100644 --- a/tox.ini +++ b/tox.ini @@ -8,9 +8,11 @@ passenv = CI TRAVIS* py36: CODACY_PROJECT_TOKEN + py37: CODACY_PROJECT_TOKEN deps = -r{toxinidir}/requirements/test.txt py36: -r{toxinidir}/requirements/test_black.txt + py37: -r{toxinidir}/requirements/test_black.txt commands = pip install -U pip xvfb-run pytest @@ -18,3 +20,7 @@ commands = py36: black -l 100 --check . py36: python setup.py check -r -s py36: python-codacy-coverage -r coverage.xml + py37: flake8 . + py37: black -l 100 --check . + py37: python setup.py check -r -s + py37: python-codacy-coverage -r coverage.xml