simul.simul

Module Contents

class simul.simul.Simul[source]

Generic simulator.

__init__()[source]

Default constructor.

sim(model, inputdir, outputdir, cluster="local", local_cpus=1, runs=1, output_msg=False)[source]

Time course simulator.

Parameters:
  • model – the model to process
  • inputdir – the directory containing the model
  • outputdir – the directory containing the output files
  • cluster – local, lsf for Load Sharing Facility, sge for Sun Grid Engine.
  • local_cpus – the number of CPU.
  • runs – the number of model simulation
  • output_msg – print the output messages on screen (available for cluster=’local’ only)
ps1(model, scanned_par, simulate_intervals, single_param_scan_intervals, inputdir, outputdir, cluster="local", local_cpus=1, runs=1, output_msg=False)[source]

Single parameter scan.

Parameters:
  • model – the model to process
  • scanned_par – the scanned parameter
  • simulate_intervals – the time step of each simulation
  • single_param_scan_intervals – the number of scans to perform
  • inputdir – the directory containing the model
  • outputdir – the directory to store the results
  • cluster – local, lsf for Load Sharing Facility, sge for Sun Grid Engine.
  • local_cpus – the number of CPU used.
  • runs – the number of model simulation
  • output_msg – print the output messages on screen (available for cluster=’local’ only)
ps2(model, sim_length, inputdir, outputdir, cluster="local", local_cpus=1, runs=1, output_msg=False)[source]

Double paramter scan.

Parameters:
  • model – the model to process
  • sim_length – the length of the simulation
  • inputdir – the directory containing the model
  • outputdir – the directory to store the results
  • cluster – local, lsf for Load Sharing Facility, sge for Sun Grid Engine.
  • local_cpus – the number of CPU.
  • runs – the number of model simulation
  • output_msg – print the output messages on screen (available for cluster=’local’ only)
pe(model, inputdir, cluster, local_cpus, runs, outputdir, sim_data_dir, output_msg=False)[source]

parameter estimation.

Parameters:
  • model – the model to process
  • inputdir – the directory containing the model
  • cluster – local, lsf for load sharing facility, sge for sun grid engine
  • local_cpus – the number of cpu
  • runs – the number of fits to perform
  • outputdir – the directory to store the results
  • sim_data_dir – the directory containing the simulation data sets
  • output_msg – print the output messages on screen (available for cluster=’local’ only)
get_sim_columns(path_in=".")[source]

Return the columns to analyse (sim task)

Parameters:path_in – the path to the input files
get_best_fits(path_in=".", path_out=".", filename_out="final_estimates.csv")[source]

Collect the final parameter estimates. Results are stored in filename_out.

Parameters:
  • path_in – the path to the input files
  • path_out – the path to the output files
  • filename_out – a global file containing the best fits from independent parameter estimations.
Returns:

the number of retrieved files

get_all_fits(path_in=".", path_out=".", filename_out="all_estimates.csv")[source]

Collect all the parameter estimates. Results are stored in filename_out.

Parameters:
  • path_in – the path to the input files
  • path_out – the path to the output files
  • filename_out – a global file containing all fits from independent parameter estimations.
Returns:

the number of retrieved files

_run_par_comput(model, inputdir, outputdir, cluster="local", local_cpus=1, runs=1, output_msg=False)[source]

Run generic parallel computation.

Parameters:
  • model – the model to process
  • inputdir – the directory containing the model
  • outputdir – the directory to store the results
  • cluster – local, lsf for load sharing facility, sge for sun grid engine
  • local_cpus – the number of cpus
  • runs – the number of runs to perform
  • output_msg – print the output messages on screen (available for cluster=’local’ only)
Returns:

(groupid, group_model)

_get_model_group(model)[source]

Return the model without extension concatenated with the groupid string :param model: the model name :return: the concatenated string

_move_reports(inputdir, outputdir, model, groupid)[source]

Move the report files

Parameters:
  • inputdir – the directory containing the model
  • outputdir – the directory containing the output files
  • model – the model to process
  • groupid – a string identifier in the file name characterising the batch of simulated models.
replace_str_in_report(report)[source]

Replaces strings in a report file.

Parameters:report – a report file with its absolute path
_get_input_files(path)[source]

Retrieve the input files in a path.

Parameters:path – the path containing the input files to retrieve
Returns:the list of input files
_get_params_list(filein)[source]

Return the list of parameter names from filein

Parameters:filein – a report file
Returns:the list of parameter names
_write_params(col_names, path_out, filename_out)[source]

Write the list of parameter names to filename_out

Parameters:
  • col_names – the list of parameter names
  • path_out – the path to store filename_out
  • filename_out – the output file to store the parameter names
_write_best_fits(files, path_out, filename_out)[source]

Write the final estimates to filename_out

Parameters:
  • files – the list of parameter estimation reports
  • path_out – the path to store the file combining the final (best) estimates (filename_out)
  • filename_out – the file containing the final (best) estimates
_write_all_fits(files, path_out, filename_out)[source]

Write all the estimates to filename_out

Parameters:
  • files – the list of parameter estimation reports
  • path_out – the path to store the file combining all the estimates
  • filename_out – the file containing all the estimates
_ps1_header_init(report, scanned_par)[source]

Header report initialisation for single parameter scan pipeline.

Parameters:
  • report – a report
  • scanned_par – the scanned parameter

:return a list containing the header or an empty list if no header was created.

ps1_postproc(model, scanned_par, simulate_intervals, single_param_scan_intervals, outputdir)[source]

Perform post processing organisation to single parameter scan report files.

Parameters:
  • model – the model to process
  • scanned_par – the scanned parameter
  • simulate_intervals – the time step of each simulation
  • single_param_scan_intervals – the number of scans to perform
  • outputdir – the directory to store the results
ps2_postproc(model, sim_length, outputdir)[source]

Perform post processing organisation to double parameter scan report files.

Parameters:
  • model – the model to process
  • sim_length – the length of the simulation
  • outputdir – the directory to store the results