def fmt2header(fmt):
return re.sub("<STR_LIT>", "<STR_LIT>", fmt)<EOL>
Turn a python format string into a usable header:
>>> fmt = "{chrom}\t{start:d}\t{end:d}\t{pvalue:.4g}"
>>> fmt2header(fmt)
'chrom  start       end pvalue'
>>> fmt.format(chrom='chr1', start=1234, end=3456, pvalue=0.01232432)
'chr1  1234       3456 0.01232'