Import
Import a project from the standard PhysiCell format (sample_projects or user_projects) into the PhysiCellModelManager.jl format.
Public API
PhysiCellModelManager.importProject — Method
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 theinputsfolder 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)Private API
PhysiCellModelManager.adaptConfig — Method
adaptConfig(config::ImportDestFolder)Adapt the config file to be used in the PhysiCellModelManager.jl structure.
PhysiCellModelManager.adaptCustomCPP — Method
adaptCustomCPP(path_from_inputs::AbstractString)Adapt the custom cpp file to be used in the PhysiCellModelManager.jl structure.
PhysiCellModelManager.adaptCustomCode — Method
adaptCustomCode(custom_code::ImportDestFolder)Adapt the custom code to be used in the PhysiCellModelManager.jl structure.
PhysiCellModelManager.adaptCustomHeader — Method
adaptCustomHeader(path_from_inputs::AbstractString)Adapt the custom header to be used in the PhysiCellModelManager.jl structure.
PhysiCellModelManager.adaptCustomModules — Method
adaptCustomModules(path_from_inputs::AbstractString)Adapt the custom modules to be used in the PhysiCellModelManager.jl structure.
PhysiCellModelManager.adaptMain — Method
adaptMain(path_from_inputs::AbstractString)Adapt the main.cpp file to be used in the PhysiCellModelManager.jl structure.
PhysiCellModelManager.adaptMakefile — Method
adaptMakefile(path_from_inputs::AbstractString)Adapt the Makefile to be used in the PhysiCellModelManager.jl structure.
PhysiCellModelManager.adaptProject — Method
adaptProject(import_dest_folders::ImportDestFolders)Adapt the project to be used in the PhysiCellModelManager.jl structure.
PhysiCellModelManager.copyFilesToFolders — Method
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.
PhysiCellModelManager.createComponentDestFilename — Method
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.
PhysiCellModelManager.createInputFolder! — Method
createInputFolder!(import_dest_folder::ImportDestFolder)Create an input folder based on the provided destination folder.
PhysiCellModelManager.createInputFolders! — Method
createInputFolders!(import_dest_folders::ImportDestFolders, project_sources::ImportSources)Create input folders based on the provided project sources and destination folders.
PhysiCellModelManager.prepareIntracellularImport — Method
prepareIntracellularImport(src::Dict, config::ImportSource, path_to_project::AbstractString)Prepare the intracellular import source.
PhysiCellModelManager.prepareRulesetsCollectionImport — Method
prepareRulesetsCollectionImport(src::Dict, path_to_project::AbstractString)Prepare the rulesets collection import 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.
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.
PhysiCellModelManager.processSuccessfulImport — Method
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.
PhysiCellModelManager.resolveProjectSource! — Method
resolveProjectSource!(project_source::ImportSource, path_to_project::AbstractString)Resolve the project source by checking if it exists in the project directory.
PhysiCellModelManager.resolveProjectSources! — Method
resolveProjectSources!(project_sources::ImportSources, path_to_project::AbstractString)Resolve the project sources by checking if they exist in the project directory.
PhysiCellModelManager.writeDescriptionToMetadata — Method
writeDescriptionToMetadata(path_to_metadata::AbstractString, description::AbstractString)Write the description to the metadata file.