config module

It contains functions that handle configuration of gcMapExplorer. gcMapExplorer uses some default settings and options. This can be read and changed through these modules.

Configuraion file structure

    ├─────────── Dirs
    │             └──────── WorkingDirectory
    └─────────── Programs
                  ├──────── bigWigInfo
                  └──────── bigWigToWig


import gcMapExplorer

gcMapExplorer.config.cleanScratch()   # Clean default scratch directory

# Change scratch directory
gcMapExplorer.config.updateConfig('Dirs', 'WorkingDirectory', 'Path/to/new/scratch/directory')

# Set path to bigWigInfo program
gcMapExplorer.config.updateConfig('Programs', 'bigWigInfo', 'Path/to/bigWigInfo')

# Set path to bigWigToWig program
gcMapExplorer.config.updateConfig('Programs', 'bigWigToWig', 'Path/to/bigWigToWig')

# Print current configuration file content

# Get configuration
config = gcMapExplorer.config.getConfig()

# Get scratch directory


updateConfig(section, option, value) Update configuration file
getConfig() To get the present configuration.
printConfig() Print configuration file
cleanScratch() Clean scratch directory.
updateConfig(section, option, value)

Update configuration file

  • section (str) – Section of the configuration files. It could be Dirs or Programs.
  • option (str) – Input option, for which value is to be changed.
  • value (str or int) – New value of the input option.

To get the present configuration.

Configuration file has the following organization.

    ├─────────── Dirs
    │             └──────── WorkingDirectory
    └─────────── Programs
                  ├──────── bigWigInfo
                  └──────── bigWigToWig

In case no configuration file is found, a new file is generated and default value is assigned to each option.

Returns:config – Dictionary of Dictionaries with option name and value pair. For example, config[‘Dirs’][‘WorkingDirectory’] contains path to scratch directory. Similarly, config[‘Programs’][‘bigWigInfo’] contains path to bigWigInfo program.
Return type:dict

Print configuration file

It can be used to print the configuration file. It shows the current configuration of gcMapExplorer.


Clean scratch directory.

It checks whether any other gcMapExplorer process is running. In case, when only one process (i.e. current) is running, all files with “gcx” prefix will be deleted from default scratch directory.