INNER CODE UNIT · Python
cfg_writer
hahnlab/CAFE5 · scripts/cfg_maker.py:58
def cfg_writer(self):
for r in xrange(self.n_runs):
with open(self.output_path + 'config_file_' + str(r) + '.cfg', 'w') as config_file:
config_file.write('[CAFExp folder]\ncafexp = ' + self.cafexp_path)
config_file.write('\n\n[input files]\ngene families = ')
input_dict = self.dictionize_lists(self.input_args, self.input_values)
if 'i' in input_dict: config_file.write(input_dict['i'])
config_file.write('\ntree = ')
if 't' in input_dict: config_file.write(input_dict['t'])
config_file.write('\nlambda tree = ')
if 'y' in input_dict: config_file.write(input_dict['y'])
config_file.write('\nroot distribution = ')
if 'f' in input_dict: config_file.write(input_dict['f'])
config_file.write('\n\n[options]\nsimulate = ')
options_dict = self.dictionize_lists(self.options_args, self.options_values)
if 's' in options_dict: config_file.write('True')