Skip to content

Commit

Permalink
Merge pull request #62 from fish-quant/develop
Browse files Browse the repository at this point in the history
v0.6.1
  • Loading branch information
Henley13 authored Feb 7, 2022
2 parents 690404b + cb954e8 commit c9f50d3
Show file tree
Hide file tree
Showing 26 changed files with 586 additions and 443 deletions.
4 changes: 1 addition & 3 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ comment: false

ignore:
- "setup.py"
- "python_scripts"
- "bigfish/plot"
- "bigfish/deep_learning"
- "data"
- "weights"
- "bigfish/weights"

coverage:
status:
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ language: python

python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"

install:
- pip install -r requirements.txt
- pip install -r requirements_dev.txt

script:
Expand Down
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Big-FISH

[![PyPI version](https://badge.fury.io/py/big-fish.svg)](https://badge.fury.io/py/big-fish)
[![Build Status](https://travis-ci.com/fish-quant/big-fish.svg?branch=master)](https://travis-ci.com/fish-quant/big-fish)
[![Documentation Status](https://readthedocs.org/projects/big-fish/badge/?version=latest)](https://big-fish.readthedocs.io/en/latest/?badge=latest)
[![Documentation Status](https://readthedocs.org/projects/big-fish/badge/?version=stable)](https://big-fish.readthedocs.io/en/latest/?badge=stable)
[![codecov](https://codecov.io/gh/fish-quant/big-fish/branch/master/graph/badge.svg)](https://codecov.io/gh/fish-quant/big-fish)
[![License](https://img.shields.io/badge/license-BSD%203--Clause-green)](https://github.com/fish-quant/big-fish/blob/master/LICENSE)
[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)
[![Python version](https://img.shields.io/pypi/pyversions/big-fish.svg)](https://pypi.python.org/pypi/big-fish/)

**Big-FISH** is a python package for the analysis of smFISH images. It includes various methods to **analyze microscopy images**, such **spot detection** and **segmentation of cells and nuclei**. The package allows the user represent the extract properties of a cell as coordinates (see figure below). The ultimate goal is to simplify **large scale statistical analysis** and quantification.

Expand All @@ -18,20 +19,18 @@

Big-FISH requires Python 3.6 or newer. Additionally, it has the following dependencies:

- numpy (== 1.16.0)
- scipy (== 1.4.1)
- scikit-learn (== 0.21.0)
- scikit-image (== 0.14.2)
- matplotlib (== 3.0.2)
- pandas (== 0.24.0)
- mrc (== 0.1.5)
- numpy (>= 1.16.0)
- scipy (>= 1.4.1)
- scikit-learn (>= 0.21.0)
- scikit-image (>= 0.14.2)
- matplotlib (>= 3.0.2)
- pandas (>= 0.24.0)
- mrc (>= 0.1.5)

For segmentation purpose, two additional dependencies can be requested:
- tensorflow (== 2.3.0)
- tensorflow-addons (== 0.12.1)

Updated dependencies are not tested yet and might break.

### Virtual environment

To avoid dependency conflicts, we recommend the the use of a dedicated [virtual](https://docs.python.org/3.6/library/venv.html) or [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) environment. In a terminal run the command:
Expand Down Expand Up @@ -75,6 +74,8 @@ If you have any question relative to the repository, please open an [issue](http

Version 1.0.0:
- Complete code coverage.
- Unpin deep learning dependencies
- Add a pretrained pattern recognition model

## Development

Expand All @@ -100,8 +101,14 @@ Please make sure to update tests as appropriate if you open a pull request. You
pip install -r requirements_dev.txt
```

To perform unitary tests, run :
To perform unit tests, run :

```bash
pytest bigfish
```

## Citation

If you exploit this package for your work, please cite:

> Arthur Imbert, Wei Ouyang, Adham Safieddine, Emeline Coleno, Christophe Zimmer, Edouard Bertrand, Thomas Walter, Florian Mueller. FISH-quant v2: a scalable and modular analysis tool for smFISH image analysis. bioRxiv (2021) https://doi.org/10.1101/2021.07.20.453024
2 changes: 1 addition & 1 deletion bigfish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# MINOR: new features
# PATCH: backwards compatible bug fixes
# MAJOR.MINOR.PATCHdev means a version under development
__version__ = "0.6.0"
__version__ = "0.6.1"
4 changes: 2 additions & 2 deletions bigfish/detection/spot_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def _get_spot_counts(thresholds, value_spots):
thresholds : np.ndarray, np.float64
Candidate threshold values.
count_spots : np.ndarray, np.float64
Spots count function.
Spots count function (log scale).
"""
# count spots for each threshold
Expand Down Expand Up @@ -616,7 +616,7 @@ def get_elbow_values(images, voxel_size=None, spot_radius=None,
thresholds : np.ndarray, np.float64
Candidate threshold values.
count_spots : np.ndarray, np.float64
Spots count.
Spots count (log scale).
threshold : float or None
Threshold automatically set.
Expand Down
13 changes: 9 additions & 4 deletions bigfish/multistack/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ def _check_nucleus_in_cell(cell_mask, nuc_mask):
return True


# TODO fix docstring
def extract_spots_from_frame(spots, z_lim=None, y_lim=None, x_lim=None):
"""Get spots coordinates within a given frame.
Expand Down Expand Up @@ -567,7 +568,8 @@ def extract_spots_from_frame(spots, z_lim=None, y_lim=None, x_lim=None):
return extracted_spots


def summarize_extraction_results(fov_results, ndim, path_output=None):
def summarize_extraction_results(fov_results, ndim, path_output=None,
delimiter=";"):
"""Summarize results extracted from an image and store them in a dataframe.
Parameters
Expand All @@ -584,8 +586,11 @@ def summarize_extraction_results(fov_results, ndim, path_output=None):
* `cell_mask`: mask of the cell.
ndim : int
Number of spatial dimensions to consider (2 or 3).
path_output : str or None
path_output : str, optional
Path to save the dataframe in a csv file.
delimiter : str, default=";"
Delimiter used to separate columns if the dataframe is saved in a csv
file.
Returns
-------
Expand Down Expand Up @@ -613,7 +618,7 @@ def summarize_extraction_results(fov_results, ndim, path_output=None):
if len(fov_results) == 0:
df = pd.DataFrame({"cell_id": []})
if path_output is not None:
stack.save_data_to_csv(df, path_output)
stack.save_data_to_csv(df, path_output, delimiter)
return df

# check extra coordinates to summarize
Expand Down Expand Up @@ -690,7 +695,7 @@ def summarize_extraction_results(fov_results, ndim, path_output=None):

# save dataframe
if path_output is not None:
stack.save_data_to_csv(df, path_output)
stack.save_data_to_csv(df, path_output, delimiter)

return df

Expand Down
1 change: 0 additions & 1 deletion bigfish/multistack/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,4 +634,3 @@ def _load_stack_no_recipe(paths, input_dimension=None):
"5 dimensions.".format(input_dimension))

return tensor_5d

1 change: 0 additions & 1 deletion bigfish/multistack/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,3 @@ def check_datamap(data_map):
check_recipe(recipe, data_directory=input_folder)

return True

Loading

0 comments on commit c9f50d3

Please sign in to comment.