https://github.com/ocbe-uio/trajpy

Trajpy - empowering feature engineering for trajectory analysis across domains.

https://github.com/ocbe-uio/trajpy

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 19 DOI reference(s) in README
  • Academic publication links
    Links to: biorxiv.org, wiley.com, zenodo.org
  • Committers with academic emails
    1 of 6 committers (16.7%) from academic institutions
  • Institutional organization owner
    Organization ocbe-uio has institutional domain (www.med.uio.no)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.1%) to scientific vocabulary

Keywords

cell-migration diffusion python-package repeated-measurements time-series trajectory-analysis
Last synced: 5 months ago · JSON representation

Repository

Trajpy - empowering feature engineering for trajectory analysis across domains.

Basic Info
Statistics
  • Stars: 9
  • Watchers: 1
  • Forks: 2
  • Open Issues: 11
  • Releases: 10
Topics
cell-migration diffusion python-package repeated-measurements time-series trajectory-analysis
Created over 6 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License Code of conduct

README.md

PyPI version Build Status Documentation Status Python3 License: GPL v3 DOI Binder

TrajPy

Trajectory analysis is a challenging task and fundamental for understanding the movement of living organisms in various scales.

We propose TrajPy as an easy pythonic solution to be applied in studies that demand trajectory analysis. With a friendly graphic user interface (GUI) it requires little knowledge of computing and physics to be used by nonspecialists.

TrajPy is composed of three main units of code:

  • Basic usage:
    • The GUI: it is where you interact with trajpy and the only thing you need to know to start using it
  • Advanced
    • trajpy.py: it's the heart of trajpy, it computes the Features for characterizing the trajectories
    • traj_generator.py: a trajectory generator that can be used to build a dataset for trajectory classification

Our dataset and Machine Learning (ML) model are available for use, as well the generator for building your own database.

Installation

We have the package hosted at PyPi, for installing use the command line: bash pip3 install trajpy If you want to test the development version, clone the repository at your local directory from your terminal: bash git clone https://github.com/ocbe-uio/trajpy Then run the setup.py for installing bash python setup.py --install

Basic Usage Example

Using the Graphic User Interface (GUI)

Open a terminal and execute the line bellow bash python3 -m trajpy.gui

1 - You can open one file at time clicking on Open file... or process several files in the same director with Open directory...

2 - Select the features to be computed by ticking the boxes

3 - Click on Compute

4 - Select the directory and file name where the results will be stored

The processing is ready when the following message appears in the text box located at the bottom of the GUI:

Results saved to /path/to/results/output.csv

File formats

Comma separated values (CSV)

Currently trajpy support CSV files organized in 4 columns: time t and 3 spatial coordinates x, y, z:

|t|x|y|z| |---|---|---|---| | 1.00 | 10.00 | 50.00 | 50.00 | 2.00 | 11.00 | 50.00 | 50.00 | 3.00 | 11.00 | 50.00 | 50.00 | 4.00 | 12.00 | 50.00 | 50.00 | 5.00 | 12.00 | 50.00 | 50.00 | 6.00 | 13.00 | 50.00 | 50.00

See the sample file provided in this repository as example.

LAMMPS YAML dump format

LAMMPS YAML files are defined with the following structure: yaml --- time: 0.0 natoms: 100 keywords: [id, type, x, y, z, vx, vy, vz, fx, fy, fz] data: - [1, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -nan, -nan, -nan] - [2, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -nan, -nan, -nan] - [3, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -nan, -nan, -nan] ... We provide support for parsing this type of data files with the function parse_lammps_dump_yaml().

Scripting

First we import the package python import trajpy.trajpy as tj Then we load the data sample provided in this repository, we pass the arguments skip_header=1 to skip the first line of the file and delimiter=',' to specify the file format python filename = 'data/samples/sample.csv' r = tj.Trajectory(filename, skip_header=1, delimiter=',') Finally, for computing a set of features for trajectory analysis we can simple run the function r.compute_features() python r.compute_features() The features will be stored in the object r, for instance: ```python

r.asymmetry 0.5782095322093505 r.fractaldimension 1.04 r.efficiency 0.29363293632936327 r.gyrationradius array([[30.40512689, 5.82735002, 0.96782673], [ 5.82735002, 2.18625318, 0.27296851], [ 0.96782673, 0.27296851, 2.41663589]]) ```

For more examples please consult the extended documentation: https://trajpy.readthedocs.io/

Requirements

  • numpy >= 1.14.3
  • scipy >= 1.7.1
  • ttkthemes >= 2.4.0
  • Pillow >= 8.1.0
  • PyYAML >= 5.3.1

How to cite?

If using TrajPy for academic work, please cite our methodological paper and Software DOI:

