# Files Generated by Gen Script

This section discusses how the Gen Script saves files to disk, you can see an example in Generate a Two Compartment PopPK Data Set. After running a gen script, named ‘my_gen_script.pyml’, using the command:-

    $ popy_run my_gen_script.pyml

the output folder ‘my_gen_script.pyml_output’ will be created as follows:-

    my_gen_script.pyml_output/
        gen/
        sim/
        sum/

where

- gen contains the results of running the Gen Script
- sim contains the results of running Sim Script to create smoother profile curves and
- sum is a html summary of the generated data.

The Gen Script also creates a log file my_gen_script.pyml.run.main.log that stores the output to the command prompt.

## Gen Folder Output

The gen folder has the following contents:-

    builtin_gen_example_gen.pyml_output/
        gen/
            _temp/
            clean_sol/
            noisy_sol/
            compartment_diagram.dot
            compartment_diagram.svg
            dupe_covars_data.csv
            synthetic_data.csv

Here ‘_temp’ is a temporary folder used by PoPy. The file ‘dupe_covars_data.csv’ is an intermediate file.

A compartment diagram is created in .svg format. The .dot file is the Graphviz file, used to create the .svg file. You can see an example compartment diagram in Fig. 42.

The ‘clean_sol’ folder contains a solution with no noise added. The ‘noisy_sol’ contains as solution with measurement noise added. For example the ‘noisy_sol’ folder contains these files:-

    builtin_gen_example_gen.pyml_output/
        gen/
            noisy_sol/
                fx_params.csv
                mx_params.csv
                rx_params.csv
                solution.pyml
                sx_params.csv
                synthetic_data.csv

Here the key file is ‘synthetic_data.csv’, which is the full synthetic data file generated for this population. The other files represent intermediate variables for each time point, see Files Generated by Sim Script for more information.

Note the ‘synthetic_data.csv’ file is also output to this location, for easier access:-

    builtin_gen_example_gen.pyml_output/
        gen/
            synthetic_data.csv

It is the main data file created by the Gen Script.

## Naming of child scripts

Each child script file name is based on the following entry, in the parent Gen Script:-

    DESCRIPTION: {name: <gen_name>}

This naming convention for output folders and generated scripts is followed by all Script File Formats in PoPy.

## Gen Sim Folder Output

The Gen Script creates the following Sim Script:-

    my_gen_script.pyml_output/
        sim/
            <gen_name>_sim.pyml

This Sim Script plots smooth PK curves to visualise the `f[X]` parameters sampled by the Gen Script. See Files Generated by Sim Script for more details.

## Gen Sum Folder Output

The Gen Script creates the following GenSum Script:-

    my_gen_script.pyml_output/
        sum/
            <gen_name>_gensum.pyml

The GenSum Script creates html output that summaries the gen and sim folders. See Files Generated by Gensum Script for more details.