def format_qiime_parameters(params, header='#QIIME parameters'):
 qiime_params = [header]
 for (script, options) in sorted(params.items()):
  for (option, value) in sorted(options.items()):
   specific_option = ':'.join([script, option])
   if (value is None):
    value = 'True'
   full_line = ' DCTB '.join([specific_option, str(value)])
   qiime_params.append(full_line)
 return qiime_params

def format_qiime_parameters ( params , header = '#QIIME parameters' ) : qiime_params = [ header ] for ( script , options ) in sorted ( params . items ( ) ) : for ( option , value ) in sorted ( options . items ( ) ) : specific_option = ':' . join ( [ script , option ] ) if ( value is None ) : value = 'True' full_line = ' DCTB ' . join ( [ specific_option , str ( value ) ] ) qiime_params . append ( full_line ) return qiime_params
formats lines for qiime_parameters .