Skip to content

Minor changes before publication in JOSS #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
project = 'tracksegnet'
copyright = '2024, H. Kabbech'
author = 'H. Kabbech'
release = '1.0.0'
release = '1.3.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
26 changes: 16 additions & 10 deletions docs/source/installation.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# Installation and requirements
# Installation

## Clone the repository
## Installation with pip

```bash
```
[sudo] pip install tracksegnet
```

## Installation from the GitHub repository and requirements

- Clone the repository
```
git clone https://github.com/hkabbech/TrackSegNet.git
cd TrackSegNet
```

## Either create and run a docker container
- Either create and run a docker container

```bash
# Build a docker image (Rebuild the image after changing the parameters):
Expand All @@ -16,18 +23,17 @@ docker compose build
docker compose run tracksegnet-env
```

## Or create a virtual environment and install the packages
- Or create a virtual environment and install the packages

Requirement: python3.8 or equivalent and the virtualenv library
Requirement: python={3.8, 3.9, 3.10} and the virtualenv library

```bash
# Create the environment:
python -m venv tracksegnet-env
# virtualenv -p /usr/bin/python3 tracksegnet-env
python -m venv tracksegnet-env # or virtualenv -p /usr/bin/python3 tracksegnet-env
# Activate the environment:
source ./tracksegnet-env/bin/activate # for Windows PowerShell: .\tracksegnet-env\Scripts\Activate.ps1 (run as administrator)
source ./tracksegnet-env/bin/activate # Or source ./tracksegnet-env/Scripts/activate for Windows. For PowerShell: .\tracksegnet-env\Scripts\Activate.ps1 (run as administrator)
# Install the required python libraries:
python -m pip install -r requirements.txt
pip install -e . # or python -m pip install -r requirements.txt
```

Note for later, to deactivate the virtual environment, type `deactivate`.
9 changes: 0 additions & 9 deletions paper/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ @article{metzler2014
publisher={Royal Society of Chemistry}
}


@misc{chollet2015,
title={Keras},
author={Chollet, F. and others},
year={2015},
howpublished={\url{https://keras.io}},
}


@article{lundahl1986,
title={Fractional Brownian motion: A maximum likelihood estimator and its application to image texture},
author={Lundahl, T. and Ohley, W. J. and Kay, S. M. and Siffert, R.},
Expand Down
10 changes: 3 additions & 7 deletions paper/paper.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
---
title: 'TrackSegNet: a tool for trajectory segmentation into diffusive states using supervised deep learning'
tags:
- Python
- single-particle tracking
- trajectory segmentation
- supervised deep learning
- mean squared displacement
authors:
- name: Hélène Kabbech
orcid: 0000-0002-9200-2112
affiliation: "1"
- name: Ihor Smal
orcid: 0000-0001-7576-7028
affiliation: "1"
orcid: 0000-0001-7576-7028
affiliations:
- name: Department of Cell Biology, Erasmus University Medical Center, Rotterdam, the Netherlands
index: 1
date: 14 March 2023
date: June 2024
bibliography: paper.bib
---

Expand All @@ -40,7 +36,7 @@ This software is based on the method of @arts2019 with major improvements, makin

Tracking particles from 2-dimensional images results in a set $\mathcal{S}$ of trajectories $r_i \in \mathcal{S}$, $i = \left\{1, \dots, P \right\}$, where $P$ is the total number of trajectories, and $r_i(t) = (x_i(t), y_i(t))$ are the 2D coordinates of the particle $i$ at time $t$.

The network is built using functions from the Keras library [@chollet2015], and is composed of a bidirectional long short-term memory (LSTM) layer (having 200 hidden units), followed by a fully connected time-distributed layer with a `SoftMax` activation function. The inputs of the network are of six trajectory features previously computed, while the outputs are probabilities for each trajectory point of belonging to one of the $N$ diffusive states, the predicted state is defined by the highest probability.
The network is built using functions from the Keras library, and is composed of a bidirectional long short-term memory (LSTM) layer (having 200 hidden units), followed by a fully connected time-distributed layer with a `SoftMax` activation function. The inputs of the network are of six trajectory features previously computed, while the outputs are probabilities for each trajectory point of belonging to one of the $N$ diffusive states, the predicted state is defined by the highest probability.

The computed features along a given trajectory are: the displacements $\Delta x_{\delta=1}$ and $\Delta y_{\delta=1}$ at the first discrete time interval $\delta=1$ (with $\Delta r_\delta (t) = r(t) - r(t+\delta)$), the distances $d_{\delta=1}$ (with $d_\delta (t) = \sqrt{\Delta x_\delta (t)^2 + \Delta y_\delta (t)^2}$), the mean of displacements $\overline{d_{\delta=1,p=1}}$ and $\overline{d_{\delta=2,p=1}}$ (with $\overline{d_{\delta,p}}(t) = \frac{1}{2p+1}\sum_{k=t-p}^{t+p} d_{\delta}(k)$ with $p\geq 1$) and the angles $\theta_{\delta=1}$ between consecutive displacements. The last feature is an addition to the initial method, used for a better distinction of the trajectory confinement. The first and last trajectory points of each trajectory vector are discarded due to missing computed feature(s).

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "tracksegnet"
version = "1.2.5"
version = "1.3.0"
dynamic = ["dependencies"]
authors = [
{ name="Hélène Kabbech", email="[email protected]" },
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ google-auth-oauthlib==0.4.6
google-pasta==0.2.0
grpcio>=1.53.0
h5py==3.8.0
idna==3.4
idna>=3.7
importlib-metadata==6.0.0
keras==2.11.0
kiwisolver==1.4.4
Expand Down Expand Up @@ -47,7 +47,7 @@ tensorflow==2.11.1
tensorflow-estimator==2.11.0
tensorflow-io-gcs-filesystem==0.30.0
termcolor==2.2.0
tqdm==4.64.1
tqdm>=4.66.3
typing-extensions==4.4.0
urllib3>=1.26.18
werkzeug>=2.3.8
Expand All @@ -57,4 +57,4 @@ myst_parser>=2.0.0
sphinx>=7.0.0
sphinx_rtd_theme>=2.0.0
readthedocs-sphinx-search>=0.1.1
tracksegnet==1.2.5
tracksegnet==1.3.0
Loading