Skip to content

Commit

Permalink
renamed module to infer_subc
Browse files Browse the repository at this point in the history
  • Loading branch information
andy henrie committed Apr 15, 2023
1 parent 2afb445 commit 859df12
Show file tree
Hide file tree
Showing 138 changed files with 753 additions and 713 deletions.
4 changes: 2 additions & 2 deletions ABOUT_THIS_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Lets take a look at the structure of this template:
├── Makefile # A collection of utilities to manage the project
├── MANIFEST.in # A list of files to include in a package
├── mkdocs.yml # Configuration for documentation site
├── infer_subc_2d # The main python package for the project
├── infer_subc # The main python package for the project
│   ├── base.py # The base module for the project
│   ├── __init__.py # This tells Python that this is a package
│   ├── __main__.py # The entry point for the project
Expand Down Expand Up @@ -109,7 +109,7 @@ I had to do some tricks to read that version variable inside the setuptools
I decided to keep the version in a static file because it is easier to read from
wherever I want without the need to install the package.

e.g: `cat infer_subc_2d/VERSION` will get the project version without harming
e.g: `cat infer_subc/VERSION` will get the project version without harming
with module imports or anything else, it is useful for CI, logs and debugging.

### Why to include `tests`, `history` and `Containerfile` as part of the release?
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to develop on this project

infer_subc_2d welcomes contributions from the community.
infer_subc welcomes contributions from the community.

**You need PYTHON3!**

Expand Down
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM python:3.7-alpine
COPY . /app
WORKDIR /app
RUN pip install .
CMD ["infer_subc_2d"]
CMD ["infer_subc"]
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include LICENSE
include HISTORY.md
include Containerfile
graft tests
graft infer_subc_2d
graft infer_subc
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ install: ## Install the project in dev mode.

.PHONY: fmt
fmt: ## Format code using black & isort.
$(ENV_PREFIX)isort infer_subc_2d/
$(ENV_PREFIX)black -l 79 infer_subc_2d/
$(ENV_PREFIX)isort infer_subc/
$(ENV_PREFIX)black -l 79 infer_subc/
$(ENV_PREFIX)black -l 79 tests/

.PHONY: lint
lint: ## Run pep8, black, mypy linters.
$(ENV_PREFIX)flake8 infer_subc_2d/
$(ENV_PREFIX)black -l 79 --check infer_subc_2d/
$(ENV_PREFIX)flake8 infer_subc/
$(ENV_PREFIX)black -l 79 --check infer_subc/
$(ENV_PREFIX)black -l 79 --check tests/
$(ENV_PREFIX)mypy --ignore-missing-imports infer_subc_2d/
$(ENV_PREFIX)mypy --ignore-missing-imports infer_subc/

.PHONY: test
test: lint ## Run tests and generate coverage report.
$(ENV_PREFIX)pytest -v --cov-config .coveragerc --cov=infer_subc_2d -l --tb=short --maxfail=1 tests/
$(ENV_PREFIX)pytest -v --cov-config .coveragerc --cov=infer_subc -l --tb=short --maxfail=1 tests/
$(ENV_PREFIX)coverage xml
$(ENV_PREFIX)coverage html

Expand Down Expand Up @@ -78,9 +78,9 @@ virtualenv: ## Create a virtual environment.
release: ## Create a new tag for release.
@echo "WARNING: This operation will create s version tag and push to github"
@read -p "Version? (provide the next x.y.z semver) : " TAG
@echo "$${TAG}" > infer_subc_2d/VERSION
@echo "$${TAG}" > infer_subc/VERSION
@$(ENV_PREFIX)gitchangelog > HISTORY.md
@git add infer_subc_2d/VERSION HISTORY.md
@git add infer_subc/VERSION HISTORY.md
@git commit -m "release: version $${TAG} 🚀"
@echo "creating git tag : $${TAG}"
@git tag $${TAG}
Expand All @@ -101,15 +101,15 @@ switch-to-poetry: ## Switch to poetry package manager.
@poetry init --no-interaction --name=a_flask_test --author=rochacbruno
@echo "" >> pyproject.toml
@echo "[tool.poetry.scripts]" >> pyproject.toml
@echo "infer_subc_2d = 'infer_subc_2d.__main__:main'" >> pyproject.toml
@echo "infer_subc = 'infer_subc.__main__:main'" >> pyproject.toml
@cat requirements.txt | while read in; do poetry add --no-interaction "$${in}"; done
@cat requirements-test.txt | while read in; do poetry add --no-interaction "$${in}" --dev; done
@poetry install --no-interaction
@mkdir -p .github/backup
@mv requirements* .github/backup
@mv setup.py .github/backup
@echo "You have switched to https://python-poetry.org/ package manager."
@echo "Please run 'poetry shell' or 'poetry run infer_subc_2d'"
@echo "Please run 'poetry shell' or 'poetry run infer_subc'"

