@blueprint.route('/snapshot', methods=['POST', 'GET'])
def snapshot():
    settings = current_app.config['SETTINGS']
    samples = request.form.getlist("samples")
    alignments_by_sample = {}
    for s in samples:
        alignments_by_sample[s] = request.form["alignment_%s"%s]
    region = request.form["region"]
    region.replace("%3A",":")
    startpos = request.form["startpos"]
    reference = request.form["reference"]
    zoom = request.form["zoomlevel"]
    zoomlevel = float(zoom)
    if zoomlevel < 0:
        zoomlevel = -1/zoomlevel
    chrom, start = region.split(":")
    region = "%s-%s"%(max(int(int(start)-25/zoomlevel),0), int(int(start)+50+25/zoomlevel))
    return render_template("snapshot.html", title="Pybamview - take snapshot", SAMPLES=samples, ZOOMLEVEL=zoom, \
                               CHROM=chrom, REGION=region, MINSTART=settings["LOADCHAR"]/2-int(start), MAXEND=int(start)+settings["LOADCHAR"]/2,\
                               REFERENCE_TRACK=reference, ALIGN_BY_SAMPLE=alignments_by_sample, STARTPOS=startpos)
dataset/ETHPy150Open mgymrek/pybamview/pybamview/browser/views.py/snapshot/swapped operands of `-`