Skip to main content

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

pip install casta

For development

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

Quick Start

Python

import casta

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

# 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

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
  • hmmlearn 0.3.3
  • Shapely 2.0.6
  • tqdm 4.67.1
  • 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.

Metadata

Release files for casta 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for casta 0.1.2
File Size Uploaded Provenance Actions
casta-0.1.2.tar.gz 43.2 kB Without provenance Details for casta-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for casta 0.1.2
File Interpreter ABI Platform Actions
casta-0.1.2-py3-none-any.whl Python 3 none any Details for casta-0.1.2-py3-none-any.whl

Total release size: 86.4 kB

Release files / casta-0.1.2.tar.gz

Download URL casta-0.1.2.tar.gz
Size 43.2 kB
Tags Source
SHA-256 checksum
How to use checksums
03a958c4ac3d62a6e7ff0cd103d644e84f4000c588301fe7013c59853deb5bb4
BLAKE2b-256 checksum
How to use checksums
2fe349031ebffded82511b95c329f5bae78df9744907fe500655794a5685c49c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.13

Release files / casta-0.1.2-py3-none-any.whl

Download URL casta-0.1.2-py3-none-any.whl
Size 43.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b3e508cf078c090dc2c809e0473abc0b1e41a48cdaf7dea6908777e2463bfd5
BLAKE2b-256 checksum
How to use checksums
18fbae03f80896915d145cf27ceab0a37cc9b64411b2f1cd8e4e89c62913b008
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.13

Security for casta 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page