Skip to content

Commit

Permalink
version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
falexwolf committed Mar 29, 2018
1 parent 16b4ee7 commit cf395be
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 44 deletions.
29 changes: 15 additions & 14 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ See the documentation of version 0.4.4 `here <http://scanpy.readthedocs.io/en/0.

**March 28, 2018**: version 1.0

Scanpy is much faster. A standard analysis of 130k cells now takes about `14 min
Scanpy is much faster and memory efficient. A clustering analysis of 130k cells now takes about `14 min
<https://github.com/theislab/scanpy_usage/blob/master/170522_visualizing_one_million_cells/logfile_130k.txt>`_. A
standard analysis of 1.3M cells takes about `6 h
clustering analysis of 1.3M cells takes about `6 h
<https://github.com/theislab/scanpy_usage/blob/master/170522_visualizing_one_million_cells/logfile_1.3M.txt>`_.

The API gained a preprocessing function :func:`~scanpy.api.pp.neighbors` and a
class :func:`~scanpy.api.Neighbors` to which all basic graph computations are
delegated. By that, the used data representation in pipelines is more
transparent and tools are less bloated with parameters.
delegated. By that, the used data representation in pipelines became more
transparent and tools less bloated with parameters.

.. warning::

Upgrading to 1.0 isn't fully backwards compatible.

- the graph-based tools :func:`~scanpy.api.tl.louvain`
:func:`~scanpy.api.tl.dpt` :func:`~scanpy.api.tl.draw_graph`
:func:`~scanpy.api.tl.umap` :func:`~scanpy.api.tl.diffmap`
:func:`~scanpy.api.tl.paga` now require a prior computtion of the graph::
:func:`~scanpy.api.tl.dpt` :func:`~scanpy.api.tl.draw_graph`
:func:`~scanpy.api.tl.umap` :func:`~scanpy.api.tl.diffmap`
:func:`~scanpy.api.tl.paga` now require prior computation of the graph::
sc.pp.neighbors(adata, n_neighbors=5)
sc.tl.louvain(adata)
Expand Down Expand Up @@ -57,17 +57,18 @@ transparent and tools are less bloated with parameters.
- upgrading scikit-learn from 0.18 to 0.19 changed the implementation of PCA,
some results might therefore look slightly different

Further changes are as follows
Further changes are

- UMAP [McInnes18]_ can serve as a first visualization of the data just as
tSNE. In contrast to tSNE, UMAP directly embeds the single-cell graph and is
faster.
- UMAP [McInnes18]_ can serve as a first visualization of the data just as tSNE,
in contrast to tSNE, UMAP directly embeds the single-cell graph and is faster;
UMAP is now also used for measuring connectivities and computing neighbors,
see :func:`~scanpy.api.pp.neighbors`

- graph abstraction: AGA is renamed to PAGA :func:`~scanpy.api.tl.paga`. now, it
only measures connectivities between partitions of the single-cell graph,
- graph abstraction: AGA is renamed to PAGA: :func:`~scanpy.api.tl.paga`; now,
it only measures connectivities between partitions of the single-cell graph,
pseudotime and clustering need to be computed separately via
:func:`~scanpy.api.tl.louvain` and :func:`~scanpy.api.tl.dpt`, the
connectivity measure has been improved
connectivity measure has been improved

- logistic regression for finding marker genes
:func:`~scanpy.api.tl.rank_genes_groups` with parameter `metfod='logreg'`
Expand Down
21 changes: 5 additions & 16 deletions scanpy/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
**Neighbors**
Compute a neighborhood-graph representation of the data, usually a knn-graph.
.. autosummary::
:toctree: .
Expand All @@ -59,7 +57,7 @@
tl.draw_graph
tl.diffmap
**Clustering, branching trajectories and pseudotime based on single-cell neighborhood graph**
**Clustering, branching trajectories and pseudotime based on single-cell graph**
.. autosummary::
:toctree: .
Expand Down Expand Up @@ -134,14 +132,14 @@
.. autosummary::
:toctree: .
pl.aga
pl.aga_graph
pl.aga_path
pl.louvain
pl.dpt
pl.dpt_scatter
pl.dpt_groups_pseudotime
pl.dpt_timeseries
pl.paga
pl.paga_path
pl.paga_compare
pl.rank_genes_groups
pl.rank_genes_groups_violin
Expand Down Expand Up @@ -233,9 +231,7 @@
Settings and Logging
--------------------
Global settings.
One function `settings.set_figure_params`.
Note the functions `settings.set_figure_params` and `logging.print_versions()`.
============================================== ===================================
`settings.verbosity` Verbosity level (default: 1).
Expand All @@ -256,13 +252,6 @@
... Show even more detailed progress.
=== ======================================
Logging.
================================================ ===================================
`logging.print_version_and_date()` Print the version and the date.
`logging.print_versions_dependencies_numerics()` Print the versions of dependencies.
================================================ ===================================
"""

from anndata import AnnData
Expand Down
2 changes: 1 addition & 1 deletion scanpy/neighbors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def neighbors(
metric_kwds={},
copy=False):
"""\
Compute a neighborhood graph of data points [McInnes18]_.
Compute a neighborhood graph of observations [McInnes18]_.
The neighbor search efficiency of this heavily relies on UMAP [McInnes18]_,
which also provides a method for estimating connectivities of data points -
Expand Down
17 changes: 4 additions & 13 deletions scanpy/tools/paga.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
from .. import settings


def paga(adata,
def paga(
adata,
groups='louvain',
# threshold=0.01,
tree_based_confidence=False,
n_jobs=None,
copy=False):
"""\
Expand All @@ -33,12 +32,6 @@ def paga(adata,
graph. 'louvain_groups' uses the Louvain algorithm and optimizes
modularity of the graph. You can also pass your predefined groups by
choosing any categorical annotation of observations (`adata.obs`).
tree_based_confidence : `bool`, optional (default: `True`)
Have high confidence in a connection if its connectivities is
significantly higher than the median connectivities of the global spanning
tree of the abstracted graph.
n_jobs : `int` or None (default: `sc.settings.n_jobs`)
Number of CPUs to use for parallel processing.
copy : `bool`, optional (default: `False`)
Copy `adata` before computation and return a copy. Otherwise, perform
computation inplace and return None.
Expand All @@ -62,7 +55,7 @@ def paga(adata,
adata = adata.copy() if copy else adata
utils.sanitize_anndata(adata)
logg.info('running partition-based graph abstraction (PAGA)', reset=True)
paga = PAGA(adata, groups, tree_based_confidence=tree_based_confidence)
paga = PAGA(adata, groups)
paga.compute()
adata.uns['paga'] = {}
adata.uns['paga']['connectivities'] = paga.connectivities_coarse
Expand All @@ -80,10 +73,8 @@ def paga(adata,


class PAGA(Neighbors):
"""Statistical Graph Abstraction.
"""

def __init__(self, adata, groups, threshold=0.05, tree_based_confidence=True):
def __init__(self, adata, groups, threshold=0.05, tree_based_confidence=False):
super(PAGA, self).__init__(adata)
self._groups = groups
self.threshold = threshold
Expand Down

0 comments on commit cf395be

Please sign in to comment.