def df_to_feature(struct_df, grid_config, random_seed=None): pos = struct_df[['x', 'y', 'z']].astype(np.float32) center = util.get_center(pos) rot_mat = subgrid_gen.gen_rot_matrix(grid_config, random_seed=random_seed) grid = subgrid_gen.get_grid( struct_df, center, config=grid_config, rot_mat=rot_mat) return grid
def __feature(struct, center): rot_mat = subgrid_gen.gen_rot_matrix(grid_config, random_seed=random_seed) grid = subgrid_gen.get_grid(struct, center, config=grid_config, rot_mat=rot_mat) return grid
def df_to_feature(struct_df, label_info, grid_config, center_at_mut=True, random_seed=None): mutation_center = __get_mutation_center(struct_df, label_info, center_at_mut) rot_mat = subgrid_gen.gen_rot_matrix(grid_config, random_seed=random_seed) grid = subgrid_gen.get_grid( struct_df, mutation_center, config=grid_config, rot_mat=rot_mat) return grid
def df_to_feature(struct_df, grid_config, random_seed=None): # Use center of ligand for subgrid center ligand_pos = struct_df[struct_df.chain == 'LIG'][['x', 'y', 'z']].astype(np.float32) ligand_center = util.get_center(ligand_pos) rot_mat = subgrid_gen.gen_rot_matrix(grid_config, random_seed=random_seed) grid = subgrid_gen.get_grid(struct_df, ligand_center, config=grid_config, rot_mat=rot_mat) return grid
def df_to_feature(struct_df, grid_config, center_around_Cs, random_seed=None): # Consider only atoms that have mapping for computing center. # If <center_around_Cs> is set, consider only carbon atoms. if center_around_Cs: pruned_struct_df = struct_df[struct_df.element == 'C'] else: pruned_struct_df = struct_df[struct_df.element.isin( grid_config.element_mapping.keys())] pos = pruned_struct_df[['x', 'y', 'z']].astype(np.float32) # Use center of ligand for subgrid center ligand_pos = pruned_struct_df[pruned_struct_df.chain == 'L'][[ 'x', 'y', 'z' ]].astype(np.float32) ligand_center = util.get_center(ligand_pos) rot_mat = subgrid_gen.gen_rot_matrix(grid_config, random_seed=random_seed) grid = subgrid_gen.get_grid(struct_df, ligand_center, config=grid_config, rot_mat=rot_mat) return grid