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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1c2d604c65712a2d6474bc025b616ea43eaaf664ad1f1f9d3a42fbd2ec04e6d |
|
MD5 | 323928bce8e04064221f230c7e660841 |
|
BLAKE2b-256 | bf277f186f4bc97123557196ba59c18d0601c475e6eb9a99576ae1aec1bd141b |
Close
Hashes for simularium_metrics_calculator-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7328442f56342365f60539a3bd18779d3621be95a131d9e51b1a424da4c86091 |
|
MD5 | 26f1e287b02b9f81d9b611cdc9a8c960 |
|
BLAKE2b-256 | 794829f49a465fa935d2fd57a28f71edab93592e401db99b46ca14ceebb65995 |