Skip to content
Snippets Groups Projects
Commit 581cac3f authored by Vermaat's avatar Vermaat
Browse files

Define default values for most configuration settings

parent 0a8ce44e
No related branches found
No related tags found
No related merge requests found
...@@ -122,7 +122,6 @@ PIDfile = "/var/run/mutalyzer/mutalyzer-batchd.pid" ...@@ -122,7 +122,6 @@ PIDfile = "/var/run/mutalyzer/mutalyzer-batchd.pid"
batchInputMaxSize = 5 batchInputMaxSize = 5
# The output header for NameChecking # The output header for NameChecking
# Todo: migration for restriction sites
nameCheckOutHeader = "Input", "Errors | Messages", "AccNo", "Genesymbol", "Variant", "Reference Sequence Start Descr.", "Coding DNA Descr.", "Protein Descr.", "GeneSymbol Coding DNA Descr.", "GeneSymbol Protein Descr.", "Genomic Reference", "Coding Reference", "Protein Reference", "Affected Transcripts", "Affected Proteins", "Restriction Sites Created", "Restriction Sites Deleted" nameCheckOutHeader = "Input", "Errors | Messages", "AccNo", "Genesymbol", "Variant", "Reference Sequence Start Descr.", "Coding DNA Descr.", "Protein Descr.", "GeneSymbol Coding DNA Descr.", "GeneSymbol Protein Descr.", "Genomic Reference", "Coding Reference", "Protein Reference", "Affected Transcripts", "Affected Proteins", "Restriction Sites Created", "Restriction Sites Deleted"
# The output header for SyntaxChecking # The output header for SyntaxChecking
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
# Copy this file to ~/.config/mutalyzer/config to overwrite definitions from # Copy this file to ~/.config/mutalyzer/config to overwrite definitions from
# /etc/mutalyzer.config. # /etc/mutalyzer.config.
# Use this email address for retrieval of records at the NCBI.
email = "mutalyzer@humgen.nl"
# The cache directory. # The cache directory.
cache = "/home/<USERNAME>/.cache/mutalyzer" cache = "/home/<USERNAME>/.cache/mutalyzer"
......
...@@ -106,8 +106,58 @@ class _Config(): ...@@ -106,8 +106,58 @@ class _Config():
if not config: if not config:
raise ConfigurationError('Could not locate configuration.') raise ConfigurationError('Could not locate configuration.')
try: # We define default values for many configuration settings (except for
# some that are mandatory for the user to define, i.e. those in the
# extras/config.user.example file).
# Todo: Do not duplicate default values here and in the example config
# file template.
config.setdefault('cachesize', 50)
config.setdefault('maxDldSize', 10)
config.setdefault('minDldSize', 512)
config.setdefault('lrgurl', 'ftp://ftp.ebi.ac.uk/pub/databases/lrgex/')
config.setdefault('internalDb', 'mutalyzer')
config.setdefault('dbNames', ['hg18', 'hg19', 'mm10'])
config.setdefault('defaultDb', 'hg19')
config.setdefault('LocalMySQLuser', 'mutalyzer')
config.setdefault('LocalMySQLhost', 'localhost')
config.setdefault('autoReconnect', False)
config.setdefault('proteinLinkLifetime', 30)
config.setdefault('proteinLinkNoneLifetime', 5)
config.setdefault('datestring', '%Y-%m-%d %H:%M:%S')
config.setdefault('loglevel', 3)
config.setdefault('outputlevel', 1)
config.setdefault('debug', True)
config.setdefault('flanksize', 25)
config.setdefault('maxvissize', 25)
config.setdefault('flankclipsize', 6)
config.setdefault('mailFrom', 'noreply@humgen.nl')
config.setdefault('mailSubject', 'Result of Mutalyzer batch check.')
config.setdefault('resultsDir', config['cache'])
config.setdefault('PIDfile', '/var/run/mutalyzer/mutalyzer-batchd.pid')
config.setdefault('batchInputMaxSize', 5)
config.setdefault('nameCheckOutHeader',
['Input', 'Errors | Messages', 'AccNo', 'Genesymbol', 'Variant',
'Reference Sequence Start Descr.', 'Coding DNA Descr.',
'Protein Descr.', 'GeneSymbol Coding DNA Descr.',
'GeneSymbol Protein Descr.', 'Genomic Reference',
'Coding Reference', 'Protein Reference', 'Affected Transcripts',
'Affected Proteins', 'Restriction Sites Created',
'Restriction Sites Deleted'])
config.setdefault('syntaxCheckOutHeader', ['Input', 'Status'])
config.setdefault('positionConverterOutHeader',
['Input Variant', 'Errors', 'Chromosomal Variant', 'Coding Variant(s)'])
config.setdefault('snpConverterOutHeader',
['Input Variant', 'HGVS description(s)', 'Errors | Messages'])
config.setdefault('bufSize', 32768)
config.setdefault('header', ['AccNo', 'Genesymbol', 'Mutation'])
config.setdefault('threshold', 0.05)
config.setdefault('spliceAlarm', 2)
config.setdefault('spliceWarn', 5)
config.setdefault('piwik', False)
config.setdefault('piwikBase', 'https://piwik.example.com')
config.setdefault('piwikSite', 1)
try:
# We explicitely read all configuration values ad store them in # We explicitely read all configuration values ad store them in
# our own dictionary. This makes sure we notice missing or # our own dictionary. This makes sure we notice missing or
# incorrect values upon instantiation. # incorrect values upon instantiation.
...@@ -116,7 +166,7 @@ class _Config(): ...@@ -116,7 +166,7 @@ class _Config():
self._values = {'autoReconnect': config.as_bool('autoReconnect'), self._values = {'autoReconnect': config.as_bool('autoReconnect'),
'debug': config.as_bool('debug'), 'debug': config.as_bool('debug'),
'piwik': config.as_bool('piwik'), 'piwik': config.as_bool('piwik'),
'threshold': float(config['threshold'])} 'threshold': config.as_float('threshold')}
# Simple string values. # Simple string values.
for name in ('email', 'cache', 'lrgurl', 'internalDb', 'dbNames', for name in ('email', 'cache', 'lrgurl', 'internalDb', 'dbNames',
...@@ -133,11 +183,11 @@ class _Config(): ...@@ -133,11 +183,11 @@ class _Config():
'maxvissize', 'flankclipsize', 'bufSize', 'maxvissize', 'flankclipsize', 'bufSize',
'spliceAlarm', 'spliceWarn', 'piwikSite', 'spliceAlarm', 'spliceWarn', 'piwikSite',
'proteinLinkLifetime', 'proteinLinkNoneLifetime'): 'proteinLinkLifetime', 'proteinLinkNoneLifetime'):
self._values[name] = int(config[name]) self._values[name] = config.as_int(name)
# File sizes (given in megabytes, stored in bytes). # File sizes (given in megabytes, stored in bytes).
for name in ('cachesize', 'maxDldSize', 'batchInputMaxSize'): for name in ('cachesize', 'maxDldSize', 'batchInputMaxSize'):
self._values[name] = int(config[name]) * 1048576 self._values[name] = config.as_int(name) * 1048576
except KeyError as e: except KeyError as e:
raise ConfigurationError('Missing configuration value: %s' % e) raise ConfigurationError('Missing configuration value: %s' % e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment