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,
              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, username=None, password=None, server=None, authSource='admin',
                 database='datanator', max_entries=float('inf'), verbose=True, collection_str='sabio_compound',
                 readPreference='nearest', replicaSet=None):

        super().__init__(MongoDB=server,
                         db=database,
                         verbose=verbose, max_entries=max_entries, username=username,
                         password=password, authSource=authSource, readPreference=readPreference,
                         replicaSet=replicaSet)
        self.file_manager = file_util.FileUtil()
        self.max_entries = max_entries
        self.verbose = verbose
        self.db = self.db_obj
        self.collection = self.db[collection_str]
        self.collation = Collation(locale='en', strength=CollationStrength.SECONDARY)
        self.collection_str = collection_str
Exemplo n.º 4
0
 def setUpClass(cls):
     cls.cache_dirname = tempfile.mkdtemp()
     cls.db = 'datanator'
     conf = config.TestConfig()
     username = conf.USERNAME
     password = conf.PASSWORD
     MongoDB = conf.SERVER
     cls.MongoDB = MongoDB
     cls.username = username
     cls.password = password
     cls.src = query_kegg_orthology.QueryKO(server=cls.MongoDB,
                                            database=cls.db,
                                            verbose=True,
                                            max_entries=20,
                                            username=cls.username,
                                            password=cls.password)
     cls.file_manager = file_util.FileUtil()
Exemplo n.º 5
0
 def __init__(self, username=None, password=None, server=None, authSource='admin',
              src_database='datanator', max_entries=float('inf'), verbose=True,
              collection='sabio_reaction_entries', destination_database='datanator', cache_dir=None):
     '''
             Args:
                     src_database (:obj: `str`): name of database in which source collections reside
                     destination_database (:obj: `str`): name of database to put the aggregated collection
     '''
     super().__init__(MongoDB=server, db=destination_database, username=username, password=password,
                     authSource=authSource)
     self.col = self.db_obj[collection]
     self.query_manager = query_sabiork_old.QuerySabioOld(MongoDB=server, password=password, authSource=authSource, username=username)
     self.metabolites_meta_manager = self.client[src_database]['metabolites_meta']
     self.file_manager = file_util.FileUtil()
     self.collation = Collation(locale='en', strength=CollationStrength.SECONDARY)
     self.verbose = verbose
     self.max_entries = max_entries
 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)
Exemplo n.º 7
0
 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,
                 username=None,
                 password=None,
                 server=None,
                 authSource='admin',
                 database='datanator',
                 max_entries=float('inf'),
                 verbose=True,
                 collection_str='uniprot',
                 readPreference='nearest',
                 replicaSet=None):

        super().__init__(MongoDB=server,
                         username=username,
                         password=password,
                         authSource=authSource,
                         db=database,
                         readPreference=readPreference,
                         replicaSet=replicaSet)
        self.taxon_manager = query_taxon_tree.QueryTaxonTree(
            MongoDB=server,
            username=username,
            password=password,
            authSource=authSource,
            db=database,
            replicaSet=replicaSet)
        self.taxon_col = self.db_obj['taxon_tree']
        self.kegg_manager = query_kegg_orthology.QueryKO(username=username,
                                                         password=password,
                                                         server=server,
                                                         authSource=authSource,
                                                         replicaSet=replicaSet)
        self.file_manager = file_util.FileUtil()
        self.max_entries = max_entries
        self.verbose = verbose
        self.collection = self.db_obj[collection_str]
        self.paxdb_collection = self.db_obj['pax']
        self.collation = Collation(locale='en',
                                   strength=CollationStrength.SECONDARY)
        self.collection_str = collection_str
Exemplo n.º 9
0
 def __init__(self,
              MongoDB=None,
              db=None,
              collection_str=None,
              username=None,
              password=None,
              authSource='admin',
              readPreference='nearest',
              verbose=True,
              replicaSet=None):
     super().__init__(MongoDB=MongoDB,
                      db=db,
                      verbose=verbose,
                      username=username,
                      password=password,
                      authSource=authSource,
                      readPreference=readPreference,
                      replicaSet=replicaSet)
     self.file_manager = file_util.FileUtil()
     self._collection = self.db_obj[collection_str]
     self.collation = Collation(locale='en',
                                strength=CollationStrength.SECONDARY)
Exemplo n.º 10
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]
 def setUpClass(cls):
     cls.cache_dirname = tempfile.mkdtemp()
     cls.src = file_util.FileUtil()