diff --git a/.gitignore b/.gitignore index 322472c..d81b1c7 100755 --- a/.gitignore +++ b/.gitignore @@ -85,3 +85,4 @@ examples/_* examples/_*/ _*/ examples/*demo_data* +outputs/ diff --git a/CITATION.cff b/CITATION.cff index 08c390d..761e889 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,18 +1,14 @@ cff-version: 1.2.0 -title: >- - htsimaging: High-Throughput Single-cell Imaging analysis - in python -message: >- - If you use this software, please cite it using the - metadata from this file. +title: 'htsimaging: High-Throughput Single-cell Imaging analysis in python' +message: If you use this software, please cite it using the metadata from this file. type: software authors: - - given-names: Rohan - family-names: Dandage - orcid: 'https://orcid.org/0000-0002-6421-2067' +- given-names: Rohan + family-names: Dandage + orcid: https://orcid.org/0000-0002-6421-2067 identifiers: - - type: doi - value: 10.5281/zenodo.8264035 -repository-code: 'https://github.com/rraadd88/htsimaging' -version: 1.0.4 -date-released: '2023-08-10' +- type: doi + value: doi/10.5281/zenodo.3697134 +repository-code: https://github.com/rraadd88/htsimaging +version: v1.0.5 +date-released: '2023-11-27' diff --git a/README.md b/README.md index 292c7a3..c34d956 100755 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Issues](https://img.shields.io/github/issues/rraadd88/htsimaging.svg?style=for-the-badge)](https://github.com/rraadd88/htsimaging/issues)
[![Downloads](https://img.shields.io/pypi/dm/htsimaging?style=for-the-badge)](https://pepy.tech/project/htsimaging) -[![GNU License](https://img.shields.io/github/license/rraadd88/htsimaging.svg?style=for-the-badge)](https://github.com/rraadd88/htsimaging/blob/master/LICENSE) +[![GNU License](https://img.shields.io/github/license/rraadd88/htsimaging.svg?style=for-the-badge)](https://github.com/rraadd88/htsimaging/blob/main/LICENSE) @@ -23,8 +23,19 @@ ยท Explore the API

- - + + +![image](./examples/image.png) + +# Examples + +[๐Ÿ“ˆ Single-cell protein abundance and its normalization](https://github.com/rraadd88/htsimaging/blob/main/examples/protein_abundance_and_normalization.ipynb) +[๐Ÿ“ˆ Single-cell protein abundance by marker localization](https://github.com/rraadd88/htsimaging/blob/main/examples/protein_abundance_by_marker_location.ipynb) +[๐Ÿ–ผ๏ธ Visualization of the images.](https://github.com/rraadd88/htsimaging/blob/main/examples/viz_image.ipynb) +[๐Ÿ“ˆ Quantitative analysis of endocytosis.](https://github.com/rraadd88/htsimaging/blob/main/examples/endocytosis.ipynb) +[๐Ÿ“ˆ Single-particle tracking (SPT).](https://github.com/rraadd88/htsimaging/blob/main/examples/spt.ipynb) +[๐Ÿ“ˆ Calculating the recovery rate from a bleach-chase data](https://github.com/rraadd88/htsimaging/blob/main/examples/bleach_chase.ipynb) + # Installation ``` @@ -34,14 +45,30 @@ With additional dependencies as required: ``` pip install htsimaging[spt] # for the analysis of the Single-Particle Tracking e.g. endocytosis. ``` -# Examples + +# How to cite? +1. Using BibTeX: +``` +@software{Dandage_htsimaging, + title = {htsimaging: High-Throughput Single-cell Imaging analysis in python}, + author = {Dandage, Rohan}, + year = {2023}, + url = {https://zenodo.org/doi/10.5281/zenodo.3697134}, + version = {v1.0.5}, + note = {The URL is a DOI link to the permanent archive of the software.}, +} +``` +2. DOI link: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3697134.svg)](https://zenodo.org/doi/10.5281/zenodo.3697134), or -[Single-cell protein abundance and its normalization](https://github.com/rraadd88/htsimaging/blob/master/examples/protein_abundance_and_normalization.ipynb) -[Single-cell protein abundance by marker localization](https://github.com/rraadd88/htsimaging/blob/master/examples/protein_abundance_by_marker_location.ipynb) -[Visualization of the images.](https://github.com/rraadd88/htsimaging/blob/master/examples/viz_image.ipynb) -[Quantitative analysis of endocytosis.](https://github.com/rraadd88/htsimaging/blob/master/examples/endocytosis.ipynb) -[Single-particle tracking (SPT).](https://github.com/rraadd88/htsimaging/blob/master/examples/spt.ipynb) -[Calculating the recovery rate from a bleach-chase data](https://github.com/rraadd88/htsimaging/blob/master/examples/bleach_chase.ipynb) +3. Using citation information from [CITATION.CFF file](https://github.com/rraadd88/htsimaging/blob/main/CITATION.cff). + + +# Future directions, for which contributions are welcome +- [ ] Command-line usage. + +# Similar projects +- https://github.com/vanvalenlab/deepcell-tf +- https://github.com/junlabucsd/napari-mm3 # API @@ -1678,208 +1705,6 @@ Distance travelled. - `pd.DataFrame`: output dataframe. - - - - -## module `htsimaging.spt.viz` - - - - - ---- - - - -### function `plot_msd` - -```python -plot_msd( - imsd: DataFrame, - emsd: DataFrame, - scale: str = 'log', - plot_fh: str = None, - time_points_max: int = None, - ax: Axes = None -) โ†’ Axes -``` - -Plot MSD. - - - -**Args:** - - - `imsd` (pd.DataFrame): mean squared displacement of each particle. - - `emsd` (pd.DataFrame): ensemble mean squared displacement of particles. - - `scale` (str, optional): axis scale. Defaults to "log". - - `plot_fh` (str, optional): output path. Defaults to None. - - `params_msd` (dict, optional): parameters of MSD. Defaults to { "mpp":0.0645, "fps":0.2, "max_lagtime":100 }. - - `ax` (plt.Axes, optional): subplot. Defaults to None. - - - -**Returns:** - - - `plt.Axes`: subplot - - - -**Examples:** - Calculate `time_points_max`: ``` - params_msd: dict={ - "mpp":0.0645, - "fps":0.2, - "max_lagtime":100 - } - time_points_max=params_msd["fps"]*params_msd["max_lagtime"] - ``` - - ---- - - - -### function `plot_emsd` - -```python -plot_emsd( - expt_data: DataFrame, - color: str = 'k', - scale: str = 'log', - plot_fh: str = None, - ax: Axes = None -) โ†’ Axes -``` - -Plot ensemble mean squared displacement of particles. - - - -**Args:** - - - `expt_data` (pd.DataFrame): input data. - - `color` (str, optional): color. Defaults to 'k'. - - `scale` (str, optional): scale of the axes. Defaults to "log". - - `plot_fh` (str, optional): output path. Defaults to None. - - `ax` (plt.Axes, optional): subplot. Defaults to None. - - - -**Returns:** - - - `plt.Axes`: subplot - - ---- - - - -### function `plot_kin` - -```python -plot_kin( - traj: DataFrame, - dparams: DataFrame = None, - ctime: str = 'time (s)', - fit_eqn: str = None, - ylabel: str = '', - label: str = '', - color: str = 'b', - ax1: Axes = None, - plot_fh: str = None -) โ†’ Axes -``` - -Plot kinetics. - - - -**Args:** - - - `traj` (pd.DataFrame): table containing the trajectories. - - `dparams` (pd.DataFrame, optional): table containing the parameters. Defaults to None. - - `ctime` (str, optional): time point. Defaults to 'time (s)'. - - `fit_eqn` (str, optional): fit equation name. Defaults to None. - - - -**Returns:** - plt.Axes - - ---- - - - -### function `plot_kin_all` - -```python -plot_kin_all(expt_dh: str, imsd_fhs: list) -``` - -Plot multiple kinetics plots. - - ---- - - - -### function `plot_trajectories_stats` - -```python -plot_trajectories_stats( - df: DataFrame, - coly: str, - colx: str = 'frame', - rescalex: bool = True, - label: str = None, - axvlinex=None, - params_plot: dict = {'color': 'k', 'alpha': 0.5}, - fig=None, - ax: Axes = None -) โ†’ Axes -``` - -Plot statistics of the particle trajectories. - - ---- - - - -### function `plot_trajectories` - -```python -plot_trajectories( - traj, - image, - colorby: str = 'particle', - mpp: float = None, - label: str = False, - cmap: str = None, - t_column: str = None, - pos_columns: list = None, - plot_style: dict = {}, - params_text: dict = {'ha': 'center', 'va': 'center'}, - ax: Axes = None, - **kwargs -) โ†’ Axes -``` - -Plot traces of trajectories for each particle. Optionally image it on a frame from the video. - -Parameters ----------- traj : DataFrame The DataFrame should include time and spatial coordinate columns. colorby : {'particle', 'frame'}, optional mpp : float, optional Microns per pixel. If omitted, the labels will have units of pixels. label : boolean, optional Set to True to write particle ID numbers next to trajectories. image : ndarray, optional Background image, default None cmap : colormap, optional This is only used in colorby='frame' mode. Default = mpl.cm.winter ax : matplotlib axes object, optional Defaults to current axes t_column : string, optional DataFrame column name for time coordinate. Default is 'frame'. pos_columns : list of strings, optional Dataframe column names for spatial coordinates. Default is ['x', 'y']. plot_style : dictionary Keyword arguments passed through to the `Axes.plot(...)` command - -Returns -------- Axes object - -See Also --------- plot_traj3d : the 3D equivalent of `plot_traj` - - @@ -1954,7 +1779,7 @@ Keyword Args: parameters provided to the `plt.imshow`. --- - + ### function `annot_cells` @@ -1980,7 +1805,7 @@ Annotate the cells on an image. --- - + ### function `image_regions_annotated` diff --git a/examples/endocytosis.ipynb b/examples/endocytosis.ipynb index 6135db2..7a72531 100755 --- a/examples/endocytosis.ipynb +++ b/examples/endocytosis.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "source": [ "---\n", - "# Quantitative analysis of endocytosis.\n", + "# ๐Ÿ“ˆ Quantitative analysis of endocytosis.\n", "\n", "Note: Demo data used in this notebook is not included in the repository, but can be made available upon request." ] diff --git a/examples/image.png b/examples/image.png new file mode 100644 index 0000000..4690e0e Binary files /dev/null and b/examples/image.png differ diff --git a/examples/io_read_nd2.ipynb b/examples/io_read_nd2.ipynb index 5c8aa1c..baec6ba 100755 --- a/examples/io_read_nd2.ipynb +++ b/examples/io_read_nd2.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "source": [ "---\n", - "## Reading the channels from Nikon microscope images with `.nd2` format" + "## ๐Ÿ’พ Reading the channels from Nikon microscope images with `.nd2` format" ] }, { diff --git a/examples/protein_abundance_and_normalization.ipynb b/examples/protein_abundance_and_normalization.ipynb index e9205c3..137e525 100755 --- a/examples/protein_abundance_and_normalization.ipynb +++ b/examples/protein_abundance_and_normalization.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "source": [ "---\n", - "# Single-cell protein abundance and its normalization" + "# ๐Ÿ“ˆ Single-cell protein abundance and its normalization" ] }, { diff --git a/examples/protein_abundance_by_marker_location.ipynb b/examples/protein_abundance_by_marker_location.ipynb index 2232f54..7ece8e3 100755 --- a/examples/protein_abundance_by_marker_location.ipynb +++ b/examples/protein_abundance_by_marker_location.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "source": [ "---\n", - "# Single-cell protein abundance by marker localization" + "# ๐Ÿ“ˆ Single-cell protein abundance by marker localization" ] }, { diff --git a/examples/spt.ipynb b/examples/spt.ipynb index 40114f7..79e2949 100755 --- a/examples/spt.ipynb +++ b/examples/spt.ipynb @@ -5,7 +5,7 @@ "metadata": {}, "source": [ "---\n", - "## Single-particle tracking (SPT).\n", + "## ๐Ÿ“ˆ Single-particle tracking (SPT).\n", "\n", "**Demo data** \n", "Download the demodata from this link: [the test video from Munder et al 2016 paper](https://elifesciences.org/download/aHR0cHM6Ly9zdGF0aWMtbW92aWUtdXNhLmdsZW5jb2Vzb2Z0d2FyZS5jb20vbXA0LzEwLjc1NTQvNTI2LzY3YWIyOTExMjkxMTcyMGU1OTk4MjY5OGZiMWVlMzY2OTE0YTBmZDIvZWxpZmUtMDkzNDctbWVkaWExLm1wNA==/elife-09347-media1.mp4?_hash=0Xnr7HGX1AYuIfQcupU%2BW3PG30wh8Wj6Cx3CXW6cO%2BA%3D) and store it in folder containing this notebook i.e. `examples`.\n", diff --git a/examples/viz_image.ipynb b/examples/viz_image.ipynb index f23fc26..33362a1 100755 --- a/examples/viz_image.ipynb +++ b/examples/viz_image.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "source": [ "---\n", - "## Visualization of the images." + "## ๐Ÿ–ผ๏ธ Visualization of the images." ] }, { @@ -96,7 +96,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.8" + "version": "3.7.12" } }, "nbformat": 4, diff --git a/setup.py b/setup.py index 277beb9..e04ae90 100755 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ author='rraadd88', author_email='rohanadandage@gmail.com', license='General Public License v. 3', - packages=setuptools.find_packages('.',exclude=['test', 'unit','deps', 'data']), + packages=setuptools.find_packages('.',exclude=['test','tests', 'unit','deps','data','examples']), classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 3',