Beispiel #1
0
bounds = [rmsdlib.read_pdb(f) for f in boundfiles]
unbounds = [rmsdlib.read_pdb(f) for f in unboundfiles]

initargs = [sys.argv[1], receptor] + unboundfiles
if modefile: initargs += ["--modes", modefile]
if imodefile: initargs += ["--imodes", imodefile]
ens_receptor = 0
for nr, ensfile in ensfiles:
    if nr == "1": ens_receptor = 1
    initargs += ["--ens", nr, ensfile]

collectlib.collect_init(initargs)
unboundsizes = [len(list(p.atoms())) for p in unbounds]
receptor_offset = collectlib.ieins[0]
collectlib.check_sizes([receptor_offset] + unboundsizes,
                       [receptor] + unboundfiles)

if opt_allatoms:
    unbound_amask = rmsdlib.build_hydrogenmask(unbounds)
else:
    unbound_amask = rmsdlib.build_atommask(unbounds, atomnames)

unbound_amasks_ligand = []
for unr, u in enumerate(unbounds):
    if opt_allatoms:
        uu = rmsdlib.build_hydrogenmask([u])
    else:
        uu = rmsdlib.build_atommask([u], atomnames)
    offset = 0
    if unr: offset = sum(unboundsizes[:unr])
    offsetmask = numpy.zeros(offset, dtype="bool")
Beispiel #2
0
    for hnr, h in enumerate(struc_header):
        if not h.startswith("#pivot"): continue
        hh = h.split()
        assert len(hh) == 5 and hh[1] == str(hnr + 1), h
        pivot = numpy.array([float(v) for v in hh[2:5]])
        pivots.append(pivot)

    initargs = [sys.argv[1]] + unboundfiles
    if modefile: initargs += ["--modes", modefile]
    if imodefile: initargs += ["--imodes", imodefile]
    for nr, ensfile in ensfiles:
        initargs += ["--ens", nr, ensfile]

    collectlib.collect_init(initargs)
    unboundsizes = [len(list(p.atoms())) for p in unbounds]
    collectlib.check_sizes(unboundsizes, unboundfiles)

    rmsdlib.check_pdbs(unbounds, bounds)

    allboundatoms = []
    for p in bounds:
        for c in p.coordinates():
            allboundatoms.append(c)
    allboundatoms = numpy.array(allboundatoms)

    sel = numpy.array([True] * len(allboundatoms))
    if not opt_allresidues:
        imask = rmsdlib.build_interfacemask(bounds, thresh)
        sel = (sel & imask)
    if not opt_allatoms:
        amask = rmsdlib.build_atommask(bounds, atomnames)
Beispiel #3
0
    continue
  if arg.startswith("--"): raise Exception("Unknown option '%s'" % arg)

cutoff = float(sys.argv[2])
pdbfiles = sys.argv[3:]
pdbs = [rmsdlib.read_pdb(f) for f in pdbfiles]

initargs = [sys.argv[1]] + pdbfiles
if modefile: initargs += ["--modes", modefile]
if imodefile: initargs += ["--imodes", imodefile]
for nr, ensfile in ensfiles:
  initargs += ["--ens", nr, ensfile]

collectlib.collect_init(initargs)
pdbsizes = [len(list(p.atoms())) for p in pdbs]
collectlib.check_sizes(pdbsizes, pdbfiles)
resids = []
for pdb in pdbs:
  cresids = []
  for residue in pdb.residues():
    resid = residue[0].resid
    for n in range(len(residue)):
      cresids.append(resid)
  resids.append(cresids)


f1 = sys.stdout
if output is not None:
  f1 = open(output,'w')
  
nstruc = 0