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

Commit

Permalink
Merge pull request #146 from DeepRank/tidy_examples
Browse files Browse the repository at this point in the history
Tidy examples
  • Loading branch information
LilySnow committed Apr 14, 2020
2 parents b5f227f + 0cda741 commit eb8c96d
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 136 deletions.
42 changes: 42 additions & 0 deletions example/alignH5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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 align
h5file = './hdf5/1ak4.hdf5'

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


# 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()
67 changes: 0 additions & 67 deletions example/generate_dataset.py

This file was deleted.

67 changes: 0 additions & 67 deletions example/generate_dataset_alignH5.py

This file was deleted.

8 changes: 7 additions & 1 deletion example/generate_dataset_alignPDB.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# generate a hdf5 file
# 1. calculate features/targets
# 2. align pdb
# 3. map features to 3D grids
# 4. write to a hdf5 file
from deeprank.generate import *
from mpi4py import MPI

Expand All @@ -22,7 +27,8 @@
pdb_source=pdb_source,
pdb_native=pdb_native,
pssm_source=pssm_source,
align={"axis":'x','export':False},
#align={"axis":'x','export':False},
align={"selection":"interface","plane":"xy", 'export':True},
data_augmentation=None,
compute_targets=[
'deeprank.targets.binary_class'],
Expand Down
6 changes: 5 additions & 1 deletion example/generate_dataset_noalign.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# generate a hdf5 file
# 1. calculate features/targets
# 2. map features to 3D grids
# 3. write to a hdf5 file
from deeprank.generate import *
from mpi4py import MPI

Expand All @@ -23,7 +27,7 @@
pdb_source=pdb_source,
pdb_native=pdb_native,
pssm_source=pssm_source,
data_augmentation=2,
data_augmentation=None,
compute_targets=[
'deeprank.targets.dockQ',
'deeprank.targets.binary_class'],
Expand Down

0 comments on commit eb8c96d

Please sign in to comment.