.PHONY: init
init: ## Initialize the project based on an application template.
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# infer_subc_2d
# infer_subc

[![codecov](https://codecov.io/gh/ergonyc/infer-subc/branch/main/graph/badge.svg?token=infer-subc_token_here)](https://codecov.io/gh/ergonyc/infer-subc)
[![CI](https://github.com/ergonyc/infer-subc/actions/workflows/main.yml/badge.svg)](https://github.com/ergonyc/infer-subc/actions/workflows/main.yml)

## About The Project

`infer_subc_2d`
`infer_subc`
- aims to create a simple, extensible, and reproducible workflow to measure (or infer) the shape, position, size, and interaction of several sub-cellular components. These data can then be applied later to better understand the spatial coordination of these structures and the interactome during key biological processes.

- is part of a larger collaboration between the CZI Neurodegeneration Challenge Network [(NDCN)](https://chanzuckerberg.com/science/programs-resources/neurodegeneration-challenge/) Data Science Concierge program and the Cohen lab at UNC [(website,](https://cohenlaboratory.web.unc.edu/) [github)](https://github.com/SCohenLab) to migrate a multispectral imaging dataset of iPSCs which identifies sub-cellular components to a scalable cloud-based pipeline.



## `infer_subc_2d` Workflow
## `infer_subc` Workflow

The staring point of this workflow is a set of multichannel images, where each channel labels a different sub-cellular component. The workflow can then be completed in a _**suggested**_ series of steps, outlined in the notebooks below.

Expand Down Expand Up @@ -84,16 +84,16 @@ The following are prerequisites and should be installed prior to using the workf

### Installation

`infer_subc_2d` is not yet available on `PyPI` so must be be `pip` ionstalled from source
`infer_subc` is not yet available on `PyPI` so must be be `pip` ionstalled from source
```
pip install git+https://github.com/ndcn/infer-subc-2D.git
```

## Usage

```py
from infer_subc_2d.organelles import infer_lyso
from infer_subc_2d.core.file_io import read_czi_image
from infer_subc.organelles import infer_lyso
from infer_subc.core.file_io import read_czi_image

img_data,meta_dict = read_czi_image("path/to/image.czi")
lyso_obj = infer_lyso(img_data)
Expand All @@ -103,9 +103,9 @@ lyso_obj = infer_lyso(img_data)
🚧 WIP 🚧 (🚨🚨🚨🚨 )
> NOTE: command line capabilities not implimented
```bash
$ python -m infer_subc_2d
$ python -m infer_subc
#or
$ infer_subc_2d
$ infer_subc
```

## Roadmap
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Welcome to infer_subc_2d
# Welcome to infer_subc

`infer_subc_2d` aims to create a simple and extensible workflow of image analysis leveraging [scipy image](link), and [napari](link) for reproducable analysis with an intuitive interface.
`infer_subc` aims to create a simple and extensible workflow of image analysis leveraging [scipy image](link), and [napari](link) for reproducable analysis with an intuitive interface.

This is a simple repo to collect code and documentations from the pilot project kicking off as part of the CZI Neurodegeneration Challenge Network [(NDCN)](https://chanzuckerberg.com/science/programs-resources/neurodegeneration-challenge/) Data Science Concierge program. The PILOT study is a collaboration with Cohen lab at UNC [(website,](https://cohenlaboratory.web.unc.edu/) [github)](https://github.com/SCohenLab) to migrate a multispectral imaging dataset of iPSCs which identifies sub-cellular components to a scalable cloud-based pipeline.

Expand Down Expand Up @@ -47,5 +47,5 @@ Early in the develepmont we chose to leverage the Allen Cell & Structure Segment

-------

For full documentation visit [github.io.com/infer_subc_2d](https://ndcn.github.io/infer-subc-2D/).
For full documentation visit [github.io.com/infer_subc](https://ndcn.github.io/infer-subc-2D/).
Robust inference of subcellular objects:
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/batch.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# infer_subc_2d/batch
# infer_subc/batch

functions which help with processing batches of files

::: infer_subc_2d.batch.batch_process
::: infer_subc.batch.batch_process
2 changes: 1 addition & 1 deletion docs/infer_subc_2d/main.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#

## infer_subc_2d
## infer_subc

Several sub-modules organize the segmentation.

Expand Down
2 changes: 1 addition & 1 deletion docs/infer_subc_2d/organelles.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ In order to leverage the A

## `organelles` submodule

::: infer_subc_2d.organelles
::: infer_subc.organelles
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/organelles/cytosol.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# infer_subc_2d/organelles/cytosol
# infer_subc/organelles/cytosol

::: infer_subc_2d.organelles.cytosol
::: infer_subc.organelles.cytosol
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/organelles/er.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# infer_subc_2d/organelles/er
# infer_subc/organelles/er

::: infer_subc_2d.organelles.er
::: infer_subc.organelles.er
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/organelles/golgi.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# infer_subc_2d/organelles/golgi
# infer_subc/organelles/golgi

::: infer_subc_2d.organelles.golgi
::: infer_subc.organelles.golgi
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/organelles/lipid.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# infer_subc_2d/organelles/lipid
# infer_subc/organelles/lipid

::: infer_subc_2d.organelles.lipid
::: infer_subc.organelles.lipid
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/organelles/lysosome.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# infer_subc_2d/organelles/lysosome
# infer_subc/organelles/lysosome

::: infer_subc_2d.organelles.lysosome
::: infer_subc.organelles.lysosome
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/organelles/mitochondria.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# infer_subc_2d/organelles/mitochondria
# infer_subc/organelles/mitochondria

::: infer_subc_2d.organelles.mitochondria
::: infer_subc.organelles.mitochondria

4 changes: 2 additions & 2 deletions docs/infer_subc_2d/organelles/nuclei.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# infer_subc_2d/organelles/nuclei
# infer_subc/organelles/nuclei

::: infer_subc_2d.organelles.nuclei
::: infer_subc.organelles.nuclei
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/organelles/peroxisome.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# infer_subc_2d/organelles/peroxisome
# infer_subc/organelles/peroxisome

::: infer_subc_2d.organelles.peroxisome
::: infer_subc.organelles.peroxisome
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/organelles/soma.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# infer_subc_2d/organelles/soma
# infer_subc/organelles/soma

Routines for inference of ***soma*** for masking later organell segmentation steps.

::: infer_subc_2d.organelles.soma
::: infer_subc.organelles.soma
2 changes: 1 addition & 1 deletion docs/infer_subc_2d/overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## infer_subc_2d
## infer_subc

This module contains code to segment organelles from multi-channel images generated by SCohenLab. The "raw" data files are the output of linear unmixing of multi-spectral imaging capture in their lab.

Expand Down
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/utils.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## infer_subc_2d/utils
# infer_subc_2d/utils
## infer_subc/utils
# infer_subc/utils

The _utils_ are organized by _file input / output_ `file_io.py`, _image processing_ routines (`img.py`) and some _other_ (`etc`) functions.
2 changes: 1 addition & 1 deletion docs/infer_subc_2d/utils/etc.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# infer_subc_2d/utils
# infer_subc/utils

Also there are 'util/directories.py', 'util/filesystempy', 'util/lazy.py', and a hack from `aicsimageio` 'util/_aicsimage_reader.py'
4 changes: 2 additions & 2 deletions docs/infer_subc_2d/utils/file_io.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# infer_subc_2d/utils/file_io
# infer_subc/utils/file_io

Helpers for file input and output

::: infer_subc_2d.utils.file_io
::: infer_subc.utils.file_io

4 changes: 2 additions & 2 deletions docs/infer_subc_2d/utils/img.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# infer_subc_2d/utils/img
# infer_subc/utils/img

Image processing functions. Most are wrappers to well known `skimage` and `scipy.ndimate` utilities as well as core routines from `aicssegmentation`

::: infer_subc_2d.utils.img
::: infer_subc.utils.img
16 changes: 8 additions & 8 deletions docs/infer_subc_2d/workflow.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# infer_subc_2d/workflows
# infer_subc/workflows

Code for classes which interface with the sibling napari plugin repo `organelle-segmenter-plugin` documented at [ndcn.github.io/organelle-segmenter-plugin](https://ndcn.github.io/organelle-segmenter-plugin/)


# infer_subc_2d/workflow for napari plugin
# infer_subc/workflow for napari plugin

The `workflow` sub-module is designed to interface with this repo (`infer_subc_2d`) and the sibling [napari](https://napari.org/stable/) plugin repo [organelle-segmenter-plugin](https://github.com/ndcn/organelle-segmenter-plugin)
The `workflow` sub-module is designed to interface with this repo (`infer_subc`) and the sibling [napari](https://napari.org/stable/) plugin repo [organelle-segmenter-plugin](https://github.com/ndcn/organelle-segmenter-plugin)

### workflow sub-modules

::: infer_subc_2d.workflow.workflow
::: infer_subc.workflow.workflow

::: infer_subc_2d.workflow.workflow_config
::: infer_subc.workflow.workflow_config

::: infer_subc_2d.workflow.workflow_definition
::: infer_subc.workflow.workflow_definition

::: infer_subc_2d.workflow.workflow_engine
::: infer_subc.workflow.workflow_engine

::: infer_subc_2d.workflow.workflow_step
::: infer_subc.workflow.workflow_step
2 changes: 1 addition & 1 deletion docs/nbs/overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#

## infer_subc_2d
## infer_subc

This module contains code to segment organelles from multi-channel images generated by SCohenLab. The "raw" data files are the output of linear unmixing of multi-spectral imaging capture in their lab.

Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/nbs_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Robust inference of subcellular objects:
- 8️⃣. [Infer ***endoplasmic reticulum***](https://github.com/ndcn/infer-subc-2D/tree/main/notebooks/08_endoplasmic_reticulum.ipynb)
- 9️⃣. [Infer ***lipid body***](https://github.com/ndcn/infer-subc-2D/tree/main/notebooks/09_lipid_bodies.ipynb)

::: infer_subc_2d.organelles
::: infer_subc.organelles
42 changes: 41 additions & 1 deletion env_create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pip install -e <path to organelle-segmenter-plugin>


## Execute this if installing via pypi (not yet available)
pip install infer_subc_2d
pip install infer_subc
pip install napari-infer-subc

# # pip install opencv-python
Expand All @@ -40,3 +40,43 @@ pip install aicssegmentation #downgrades napari and scikitlearn
pip install napari-aicsimageio






conda create -n napari10 python=3.10
conda activate napari10
conda install -c conda-forge ipython ipykernel pip notebook napari scipy scikit-learn
conda install matplotlib

pip install aicsimageio tifffile aicspylibczi aicssegmentation napari-aicsimageio

pip install aicspylibczi
pip install aicssegmentation #downgrades napari and scikitlearn

pip install napari-aicsimageio







###### TEST FOR CENTROSOME
conda create -n cento python=3.9 -c conda-forge pip notebook napari scipy scikit-learn

conda activate cento

# pip install 'napari[all]'
# pip install scipy scikit-learn matplotlib #jupyter
# python3 -m pip install centrosome "matplotlib >=3.1.3"
# conda install -c bioconda centrosome

pip install centrosome
pip install aicsimageio
pip install aicspylibczi
pip install aicssegmentation #downgrades napari and scikitlearn

pip install napari-aicsimageio


File renamed without changes.
2 changes: 1 addition & 1 deletion infer_subc_2d/__init__.py → infer_subc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# -*- coding: utf-8 -*-

"""Top-level package for infer_subc_2D."""
"""Top-level package for infer_subc."""

__author__ = "Andy Henrie"
__email__ = "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion infer_subc_2d/__main__.py → infer_subc/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Entry point for infer_subc_2d."""
"""Entry point for infer_subc."""

from .cli import main # pragma: no cover

Expand Down
File renamed without changes.
Loading

0 comments on commit 859df12

Please sign in to comment.