From 6a13015aee4fad73de15a76c65a239eac02daf57 Mon Sep 17 00:00:00 2001 From: Scott Gigante Date: Tue, 26 Jun 2018 21:36:53 -0400 Subject: [PATCH 1/3] bump version --- Python/phate/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/phate/version.py b/Python/phate/version.py index c49a95c..a53c312 100644 --- a/Python/phate/version.py +++ b/Python/phate/version.py @@ -1 +1 @@ -__version__ = "0.2.8" +__version__ = "0.2.9rc" From c0fbaba88bf479f5df37cb508bb6307a766b53a2 Mon Sep 17 00:00:00 2001 From: Scott Gigante Date: Tue, 26 Jun 2018 22:36:50 -0400 Subject: [PATCH 2/3] fix EB tutorial memory issue --- Python/tutorial/EmbryoidBody.ipynb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Python/tutorial/EmbryoidBody.ipynb b/Python/tutorial/EmbryoidBody.ipynb index f1aa94a..e7c6329 100644 --- a/Python/tutorial/EmbryoidBody.ipynb +++ b/Python/tutorial/EmbryoidBody.ipynb @@ -281,9 +281,12 @@ "source": [ "mito_genes = [gene_symbol.startswith('MT-') for gene_symbol in EBT_counts.columns] # Get all mitochondrial genes. There are 14, FYI.\n", "\n", - "lib_size = EBT_counts.sum(axis=1)\n", + "lib_size = EBT_counts.to_coo().tocsr().sum(axis=1)\n", "\n", - "mito_expression = np.mean(EBT_counts.loc[:,mito_genes].values / lib_size.values[:,None], axis=1)\n", + "mito_expression = (EBT_counts.loc[:,mito_genes].to_coo().tocsr().multiply(1 / lib_size)).mean(axis=1)\n", + "\n", + "mito_expression = np.array(mito_expression).flatten() # mean returns a matrix, we want an array\n", + "lib_size = np.array(lib_size).flatten()\n", "\n", "top_pct = np.percentile(mito_expression, 90) # top 10 percentile" ] @@ -386,7 +389,7 @@ "metadata": {}, "outputs": [], "source": [ - "genes_keep = np.sum(EBT_counts > 0, axis=0) > 10\n", + "genes_keep = (EBT_counts > 0).sum(axis=0) > 10\n", "EBT_counts = EBT_counts.loc[:,genes_keep]" ] }, From 39bc484a88991a08e83a85b8d9f071a6a80e6661 Mon Sep 17 00:00:00 2001 From: Scott Gigante Date: Tue, 26 Jun 2018 22:37:56 -0400 Subject: [PATCH 3/3] revert version --- Python/phate/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/phate/version.py b/Python/phate/version.py index a53c312..c49a95c 100644 --- a/Python/phate/version.py +++ b/Python/phate/version.py @@ -1 +1 @@ -__version__ = "0.2.9rc" +__version__ = "0.2.8"