This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_protein_features(usercoords, usercenters, userchannels, rotate_over=None, boxsize=[BOXSIZE]*3): | |
""" | |
Featurizes protein pocket using 3D voxelization | |
""" | |
if rotate_over is not None: | |
alpha = np.random.uniform(0, 2 * np.pi) | |
beta = np.random.uniform(0, 2 * np.pi) | |
gamma = np.random.uniform(0, 2 * np.pi) | |
usercoords = (usercoords.squeeze() - rotate_over) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy.linalg import norm, solve | |
from scipy.spatial.distance import cdist | |
from sklearn.neighbors import kneighbors_graph | |
def phi(l, mu): | |
return (mu * (np.sqrt(l) - 1)**2) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parse(process): | |
out = process.stdout.decode('utf8') | |
out = out.split('\n') | |
for line in out: | |
if line[:2] == 'HP': | |
hp = float(line.split('=')[1]) | |
elif line[:2] == 'HM': | |
hm = float(line.split('=')[1]) | |
elif line[:2] == 'HS': | |
hs = float(line.split('=')[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from htmd.molecule.molecule import Molecule | |
target = '/shared/jose/databases/bindingdb_val/3IBU/target_0.pdbqt' | |
mol = Molecule(target) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from pyGPGO.covfunc import matern32 | |
from pyGPGO.acquisition import Acquisition | |
from pyGPGO.surrogates.GaussianProcess import GaussianProcess | |
from pyGPGO.GPGO import GPGO | |
def f(x, y): | |
# Franke's function (https://www.mathworks.com/help/curvefit/franke.html) | |
one = 0.75 * np.exp(-(9 * x - 2) ** 2 / 4 - (9 * y - 2) ** 2 / 4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from pyGPGO.covfunc import matern32 | |
from pyGPGO.acquisition import Acquisition | |
from pyGPGO.surrogates.GaussianProcess import GaussianProcess | |
from pyGPGO.GPGO import GPGO | |
def f(x, y): | |
# Franke's function (https://www.mathworks.com/help/curvefit/franke.html) | |
one = 0.75 * np.exp(-(9 * x - 2) ** 2 / 4 - (9 * y - 2) ** 2 / 4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pairCor(distances, bins = 50): | |
distances = distances.flatten() | |
c, breaks = np.histogram(distances, bins = bins) | |
dr = breaks[1] - breaks[0] | |
N = len(distances) | |
V = 4 * np.pi* breaks**2 * dr | |
rho = N/(np.max(V)) | |
c = c/N | |
c = c/V[:bins] |