class_docstr: Use GNINA to generate binding poses.
  
  This class uses GNINA (a deep learning framework for molecular
  docking) to generate binding poses. It downloads the GNINA
  executable to DEEPCHEM_DATA_DIR (an environment variable you set)
  and invokes the executable to perform pose generation.
  
  GNINA uses pre-trained convolutional neural network (CNN) scoring
  functions to rank binding poses based on learned representations of
  3D protein-ligand interactions. It has been shown to outperform
  AutoDock Vina in virtual screening applications [1]_.
  
  If you use the GNINA molecular docking engine, please cite the relevant
  papers: https://github.com/gnina/gnina#citation
  The primary citation for GNINA is [1]_.
  
  References
  ----------
  .. [1] M Ragoza, J Hochuli, E Idrobo, J Sunseri, DR Koes.
  "Protein–Ligand Scoring with Convolutional Neural Networks."
  Journal of chemical information and modeling (2017).
  
  Note
  ----
  * GNINA currently only works on Linux operating systems.
  * GNINA requires CUDA >= 10.1 for fast CNN scoring.
  * Almost all dependencies are included in the most compatible way
      possible, which reduces performance. Build GNINA from source
      for production use.
class_docstr_tok: ["Use","GNINA","to","generate","binding","poses",".","This","class","uses","GNINA","(","a","deep","learning","framework","for","molecular","docking",")","to","generate","binding","poses",".","It","downloads","the","GNINA","executable","to","DEEPCHEM_DATA_DIR","(","an","environment","variable","you","set",")","and","invokes","the","executable","to","perform","pose","generation",".","GNINA","uses","pre-trained","convolutional","neural","network","(","CNN",")","scoring","functions","to","rank","binding","poses","based","on","learned","representations","of","3D","protein-ligand","interactions",".","It","has","been","shown","to","outperform","AutoDock","Vina","in","virtual","screening","applications","[","1","]","_",".","If","you","use","the","GNINA","molecular","docking","engine",",","please","cite","the","relevant","papers",":","https",":","\/\/github.com\/gnina\/gnina","#","citation","The","primary","citation","for","GNINA","is","[","1","]","_.","References","--","--","--","--","--","..","[","1","]","M","Ragoza",",","J","Hochuli",",","E","Idrobo",",","J","Sunseri",",","DR","Koes",".","``","Protein\u2013Ligand","Scoring","with","Convolutional","Neural","Networks",".","''","Journal","of","chemical","information","and","modeling","(","2017",")",".","Note","--","--","*","GNINA","currently","only","works","on","Linux","operating","systems",".","*","GNINA","requires","CUDA",">","=","10.1","for","fast","CNN","scoring",".","*","Almost","all","dependencies","are","included","in","the","most","compatible","way","possible",",","which","reduces","performance",".","Build","GNINA","from","source","for","production","use","."]
docstr: Initialize GNINA pose generator.
docstr_tok: ["Initialize","GNINA","pose","generator","."]
code: def __init__(self):
      """Initialize GNINA pose generator."""
  
      data_dir = get_data_dir()
      if platform.system() == "Linux":
          url = "https://github.com/gnina/gnina/releases/download/v1.0/gnina"
          filename = "gnina"
          self.gnina_dir = data_dir
          self.gnina_cmd = os.path.join(self.gnina_dir, filename)
      else:
          raise ValueError(
              "GNINA currently only runs on Linux. Try using a cloud platform to run this code instead."
          )
  
      if not os.path.exists(self.gnina_cmd):
          logger.info("GNINA not available. Downloading...")
          download_url(url, data_dir)
          downloaded_file = os.path.join(data_dir, filename)
          os.chmod(downloaded_file, 755)
          logger.info("Downloaded GNINA.")
  
imports: import platform
  import logging
  import os
  import tempfile
  import numpy
  from subprocess import Popen, PIPE
  from typing import List, Optional, Tuple, Union
  from deepchem.dock.binding_pocket import BindingPocketFinder
  from deepchem.utils.data_utils import download_url, get_data_dir
  from deepchem.utils.typing import RDKitMol
  from deepchem.utils.geometry_utils import compute_centroid, compute_protein_range
  from deepchem.utils.rdkit_utils import load_molecule, write_molecule
  from deepchem.utils.docking_utils import load_docked_ligands, write_vina_conf, write_gnina_conf, read_gnina_log
label_desc: Use image node_id 1 to create a new GninaPoseGenerator object from inherited base classes: PoseGenerator with example: obj = GninaPoseGenerator()