Example #1
0
    def __init__(self,
                 residue_selectors=(TrueResidueSelector(),
                                    TrueResidueSelector()),
                 atom_selectors=(('N', 'CA', 'C'), ('N', 'CA', 'C')),
                 minimum_sequence_distance=1,
                 maximum_neighborhood_distance=20.0,
                 hash_function_kwargs={
                     'cart_resl': 1.0,
                     'ori_resl': 15.0,
                     'cart_bound': 512.0
                 },
                 hash_table_kwargs={
                     'key_type': np.dtype('i8'),
                     'value_type': np.dtype('i8'),
                     'filename': None
                 }):
        print(hash_table_kwargs['filename'])
        self.hash_function = xbin.XformBinner(**hash_function_kwargs)
        self.hash_table = gp.MultiDict(**hash_table_kwargs)

        self.residue_selectors = residue_selectors
        self.atom_selectors = atom_selectors

        self.minimum_sequence_distance = minimum_sequence_distance
        self.maximum_neighborhood_distance = maximum_neighborhood_distance
Example #2
0
def test_getpy_very_big_multidict_u8_S16():
    key_type = np.dtype('u8')
    value_type = np.dtype('S16')

    gp_dict = gp.MultiDict(key_type, value_type)

    values = np.array([np.random.bytes(16) for i in range(10**5)], dtype=value_type)

    for i in range(10**2):
        keys = np.random.randint(10**15, size=10**5, dtype=key_type)
        gp_dict[keys] = values
Example #3
0
def test_getpy_big_multidict_u8_u8_lookup():
    key_type = np.dtype('u8')
    value_type = np.dtype('u8')

    gp_dict = gp.MultiDict(key_type, value_type)

    keys = np.random.randint(10**5, size=10**5, dtype=key_type)
    values = np.random.randint(10**15, size=10**5, dtype=value_type)

    gp_dict[keys] = values

    for i in range(10**2):
        values = gp_dict[keys]
Example #4
0
import xbin

from rdkit import Chem

chi_resolution = 30.0
assert 360.0 / chi_resolution < 256.0

hash_function_kwargs = {
    'cart_resl': 1.0,
    'ori_resl': 15.0,
    'cart_bound': 512.0
}
hash_function = xbin.XformBinner(**hash_function_kwargs)

hash_table_kwargs = {'key_type': np.dtype('i8'), 'value_type': np.dtype('i4')}
hash_table = gp.MultiDict(**hash_table_kwargs)

for pdb in tqdm.tqdm(
        glob.glob('/home/apmoyer/stapler/data/native_disulfide/*.pdb')):
    mol = Chem.MolFromPDBFile(pdb)

    xyz = np.array([
        mol.GetConformer(0).GetAtomPosition(0),  # N1
        mol.GetConformer(0).GetAtomPosition(1),  # CA1
        mol.GetConformer(0).GetAtomPosition(2),  # C1
        mol.GetConformer(0).GetAtomPosition(4),  # CB1
        mol.GetConformer(0).GetAtomPosition(5),  # SG1
        mol.GetConformer(0).GetAtomPosition(11),  # SG2
        mol.GetConformer(0).GetAtomPosition(10),  # CB2
        mol.GetConformer(0).GetAtomPosition(7),  # CA2
        mol.GetConformer(0).GetAtomPosition(6),  # N2