Skip to content

Commit fe67b1f

Browse files
2 parents 6d5be67 + 03fdbf9 commit fe67b1f

19 files changed

Lines changed: 3542 additions & 672 deletions

.readthedocs.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ version: 2
33
build:
44
os: ubuntu-20.04
55
tools:
6-
python: "3.10"
6+
python: "3.11"
77
sphinx:
88
configuration: docs/conf.py
99
# disable this for more lenient docs builds
10-
fail_on_warning: true
10+
fail_on_warning: false
1111
python:
1212
install:
13+
- requirements: docs/requirements.txt
1314
- method: pip
1415
path: .
1516
extra_requirements:
16-
- doc
17+
- docsbuild
18+
submodules:
19+
include: [docs/tutorials/notebooks]
20+
recursive: true

README.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
# inflow
1+
<img src="https://github.com/Lotfollahi-lab/mintflow/blob/main/docs/_static/mintflow_logo_readme.png" width="400" alt="mintflow-logo">
22

3-
[![Tests][badge-tests]][link-tests]
4-
[![Documentation][badge-docs]][link-docs]
3+
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://github.com/Lotfollahi-lab/mintflow/blob/main/LICENSE)
4+
[![Stars](https://img.shields.io/github/stars/Lotfollahi-lab/mintflow?logo=GitHub&color=yellow)](https://github.com/Lotfollahi-lab/mintflow/stargazers)
5+
[![PyPI](https://img.shields.io/pypi/v/mintflow.svg)](https://pypi.org/project/mintflow)
6+
[![PyPIDownloads](https://static.pepy.tech/badge/mintflow)](https://pepy.tech/project/mintflow)
7+
[![Docs](https://readthedocs.org/projects/mintflow/badge/?version=latest)](https://mintflow.readthedocs.io/en/stable/?badge=stable)
8+
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
9+
[![PyPI](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
510

6-
[badge-tests]: https://img.shields.io/github/actions/workflow/status/sebastianbirk/inflow/test.yaml?branch=main
7-
[link-tests]: https://github.com/sebastianbirk/inflow/actions/workflows/test.yml
8-
[badge-docs]: https://img.shields.io/readthedocs/inflow
9-
10-
Cellular decomposition of intrinsic and neighborhood-induced omic effects
11+
MintFlow (**M**icroenvironment-induced and **IN**trinsic **T**ranscriptomic **FLOW**s) is a package to decompose spatial transcriptomics data into microenvironment-induced and intrinsic gene expression components. It interoperates with the [scverse](https://scverse.org/) ecosystem to enable seamless analysis workflows of spatial transcriptomics data to identify spatial biomarkers.
1112

1213
## Installing the Python Environment
1314
**SANGER INTERNAL**: The environment is already available on farm.
@@ -20,8 +21,8 @@ conda activate /nfs/team361/aa36/PythonEnvs_2/envinflowdec27/
2021

2122
Alternatively, you can create the python environment yourself:
2223
```commandline
23-
git clone https://github.com/Lotfollahi-lab/inflow.git # clone the repo
24-
cd ./inflow/
24+
git clone https://github.com/Lotfollahi-lab/mintflow.git # clone the repo
25+
cd ./mintflow/
2526
conda env create -f environment.yml --prefix SOME_EMPTY_PATH
2627
```
2728

@@ -30,24 +31,24 @@ It's highly recommended to setup wandb before proceeding.
3031

3132
To do so:
3233
- Go to https://wandb.ai/ and create an account.
33-
- Create a project called "inFlow".
34+
- Create a project called "MintFlow".
3435

3536
## Quick Start
36-
You can use inflow as a local package, because it's not pip installable at the moment.
37+
You can use mintflow as a local package, because it's not pip installable at the moment.
3738

3839
To do so:
3940
```commandline
40-
git clone https://github.com/Lotfollahi-lab/inflow.git # clone the repo
41-
cd ./inflow/
41+
git clone https://github.com/Lotfollahi-lab/mintflow.git # clone the repo
42+
cd ./mintflow/
4243
```
43-
The easiest way to run inflow is through the command line interface (CLI).
44+
The easiest way to run MintFlow is through the command line interface (CLI).
4445
This involves two steps
4546
1. Creating four config files (you duplicate/modify template config files).
46-
2. Running inflow with a single command line.
47+
2. Running mintflow with a single command line.
4748

4849
### Rule of thumbs §1 for modifying the config files
4950
In the template config files, there are `TODO`-s of different types that you may need to modify
50-
- Category 1: `TODO:ESSENTIAL:TUNE`: the basic/essential parts to run inflow.
51+
- Category 1: `TODO:ESSENTIAL:TUNE`: the basic/essential parts to run mintflow.
5152
- Category 2: `TODO:TUNE`: less essneitial and/or technical details.
5253
- Category 3: `TODO:check`: parameters of even less importance compared to category 1 and category 2.
5354

@@ -58,7 +59,7 @@ If you are, for example, a biologist with no interest/experience in computationa
5859
Please follow these steps
5960
- Training data config file:
6061
- Make a copy of `./cli/SampleConfigFiles/config_data_train.yml` and rename it to `YOUR_CONFIG_DATA_TRAIN.yml`
61-
- Read the block of comments tarting with *"# Inflow expects a list of .h5ad files stored on disk, ..."*.
62+
- Read the block of comments tarting with *"# MintFlow expects a list of .h5ad files stored on disk, ..."*.
6263
- Modify some parts marked by `TODO:...` and according to *"Rule of thumbs §1"* explained above.
6364

6465

@@ -76,29 +77,29 @@ Please follow these steps
7677
- Make a copy of `./cli/SampleConfigFiles/config_training.yml` and rename it to `YOUR_CONFIG_TRAINING.yml`.
7778
- Modify some parts marked by `TODO:...` and according to *"Rule of thumbs §1"* explained above.
7879

79-
### Step 2 of Using the CLI: Running inflow
80+
### Step 2 of Using the CLI: Running MintFlow
8081

8182
```commandline
82-
cd ./inflow/ # if you haven't already done it above.
83+
cd ./mintflow/ # if you haven't already done it above.
8384
cd ./cli/
8485
85-
python inflow_cli.py \
86+
python mintflow_cli.py \
8687
--file_config_data_train YOUR_CONFIG_DATA_TRAIN.yml \
8788
--file_config_data_test YOUR_CONFIG_DATA_TEST.yml \
8889
--file_config_model YOUR_CONFIG_MODEL.yml \
8990
--file_config_training YOUR_CONFIG_TRAINING.yml \
9091
--path_output "./Your/Output/Path/ToDump/Results/" \
9192
--flag_verbose "True" \
9293
```
93-
The recommended way of accessing inflow predictions is by `adata_inflowOutput_norm.h5ad` and `adata_inflowOutput_unnorm.h5ad` created in the provided `--path_output`and `adata.obsm` and `adata.uns` in these files.
94-
In the former file `..._norm.h5ad` the readcount matrix `adata.X` as well as inflow predictions Xint and Xspl are row normalised, while in the latter file `_unnorm.h5ad` they are not.
94+
The recommended way of accessing MintFlow predictions is by `adata_mintflowOutput_norm.h5ad` and `adata_mintflowOutput_unnorm.h5ad` created in the provided `--path_output`and `adata.obsm` and `adata.uns` in these files.
95+
In the former file `..._norm.h5ad` the readcount matrix `adata.X` as well as MintFlow predictions Xint and Xspl are row normalised, while in the latter file `_unnorm.h5ad` they are not.
9596

96-
Inflow dumps a README file in the provided `--path_output`, as well as each subfolder therein.
97+
MintFlow dumps a README file in the provided `--path_output`, as well as each subfolder therein.
9798

9899
## Common Issues
99-
- Use absolute paths (and not relative paths like `../../some/path/`) in the config files, as well as when running `python inflow_cli.py ...`.
100+
- Use absolute paths (and not relative paths like `../../some/path/`) in the config files, as well as when running `python mintflow_cli.py ...`.
100101
- TODO: intro to the script for tune window width.
101-
- It's common to face out of memory issue in the very last step where the big anndata objects `adata_inflowOutput_norm.h5ad` and `adata_inflowOutput_unnorm.h5ad` are created and dumped.
102+
- It's common to face out of memory issue in the very last step where the big anndata objects `adata_mintflowOutput_norm.h5ad` and `adata_mintflowOutput_unnorm.h5ad` are created and dumped.
102103
If that step fails, the results are still accesible in the output path the subfolder `CheckpointAndPredictions/`.
103104
One can laod the `.pt` files by
104105
```python
123 KB
Loading

docs/api.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/api/developer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Developer

docs/api/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# API
2+
3+
Import MintFlow as:
4+
5+
```
6+
import mintflow
7+
```
8+
9+
```{toctree}
10+
:maxdepth: 2
11+
12+
user
13+
developer
14+
```

docs/api/user.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# User

docs/changelog.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/contributing.md

Lines changed: 2 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,9 @@
1-
# Contributing guide
1+
# Contributing
22

3-
Scanpy provides extensive [developer documentation][scanpy developer guide], most of which applies to this project, too.
4-
This document will not reproduce the entire content from there. Instead, it aims at summarizing the most important
5-
information to get you started on contributing.
6-
7-
We assume that you are already familiar with git and with making pull requests on GitHub. If not, please refer
8-
to the [scanpy developer guide][].
9-
10-
## Installing dev dependencies
11-
12-
In addition to the packages needed to _use_ this package, you need additional python packages to _run tests_ and _build
13-
the documentation_. It's easy to install them using `pip`:
14-
15-
```bash
16-
cd inflow
17-
pip install -e ".[dev,test,doc]"
18-
```
19-
20-
## Code-style
21-
22-
This package uses [pre-commit][] to enforce consistent code-styles.
23-
On every commit, pre-commit checks will either automatically fix issues with the code, or raise an error message.
24-
25-
To enable pre-commit locally, simply run
26-
27-
```bash
28-
pre-commit install
29-
```
30-
31-
in the root of the repository. Pre-commit will automatically download all dependencies when it is run for the first time.
32-
33-
Alternatively, you can rely on the [pre-commit.ci][] service enabled on GitHub. If you didn't run `pre-commit` before
34-
pushing changes to GitHub it will automatically commit fixes to your pull request, or show an error message.
35-
36-
If pre-commit.ci added a commit on a branch you still have been working on locally, simply use
37-
38-
```bash
39-
git pull --rebase
40-
```
41-
42-
to integrate the changes into yours.
43-
While the [pre-commit.ci][] is useful, we strongly encourage installing and running pre-commit locally first to understand its usage.
44-
45-
Finally, most editors have an _autoformat on save_ feature. Consider enabling this option for [ruff][ruff-editors]
46-
and [prettier][prettier-editors].
47-
48-
[ruff-editors]: https://docs.astral.sh/ruff/integrations/
49-
[prettier-editors]: https://prettier.io/docs/en/editors.html
50-
51-
## Writing tests
52-
53-
```{note}
54-
Remember to first install the package with `pip install -e '.[dev,test]'`
55-
```
56-
57-
This package uses the [pytest][] for automated testing. Please [write tests][scanpy-test-docs] for every function added
58-
to the package.
59-
60-
Most IDEs integrate with pytest and provide a GUI to run tests. Alternatively, you can run all tests from the
61-
command line by executing
62-
63-
```bash
64-
pytest
65-
```
66-
67-
in the root of the repository.
68-
69-
### Continuous integration
70-
71-
Continuous integration will automatically run the tests on all pull requests and test
72-
against the minimum and maximum supported Python version.
73-
74-
Additionally, there's a CI job that tests against pre-releases of all dependencies
75-
(if there are any). The purpose of this check is to detect incompatibilities
76-
of new package versions early on and gives you time to fix the issue or reach
77-
out to the developers of the dependency before the package is released to a wider audience.
78-
79-
[scanpy-test-docs]: https://scanpy.readthedocs.io/en/latest/dev/testing.html#writing-tests
80-
81-
## Publishing a release
82-
83-
### Updating the version number
84-
85-
Before making a release, you need to update the version number in the `pyproject.toml` file. Please adhere to [Semantic Versioning][semver], in brief
86-
87-
> Given a version number MAJOR.MINOR.PATCH, increment the:
88-
>
89-
> 1. MAJOR version when you make incompatible API changes,
90-
> 2. MINOR version when you add functionality in a backwards compatible manner, and
91-
> 3. PATCH version when you make backwards compatible bug fixes.
92-
>
93-
> Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
94-
95-
Once you are done, commit and push your changes and navigate to the "Releases" page of this project on GitHub.
96-
Specify `vX.X.X` as a tag name and create a release. For more information, see [managing GitHub releases][]. This will automatically create a git tag and trigger a Github workflow that creates a release on PyPI.
97-
98-
## Writing documentation
99-
100-
Please write documentation for new or changed features and use-cases. This project uses [sphinx][] with the following features:
101-
102-
- the [myst][] extension allows to write documentation in markdown/Markedly Structured Text
103-
- [Numpy-style docstrings][numpydoc] (through the [napoloen][numpydoc-napoleon] extension).
104-
- Jupyter notebooks as tutorials through [myst-nb][] (See [Tutorials with myst-nb](#tutorials-with-myst-nb-and-jupyter-notebooks))
105-
- [Sphinx autodoc typehints][], to automatically reference annotated input and output types
106-
- Citations (like {cite:p}`Virshup_2023`) can be included with [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/)
107-
108-
See the [scanpy developer docs](https://scanpy.readthedocs.io/en/latest/dev/documentation.html) for more information
109-
on how to write documentation.
110-
111-
### Tutorials with myst-nb and jupyter notebooks
112-
113-
The documentation is set-up to render jupyter notebooks stored in the `docs/notebooks` directory using [myst-nb][].
114-
Currently, only notebooks in `.ipynb` format are supported that will be included with both their input and output cells.
115-
It is your responsibility to update and re-run the notebook whenever necessary.
116-
117-
If you are interested in automatically running notebooks as part of the continuous integration, please check
118-
out [this feature request](https://github.com/scverse/cookiecutter-scverse/issues/40) in the `cookiecutter-scverse`
119-
repository.
120-
121-
#### Hints
122-
123-
- If you refer to objects from other packages, please add an entry to `intersphinx_mapping` in `docs/conf.py`. Only
124-
if you do so can sphinx automatically create a link to the external documentation.
125-
- If building the documentation fails because of a missing link that is outside your control, you can add an entry to
126-
the `nitpick_ignore` list in `docs/conf.py`
127-
128-
#### Building the docs locally
129-
130-
```bash
131-
cd docs
132-
make html
133-
open _build/html/index.html
134-
```
3+
This will be added shortly.
1354

1365
<!-- Links -->
1376

138-
[scanpy developer guide]: https://scanpy.readthedocs.io/en/latest/dev/index.html
139-
[cookiecutter-scverse-instance]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/template_usage.html
1407
[github quickstart guide]: https://docs.github.com/en/get-started/quickstart/create-a-repo?tool=webui
1418
[codecov]: https://about.codecov.io/sign-up/
1429
[codecov docs]: https://docs.codecov.com/docs
@@ -147,8 +14,6 @@ open _build/html/index.html
14714
[myst-nb]: https://myst-nb.readthedocs.io/en/latest/
14815
[jupytext]: https://jupytext.readthedocs.io/en/latest/
14916
[pre-commit]: https://pre-commit.com/
150-
[anndata]: https://github.com/scverse/anndata
151-
[mudata]: https://github.com/scverse/mudata
15217
[pytest]: https://docs.pytest.org/
15318
[semver]: https://semver.org/
15419
[sphinx]: https://www.sphinx-doc.org/en/master/
@@ -157,4 +22,3 @@ open _build/html/index.html
15722
[numpydoc]: https://numpydoc.readthedocs.io/en/latest/format.html
15823
[sphinx autodoc typehints]: https://github.com/tox-dev/sphinx-autodoc-typehints
15924
[pypi]: https://pypi.org/
160-
[managing GitHub releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository

0 commit comments

Comments
 (0)