Exemple #1
0
    def __init__(self, lmdb_path, testing, random_seed=None, **kwargs):
        self._lmdb_dataset = LMDBDataset(lmdb_path)
        self.testing = testing
        self.random_seed = random_seed
        self.grid_config = dotdict({
            # Mapping from elements to position in channel dimension.
            'element_mapping': {
                'C': 0,
                'O': 1,
                'N': 2,
                'S': 3
            },
            # Radius of the grids to generate, in angstroms.
            'radius': 17.0,
            # Resolution of each voxel, in angstroms.
            'resolution': 1.0,
            # Number of directions to apply for data augmentation.
            'num_directions': 20,
            # Number of rolls to apply for data augmentation.
            'num_rolls': 20,

            ### PPI specific
            # Number of negatives to sample per positive example. -1 means all.
            'neg_to_pos_ratio': 1,
            'neg_to_pos_ratio_testing': 1,
            # Max number of positive regions to take from a structure. -1 means all.
            'max_pos_regions_per_ensemble': 5,
            'max_pos_regions_per_ensemble_testing': 5,
            # Whether to use all negative at test time.
            'full_test': False,
        })
        # Update grid configs as necessary
        self.grid_config.update(kwargs)
Exemple #2
0
 def __init__(self,
              add_flag=False,
              center_at_mut=False,
              random_seed=None,
              **kwargs):
     self.add_flag = add_flag
     self.center_at_mut = center_at_mut
     self.random_seed = random_seed
     self.grid_config = dotdict({
         # Mapping from elements to position in channel dimension.
         'element_mapping': {
             'H': 0,
             'C': 1,
             'O': 2,
             'N': 3,
             'S': 4,
         },
         # Radius of the grids to generate, in angstroms.
         'radius': 25.0,
         # Resolution of each voxel, in angstroms.
         'resolution': 1.0,
         # Number of directions to apply for data augmentation.
         'num_directions': 20,
         # Number of rolls to apply for data augmentation.
         'num_rolls': 20,
         # Number of negatives to sample per positive example. -1 means all.
         'neg_to_pos_ratio': 1.0,
         # Max number of positive regions to take from a structure. -1 means all.
         'max_pos_per_shard': 200,
     })
     # Update grid configs as necessary
     self.grid_config.update(kwargs)
Exemple #3
0
 def __init__(self, add_flag=False, random_seed=None, **kwargs):
     self.add_flag = add_flag
     self.random_seed = random_seed
     self.grid_config = dotdict({
         # Mapping from elements to position in channel dimension.
         'element_mapping': {
             'H': 0,
             'C': 1,
             'O': 2,
             'N': 3,
             'S': 4,
             'CL': 5,
             'F': 6,
         },
         # Radius of the grids to generate, in angstroms.
         'radius': 25.0,
         # Resolution of each voxel, in angstroms.
         'resolution': 1.0,
         # Number of directions to apply for data augmentation.
         'num_directions': 20,
         # Number of rolls to apply for data augmentation.
         'num_rolls': 20,
     })
     # Update grid configs as necessary
     self.grid_config.update(kwargs)