Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
added alignH5.py
Browse files Browse the repository at this point in the history
  • Loading branch information
LilySnow committed Apr 7, 2020
1 parent d180696 commit 2db7cf0
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions example/alignH5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This script is used to align complexes in hdf5.
# INPUT:
# 1. a hdf5 file that contains pdb of all complexes (it is the output of generate_dataset_noalign.py).
# 2. pssm files if the pssm feature is needed for the training later


from deeprank.generate import *
from mpi4py import MPI

comm = MPI.COMM_WORLD

# name of the hdf5 to generate
h5file = './hdf5/1ak4.hdf5'

# for each hdf5 file where to find the pdbs
# pdb_source = '../test/1AK4/decoys/'
#
# # where to find the native conformations
# # pdb_native is only used to calculate i-RMSD, dockQ and so on.
# # The native pdb files will not be saved in the hdf5 file
# pdb_native = '../test/1AK4/native/'

# where to find the pssm
pssm_source = '../test/1AK4/pssm_new/'

# initialize the database
# database = DataGenerator(
# pdb_source=pdb_source,
# pdb_native=pdb_native,
# pssm_source=pssm_source,
# data_augmentation=2,
# compute_targets=[
# 'deeprank.targets.dockQ',
# 'deeprank.targets.binary_class'],
# compute_features=[
# 'deeprank.features.AtomicFeature',
# 'deeprank.features.FullPSSM',
# 'deeprank.features.PSSM_IC',
# 'deeprank.features.BSA',
# 'deeprank.features.ResidueDensity'],
# hdf5=h5file,
# mpi_comm=comm)
#

# compute features/targets for all complexes and write to a hdf5 file
# print('{:25s}'.format('Create new database') + database.hdf5)
# database.create_database(prog_bar=True)

# align the principle component 1 of complexes to axis z
newdb = DataGenerator(hdf5=h5file)
newdb.realign_complexes(align={'axis':'z'})


# define the 3D grid
# grid_info = {
# 'number_of_points' : [30,30,30],
# 'resolution' : [1.,1.,1.],
# 'atomic_densities': {'C': 1.7, 'N': 1.55, 'O': 1.52, 'S': 1.8},
# }

# generate the grid
#print('{:25s}'.format('Generate the grid') + database.hdf5)
#database.precompute_grid(grid_info,try_sparse=True, time=False, prog_bar=True)


# print('{:25s}'.format('Map features in database') + database.hdf5)
# database.map_features(grid_info,try_sparse=True, time=False, prog_bar=True)

# # get the normalization of the features
# print('{:25s}'.format('Normalization') + database.hdf5)
# norm = NormalizeData(database.hdf5)
# norm.get()

0 comments on commit 2db7cf0

Please sign in to comment.