Calculate plot metrics from spatial agent data
Project description
Simularium Metrics Calculator
Calculate plot metrics from spatial agent data
Installation
Stable Release: [Coming soon!] pip install simularium_metrics_calculator
Development Head: pip install git+https://github.com/simularium/metrics-calculator.git
To install in editable mode with all dev dependencies: just install
Quickstart
from simulariumio import FileConverter, InputFileData
from simularium_metrics_calculator import (
PLOT_TYPE,
SCATTER_PLOT_MODE,
MetricsService,
PlotInfo,
)
# create main class
metrics_service = MetricsService()
# check the metrics that are available to plot
metrics = metrics_service.available_metrics()
# load simularium trajectory data using simulariumio
traj_data = FileConverter(
input_file=InputFileData(
file_path=(
"simularium_metrics_calculator/tests/data/"
"aster_pull3D_couples_actin_solid_3_frames_small.json"
)
)
)._data
# configure some plots
plot1 = PlotInfo( # Number of agents vs time scatterplot
plot_type=PLOT_TYPE.SCATTER,
metric_info_x=metrics[0]["uid"],
metric_info_y=metrics[2]["uid"],
scatter_plot_mode=SCATTER_PLOT_MODE.LINES,
)
plot2 = PlotInfo( # Nearest neighbor distance histogram
plot_type=PLOT_TYPE.HISTOGRAM,
metric_info_x=metrics[3]["uid"],
)
# calculate the plot data
result = manager.plot_data(
traj_data,
plots=[
plot1,
plot2,
],
)
Documentation
For full package documentation please visit simularium.github.io/metrics-calculator.
Development
See CONTRIBUTING.md for information related to developing the code.
Apache Software License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for simularium_metrics_calculator-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 980b55ce0fba5f35cd6140677dead1dce622978a2f21cd94ad7d7c58452ffe04 |
|
MD5 | 57410394c00c6b557bdaec9c20797048 |
|
BLAKE2b-256 | 127044f609c66fa7f130bb378a20b2f849bf7e563e08690857e0197030433201 |
Close
Hashes for simularium_metrics_calculator-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e973e8bae6c86769d94fd4219650db62e2c7e7fad3971ca0c65ac61f7d5d321d |
|
MD5 | 36780821b66c78ca4a606a895bccec09 |
|
BLAKE2b-256 | 25b72f0ba98caae64d247f663dc1a046dfca60cfee9bb203127cd04cbe231834 |