a.add_argument("pdblist") a.add_argument("--np", type=int) a.add_argument("--allatoms", action="store_true") a.add_argument("--ca", action="store_true") args = a.parse_args() #structures pdbfiles = [ l.strip().strip("\n") for l in open(args.pdblist) if len(l.strip().strip("\n")) ] #read atoms pdbs = [rmsdlib.read_pdb(f) for f in pdbfiles] for pdb in pdbs: rmsdlib.check_pdbs((pdb, ), pdbs) coors = np.array([list(pdb.coordinates()) for pdb in pdbs]) #select backbone if args.allatoms: assert not args.ca else: if args.ca: atomnames = ("CA", ) else: atomnames = ("CA", "C", "O", "N") amask = np.array([a.name in atomnames for a in pdbs[0].atoms()]) coors = coors[:, amask] def run(index):
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) sel = (sel & amask) allboundatoms = numpy.array(allboundatoms)