Skip to content

Commit aea6864

Browse files
committed
Update specification for config.ini
The full validator isn't included in the configobj module, so it has to be downloaded: ``` wget https://raw.githubusercontent.com/DiffSK/configobj/master/src/configobj/validate.py python -c 'import configobj; from validate import Validator; print( configobj.ConfigObj("tral/tral_configuration/config.ini", configspec="tral/tral_configuration/spec.ini").validate(Validator()))' ```
1 parent f1ce2c4 commit aea6864

File tree

5 files changed

+48
-17
lines changed

5 files changed

+48
-17
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,6 @@ ENV/
123123

124124
# easy install
125125
easy_setup/install_ext_software/phyml.sh
126+
127+
# configobj code
128+
validate.py

tral/repeat/repeat_align.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def realign_repeat(my_msa, realignment='mafft', sequence_type='AA', rate_distrib
4343
Returns:
4444
my_msa realigned (list of strings)
4545
46-
.. todo::
46+
.. todo::
4747
- decide what happens if branch length of tree is getting zero
4848
"""
4949

tral/sequence/repeat_detection_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def __init__(self):
199199
self.valopts = {
200200
# <file> input query alignment (fasta/a2m/a3m) or HMM file (.hhm)
201201
"-i": None,
202-
"-d": REPEAT_DETECTOR_PATH['HHrepID_dummyhmm'], # <path> dummy hmm database file
202+
"-d": os.path.expanduser(REPEAT_DETECTOR_PATH['HHrepID_dummyhmm']), # <path> dummy hmm database file
203203
"-o": 'hhrepID.o', # <file> write results and multiple sequence alignment to file (default=none)
204204
"-v": 0, # -v: verbose mode (default: show only warnings) ; -v 0: suppress all screen outpu
205205
"-P": None, # <float> max p-value of suboptimal alignments in all search rounds but the last one (def=0.1)

tral/tral_configuration/config.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sequence_type = AA
1010
# If the executable is in the system path, supply its name. Otherwise, supply the full path to the executable. Details are explained in TRAL's online docs.
1111
PHOBOS = phobos
1212
HHrepID = hhrepid_64
13-
HHrepID_dummyhmm = /path/to/home/.tral/data/hhrepid/dummyHMM.hmm
13+
HHrepID_dummyhmm = ~/.tral/data/hhrepid/dummyHMM.hmm
1414
T-REKS = T-REKS
1515
TRED = tred
1616
TRF = trf
@@ -36,13 +36,14 @@ sequence_type = AA
3636
type = min
3737
threshold = 1.9
3838

39+
3940
[repeat]
4041
scoreslist = phylo_gap01, # score (the comma in the end is needed for TRAL)
4142
calc_score = False # is the score calculated?
4243
calc_pvalue = False # is the pvalue calculated?
4344
precision = 10
4445
ginsi = ginsi # integrated in MAFFT
45-
Castor = Castor
46+
Castor = Castor
4647
[[castor_parameter]]
4748
rate_distribution = constant # either constant or gamma
4849
alfsim = alfsim

tral/tral_configuration/spec.ini

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,53 @@
1+
# Config specification
2+
# To validate, download:
3+
# https://raw.githubusercontent.com/DiffSK/configobj/master/src/configobj/validate.py
4+
#
5+
# Then run:
6+
# python -c 'import configobj; from validate import Validator;
7+
# print( configobj.ConfigObj("tral/tral_configuration/config.ini",
8+
# configspec="tral/tral_configuration/spec.ini"
9+
# ).validate(Validator()))'
10+
111
sequence_type = option('AA', 'DNA', default="AA")
212

313
[sequence]
414
[[repeat_detection]]
515
AA = string_list(min=0, max=100, default=list(''))
616
DNA = string_list(min=0, max=100, default=list(''))
17+
[[repeat_detector_path]]
18+
PHOBOS = string(default="phobos")
19+
HHrepID = string(default="hhrepid_64")
20+
HHrepID_dummyhmm = string(default="~/.tral/data/hhrepid/dummyHMM.hmm")
21+
T-REKS = string(default="T-REKS")
22+
TRED = string(default="tred")
23+
TRF = string(default="trf")
24+
TRUST = string(default="TRUST")
25+
TRUST_substitutionmatrix = string(default="/usr/bin/tral_tools/TRUST/Align/BLOSUM50")
26+
XSTREAM = string(default="XSTREAM")
27+
28+
[hmm]
29+
hmmbuild = string(default='hmmbuild')
30+
l_effective_max = integer(default=50)
31+
32+
[filter]
33+
[[basic]]
34+
tag = string(default='generic_filter_tag')
35+
[[[dict]]]
36+
# Each filter requires a func_name (to look up the function)
37+
# Other values are passed as arguments to the function.
38+
[[[[__many__]]]]
39+
func_name = string() # pvalue, divergence, n_effective, etc.
40+
41+
[[[tags]]]
742

843
[repeat]
944
scoreslist = string_list(min=1, max=100, default=list('phylo_gap01'))
1045
calc_score = boolean(default=False)
1146
calc_pvalue = boolean(default=False)
1247
precision = float(min=1, max=1000, default=10)
48+
ginsi = string(default='ginsi')
49+
Castor = string(default='Castor')
50+
[[castor_parameter]]
51+
rate_distribution = option('constant', 'gamma', default='constant')
52+
alfsim = string(default='alfsim')
1353

14-
[filter]
15-
[[basic]]
16-
tag = string_list(min=1, max=100, default=list('generic_filter_tag'))
17-
[[[dict]]]
18-
[[[[1]]]]
19-
func_name = string_list(min=1, max=100, default=list('pvalue'))
20-
score = string_list(min=1, max=100, default=list('phylo_gap01'))
21-
threshold = float(min=0.0, max=1.0, default=0.1)
22-
[[[[2]]]]
23-
func_name = string_list(min=1, max=100, default=list('pvalue'))
24-
attribute = string_list(min=1, max=100, default=list('n_effective'))
25-
type = option('min', 'max', default="min")
26-
threshold = float(min=0.1, max=10000, default=2.5)

0 commit comments

Comments
 (0)