def __init__(self,
              cache_dirname=None,
              collection_str='taxon_tree',
              verbose=False,
              max_entries=float('inf'),
              username=None,
              MongoDB=None,
              password=None,
              db='datanator-test',
              authSource='admin',
              readPreference='nearest',
              replicaSet=None):
     self.collection_str = collection_str
     super().__init__(cache_dirname=cache_dirname,
                      MongoDB=MongoDB,
                      db=db,
                      verbose=verbose,
                      max_entries=max_entries,
                      username=username,
                      password=password,
                      authSource=authSource,
                      readPreference=readPreference,
                      replicaSet=replicaSet)
     self.pipeline_manager = pipelines.Pipeline()
     self.chem_manager = chem_util.ChemUtil()
     self.file_manager = file_util.FileUtil()
     self.collection = self.db_obj[self.collection_str]
     self.collation = Collation(locale='en',
                                strength=CollationStrength.SECONDARY)
 def __init__(self,
              cache_dirname=None,
              MongoDB=None,
              replicaSet=None,
              db=None,
              collection_str='metabolites_meta',
              verbose=False,
              max_entries=float('inf'),
              username=None,
              password=None,
              authSource='admin',
              readPreference='nearest'):
     self._collection_str = collection_str
     self.verbose = verbose
     super().__init__(cache_dirname=cache_dirname,
                      MongoDB=MongoDB,
                      replicaSet=replicaSet,
                      db=db,
                      verbose=verbose,
                      max_entries=max_entries,
                      username=username,
                      password=password,
                      authSource=authSource,
                      readPreference=readPreference)
     self._collection = self.client.get_database(
         "datanator-test")[collection_str]
     self.e_client, self.e_db_obj, self.e_collection = self.con_db('ecmdb')
     self.y_client, self.y_db_obj, self.y_collection = self.con_db('ymdb')
     self.file_manager = file_util.FileUtil()
     self.chem_manager = chem_util.ChemUtil()
     self.collation = Collation(locale='en',
                                strength=CollationStrength.SECONDARY)
 def __init__(self,
              cache_dirname=None,
              MongoDB=None,
              replicaSet=None,
              db='datanator',
              collection_str='sabio_rk_old',
              verbose=False,
              max_entries=float('inf'),
              username=None,
              password=None,
              authSource='admin',
              readPreference='nearest'):
     self.max_entries = max_entries
     super().__init__(cache_dirname=cache_dirname,
                      MongoDB=MongoDB,
                      replicaSet=replicaSet,
                      db=db,
                      verbose=verbose,
                      max_entries=max_entries,
                      username=username,
                      password=password,
                      authSource=authSource,
                      readPreference=readPreference)
     self.u = self.client["datanator-test"]["uniprot"]
     self.chem_manager = chem_util.ChemUtil()
     self.file_manager = file_util.FileUtil()
     self.collection = self.db_obj[collection_str]
     self.collection_str = collection_str
     self.taxon_manager = query_taxon_tree.QueryTaxonTree(
         username=username,
         password=password,
         authSource=authSource,
         readPreference=readPreference,
         MongoDB=MongoDB,
         replicaSet=replicaSet)
     self.compound_manager = query_sabio_compound.QuerySabioCompound(
         server=MongoDB,
         database=db,
         username=username,
         password=password,
         readPreference=readPreference,
         authSource=authSource,
         replicaSet=replicaSet)
     self.collation = Collation(locale='en',
                                strength=CollationStrength.SECONDARY)
 def __init__(self,
              cache_dirname=None,
              MongoDB=None,
              replicaSet=None,
              db='datanator',
              collection_str='pax',
              verbose=False,
              max_entries=float('inf'),
              username=None,
              password=None,
              authSource='admin',
              readPreference='nearest'):
     """Instantiating query_pax
     
     Args:
         cache_dirname (str, optional): temparory cache director. Defaults to None.
         MongoDB (str, optional): mongodb server address. Defaults to None.
         replicaSet (str, optional): name of mongodb replicaset. Defaults to None.
         db (str, optional): name of database in which pax collection resides. Defaults to 'datanator'.
         collection_str (str, optional): name of collection. Defaults to 'pax'.
         verbose (bool, optional): display verbose messages. Defaults to False.
         max_entries (float, optional): max number of operations, mainly used for tests. Defaults to float('inf').
         username (str, optional): db authentication username. Defaults to None.
         password (str, optional): db authentication password. Defaults to None.
         authSource (str, optional): authentication database. Defaults to 'admin'.
         readPreference (str, optional): mongodb readpreference. Defaults to 'primary'.
     """
     super().__init__(cache_dirname=cache_dirname,
                      MongoDB=MongoDB,
                      replicaSet=replicaSet,
                      db=db,
                      verbose=verbose,
                      max_entries=max_entries,
                      username=username,
                      password=password,
                      authSource=authSource,
                      readPreference=readPreference)
     self.collation = Collation(locale='en',
                                strength=CollationStrength.SECONDARY)
     self.chem_manager = chem_util.ChemUtil()
     self.file_manager = file_util.FileUtil()
     self.max_entries = max_entries
     self.verbose = verbose
     self.collection = self.db_obj[collection_str]
 def __init__(self,
              cache_dirname=None,
              MongoDB=None,
              replicaSet=None,
              db=None,
              verbose=True,
              max_entries=float('inf'),
              username=None,
              password=None,
              authSource='admin',
              readPreference='nearest'):
     self.verbose = verbose
     super().__init__(cache_dirname=cache_dirname,
                      MongoDB=MongoDB,
                      replicaSet=replicaSet,
                      db=db,
                      verbose=verbose,
                      max_entries=max_entries,
                      username=username,
                      password=password,
                      authSource=authSource,
                      readPreference=readPreference)
     self.client_ecmdb, self.db_ecmdb, self.collection_ecmdb = self.con_db(
         'ecmdb')
     self.client_ymdb, self.db_ymdb, self.collection_ymdb = self.con_db(
         'ymdb')
     self.metabolites_meta_manager = query_metabolites_meta.QueryMetabolitesMeta(
         cache_dirname=cache_dirname,
         MongoDB=MongoDB,
         replicaSet=replicaSet,
         db=db,
         collection_str='metabolites_meta',
         verbose=verbose,
         max_entries=max_entries,
         username=username,
         password=password,
         authSource=authSource,
         readPreference=readPreference)
     self.chem_manager = chem_util.ChemUtil()
Exemple #6
0
 def __init__(self,
              cache_dirname=None,
              MongoDB=None,
              replicaSet=None,
              db='datanator',
              collection_str='sabio_rk',
              verbose=False,
              max_entries=float('inf'),
              username=None,
              password=None,
              authSource='admin'):
     self.max_entries = max_entries
     super().__init__(cache_dirname=cache_dirname,
                      MongoDB=MongoDB,
                      replicaSet=replicaSet,
                      db=db,
                      verbose=verbose,
                      max_entries=max_entries,
                      username=username,
                      password=password,
                      authSource=authSource)
     self.chem_manager = chem_util.ChemUtil()
     self.file_manager = file_util.FileUtil()
     self.collection = self.db_obj[collection_str]
Exemple #7
0
 def setUpClass(cls):
     cls.cache_dirname = tempfile.mkdtemp()
     cls.src = chem_util.ChemUtil()