Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mutalyzer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
mutalyzer
Commits
581cac3f
Commit
581cac3f
authored
11 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Define default values for most configuration settings
parent
0a8ce44e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
extras/config.example
+0
-1
0 additions, 1 deletion
extras/config.example
extras/config.user.example
+3
-0
3 additions, 0 deletions
extras/config.user.example
mutalyzer/config.py
+54
-4
54 additions, 4 deletions
mutalyzer/config.py
with
57 additions
and
5 deletions
extras/config.example
+
0
−
1
View file @
581cac3f
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
extras/config.user.example
+
3
−
0
View file @
581cac3f
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
mutalyzer/config.py
+
54
−
4
View file @
581cac3f
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment