Skip to content

Commit f1a4b9b

Browse files
authored
Merge pull request #41 from elmbeech/master
pcdl release v4.1.0
2 parents 6098199 + 02d7e79 commit f1a4b9b

27 files changed

Lines changed: 1513 additions & 50 deletions

.github/workflows/apple.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
#python-version: ["3.14"]
21-
python-version: ["3.10", "3.11", "3.12", "3.13"]
21+
python-version: ["3.11", "3.12", "3.13"]
2222

2323
env:
2424
MPLBACKEND: Agg # https://github.com/orgs/community/discussions/26434

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
#python-version: ["3.14"]
21-
python-version: ["3.10", "3.11", "3.12", "3.13"]
21+
python-version: ["3.11", "3.12", "3.13"]
2222

2323
env:
2424
MPLBACKEND: Agg # https://github.com/orgs/community/discussions/26434

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
#python-version: ["3.14"]
21-
python-version: ["3.10", "3.11", "3.12", "3.13"]
21+
python-version: ["3.11", "3.12", "3.13"]
2222

2323
env:
2424
MPLBACKEND: Agg # https://github.com/orgs/community/discussions/26434

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
## Abstract:
44

5-
physicelldataloader (pcdl) provides a platform independent, python3 based, [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)) installable interface
5+
physicelldataloader (pcdl) provides a platform-independent (Windows, MacOSX, Linux), python3 based, [pip](https://en.wikipedia.org/wiki/Pip_(package_manager))-installable set of commands
66
to load output, generated with the [PhysiCell](https://github.com/MathCancer/PhysiCell) agent-based modeling and diffusion solver framework,
7-
into [python3](https://en.wikipedia.org/wiki/Python_(programming_language)).
7+
into [python3](https://en.wikipedia.org/wiki/Python_(programming_language)) or transform PhysiCell output into more widely used data formats.
8+
pcdl can be loaded as a python3 module or run straight from the command line.
9+
10+
![pcdl concept](man/img/physicelldataloader_concept_v4.0.0.png)
811

912
pcdl was forked from the original [PhysiCell-Tools](https://github.com/PhysiCell-Tools) [python-loader](https://github.com/PhysiCell-Tools/python-loader) implementation.
1013

@@ -19,8 +22,8 @@ The pcdl python3 library maintains four branches:
1922

2023
## Header:
2124

22-
+ Language: python [>= 3.10](https://devguide.python.org/versions/)
23-
+ Library dependencies: anndata, bioio, matplotlib, numpy, pandas, (requests), scipy, vtk
25+
+ Language: python [>= 3.11](https://devguide.python.org/versions/)
26+
+ Library dependencies: anndata, bioio, geopandas, matplotlib, neuroglancer, numpy, pandas, (requests), scikit-image, scipy, shapely, spatialdata, vtk
2427
+ Date of origin original PhysiCell-Tools python-loader: 2019-09-02
2528
+ Date of origin pcdl fork: 2022-08-30
2629
+ Doi: https://doi.org/10.5281/ZENODO.8176399
@@ -92,7 +95,7 @@ Within the pcdl library, we tried to stick to the documentation policy laid out
9295
+ original PhysiCell-Tools python-loader implementation: Patrick Wall, Randy Heiland, Paul Macklin
9396
+ fork pcdl implementation: Elmar Bucher
9497
+ fork pcdl co-programmer: Furkan Kurtoglu, Heber Rocha, Jennifer Eng
95-
+ fork pcdl continuous testing and feedbacks: Aneequa Sundus, John Metzcar
98+
+ fork pcdl continuous testing and feedbacks: Aneequa Sundus (python), John Metzcar (python), Raquel Arroya (matlab)
9699
+ student prj on pcdl:
97100
Benjamin Jacobs (make\_graph\_gml),
98101
Jason Lu (render\_neuroglancer),
@@ -110,7 +113,7 @@ Developers, please make pull requests to the https://github.com/elmbeech/physice
110113

111114
```bibtex
112115
@Misc{bucher2023,
113-
author = {Bucher, Elmar and Wall, Patrick and Rocha, Heber and Kurtoglu, Furkan and Eng, Jennifer and Sundus, Aneequa, and Metzcar, John and Heiland, Randy and Macklin, Paul},
116+
author = {Bucher, Elmar and Wall, Patrick and Rocha, Heber and Kurtoglu, Furkan and Eng, Jennifer and Sundus, Aneequa, and Metzcar, John and Arroya, Raquel and Heiland, Randy and Macklin, Paul},
114117
title = {elmbeech/physicelldataloader: pcdl platform-independent, pip-installable interface to load PhysiCell agent-based modeling framework output into python3.},
115118
year = {2023},
116119
copyright = {Open Access},
@@ -124,7 +127,11 @@ Developers, please make pull requests to the https://github.com/elmbeech/physice
124127

125128
+ evt generate lineage tree graph output files.
126129

130+
127131
## Release Notes:
132+
+ version 4.1.0 (2025-12-31): elmbeech/physicelldataloader
133+
+ new TimeStep class and TimeSeris class function **get_spatialdata** and command line command **pcdl_get_spatialdata**.
134+
128135
+ version 4.0.5 (2025-10-22): elmbeech/physicelldataloader
129136
+ **settingxml** default is now set to False, because the cell\_type id label mapping can, in recent PhysiCell output, be retrieved from output\*.xml too.
130137
+ **plot_scatter** and **plot_timeseries** now additionally have a cat\_drop and cat\_keep argument to filter categorical data.
@@ -135,7 +142,7 @@ Developers, please make pull requests to the https://github.com/elmbeech/physice
135142
+ command line commands now return **error code 0** if the command runs successfully.
136143

137144
+ version 4.0.3 (2025-07-20): elmbeech/physicelldataloader
138-
+ timestep and timeseries **plot_contour**, **plot_scatter**, and **plot_timeseries** handle now **kwargs** arguments.
145+
+ TimeStep and TimeSeris **plot_contour**, **plot_scatter**, and **plot_timeseries** handle now **kwargs** arguments.
139146
+ minor bugfixes.
140147

141148
+ version 4.0.2 (2025-06-29): elmbeech/physicelldataloader

man/TUTORIAL_commandline.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Please spend some time to learn about each of the about 20 commands, by studying
1313
This will truly make you a power user!
1414

1515

16-
1716
## Preparation
1817

1918
To runs this tutorial,
@@ -31,10 +30,8 @@ python3 -c"import pathlib, pcdl, shutil; pcdl.install_data(); s_ipath=str(pathli
3130
```
3231

3332

34-
3533
## Metadata related commands
3634

37-
3835
### ✨ pcdl\_get\_version
3936

4037
Outputs PhysiCell, MCDS, and pcdl version on screen.
@@ -49,7 +46,6 @@ pcdl_get_version output/output00000000.xml
4946
pcdl_get_version -h
5047
```
5148

52-
5349
### ✨ pcdl\_get\_unit\_dict
5450

5551
Generate a [csv](https://en.wikipedia.org/wiki/Comma-separated_values) file that maps attribute and units, as specified in the settings.xml.
@@ -65,10 +61,8 @@ pcdl_get_unit_dict -h
6561
```
6662

6763

68-
6964
## Microenvironment related commands
7065

71-
7266
### ✨ pcdl\_get\_substrate\_list
7367

7468
Outputs all substrates modeled in the microenvironment on screen.
@@ -83,7 +77,6 @@ pcdl_get_substrate_list output/output00000000.xml
8377
pcdl_get_substrate_list -h
8478
```
8579

86-
8780
### ✨ pcdl\_get\_conc\_attribute
8881

8982
Generate a [json](https://en.wikipedia.org/wiki/JSON) file, that lists all substrate attributes.
@@ -108,7 +101,6 @@ Further readings:
108101
+ [TUTORIAL_r.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_r.md)
109102
+ [TUTORIAL_julia.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_julia.md)
110103

111-
112104
### ✨ pcdl\_get\_conc\_df
113105

114106
Generate a dataframe [csv](https://en.wikipedia.org/wiki/Comma-separated_values) file that lists one voxel per row,
@@ -133,7 +125,6 @@ Further readings:
133125
+ [TUTORIAL_r.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_r.md)
134126
+ [TUTORIAL_julia.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_julia.md)
135127

136-
137128
### ✨ pcdl\_plot\_contour
138129

139130
For oxygen generate a [jpeg](https://en.wikipedia.org/wiki/JPEG) file
@@ -149,7 +140,6 @@ pcdl_plot_contour output/output00000000.xml oxygen
149140
pcdl_plot_contour -h
150141
```
151142

152-
153143
### ✨ pcdl\_make\_conc\_vtk
154144

155145
Generate a rectilinear grid [vtk](https://en.wikipedia.org/wiki/VTK) file from a single time step,
@@ -179,7 +169,6 @@ Further readings:
179169

180170
## Cell agent related commands
181171

182-
183172
### ✨ pcdl\_get\_celltype\_list
184173

185174
Output all cell types modeled.
@@ -232,7 +221,6 @@ Further readings:
232221
+ [TUTORIAL_r.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_r.md)
233222
+ [TUTORIAL_julia.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_julia.md)
234223

235-
236224
### ✨ pcdl\_get\_cell\_df
237225

238226
Generate a dataframe [csv](https://en.wikipedia.org/wiki/Comma-separated_values) file that lists one cell per row,
@@ -244,7 +232,11 @@ In the example below, the generated csv contains:
244232

245233
```bash
246234
pcdl_get_cell_df output 2
235+
```
236+
```bash
247237
pcdl_get_cell_df output/output00000000.xml
238+
```
239+
```bash
248240
pcdl_get_cell_df -h
249241
```
250242

@@ -253,17 +245,15 @@ Further readings:
253245
+ [TUTORIAL_r.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_r.md)
254246
+ [TUTORIAL_julia.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_julia.md)
255247

256-
257248
### ✨ pcdl\_get\_anndata
258249

259-
From the whole time series or from a single time step generate h5ad [anndata](https://anndata.readthedocs.io/en/latest/) [hd5](https://en.wikipedia.org/wiki/Hierarchical_Data_Format) files.
250+
From the whole time series or from a single time step, generate h5ad [anndata](https://anndata.readthedocs.io/en/latest/) [hd5](https://en.wikipedia.org/wiki/Hierarchical_Data_Format) files.
260251

261252
Anndata is the standard data format in the python single cell community.
262253
Data stored in this format can be analyzed the same way as usually sc RNA seq data is analyzed.
263254

264255
```bash
265256
pcdl_get_anndata output/output00000000.xml
266-
pcdl_get_anndata -h
267257
```
268258
```bash
269259
pcdl_get_anndata output
@@ -277,7 +267,6 @@ Further readings:
277267
+ [TUTORIAL_r.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_r.md)
278268
+ [TUTORIAL_julia.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_julia.md)
279269

280-
281270
### ✨ pcdl\_make\_graph\_gml
282271

283272
Generate [gml](https://github.com/elmbeech/physicelldataloader/blob/master/man/publication/himsolt1996gml_a_portable_graph_file_format.pdf) files.
@@ -300,7 +289,6 @@ Further readings:
300289
+ [TUTORIAL_r.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_r.md)
301290
+ [TUTORIAL_julia.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_julia.md)
302291

303-
304292
### ✨ pcdl\_plot\_scatter
305293

306294
Generate a [jpeg](https://en.wikipedia.org/wiki/JPEG) file that displaying all cells.
@@ -319,7 +307,6 @@ pcdl_plot_scatter output
319307
pcdl_plot_scatter -h
320308
```
321309

322-
323310
### ✨ pcdl\_make\_cell\_vtk
324311

325312
Generate a 3D glyph [vtk](https://en.wikipedia.org/wiki/VTK) file from a single time step,
@@ -348,9 +335,28 @@ Further readings:
348335
+ [TUTORIAL_julia.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_julia.md)
349336

350337

351-
352338
## Microenvironment and cell agent related commands
353339

340+
### ✨ pcdl\_get\_spatialdata
341+
342+
From a single time step, generate [spatialdata](https://spatialdata.scverse.org/en/stable/) [zarr](https://zarr.dev/) files.
343+
The spatialdata format should, in the long run, become comaptibel with the [OME-NGFF](https://ngff.openmicroscopy.org/latest/index.html) data format.
344+
345+
Spatialdata is the standard data format in the python spatial single cell community.
346+
Data stored in this format can be analyzed the same way as spatial sc RNA seq data is analyzed.
347+
348+
```bash
349+
pcdl_get_spatialdata output/output00000000.xml
350+
```
351+
```bash
352+
pcdl_get_spatialdata output
353+
```
354+
```bash
355+
pcdl_get_spatialdata -h
356+
```
357+
358+
Further readings:
359+
+ [TUTORIAL_python3_scverse.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_python3_scverse.md)
354360

355361
### ✨ pcdl\_plot\_timeseries
356362

@@ -376,19 +382,16 @@ pcdl_plot_timeseries output none
376382
```bash
377383
pcdl_plot_timeseries output cell_type
378384
```
379-
380385
```bash
381386
pcdl_plot_timeseries output cell_type oxygen
382387
```
383-
384388
```bash
385389
pcdl_plot_timeseries output cell_type oxygen max
386390
```
387391

388392
```bash
389393
pcdl_plot_timeseries output none oxygen
390394
```
391-
392395
```bash
393396
pcdl_plot_timeseries output none oxygen --frame conc
394397
```
@@ -397,7 +400,6 @@ pcdl_plot_timeseries output none oxygen --frame conc
397400
pcdl_plot_timeseries -h
398401
```
399402

400-
401403
### ✨ pcdl\_make\_ome\_tiff
402404

403405
Generate an [ome.tiff](https://ome-model.readthedocs.io/en/stable/index.html) file,
@@ -428,7 +430,6 @@ Further readings:
428430
+ [TUTORIAL_neuroglancer.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_neuroglancer.md)
429431
+ [TUTORIAL_blender.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_blender.md)
430432

431-
432433
### ✨ pcdl\_render\_neuroglancer
433434

434435
With this command, you can render a time step ome.tiff file or a time step from a whole time series ome.tiff file straight into [Neuroglancer](https://research.google/blog/an-interactive-automated-3d-reconstruction-of-a-fly-brain/), which is a [WebGL](https://en.wikipedia.org/wiki/WebGL)-based viewer that will render the ome.tiff straight in your browser.
@@ -477,6 +478,7 @@ pcdl_make_movie output/cell_cell_type_z0.0/
477478
pcdl_make_movie -h
478479
```
479480

481+
480482
## Data Clean Up
481483

482484
After you are done checking out the 2D unit test dataset,

man/TUTORIAL_julia.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,37 @@
33
[Julia](https://julialang.org/) is a scientific computing language.
44

55

6+
## ✨ Run pcdl within Julia
7+
8+
We are using the [PyCall.js](https://github.com/JuliaPy/PyCall.jl) library
9+
to run pcdl within Julia.
10+
11+
Make sure that the python3 environment is activated, which has pcdl installed.
12+
13+
Fire up a Juila shell.
14+
```bash
15+
julia
16+
```
17+
18+
Pakage installation.
19+
20+
```julia
21+
using Pkg
22+
Pkdg.add("PyCall")
23+
```
24+
25+
Run pcdl.
26+
27+
```julia
28+
using PyCall
29+
30+
pcdl = pyimport("pcdl") # import the pcdl module.
31+
mcdsts = pcdl.TimeSeries("path/to/PhysiCell/output/") # load an mcds time series.
32+
33+
?mcdsts.get_cell_df() # retrieve a function's docstring.
34+
df = mcdsts.get_cell_df() # retrieve the cell dataframe.
35+
```
36+
637
## ✨ Handle csv files
738

839
### Save pcdl data structures as csv files from the command line
@@ -98,7 +129,7 @@ pcdl_make_graph_gml output/output00000024.xml neighbor --node_attribute cell_typ
98129

99130
### Load gml files into a julia data structures
100131

101-
⚠ **bue 2024-09-04:** this is currently not working, since, for now, GraphIO cannot handle the graph, node, or edge metadata in the file.
132+
⚠ **bue 2024-09-04:** this is currently not working, since, for now, GraphIO cannot handle the graph, node, or edge metadata in the file ( https://github.com/JuliaGraphs/GraphIO.jl/issues/46 ).
102133

103134
We will use the [GraphIO.js](https://github.com/JuliaGraphs/GraphIO.jl) library,
104135
to load gml files.
@@ -142,7 +173,7 @@ pcdl_get_anndata output/
142173

143174
### Load h5ad files into a julia data structures
144175

145-
We will use scver's [Muon.jl](https://github.com/scverse/Muon.jl) library,
176+
We will use scverse's [Muon.jl](https://github.com/scverse/Muon.jl) library,
146177
to load h5ad files.
147178

148179
Package installation.
@@ -203,7 +234,6 @@ Load image file.
203234

204235
```julia
205236
using FileIO
206-
using Images
207237
```
208238
```julia
209239
omeimg = load("output/timeseries_ID.ome.tiff")

man/TUTORIAL_python3_scverse.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# PhysiCell Data Loader Tutorial: pcdl and Python and the scVerse
22

3-
[AnnData](https://anndata.readthedocs.io/en/latest/) is the data standard from the python single cell community.
4-
This means, PhysiCell output transformed into an AnnData object can be analyzed the same way sc RNA seq data is analyzed.
3+
[AnnData](https://anndata.readthedocs.io/en/latest/) and [SpatialData](https://spatialdata.scverse.org/en/stable/) are data standards from the python single cell community.
4+
This means, PhysiCell output transformed into an AnnData and SpatialData objects can be analyzed the same way sc RNA seq data is analyzed.
55
The whole [scverse](https://scverse.org/) (single cell univers) becomes accessible.
66

77
This includes:
88
+ [scanpy](https://scanpy.readthedocs.io/en/latest/): for classic single cell analysis.
99
+ [squidpy](https://squidpy.readthedocs.io/en/stable/): for spatial single cell analysis.
1010
+ [scvi-tools](https://scvi-tools.org/): for single cell machine learning.
11-
+ [muon](https://muon.readthedocs.io/en/latest/): for multimodal omics analysis.
12-
And there is a whole [ecosystem](https://scverse.org/packages/#ecosystem) of libraries, compatible with the AnnData format.
11+
And there is a whole [ecosystem](https://scverse.org/packages/#ecosystem) of libraries, compatible with the AnnData (and SpatialData) format.
1312

1413
Whatever you d'like to do with your physicell data, it most probably was already done with single cell wet lab data.
1514
That's being said: PhysiCell data is different scdata than scRNA seq data!

0 commit comments

Comments
 (0)