Import

Import a project from the standard PhysiCell format (sample_projects or user_projects) into the PhysiCellModelManager.jl format.

Public API

PhysiCellModelManager.importProjectMethod
importProject(path_to_project::AbstractString[; src=Dict(), dest=Dict()])

Import a project from the structured in the format of PhysiCell sample projects and user projects into the PhysiCellModelManager.jl structure.

This function will create new directories every time it is called, even if the project was already imported. Copy the console output to your scripts to prepare inputs for running the imported project rather than repeatedly running this function.

Arguments

  • path_to_project::AbstractString: Path to the project to import. Relative paths are resolved from the current working directory where Julia was launched.

Keyword Arguments

  • src::Dict: Dictionary of the project sources to import. If absent, tries to use the default names.

The following keys are recognized: "config", "main", "makefile", "custom_modules", "rulesets_collection", "intracellular", "ic_cell", "ic_substrate", "ic_ecm", and "ic_dc".

  • dest::Dict: Dictionary of the inputs folders to create in the PhysiCellModelManager.jl structure. If absent, taken from the project name.

Any valid project location can be used as a key. For example, "config", "custom_code", "ic_cell", etc.

  • dest::AbstractString: If a single string is provided, it is used as the name of the folder to create in the inputs folder for all locations.

For both src and dest (as Dict), the key "rules" is an alias for "rulesets_collection".

Returns

An InputFolders instance with the paths to the imported project files. This can immediately be used to run simulations. However, do not use this function in a script as it will repeatedly create new folders each call.

Deprecated method

The following method is deprecated and will be removed in the future. Note that the arguments are optional, positional arguments, not keyword arguments.

importProject(path_to_project::AbstractString, src::Dict, dest::Dict)
source

Private API

PhysiCellModelManager.copyFilesToFoldersMethod
copyFilesToFolders(path_to_project::AbstractString, project_sources::ImportSources, import_dest_folders::ImportDestFolders)

Copy files from the project directory to the destination folders in the PhysiCellModelManager.jl structure.

source
PhysiCellModelManager.createComponentDestFilenameMethod
createComponentDestFilename(src_lines::Vector{String}, component::PhysiCellComponent)

Create a file name for the component file to be copied to. If a file exists with the same name and content, it will not be copied again. If a file exists with the same name but different content, a new file name will be created by appending a number to the base name.

source
PhysiCellModelManager.printNewFolders!Method
printNewFolders!(path_to_project::AbstractString, import_dest_folders::ImportDestFolders)

Internal function to print the new folders created during the import process.

source
PhysiCellModelManager.printTogether!Function
printTogether!(paths_created::Vector{Vector{String}}, indent::Int=1)

Internal helper function to print the paths created during the import process in a structured way.

source
PhysiCellModelManager.processSuccessfulImportMethod
processSuccessfulImport(path_to_project::AbstractString, import_dest_folders::ImportDestFolders)

Process the successful import by printing the new folders created, re-initializing the database, printing Julia code to prepare inputs, and returning the InputFolders instance.

importProject will create new input folders each time it is called, even if calling a project that was already imported. So, the printed Julia code should be used to add to scripts that prepare inputs for running the imported project.

source