physicool.processing
A module to process output PhysiCell files and extract metrics from the data.
Module Contents
Classes
Functions
|
Loads the data from the output mat files into a Pandas DataFrame. |
Reads the PhysiCell version number from VERSION.TXT. |
|
|
Converts a string with the version number to a tuple to ease version comparison. |
|
Compares the passed version to the first version with the output*_cells.mat format. |
|
Returns the expected file name for cell files based on PhysiCell version number. |
|
|
|
Reads the PhysiCell output data into a Pandas DataFrame. |
|
Returns the cells inside a z-axis slice and returns them. |
|
Reads the PhysiCell output data into a Pandas DataFrame. |
|
Returns the number of cells over time (one value for each simulation time point). |
|
Returns the number of cells over time (one value for each simulation time point). |
|
Returns the mean squared error value between the reference and simulated datasets. |
Attributes
- physicool.processing.NEW_OUTPUTS_VERSION = '1.10.3'
- physicool.processing.CELL_OUTPUT_LABELS = ['ID', 'position_x', 'position_y', 'position_z', 'total_volume', 'cell_type', 'cycle_model',...
- class physicool.processing.Microenvironment(time_point, path)[source]
- Parameters:
time_point (int) –
path (Union[pathlib.Path, str]) –
- physicool.processing.read_mat_file_cells(path, variables)[source]
Loads the data from the output mat files into a Pandas DataFrame.
- Parameters:
path (str) –
variables (List[str]) –
- Return type:
pandas.DataFrame
- physicool.processing.read_physicell_version()[source]
Reads the PhysiCell version number from VERSION.TXT.
- Return type:
str
- physicool.processing.convert_version_str_to_tuple(version)[source]
Converts a string with the version number to a tuple to ease version comparison.
- Parameters:
version (str) –
- Return type:
Tuple[int]
- physicool.processing.check_version_status(version)[source]
Compares the passed version to the first version with the output*_cells.mat format.
- Parameters:
version (str) –
- Return type:
bool
- physicool.processing.get_cell_file_name(version)[source]
Returns the expected file name for cell files based on PhysiCell version number.
- Parameters:
version (str) –
- Return type:
str
- physicool.processing.get_cell_file_num(output_path, version)[source]
- Parameters:
output_path (pathlib.Path) –
version (str) –
- Return type:
str
- physicool.processing.get_cell_data(timestep, variables, output_path=Path('output'), version=NEW_OUTPUTS_VERSION)[source]
Reads the PhysiCell output data into a Pandas DataFrame.
- Parameters:
timestep (int) – The time point to be read.
variables (List[str]) – The variables to be extracted from the file.
output_path (Union[str, pathlib.Path]) – The path to where the output files can be found.
version (str) –
- Returns:
A DataFrame with the passed variables for every cell.
- Return type:
pd.DataFrame
- physicool.processing.get_cells_in_z_slice(data, size)[source]
Returns the cells inside a z-axis slice and returns them. The slice will be centered at 0 and have the passed size.
- Parameters:
data (pandas.DataFrame) – A DataFrame with the cells’ coordinates (must contain a column called “position_z”).
size (float) – The size of the z-slice.
- Returns:
A DataFrame that only contains the cells inside the slice.
- Return type:
pd.DataFrame
- physicool.processing.get_cell_trajectories(output_path, version=NEW_OUTPUTS_VERSION)[source]
Reads the PhysiCell output data into a Pandas DataFrame.
- Parameters:
output_path (Union[str, pathlib.Path]) – The path to where the output files can be found.
version (str) –
- Returns:
A DataFrame with the passed variables for every cell.
- Return type:
pd.DataFrame
- physicool.processing.OutputProcessor
- physicool.processing.get_cell_numbers_over_time(output_path=Path('output'), version=NEW_OUTPUTS_VERSION)[source]
Returns the number of cells over time (one value for each simulation time point).
- Parameters:
output_path (pathlib.Path) – The path to where the output files can be found.
version (str) –
- Returns:
An array with the number of cells at every simulation time point.
- Return type:
np.ndarray
- physicool.processing.get_final_y_position(output_path=Path('output'), version=NEW_OUTPUTS_VERSION)[source]
Returns the number of cells over time (one value for each simulation time point).
- Parameters:
output_path (pathlib.Path) – The path to where the output files can be found.
version (str) –
- Returns:
An array with the number of cells at every simulation time point.
- Return type:
np.ndarray
- physicool.processing.ErrorQuantification