From df5690e1477301677d77de0d338f718627688b58 Mon Sep 17 00:00:00 2001 From: Danila Bredikhin Date: Wed, 26 May 2021 17:50:10 +0200 Subject: [PATCH] Improve docs --- docs/source/omics/multi.rst | 9 +++++++++ muon/_core/preproc.py | 9 --------- muon/rna.py | 1 + pyproject.toml | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 muon/rna.py diff --git a/docs/source/omics/multi.rst b/docs/source/omics/multi.rst index e25fbd4..a79c419 100644 --- a/docs/source/omics/multi.rst +++ b/docs/source/omics/multi.rst @@ -75,3 +75,12 @@ Weighted nearest neighbours (WNN) is a procedure to define a neighbourhood graph >>> mu.pp.neighbors(mdata) >>> mu.tl.umap(mdata) + +Utility functions +----------------- + +To manage the complexity of having to deal with multiple modalities, there is a handful of utility functions in `muon`. This includes in-place filtering: just as it works `for a single modality `_, :func:`muon.pp.filter_obs` and :func:`muon.pp.filter_var` will filter observations or variables in each modality as well as in the attributes of the ``MuData`` object. + +In order to keep observations present in all the modalities, there is :func:`muon.pp.intersect_obs`. Using the in-place filtering under the hood, it will modify the ``MuData`` object and the contained modalities to only have the common observations: + + >>> mu.pp.intersect_obs(mdata) diff --git a/muon/_core/preproc.py b/muon/_core/preproc.py index 1d5a522..39ae45b 100644 --- a/muon/_core/preproc.py +++ b/muon/_core/preproc.py @@ -612,9 +612,6 @@ def intersect_obs(mdata: MuData): Subset observations (samples or cells) in-place taking observations present only in all modalities. - This function is currently a draft, and it can be removed - or its behaviour might be changed in future. - Parameters ---------- mdata: MuData @@ -646,9 +643,6 @@ def filter_obs( Filter observations (samples or cells) in-place using any column in .obs or in .X. - This function is currently a draft, and it can be removed - or its behaviour might be changed in future. - Parameters ---------- data: AnnData or MuData @@ -765,9 +759,6 @@ def filter_var( Filter variables (features, e.g. genes) in-place using any column in .var or row in .X. - This function is currently a draft, and it can be removed - or its behaviour might be changed in future. - Parameters ---------- data: AnnData or MuData diff --git a/muon/rna.py b/muon/rna.py new file mode 100644 index 0000000..6bf4a15 --- /dev/null +++ b/muon/rna.py @@ -0,0 +1 @@ +from ._rna import * diff --git a/pyproject.toml b/pyproject.toml index bc26c79..c52a978 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ docs = [ Documentation = "https://muon.readthedocs.io/en/latest/" [tool.flit.sdist] -exclude = [".github"] +exclude = [".github", "docs/build"] [tool.black]