Skip to content

Commit e95d774

Browse files
authored
Merge pull request #44 from elmbeech/master
pcdl version 4.1.5
2 parents cc278a9 + ad31057 commit e95d774

40 files changed

Lines changed: 1651 additions & 300 deletions

.github/workflows/apple.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
PYTHONPATH: /Users/runner/work/physicelldataloader/physicelldataloader
2626

2727
steps:
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@main
2929
- name: set up python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v5
30+
uses: actions/setup-python@main
3131
with:
3232
python-version: ${{ matrix.python-version }}
3333
- name: install dependencies
3434
run: |
3535
brew install ffmpeg imagemagick
3636
python -m pip install --upgrade pip
37-
python -m pip install flake8 pytest anndata bioio bioio-ome-tiff matplotlib neuroglancer numpy pandas requests scikit-image scipy vtk
37+
python -m pip install flake8 pytest anndata bioio bioio-ome-tiff matplotlib networkx neuroglancer numpy pandas requests scikit-image scipy vtk "ome-zarr<0.14.0"
3838
python -m pip install /Users/runner/work/physicelldataloader/physicelldataloader -v
3939
#if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
4040
- name: lint with flake8

.github/workflows/linux.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ jobs:
2525
PYTHONPATH: /home/runner/work/physicelldataloader/physicelldataloader
2626

2727
steps:
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@main
2929
- name: set up python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v5
30+
uses: actions/setup-python@main
3131
with:
3232
python-version: ${{ matrix.python-version }}
3333
- name: install dependencies
3434
run: |
35+
sudo apt update
3536
sudo apt install ffmpeg imagemagick
3637
python -m pip install --upgrade pip
37-
python -m pip install flake8 pytest anndata bioio bioio-ome-tiff matplotlib neuroglancer numpy pandas requests scikit-image scipy vtk
38+
python -m pip install flake8 pytest anndata bioio bioio-ome-tiff matplotlib networkx neuroglancer numpy pandas requests scikit-image scipy vtk "ome-zarr<0.14.0"
3839
python -m pip install /home/runner/work/physicelldataloader/physicelldataloader -v
3940
#if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
4041
- name: lint with flake8

.github/workflows/windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
PYTHONPATH: D:\a\physicelldataloader\physicelldataloader
2626

