Ejemplo n.º 1
0
            '--imodes', 'flexm-' + str(nstruc + 1) + name + '.dat'
        ]
        if not os.path.exists('flexm-' + str(nstruc + 1) + name + '.dat'):
            break
        collectlib.collect_iattract(newargs)

    result = collectlib.collect_next()
    if result: break
    nstruc += 1
    coor = collectlib.collect_all_coor()
    coor = numpy.compress(unbound_hmask, coor, axis=0)
    fcoor = numpy.compress(selmask, coor, axis=0)
    U = rmsdlib.fit(fcoor, fboundatoms)[0]
    rotfcoor = numpy.array([], ndmin=2)
    L = len(fcoor)
    COM1 = numpy.sum(fcoor, axis=0) / float(L)
    COM2 = numpy.sum(fboundatoms, axis=0) / float(L)
    for c in fcoor:
        rotfcoor = numpy.append(rotfcoor, U.dot(c - COM1))

    rotfcoor = numpy.reshape(rotfcoor, (-1, 3))
    f1.write(str(nstruc))
    for start, end in ligandselmask:
        sel1 = rotfcoor[start:end]
        sel2 = fboundatoms[start:end]
        sel2 = sel2 - COM2
        irmsd = rmsdlib.rmsd(sel1, sel2)
        f1.write(" %.3f" % irmsd)

    f1.write("\n")
Ejemplo n.º 2
0
    if name is not None:
        newargs = initargs + [
            '--imodes', 'flexm-' + str(nstruc + 1) + name + '.dat'
        ]
        if not os.path.exists('flexm-' + str(nstruc + 1) + name + '.dat'):
            break
        collectlib.collect_iattract(newargs)

    result = collectlib.collect_next()
    if result: break
    nstruc += 1

    l1, l2 = strucs.next()
    ll = [float(v) for v in l2[0].split()[ens_receptor:ens_receptor + 6]]
    for v in ll:
        if abs(v) > 0.001:
            raise ValueError("Structures have not yet been fitted")

    f1.write("l-RMSD")
    coor = collectlib.collect_all_coor()
    coor = numpy.array(coor)[receptor_offset:]
    fcoor = numpy.compress(unbound_amask, coor, axis=0)
    rmsd = rmsdlib.rmsd(allboundatoms, fcoor)
    f1.write(" %.3f" % rmsd)
    if len(unbounds) > 1:
        for n in range(len(unbounds)):
            fcoor = numpy.compress(unbound_amasks_ligand[n], coor, axis=0)
            rmsd = rmsdlib.rmsd(boundatoms[n], fcoor)
            f1.write(" %.3f" % rmsd)
    f1.write("\n")