```latex @article{10.1093/bioadv/vbae026, author = {Moreira-Soares, Maurício and Mossmann, Eduardo and Travasso, Rui D M and Bordin, José Rafael}, title = "{TrajPy: empowering feature engineering for trajectory analysis across domains}", journal = {Bioinformatics Advances}, volume = {4}, number = {1}, pages = {vbae026}, year = {2024}, month = {02}, issn = {2635-0041}, doi = {10.1093/bioadv/vbae026}, url = {https://doi.org/10.1093/bioadv/vbae026}, eprint = {https://academic.oup.com/bioinformaticsadvances/article-pdf/4/1/vbae026/56926570/vbae026.pdf}, }

@software{mauriciomoreira2020_3978699, author = {Mauricio Moreira and Eduardo Mossmann}, title = {phydev/trajpy: TrajPy 1.3.1}, month = aug, year = 2020, publisher = {Zenodo}, version = {1.3.1}, doi = {10.5281/zenodo.3978699}, url = {https://doi.org/10.5281/zenodo.3978699} } ```

Contribution

This is an open source project, and all contributions are welcome. Feel free to open an Issue, a Pull Request, or to e-mail us.

Publications using trajpy

Moreira-Soares M., Mossmann E., Travasso R. D. M, Bordin J. R., TrajPy: empowering feature engineering for trajectory analysis across domains, Bioinformatics Advances, Volume 4, Issue 1, 2024, vbae026, doi:10.1093/bioadv/vbae026

Eduardo Henrique Mossmann. A physics based feature engineering framework for trajectory analysis. MSc dissertation. Federal University of Pelotas 2022, Brazil.

Simões, RF, Pino, R, Moreira-Soares, M, et al. Quantitative Analysis of Neuronal Mitochondrial Movement Reveals Patterns Resulting from Neurotoxicity of Rotenone and 6-Hydroxydopamine. FASEB J. 2021; 35:e22024. doi:10.1096/fj.202100899R

Moreira-Soares, M., Pinto-Cunha, S., Bordin, J. R., Travasso, R. D. M. Adhesion modulates cell morphology and migration within dense fibrous networks. https://doi.org/10.1088/1361-648X/ab7c17

References

Arkin, H. and Janke, W. 2013. Gyration tensor based analysis of the shapes of polymer chains in an attractive spherical cage. J Chem Phys 138, 054904.

Wagner, T., Kroll, A., Haramagatti, C.R., Lipinski, H.G. and Wiemann, M. 2017. Classification and Segmentation of Nanoparticle Diffusion Trajectories in Cellular Micro Environments. PLoS One 12, e0170165.

Owner

  • Name: Oslo Centre for Biostatistics and Epidemiology
  • Login: ocbe-uio
  • Kind: organization
  • Location: Oslo, Norway

This is where we host some of the scientific software we produce at OCBE, a joint center between the University of Oslo and the Oslo University Hospital.

GitHub Events

Total
  • Watch event: 3
Last Year
  • Watch event: 3

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 355
  • Total Committers: 6
  • Avg Commits per committer: 59.167
  • Development Distribution Score (DDS): 0.118
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Mauricio Moreira p****v 313
pyup-bot g****t@p****o 24
--unset -****t 9
wpendl99 w****3@b****u 4
Maurício m****s@N****l 3
EduardoHenriqueMossmann e****n@h****m 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 28
  • Total pull requests: 80
  • Average time to close issues: 4 months
  • Average time to close pull requests: 9 days
  • Total issue authors: 3
  • Total pull request authors: 4
  • Average comments per issue: 0.64
  • Average comments per pull request: 0.94
  • Merged pull requests: 18
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • phydev (26)
  • wleoncio (1)
  • pyup-bot (1)
Pull Request Authors
  • pyup-bot (73)
  • phydev (3)
  • wpendl99 (2)
  • EduardoHenriqueMossmann (2)
Top Labels
Issue Labels
enhancement (12) good first issue (10) future-work (6) documentation (6) maintainability (5) bug (4) help wanted (3) tests (3) invalid (1)
Pull Request Labels
update (18) enhancement (1) bug (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 25 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 10
  • Total maintainers: 1
pypi.org: trajpy

Empowering feature engineering for trajectory analysis across domains.

  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 25 Last month
Rankings
Dependent packages count: 7.4%
Forks count: 19.2%
Average: 20.4%
Dependent repos count: 22.2%
Stargazers count: 23.2%
Downloads: 29.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • numpy >=1.14.3
  • opencv-contrib-python ==4.5.5.62
  • scipy ==1.7.1
requirements_docs.txt pypi
  • IPython >=7.14.0
  • ipykernel >=5.2.1
  • nbsphinx >=0.7.0
  • sphinx >=3.0.4
setup.py pypi
  • numpy *
  • opencv-contrib-python *
  • scipy *
.github/workflows/python-app.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/python-publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • pypa/gh-action-pypi-publish release/v1 composite