@@ -124,6 +124,31 @@ def mav_alpha_failsafe(mav_params, k_list):
124124 return sorted_data
125125
126126
127+ def _ti_test (outdir , norm_evidence , ti_in_use ):
128+ """
129+ Write a bestK result based on TI or STRUCTURE results.
130+ """
131+ if ti_in_use :
132+ # Use TI for bestK estimation
133+ criteria = norm_evidence [2 ]
134+ else :
135+ # Use Structure for bestK estimation
136+ criteria = norm_evidence [1 ]
137+ means = {x : y ["norm_mean" ] for x , y in criteria .items ()}
138+
139+ bestk_dir = os .path .join (outdir , "bestK" )
140+ os .makedirs (bestk_dir , exist_ok = True )
141+ bestk = max (means , key = means .get )
142+ bestk_file = open (os .path .join (bestk_dir , "TI_integration.txt" ), "w" )
143+ output_text = ("MavericK's estimation test revealed "
144+ "that the best value of 'K' is: {}\n " .format (bestk ))
145+ bestk_file .write (output_text )
146+ bestk_file .close ()
147+
148+ return [int (bestk )]
149+ # TODO: Draw a plot!
150+
151+
127152def maverick_merger (outdir , k_list , mav_params , no_tests ):
128153 """
129154 Grabs the split outputs from MavericK and merges them in a single directory.
@@ -146,28 +171,7 @@ def _mav_output_parser(filename):
146171
147172 return data
148173
149- def _ti_test (outdir , norm_evidence , ti_in_use ):
150- """
151- Write a bestK result based on TI or STRUCTURE results.
152- """
153- if ti_in_use :
154- # Use TI for bestK estimation
155- criteria = norm_evidence [2 ]
156- else :
157- # Use Structure for bestK estimation
158- criteria = norm_evidence [1 ]
159- means = {x : y ["norm_mean" ] for x , y in criteria .items ()}
160-
161- bestk_dir = os .path .join (outdir , "bestK" )
162- os .makedirs (bestk_dir , exist_ok = True )
163- bestk = max (means , key = means .get )
164- bestk_file = open (os .path .join (bestk_dir , "TI_integration.txt" ), "w" )
165- output_text = ("MavericK's estimation test revealed "
166- "that the best value of 'K' is: {}\n " .format (bestk ))
167- bestk_file .write (output_text )
168- bestk_file .close ()
169- return [int (bestk )]
170- # TODO: Draw a plot!
174+
171175
172176 def _gen_files_list (output_params , no_tests ):
173177 """
0 commit comments