Skip to content

Commit 21d6b18

Browse files
committed
Merge branch 'dev' for 0.11.1
2 parents 79b97ed + 1acff24 commit 21d6b18

File tree

7 files changed

+20
-14
lines changed

7 files changed

+20
-14
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN pip install --no-cache-dir --upgrade pip wheel && \
2121
# use version from argument (--build-arg version=0.11.0), or a default:
2222
ARG version="0.11.0"
2323
RUN pip install --no-cache-dir pyscenic==$version && \
24-
pip install --no-cache-dir scanpy==1.7.0
24+
pip install --no-cache-dir scanpy==1.7.2
2525

2626

2727
FROM python:3.7.9-slim AS build-image
@@ -42,3 +42,5 @@ COPY --from=compile-image /opt/venv /opt/venv
4242
# Make sure we use the virtualenv:
4343
ENV PATH="/opt/venv/bin:$PATH"
4444

45+
EXPOSE 8787
46+

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ in no time. The latter is achieved via the dask_ framework for distributed compu
1818
News and releases
1919
-----------------
2020

21+
0.11.1 | 2021-02-11
22+
^^^^^^^^^^^^^^^^^^^
23+
24+
* Fix bug in motif url construction (#275)
25+
* Fix for export2loom with sparse dataframe (#278)
26+
* Fix sklearn t-SNE import (#285)
27+
* Updates to Docker image (expose port 8787 for Dask dashboard)
28+
2129
0.11.0 | 2021-02-10
2230
^^^^^^^^^^^^^^^^^^^
2331

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ scipy
2323
fsspec
2424
requests
2525
aiohttp
26+
scikit-learn>=0.22.2

requirements_docker.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
adjustText==0.7.3
2-
aiohttp==3.7.3
2+
aiohttp==3.7.4
33
anndata==0.7.5
44
ansiwrap==0.8.4
55
appdirs==1.4.4
@@ -81,7 +81,7 @@ pathspec==0.8.1
8181
patsy==0.5.1
8282
pexpect==4.8.0
8383
pickleshare==0.7.5
84-
Pillow==8.1.0
84+
Pillow==8.1.1
8585
prompt-toolkit==3.0.15
8686
psutil==5.8.0
8787
ptyprocess==0.7.0
@@ -122,7 +122,7 @@ traitlets==5.0.5
122122
typed-ast==1.4.2
123123
typing-extensions==3.7.4.3
124124
umap-learn==0.5.1
125-
urllib3==1.26.3
125+
urllib3==1.26.4
126126
wcwidth==0.2.5
127127
webencodings==0.5.1
128128
yarl==1.6.3

src/pyscenic/aucell.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ def derive_auc_threshold(ex_mtx: pd.DataFrame) -> pd.DataFrame:
6060
that when using this value as the AUC threshold for 99% of the cells all ranked genes used for AUC calculation will
6161
have had a detected expression in the single-cell experiment.
6262
"""
63-
binary_mtx = ex_mtx.copy()
64-
binary_mtx[binary_mtx != 0] = 1.0
65-
n_genes = len(binary_mtx.columns)
66-
return binary_mtx.sum(axis=1).quantile([.01, .05, .10, .50, 1])/n_genes
63+
return pd.Series(np.count_nonzero(ex_mtx, axis=1)).quantile([.01, .05, .10, .50, 1])/ex_mtx.shape[1]
6764

6865

6966
enrichment = enrichment4cells

src/pyscenic/export.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy as np
55
import pandas as pd
66
import loompy as lp
7-
from sklearn.manifold.t_sne import TSNE
7+
from sklearn.manifold import TSNE
88
from .aucell import aucell
99
from .genesig import Regulon
1010
from typing import List, Mapping, Union, Sequence, Optional
@@ -95,9 +95,7 @@ def export2loom(ex_mtx: pd.DataFrame, regulons: List[Regulon], out_fname: str,
9595
embeddings_Y = pd.merge(embeddings_Y, embedding['_Y'].to_frame().rename(columns={'_Y': str(embedding_id)}), left_index=True, right_index=True)
9696

9797
# Calculate the number of genes per cell.
98-
binary_mtx = ex_mtx.copy()
99-
binary_mtx[binary_mtx != 0] = 1.0
100-
ngenes = binary_mtx.sum(axis=1).astype(int)
98+
ngenes = np.count_nonzero(ex_mtx, axis=1)
10199

102100
# Encode genes in regulons as "binary" membership matrix.
103101
genes = np.array(ex_mtx.columns)
@@ -127,7 +125,7 @@ def create_structure_array(df):
127125
default_embedding.columns=['_X', '_Y']
128126
column_attrs = {
129127
"CellID": ex_mtx.index.values.astype('str'),
130-
"nGene": ngenes.values,
128+
"nGene": ngenes,
131129
"Embedding": create_structure_array(default_embedding),
132130
"RegulonsAUC": create_structure_array(auc_mtx),
133131
"Clusterings": create_structure_array(clusterings),

src/pyscenic/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def add_motif_url(df: pd.DataFrame, base_url: str):
323323
:param base_url:
324324
:return:
325325
"""
326-
df[("Enrichment", COLUMN_NAME_MOTIF_URL)] = list(map(partial(urljoin, base=base_url), df.index.get_level_values(COLUMN_NAME_MOTIF_ID)))
326+
df[("Enrichment", COLUMN_NAME_MOTIF_URL)] = list(map(partial(urljoin, base_url), df.index.get_level_values(COLUMN_NAME_MOTIF_ID)))
327327
return df
328328

329329

0 commit comments

Comments
 (0)