Skip to main content

Calculate spatial transient arrests

Project description

CASTA - Computational Analysis of Spatial Transient Arrests

CASTA is a Python package for analyzing spatial transient patterns in tracking data using Hidden Markov Models (HMM). It provides tools for processing and plotting trajectory data.

Installation

From PyPI (recommended)

pip install casta

For development

git clone https://github.com/NanoSignalingLab/photochromic-reversion.git
cd photochromic-reversion
pip install -e .

Quick Start

Command Line Usage

# Basic usage
python -m casta /path/to/your/track/data

# With parameters
python -m casta /path/to/data --dt 0.05 --min-track-length 25

Jupyter Notebook Usage

import casta

# Run analysis in notebook
casta.calculate_sta(
    dir="/path/to/data/directory",
    out_dir="/path/to/output/directory",
    min_track_length=25,
    dt=0.05,
    plot=True,
    image_format="svg"
)

Command Line Options

Option Type Default Description
dir str required Path to directory containing input track data
--out_dir str None Path to output directory to save results, defaults to input directory
--dt float 0.05 Time step for analysis
--min-track-length int 25 Minimum track length for analysis
--plot bool False Enable additional plotting
--image-format str svg Image format (svg, tiff)

Input Data Format

CASTA includes an example file.

import os
import casta

example_df, path = casta.example.load_example_data()

current_dir = os.getcwd()

casta.calculate_sta(path, out_dir=current_dir)

Output

The analysis generates:

  • Excel files with detailed results (*_CASTA_results.xlsx)
  • Visualization plots (optional, in specified format)

Requirements

  • Python 3.10.18
  • NumPy 1.26.4
  • Pandas 2.2.3
  • Matplotlib 3.10.0
  • SciPy 1.15.0
  • Scikit-learn 1.6.1
  • Seaborn 0.13.2
  • hmm-learn 0.3.3
  • Shapely 2.0.6
  • xlsxwriter 3.2.3

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use CASTA in your research, please cite:

Photochromic reversion enables long-term tracking of single molecules in living plants
Michelle von Arx, Kaltra Xhelilaj, Philip Schulz, Sven zur Oven-Krockhaus, Julien Gronnier
bioRxiv 2024.04.10.585335; doi: https://doi.org/10.1101/2024.04.10.585335

Support

For questions and support, please open an issue on the GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

casta-0.1.0.tar.gz (63.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

casta-0.1.0-py3-none-any.whl (64.3 kB view details)

Uploaded Python 3

File details

Details for the file casta-0.1.0.tar.gz.

File metadata

  • Download URL: casta-0.1.0.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for casta-0.1.0.tar.gz
Algorithm Hash digest
SHA256 44d7b9ed2fa0f8a0a40bf7bef7a78eb3d8045fe21de249a3641e918618e777bf
MD5 c703695f6f6df11cc791395741e1a630
BLAKE2b-256 0326bf591b26488c1ff032d42099719ddef88c6b240e9707519d7ef4a39f5bbb

See more details on using hashes here.

File details

Details for the file casta-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: casta-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 64.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for casta-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11a710db651f03b7e12112a8519e417e62d7e5bc6f018074f34cee6bec7b067d
MD5 1758eb809d31acf90a9b4cf3744b4632
BLAKE2b-256 1b54aeb6314be76c874b4f63232e98e6e94d0d49548cc431b7002527f8c6f7be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page