# OUTPUT_SCRIPTS

An optional section that controls the child scripts that are created and possibly run after a parent script has finished running.

The OUTPUT_SCRIPTS section is available in the following scripts:-

- Tut Script
- Gen Script
- Fit Script
- Sim Script
- MSim Script
- MTut Script

i.e. Any script that can generate child scripts may have an OUTPUT_SCRIPTS section.

## Structure of OUTPUT_SCRIPTS

The OUTPUT_SCRIPTS in all Script File Formats share a common format, as follows:-

    OUTPUT_SCRIPTS:
        <child_script1>: {output_mode: gen_script_and_run}
        <child_script2>: {output_mode: gen_script_only}
        <child_script3>: {output_mode: no_output}

The OUTPUT_SCRIPTS section is a dict record. i.e it is a Python dictionary with child script names as keys.

All child script sections share the ‘output_mode’ field, which can take the following values:-

- gen_script_and_run - create the child script and run it
- gen_script_only - create the child script, but do not run it
- no_output - do not create the child script

Generally if a child script is not mentioned in the parent script the ‘output_mode’ defaults to ‘no_output’.

The available child scripts are dependent on the parent script type. Also there maybe additional options for each child script, see examples below for more concrete details.

## Example OUTPUT_SCRIPTS for tut_script

The example below is used in Generate data and Fit using a Two Compartment Model.

    OUTPUT_SCRIPTS:
        GEN: {output_mode: gen_script_and_run, sim_time_step: 1.0, share_axes: True}
        FIT: {output_mode: gen_script_and_run, sim_time_step: 1.0, share_axes: True}
        COMP: {output_mode: gen_script_and_run}
        TUTSUM: {output_mode: gen_script_and_run}

This specifies that a child Gen Script, Fit Script, Comp Script and TutSum Script are all run.

Note it’s possible to miss out the OUTPUT_SCRIPTS section from a Tut Script, then the default settings are run, which is equivalent to:-

    OUTPUT_SCRIPTS:
        GEN: {output_mode: gen_script_and_run, sim_time_step: -1.0, share_axes: True}
        FIT: {output_mode: gen_script_and_run, sim_time_step: -1.0, share_axes: True}
        COMP: {output_mode: no_output}
        TUTSUM: {output_mode: gen_script_and_run}

This results in more limited tutorial outputs compared to the previous example.

## Example OUTPUT_SCRIPTS for gen_script

The example below is used in Generate a Two Compartment PopPK Data Set.

    OUTPUT_SCRIPTS:
        SIM: {output_mode: gen_script_and_run, sim_time_step: 1.0, share_axes: True}
        GENSUM: {output_mode: gen_script_and_run}

This specifies that a child Sim Script and GenSum Script are run.

Note it’s possible to miss out the OUTPUT_SCRIPTS section from a Gen Script, then the default settings are run, which is equivalent to:-

    OUTPUT_SCRIPTS:
        GRPH: {output_mode: no_output}
        SIM: {output_mode: no_output}
        GENSUM: {output_mode: no_output}

i.e. if you miss out the OUTPUT_SCRIPTS then you just get the Gen Script output and no further processing, as you might expect.

## Example OUTPUT_SCRIPTS for fit_script

The example below is used in Fitting a Two Compartment PopPK Model.

    OUTPUT_SCRIPTS:
        SIM: {output_mode: gen_script_and_run, sim_time_step: 1.0}
        MSIM: {output_mode: gen_script_only}
        FITSUM: {output_mode: gen_script_and_run}

This specifies that a child Sim Script and FitSum Script are run and a MSim Script is created on disk but not run automatically.

Note it’s possible to miss out the OUTPUT_SCRIPTS section from a Fit Script, then the default settings are run, which is equivalent to:-

    OUTPUT_SCRIPTS:
        GRPH: {output_mode: no_output}
        SIM: {output_mode: no_output}
        MSIM: {output_mode: no_output}
        FITSUM: {output_mode: no_output}

i.e. if you miss out the OUTPUT_SCRIPTS then you just get the Fit Script output and no further processing, as you might expect.

## Example OUTPUT_SCRIPTS for sim_script

The example below is from a Sim Script generated by a Fit Script in Fitting a Two Compartment PopPK Model.

    OUTPUT_SCRIPTS:
        GRPH:
            output_mode: gen_script_and_run
            grph_list: ['SPAG_GRPH', 'COMB_SPAG_GRPH']
            x_var: TIME
            y_var_list: ['DV_CENTRAL', 'DV_CENTRAL', 'DV_CENTRAL']
            y_var_src_list: ['observed_data', 'initial', 'final']
            y_var_label_list: ['DV_CENTRAL', 'DV_CENTRAL', 'DV_CENTRAL']

The single ‘GRPH’ child script above, is used to plot the results of the Sim Script simulated PK curves.

You can edit the ‘GRPH’ options to control the graphical output.

## Example OUTPUT_SCRIPTS for msim_script

The example below is from a MSim Script generated by a Fit Script in Fitting a Two Compartment PopPK Model.

    OUTPUT_SCRIPTS:
        VPC:
            output_mode: gen_script_and_run
            vpc_list: ['COMB_QUANT_SIM_VPC']
            y_var_src_list: ['sim', 'orig']
            y_var_list: ['DV_CENTRAL_sim', 'DV_CENTRAL']
            x_var: TIME_SINCE_LAST_DOSE

The single ‘VPC’ child script above, is used to plot a VPC using the results of the MSim Script multi population simulated PK curves.

You can edit the ‘VPC’ options to control the graphical output.

## Example OUTPUT_SCRIPTS for mtut_script

The example below is used in Generate multiple data sets and Fit using a Two Compartment Model.

    OUTPUT_SCRIPTS:
        MGEN: {output_mode: gen_script_and_run}
        MFIT: {output_mode: gen_script_and_run}
        MCOMP: {output_mode: gen_script_and_run, dot_size: 12}

This MTut Script outputs and runs a MGen Script, MFit Script and MComp Script.

Notice you can optionally alter the size of the dots on the MComp Script scatter plots using the ‘dot_size’ field.