Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def ShortGI(dist, charge1,charge2,):
#These are precomputed coefficients:
a=np.array([[ 15.90600036, 3.9534831 , 17.61453176],
[ 3.9534831 , 5.21580206, 1.91045387],
[ 17.61453176, 1.91045387, 238.75820253]])
b=np.array([[-0.02495 , -0.04539319, -0.00247124],
[-0.04539319, -0.2513 , -0.00258662],
[-0.00247124, -0.00258662, -0.0013 ]])
a_flat = a.flatten()
from rdkit.Chem.Draw import rdMolDraw2D
from IPython.display import SVG
from rdkit import Chem
from rdkit.Chem import Draw
mol = Chem.MolFromSmiles(Chem.MolToSmiles(l))
beez = mol_to_bits(mol)
def mol_to_bits(mol):
"""Convert the atoms in a molecule into bit IDs.
This uses the morgan fingerprint with a depth of zero -
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import keras
import tensorflow as tf
class D2M(keras.layers.Layer):
"""
Converts an EDM `D` to its Gram matrix representation `M`.
"""
def call(self, inputs, **kwargs):
batch_size = tf.shape(inputs)[0]
n_atoms = tf.shape(inputs)[1]
from rdkit import Chem
import numpy as np
from rdkit.Chem import AllChem
from rdkit.Geometry import Point3D
from scipy.spatial.distance import squareform, pdist
import copy
import py3Dmol