def blastplus(out_fh, cmd, query, lock):
    cmd += " -query {0}".format(query)
    proc = Popen(cmd)

    logging.debug("job <%d> started: %s" % (proc.pid, cmd))
    for row in proc.stdout:
        if row[0] == '#':
            continue
        lock.acquire()
        out_fh.write(row)
        out_fh.flush()
        lock.release()
    logging.debug("job <%d> finished" % proc.pid)
dataset/ETHPy150Open tanghaibao/jcvi/apps/blastplus.py/blastplus/original