2727
steps:
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@main
2929
- name: set up python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v5
30+
uses: actions/setup-python@main
3131
with:
3232
python-version: ${{ matrix.python-version }}
3333
- name: install dependencies
3434
run: |
3535
choco install ffmpeg imagemagick
3636
python -m pip install --upgrade pip
37-
python -m pip install flake8 pytest anndata bioio bioio-ome-tiff matplotlib neuroglancer numpy pandas requests scikit-image scipy vtk
37+
python -m pip install flake8 pytest anndata bioio bioio-ome-tiff matplotlib networkx neuroglancer numpy pandas requests scikit-image scipy vtk "ome-zarr<0.14.0"
3838
python -m pip install D:\a\physicelldataloader\physicelldataloader -v
3939
#echo 'set PYTHONPATH=D:\a\physicelldataloader\physicelldataloader' >> $GITHUB_ENV
4040
#if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Abstract:
44

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
5+
physicell data loader (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,
77
into [python3](https://en.wikipedia.org/wiki/Python_(programming_language)) or transform PhysiCell output into more widely used data formats.
88
pcdl can be loaded as a python3 module or run straight from the command line.
@@ -23,7 +23,7 @@ The pcdl python3 library maintains four branches:
2323
## Header:
2424

2525
+ 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
26+
+ Library dependencies: anndata, bioio, geopandas, matplotlib, networkx, neuroglancer, numpy, pandas, (requests), scikit-image, scipy, shapely, spatialdata, vtk
2727
+ Date of origin original PhysiCell-Tools python-loader: 2019-09-02
2828
+ Date of origin pcdl fork: 2022-08-30
2929
+ Doi: https://doi.org/10.5281/ZENODO.8176399
@@ -49,7 +49,8 @@ Basics Tutorials:
4949
Extras tutorials python3 language:
5050
+ [pcdl and python3 and json](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_python3_json.md)
5151
+ [pcdl and python3 and pandas](https://github.com/elmbeech/physicelldataloader/tree/master/man/TUTORIAL_python3_pandas.md)
52-
+ [pcdl and python3 and scipy and scanpy](https://github.com/elmbeech/physicelldataloader/tree/master/man/TUTORIAL_python3_scverse.md)
52+
+ [pcdl and python3 and scanpy and squidpy](https://github.com/elmbeech/physicelldataloader/tree/master/man/TUTORIAL_python3_scverse.md)
53+
+ [pcdl and python3 and muspan](https://github.com/elmbeech/physicelldataloader/tree/master/man/TUTORIAL_python3_muspan.md)
5354
+ [pcdl and python3 and graphs](https://github.com/elmbeech/physicelldataloader/tree/master/man/TUTORIAL_python3_graph.md)
5455
+ [pcdl and python3 and matplotlib](https://github.com/elmbeech/physicelldataloader/tree/master/man/TUTORIAL_python3_matplotlib.md)
5556
+ [pcdl and python3 and vtk](https://github.com/elmbeech/physicelldataloader/tree/master/man/TUTORIAL_python3_vtk.md)
@@ -129,6 +130,18 @@ Developers, please make pull requests to the https://github.com/elmbeech/physice
129130

130131

131132
## Release Notes:
133+
+ version 4.1.5 (2026-04-05)
134+
+ bugfix library dependencies and library versions.
135+
136+
+ version 4.1.4 (2026-04-04)
137+
+ pyMCDSts **mcdsts.make_contour** extrema parameter is replaced by vmin and vmax to be compatible with mcds.make\_contour and plt.contour.
138+
+ **make_cell_vtk** and **make_conc_vtk** now offer an ext parameter, allowing to manually specify the exact file extension. special thanks to Danyon Gedris!
139+
+ new **make_muspan** TimeStep class and TimeSeris class function and **pcdl_get_muspan** command line command. special thanks to Joshua Moore and Joshua Bull!
140+
141+
+ version 4.1.3 (2026-03-21):
142+
+ new **pcdl.pccmap** color map. this is an adaptation of the physicell pathology paint by number color map.
143+
+ new TimeStep **get_pcdl_version** function.
144+
132145
+ version 4.1.2 (2026-03-06): elmbeech/physicelldataloader
133146
+ new **custom_data_astype** TimeStep class and TimeSeries class function to set the dtype of custom\_data variables even after the timestep or timeseries is loaded.
134147
+ TimeSeries \_\_init\_\_ function can now handle a list of TimeStep objects as input instead of a path.
@@ -137,13 +150,14 @@ Developers, please make pull requests to the https://github.com/elmbeech/physice
137150
+ reduced memory footprint.
138151

139152
+ version 4.1.0 (2025-12-31): elmbeech/physicelldataloader
140-
+ new **get_spatialdata** TimeStep class and TimeSeris class function and **pcdl_get_spatialdata** command line command.
153+
+ new **get_spatialdata** TimeStep class and TimeSeris class function and **pcdl_get_spatialdata** command line command. special thanks to Luca Marconato!
154+
+ with this release, pcdl officially became an [scverse ecosystem](https://scverse.org/packages/#ecosystem) package.
141155

142156
+ version 4.0.5 (2025-10-22): elmbeech/physicelldataloader
143157
+ **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.
144158
+ **plot_scatter** and **plot_timeseries** now additionally have a cat\_drop and cat\_keep argument to filter categorical data.
145159
+ **plot_timeseries(frame=conc)** now plots by default all substrate concentrations over time.
146-
+ **plot_timeseries(ext=)** parameter offers to return a dataframe object, dafaframe csv file, image file, or a matplotlib fig object. special thanks to John Nardini and Edward Young.
160+
+ **plot_timeseries(ext=)** parameter offers to return a dataframe object, dafaframe csv file, image file, or a matplotlib fig object. special thanks to John Nardini and Edward Young!
147161

148162
+ version 4.0.4 (2025-07-23): elmbeech/physicelldataloader
149163
+ command line commands now return **error code 0** if the command runs successfully.

man/REFERENCE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Basically, there are four types of functions:
4646
### TimeStep medata
4747
*version*
4848
+ [help(mcds.get_multicellds_version)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcds.get_multicellds_version.md) #! workhorse function
49+
+ [help(mcds.get_pcdl_version)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcds.get_pcdl_version.md) #! workhorse function
4950
+ [help(mcds.get_physicell_version)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcds.get_physicell_version.md) #! workhorse function
5051

5152
*time*
@@ -99,6 +100,8 @@ Basically, there are four types of functions:
99100
+ [help(mcds.make_graph_gml)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcds.make_graph_gml.md) #! workhose function
100101

101102
### TimeStep microenvironment and cells
103+
+ [help(mcds.get_muspan)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcds.get_muspan.md) #! workhose function
104+
+ [help(mcds.get_spatialdata)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcds.get_spatialdata.md) #! workhose function
102105
+ [help(mcds.make_ome_tiff)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcds.make_ome_tiff.md) #! workhose function
103106
+ [help(mcds.make_neuroglancer)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcds.make_neuroglancer.md) #! workhose function
104107

@@ -146,6 +149,8 @@ Basically, there are four types of functions:
146149
+ [help(mcdsts.get_graph_gml)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcdsts.make_graph_gml.md) #! workhose function
147150

148151
### TimeSteries microenvironment and cells
152+
+ [help(mcdsts.get_muspan)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcdsts.get_muspan.md) #! workhose function
153+
+ [help(mcdsts.get_spatialdata)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcdsts.get_spatialdata.md) #! workhose function
149154
+ [help(mcdsts.make_ome_tiff)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcdsts.make_ome_tiff.md) #! workhose function
150155
+ [help(mcdsts.make_neuroglancer)](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/mcdsts.make_neuroglancer.md) #! workhose function
151156

@@ -196,6 +201,8 @@ The command line interface functions mimic the name and parameter arguments as c
196201
+ [pcdl_make_graph_gml --help](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/pcdl_make_graph_gml.md) #! workhorse function
197202

198203
### Command line cells and microenvironment
204+
+ [pcdl_get_muspan --help](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/pcdl_get_muspan.md) #! workhorse function
205+
+ [pcdl_get_spatialdata --help](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/pcdl_get_spatialdata.md) #! workhorse function
199206
+ [pcdl_make_ome_tiff --help](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/pcdl_make_ome_tiff.md) #! workhorse function
200207
+ [pcdl_make_neuroglancer --help](https://github.com/elmbeech/physicelldataloader/tree/master/man/docstring/pcdl_make_neuroglancer.md) #! workhorse function
201208

man/TUTORIAL_blender.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ And there exists a bioxel nodes plugin, that lets us load ome tiff files.
1010

1111
The blender bvtk nodes plugin allows us to load vtk files into blender.
1212

13+
Note, to be able to load whole time series, the blender bvtk nodes plugin needs a simplified output00000000.vtp file name and extension (which is different from the pcdl default output00000000\_cell.vtp).
14+
This is why the ext parameter explicitly has to be set.
15+
1316
### Generate vtk files from the command line
1417

1518
```bash
1619
pcdl_make_conc_vtk output
1720
```
1821
```bash
19-
pcdl_make_cell_vtk output
22+
pcdl_make_cell_vtk output --ext .vtp # blender bvtk nodes compatible filename and extension.
2023
```
2124

2225
### Generate vtk files from within python
@@ -26,7 +29,7 @@ import pcdl
2629

2730
mcdsts = pcdl.TimeSeries('output/')
2831
mcdsts.make_conc_vtk()
29-
mcdsts.make_cell_vtk()
32+
mcdsts.make_cell_vtk(ext='.vtp') # blender bvtk nodes compatible filename and extension.
3033
```
3134

3235
### Blender vtk nodes plugin installation

man/TUTORIAL_commandline.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ Further readings:
249249

250250
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.
251251

252-
Anndata is the standard data format in the python single cell community.
252+
Anndata is the standard data format in the python3 single cell community.
253253
Data stored in this format can be analyzed the same way as usually sc RNA seq data is analyzed.
254254

255255
```bash
@@ -337,12 +337,33 @@ Further readings:
337337

338338
## Microenvironment and cell agent related commands
339339

340+
### &#x2728; pcdl\_get\_muspan
341+
342+
From time series and single time steps, generate [muspan](https://www.muspan.co.uk/) domain files.
343+
One file per time step and z-layer.
344+
345+
Muspan is a sphisticated python3 libaray for multiscale spatial data analysis, develop by researchers at the University of Oxford.
346+
347+
```bash
348+
pcdl_get_muspan output/output00000000.xml
349+
```
350+
```bash
351+
pcdl_get_muspan output
352+
```
353+
```bash
354+
pcdl_get_muspand -h
355+
```
356+
357+
Further readings:
358+
+ [TUTORIAL_python3_muspan.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_python3_muspan.md)
359+
360+
340361
### &#x2728; pcdl\_get\_spatialdata
341362

342363
From a single time step, generate [spatialdata](https://spatialdata.scverse.org/en/stable/) [zarr](https://zarr.dev/) files.
343364
The spatialdata format should, in the long run, become comaptibel with the [OME-NGFF](https://ngff.openmicroscopy.org/latest/index.html) data format.
344365

345-
Spatialdata is the standard data format in the python spatial single cell community.
366+
Spatialdata is the standard data format in the python3 spatial single cell community.
346367
Data stored in this format can be analyzed the same way as spatial sc RNA seq data is analyzed.
347368

348369
```bash

man/TUTORIAL_introduction.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PhysiCell Data Loader Tutorial: pcdl Introduction
22

3-
If you have not already done so, please install the latest version of physicelldataloader (pcdl),
3+
If you have not already done so, please install the latest version of physicell data loader (pcdl),
44
as described in the [HowTo](https://github.com/elmbeech/physicelldataloader/blob/master/man/HOWTO.md) section.\
55
The current development happens in branch v4.
66
Branch v3 and v4 are maintained and [pip](https://pypi.org/project/pcdl/) installable.
@@ -23,10 +23,10 @@ In 2019, a similar loader script was written for python3.
2323
The name of this script filed was pyMCDS.py and basically defined one class named pyMCDS.
2424

2525
In autumn 2022, an endeavor was undertaken to pack the original pyMCDS.py script into a pip installable python3 library and develop it further, but always in such a way that, if necessary, the code could still be run like in the early days.\
26-
The result is the pcdl physicelldataloader library branch v2, v3.
26+
The result is the pcdl physicell data loader library branch v2, v3.
2727
In spring 2025, the code was stripped of some relics (mainly in the back end) from the early days to make the code more python3 than C++ like, which resulted in branch v4.
2828

29-
The result from all of this is the pcdl physicelldataloader library here.\
29+
The result from all of this is the pcdl physicell data loader library here.\
3030
In the big picture, the pyMCDS class evolved into the TimeStep class, which is slightly heavier but much more powerful for downstream data analysis than the original pyMCDS class.
3131
Additionally, a TimeSeries class was added.
3232

man/TUTORIAL_python3_muspan.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# PhysiCell Data Loader Tutorial: pcdl and Python and MuSpAn
2+
3+
[MuSpAn](https://www.muspan.co.uk/) is a multiscale spatial analysis toolbox for analyzing spatial transcriptomics data, multiplex immunohistochemistry data, imaging mass cytometry data, and more.
4+
It uses cutting-edge mathematical and statistical approaches to data analysis to provide the most comprehensive spatial analysis available and is being continually expanded, with a team of quantitative researchers constantly developing new methodology to tackle multiscale spatial analysis problems.
5+
6+
Pcdl offers a time step and time series get\_muspan function to translate cell and substrate data into a dictionary of muspan domain objects, one domain per time step z-layer.
7+
8+
Additionally, pcdl provides a pcdl\_get\_muspan command line command to translate PhysiCell output into muspan domain files.
9+
10+
For installation and learning how to use muspan, please follow the official documentation.
11+
12+
+ https://www.muspan.co.uk/
13+
+ https://docs.muspan.co.uk/latest/Documentation.html
14+
+ https://github.com/joshwillmoore1/MuSpAn-Public
15+
16+
## Translate mcds time step and time series into muspan domains.
17+
18+
```python
19+
import pcdl
20+
import muspan as ms
21+
22+
mcdsts = pcdl.TimeSeries('output/')
23+
do_domain = mcdsts.get_muspan() # translate the mcds time seris into a dictionary of muspan domain objects.
24+
ls_domain = sorted(do_domain.keys()) # generate an orderes list of domain names
25+
26+
print(ls_domain) # print a list of domain names
27+
print(do_domain[ls_domain[0]]) # take a look at the first domain in the ls_domain list.
28+
```
29+
30+
That's it. The rest is analysis!

man/TUTORIAL_python3_timeseries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PhysiCell Data Loader Tutorial: pcdl and Python and MCDS TimeSeries
22

3-
If not already done so, please install the latest version of physicelldataloader (pcdl), as described in the [HowTo](https://github.com/elmbeech/physicelldataloader/blob/master/man/HOWTO.md) section.
3+
If not already done so, please install the latest version of physicell data loader (pcdl), as described in the [HowTo](https://github.com/elmbeech/physicelldataloader/blob/master/man/HOWTO.md) section.
44
And maybe read about the pcdl [background](https://github.com/elmbeech/physicelldataloader/tree/master/man/TUTORIAL_introduction.md) information.
55
And perhaps, work thorough the [TUTORIAL_python3_timestep.md](https://github.com/elmbeech/physicelldataloader/blob/master/man/TUTORIAL_python3_timestep.md)
66

0 commit comments

Comments
 (0)