예제 #1
0
def tractability_workflow(protein, tag):
    """
    A very simple tractability workflow.

    :param str protein: PDB identification code
    :param str tag: Tractability tag: either 'druggable' or 'less-druggable'
    :return: `pandas.DataFrame`
    """
    # 1) calculate Fragment Hotspot Result
    runner = Runner()
    result = runner.from_pdb(pdb_code=protein,
                             nprocesses=1,
                             buriedness_method='ghecom')

    # 2) calculate Best Continuous Volume
    extractor = Extractor(hr=result)
    bcv_result = extractor.extract_volume(volume=500)

    # 3) find the median score
    grid = Grid.get_single_grid(bcv_result.super_grids, mask=False)
    values = grid.grid_values(threshold=5)
    median = np.median(values)

    # 4) return the data
    return pd.DataFrame({
        'scores': values,
        'pdb': [protein] * len(values),
        'median': [median] * len(values),
        'tractability': [tag] * len(values),
    })
    def run(self):
        h = Runner()

        # hotspot calculation settings
        s = h.Settings()
        s.apolar_translation_threshold = 15
        s.polar_translation_threshold = 15
        s.polar_contributions = False
        s.nrotations = 3000
        s.sphere_maps = True

        hr = h.from_pdb(pdb_code=self.pdb,
                        charged_probes=False,
                        buriedness_method='ghecom',
                        nprocesses=3,
                        settings=s,
                        cavities=None)

        out_settings = HotspotWriter.Settings()
        out_settings.charged = False

        with HotspotWriter(os.path.dirname(self.output().path),
                           grid_extension=".grd",
                           zip_results=True,
                           settings=out_settings) as w:
            w.write(hr)
예제 #3
0
 def test_generate_real(self):
     runner = Runner()
     hr = runner.from_pdb(pdb_code="2vta", buriedness_method='ghecom')
     settings = HotspotWriter.Settings()
     settings.output_superstar = True
     parent = "testdata/2vta"
     with HotspotWriter(parent) as w:
         w.write(hr)
예제 #4
0
    def run(self):
        """from fragment hotspot calc from protein"""
        h = Runner()
        settings = Runner.Settings(sphere_maps=False)
        result = h.from_pdb(pdb_code=self.args.pdb,
                            charged_probes=True,
                            buriedness_method=self.args.buriedness_method,
                            nprocesses=5,
                            settings=settings)

        with HotspotWriter(path=self.args.out_dir,
                           zip_results=self.args.zipped) as writer:
            writer.write(result)