def WriteParamFile(paramfile, jspath, filetype, reference_track, samples, alignments_by_sample, fromindex, toindex):
    """
    Generate paramfile for creating snapshots from the command line
    """
    f = open(paramfile, "w")
    f.write('var exports = module.exports = {};\n')
    f.write(reference_track % 'exports.reference_track = "%s";\n')
    f.write('exports.samples = %s;\n' % str(samples))
    f.write('exports.alignBySample = {\n')
    for sample in alignments_by_sample:
        f.write('"%s": "%s",\n' % (sample, alignments_by_sample[sample]))
    f.write('};\n')
    f.write('exports.fromindex = %s;\n' % fromindex)
    f.write('exports.toindex = %s;\n' % toindex)
    f.write('exports.jspath = "%s";\n' % jspath)
    if filetype in ["html","svg"]:
        f.write('exports.filetype = "%s";\n' % filetype)
    elif filetype == "pdf":
        f.write('exports.filetype = "svg";\n')
    else:
        f.write('exports.filetype = "none";\n')
    f.close()
dataset/ETHPy150Open mgymrek/pybamview/pybamview/utils.py/WriteParamFile/swapped operands of `%`