raise Exception("Cannot determine the interface for a single PDB") bounds = [rmsdlib.read_pdb(f) for f in boundfiles] unbounds = [rmsdlib.read_pdb(f) for f in unboundfiles] 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) unbound_hmask = rmsdlib.build_hydrogenmask(unbounds) for p in unbounds + bounds: p.remove_hydrogens() rmsdlib.check_pdbs(unbounds, bounds) allboundatoms = [] for p in bounds: for c in p.coordinates(): allboundatoms.append(c) allboundatoms = numpy.array(allboundatoms) selmask = numpy.array([True] * len(allboundatoms)) if not opt_allresidues: imask = rmsdlib.build_interfacemask(bounds, thresh)
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") uu = numpy.concatenate((offsetmask, uu), axis=0) unbound_amasks_ligand.append(uu)