Julia is a scientific computing language.
We are using the PyCall.js library to run pcdl within Julia.
Make sure that the python3 environment is activated, which has pcdl installed.
Fire up a Juila shell.
juliaPakage installation.
using Pkg
Pkdg.add("PyCall")Run pcdl.
using PyCall
pcdl = pyimport("pcdl") # import the pcdl module.
mcdsts = pcdl.TimeSeries("path/to/PhysiCell/output/") # load an mcds time series.
?mcdsts.get_cell_df() # retrieve a function's docstring.
df = mcdsts.get_cell_df() # retrieve the cell dataframe.cd path/to/PhysiCellpcdl_get_conc_df outputpcdl_get_cell_df outputWe are using the DataFrames.js library, to load the csv files.
Package installation.
using Pkg
Pkdg.add("CSV")
Pkdg.add("DataFrames")Load csv into a dataframe.
using CSV
using DataFramesdf_cell = CSV.File("output/timeseries_cell.csv") |> DataFramedf_conc = CSV.File("output/timeseries_cell.csv") |> DataFramecd path/to/PhysiCellpcdl_get_conc_attribute output 2pcdl_get_cell_attribute output 2We are using the JSON3.js library, to load the json files.
Package installation.
using Pkg
Pkg.add("JSON3")Load json.
using JSON3json_string = read("output/timeseries_conc_attribute_minmax.json", String)
j_conc = JSON3.read(json_string)json_string = read("output/timeseries_cell_attribute_minmax.json", String)
j_cell = JSON3.read(json_string)cd path/to/PhysiCellpcdl_make_graph_gml output/output00000024.xml neighbor --node_attribute cell_type dead oxygen pressure⚠ bue 2024-09-04: this is currently not working, since, for now, GraphIO cannot handle the graph, node, or edge metadata in the file ( JuliaGraphs/GraphIO.jl#46 ).
We will use the GraphIO.js library, to load gml files.
Package installation.
using Pkg
Pkg.add("GraphIO")
Pkg.add("Graphs")
Pkg.add("ParserCombinator")Load gml.
using GraphIO
using Graphs
using ParserCombinatorgraph = loadgraph("output/output00000024_neighbor.gml", GraphIO.GML.GMLFormat())Please study the Graphs documentation to learn how to analyze graph data.
cd path/to/PhysiCellpcdl_get_anndata output/We will use scverse's Muon.jl library, to load h5ad files.
Package installation.
using Pkg
Pkg.add("Muon")Load h5ad.
using Muonadata = readh5ad("output/timeseries_cell_maxabs.h5ad")Please study the Muon and AnnData documentation to learn how to analyze this data.
pcdl_plot_contour output/output00000021.xml oxygen --ext tiffpcdl_plot_contour output/output00000021.xml oxygenpcdl_plot_scatter output/output00000021.xmlpcdl_make_ome_tiff('output/')⚠ bue 2024-09-04: ome.tiff files currently cannot be loaded ( github issue: tlnagy/OMETIFF.jl#112 ).
We will use the Images library, and it's OMETIFF extension, to load jpeg, png, tiff, and ome.tiff files
Package installation.
using Pkg
Pkg.add("FileIO")
Pkg.add("Images")
Pkg.add("OMETIFF")Load image file.
using FileIOomeimg = load("output/timeseries_ID.ome.tiff")img = load("output/cell_cell_type_z0.0/output00000021_cell_type.jpeg")That's it!