diff --git a/README.md b/README.md index eb31b380c..9857cb6eb 100755 --- a/README.md +++ b/README.md @@ -37,22 +37,22 @@ Single-cell (sc)RNA-seq, together with RNA velocity and metabolic labeling, reve * Overcome intrinsic limitation of the conventional splicing based RNA velocity analyses * Explicitly model RNA metabolic labeling, in conjunction with RNA bursting, transcription, splicing and degradation * Comprehensive RNA kinetic rate estimation for one-shot, pulse, chase and mixture metabolic labeling experiments -* Move beyond RNA velocity to continuous vector field function for gaining mechannistic insights of cell fate transitions: +* Move beyond RNA velocity to continuous vector field function for gaining mechanistic insights into cell fate transitions: * Dynamical systems approaches to identify stable cell types (fixed points), boundaries of cell states (separatrices), etc * Calculate RNA acceleration (reveals early drivers), curvature (reveals master regulators of fate decision points), divergence (stability of cell states) and RNA Jacobian (cell-state dependent regulatory networks) * Various downstream differential geometry analyses to rank critical regulators/effectors, and visualize regulatory networks at key fate decision points * Non-trivial vector field predictions of cell fate transitions: - * Least action path approach to predict the optimal paths and transcription factors of cell fate reprogrammings + * Least action path approach to predict the optimal paths and transcription factors of cell fate reprogramming * In silico perturbation to predict the gene-wise perturbation effects and cell fate diversion after genetic perturbations ## News * 5/30/2023: dynamo 1.3.0 released! -* 3/1/2023: We welcome @Sichao25 to join the dynamo develop team! -* 1/28/2023: We welcome @Ukyeon to join the dynamo develop team! +* 3/1/2023: We welcome @Sichao25 to join the dynamo development team! +* 1/28/2023: We welcome @Ukyeon to join the dynamo development team! * 15/12/2022: *Thanks for @elfofmaxwell and @MukundhMurthy's contribution*. dynamo 1.2.0 released * 11/11/2022: the continuing development of dynamo and the Aristotle ecosystem will be supported by CZI. See [here](https://chanzuckerberg.com/eoss/proposals/predictive-modeling-of-single-cell-multiomics-over-time-and-space/) * 4/14/2022: dynamo 1.1.0 released! -* 3/14/2022: Since today dynamo has its own logo! Here the arrow represents the RNA velocity vector field, while the helix the RNA molecule and the colored dots RNA metabolic labels (4sU labeling). See [readthedocs](https://dynamo-release.readthedocs.io/en/latest/index.html) +* 3/14/2022: Since today dynamo has its own logo! Here the arrow represents the RNA velocity vector field, while the helix is the RNA molecule and the colored dots are RNA metabolic labels (4sU labeling). See [readthedocs](https://dynamo-release.readthedocs.io/en/latest/index.html) * 2/15/2022: primers and tutorials on least action paths and in silico perturbation are released. * 2/1/2022: after 3.5+ years of perseverance, our dynamo paper is finally online in [Cell](https://www.sciencedirect.com/science/article/pii/S0092867421015774#tbl1) today! diff --git a/dynamo/plot/networks.py b/dynamo/plot/networks.py index 5e53ff68c..e96bfc57a 100644 --- a/dynamo/plot/networks.py +++ b/dynamo/plot/networks.py @@ -5,6 +5,7 @@ except ImportError: from typing_extensions import Literal +import matplotlib.pyplot as plt import networkx as nx import numpy as np import pandas as pd @@ -363,6 +364,7 @@ def circosPlot( the Matplotlib Axes on which the Circos plot is drawn. """ try: + import matplotlib import nxviz as nv from nxviz import annotate except ImportError: @@ -382,12 +384,16 @@ def circosPlot( annotate.circos_labels(network, group_by=node_label_key, layout=circos_label_layout) if node_color_key and show_colorbar: - annotate.node_colormapping( - network, - color_by=node_color_key, - legend_kwargs={"loc": "upper right", "bbox_to_anchor": (0.0, 1.0)}, - ax=None, + nt = nv.utils.node_table(network) + data = nt[node_color_key] + cmap, data_family = nv.encodings.data_cmap(data) + norm = matplotlib.colors.Normalize(vmin=data.min(), vmax=data.max()) + scalarmap = matplotlib.cm.ScalarMappable( + cmap=cmap, + norm=norm, ) + fig = plt.gcf() + fig.colorbar(scalarmap, ax=ax) return ax diff --git a/dynamo/plot/utils.py b/dynamo/plot/utils.py index 0f098c597..f505e14d7 100755 --- a/dynamo/plot/utils.py +++ b/dynamo/plot/utils.py @@ -321,17 +321,17 @@ def _to_hex(arr): """ -@numba.vectorize(["uint8(uint32)", "uint8(uint32)"]) +@numba.vectorize(["uint8(uint32)"]) def _red(x): return (x & 0xFF0000) >> 16 -@numba.vectorize(["uint8(uint32)", "uint8(uint32)"]) +@numba.vectorize(["uint8(uint32)"]) def _green(x): return (x & 0x00FF00) >> 8 -@numba.vectorize(["uint8(uint32)", "uint8(uint32)"]) +@numba.vectorize(["uint8(uint32)"]) def _blue(x): return x & 0x0000FF diff --git a/dynamo/preprocessing/__init__.py b/dynamo/preprocessing/__init__.py index 35935bedb..a309d76da 100755 --- a/dynamo/preprocessing/__init__.py +++ b/dynamo/preprocessing/__init__.py @@ -30,6 +30,7 @@ ) from .transform import log1p, log1p_adata_layer from .utils import ( + calc_new_to_total_ratio, compute_gene_exp_fraction, convert2symbol, decode, @@ -54,6 +55,7 @@ __all__ = [ "calc_sz_factor", + "calc_new_to_total_ratio", "filter_cells", "filter_genes", "normalize_cells",