Tools¶
A collection of tools that make DAPT easy to use, especially with PhysiCell. The sample_db
and create_settings_file()
methods are helpful with anyone using DAPT. The rest of the methods are used specifically for PhysiCell pipelines.
-
dapt.tools.
create_XML
(parameters, default_settings='PhysiCell_settings_default.xml', save_settings='PhysiCell_settings.xml', off_limits=[])¶ Create a PhysiCell XML settings file given a dictionary of paramaters. This function works by having a
default_settings
file which contains the generic XML structure. Each key inparameters` then contains the paths to each XML tag in the ``default_settings
file. The value of that tag is then set to the value in the associated key. If a key inparameters
does not exist in thedefault_settings
XML file then it is ignored. If a key inparameters
also exists inoff_limits
then it is ignored.Parameters: - paramaters (dict) – A dictionary of paramaters where the key is the path to the xml variable and the value is the desired value in the XML file.
- default_settings (str) – the path to the default xml file
- save_settings (str) – the path to the output xml file
- off_limits (list) – a list of keys that should not be inserted into the XML file.
-
dapt.tools.
create_settings_file
(parameters, pid=None)¶ Creates a file where each line contains a key from the parameters and its associated key, separated by a semicolon.
Parameters: - parameters (dict) – the paramaters to be saved in the file
- pid (str) – the parameter id of the current parameter run. If you don’t give an id then the id in
parameters
will be used.
-
dapt.tools.
create_zip
(pid)¶ Zip all of the important PhysiCell items.
Parameters: pid (str) – the id of the current parameter run Returns: The name of the zipped file
-
dapt.tools.
data_cleanup
(config=None)¶ Emulating make data-cleanup-light: remove .mat, .xml, .svg, .txt, .pov. You can optionally remove zipped files by setting
remove-zip
equal toTrue
or remove*.mp4
by settingremove-movie
toTrue
in the config file.Parameters: config (Config) – A config object, optionally given.
-
dapt.tools.
sample_db
(file_name='sample_db.csv', delimiter=', ')¶ Create a sample Delimited_file database. The sample table is shown below. This method will create a file specified in the file_name attribute using the delimiter specified by delimiter.
id start-time end-time status a b c t1 2019-09-06 17:23 2019-09-06 17:36 finished 2 4 6 t2 10 10 t3 10 -10 Parameters: - file_name (str) – the file name of the file to create and use for the database. The default value is sample_db.csv.
- delimiter (str) – the delimiter to use for the file. The default is a ,.
Returns: A Delimited_file object using the file_name specified.