def get(self, name): if name.startswith('__'): return rcl.init_check('-mute all', strict=False) this_dir, this_filename = os.path.split(__file__) pdb_dir = os.path.join(this_dir, 'pdb') return pyrosetta.pose_from_file(os.path.join(pdb_dir, name + '.pdb'))
def make_atype_charges(): rcl.init_check() avg_iatype_charge = dict() atomic_charges = defaultdict(list) for resn in rif.chem.biochem.aa_name3s: res = rcl.make_res(resn) for ia in range(res.natoms()): iatype = res.atom_type_index(ia + 1) # if iatype > 100: # print iatype, resn, res.atom_name(ia+1) charge = res.atomic_charge(ia + 1) atomic_charges[iatype].append(charge) for i, charges in list(atomic_charges.items()): # print i, rcl.ats()[i].name(), np.mean(charges), np.std(charges) avg_iatype_charge[rcl.ats()[i].name()] = np.mean(charges) return avg_iatype_charge
for iat2, atype2 in enumerate(atypes2): if atypes1 == atypes2 and iat1 > iat2: continue jobs.append((iat1, iat2, atype1, atype2, spec)) if multiprocess: ncpu = multiprocessing.cpu_count() // 2 with ProcessPoolExecutor(ncpu) as executor: eframes = executor.map(run_make_eframe_for_atoms, jobs) else: eframes = list(map(run_make_eframe_for_atoms, jobs)) eframe = pd.concat(eframes) return eframe if __name__ == '__main__': rcl.init_check() mock_atom = 'mock' patch_database_with_single_atom_params_files(mock_atom=mock_atom) spec = EtableSpec(mn=0.0, mx=6, n=64, label='beta_nov15', map=(square, sqrt)) # print(spec.dists) # sys.exit(0) sfunc = rcl.create_score_function(spec.label) eframe = make_eframes(spec, multiprocess=True) # atypes1='CH3 Hapo'.split(), # atypes2='CH3 OOC Nbb Hpol Hapo Haro HNbb'.split()) print('made eframe', eframe.shape) path = rif.resources.resource_path('rosetta_score_data.h5') h5path = '/eframes/' + mock_atom + '_dsq' + '/beta_nov15/eframe' print('save to', path, ':', h5path) store = pd.HDFStore(path)
def get_pose(pdbdir, fname): if not rcl.HAVE_PYROSETTA: return None rcl.init_check(strict=False) pose = rcl.pose_from_file(join(pdbdir, fname)) return pose
def bigpose(cleanpdbfname): if not rcl.HAVE_PYROSETTA: return None rcl.init_check(strict=False) pose = rcl.pose_from_file(cleanpdbfname) return pose
def pose(pdbsmallfname): if not rcl.HAVE_PYROSETTA: return None rcl.init_check(strict=False) pose = rcl.pose_from_file(pdbsmallfname) return pose