Esempio n. 1
0
 def kegg_manager(self):
     return query_kegg_orthology.QueryKO(
         username=config.AtlasConfig.USERNAME,
         password=config.AtlasConfig.PASSWORD,
         server=config.AtlasConfig.SERVER,
         authSource=config.AtlasConfig.AUTHDB,
         readPreference=config.AtlasConfig.READ_PREFERENCE,
         verbose=False,
         replicaSet=config.AtlasConfig.REPLSET)
Esempio n. 2
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()
Esempio n. 3
0
 def __init__(self, MongoDB=None, db=None, max_entries=float('inf'), verbose=False,
      username=None, password=None, authSource='admin', replicaSet=None, collection_str='uniprot'):
     self.url = 'http://www.uniprot.org/uniprot/?fil=reviewed:yes'
     self.query_url = 'https://www.uniprot.org/uniprot/?query='
     self.MongoDB = MongoDB
     self.db = db
     self.max_entries = max_entries
     self.collection_str = collection_str
     super(UniprotNoSQL, self).__init__(MongoDB=MongoDB, db=db, username=username,
                              password=password, authSource=authSource, replicaSet=replicaSet,
                              verbose=verbose, max_entries=max_entries)
     self.taxon_manager = query_taxon_tree.QueryTaxonTree(username=username, MongoDB=MongoDB, password=password,
                                                     authSource=authSource)
     self.ko_manager = query_kegg_orthology.QueryKO(username=username, password=password, server=MongoDB,
     authSource=authSource, verbose=verbose, max_entries=max_entries)
     self.sabio_manager = query_sabiork.QuerySabio(MongoDB=MongoDB, username=username, password=password,
     authSource=authSource)
     self.collation = Collation(locale='en', strength=CollationStrength.SECONDARY)
     self.collection = self.db_obj[collection_str]
     self.verbose = verbose
    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
Esempio n. 5
0
 def __init__(self, server, src_db='datanator', des_db='datanator', collection_str='uniprot',
             username=None, password=None, readPreference='nearest', authSource='admin', verbose=True,
             max_entries=float('inf')):
     super().__init__(MongoDB=server, db=des_db, verbose=verbose, max_entries=max_entries,
                     username=username, password=password, authSource=authSource,
                     readPreference=readPreference)
     self.collection_str = collection_str
     self.max_entries = max_entries
     self.verbose = verbose
     self.des_client, self.des_db, self.des_collection = self.con_db(collection_str)
     self.koc_manager = query_kegg_organism_code.QueryKOC(username=username, password=password,
     server=server, authSource=authSource, collection_str='kegg_organism_code', readPreference=readPreference,
     database=src_db)
     self.uniprot_manager = query_uniprot.QueryUniprot(username=username, password=password, server=server,
     authSource=authSource, database=src_db, collection_str='uniprot', readPreference=readPreference)
     self.kegg_manager = query_kegg_orthology.QueryKO(username=username, password=password, server=server,
     authSource=authSource, database=src_db, max_entries=max_entries, verbose=verbose, readPreference=readPreference)
     self.protein_manager = query_protein.QueryProtein(username=username, password=password, server=server,
     authSource=authSource, database=src_db, max_entries=max_entries, verbose=verbose, readPreference=readPreference)
     self.uniprot_nosql_manager = uniprot_nosql.UniprotNoSQL(MongoDB=server, db=des_db, max_entries=max_entries,
     verbose=verbose, username=username, password=password, authSource=authSource)
     self.endpoint = 'https://www.kegg.jp/ssdb-bin/ssdb_best?org_gene='
Esempio n. 6
0
    def __init__(self,
                 username=None,
                 password=None,
                 server=None,
                 authSource='admin',
                 src_database='datanator',
                 max_entries=float('inf'),
                 verbose=True,
                 collection='protein',
                 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
        '''

        self.max_entries = max_entries
        self.verbose = verbose
        self.cache_dir = cache_dir
        self.mongo_manager = mongo_util.MongoUtil(MongoDB=server,
                                                  username=username,
                                                  password=password,
                                                  authSource=authSource,
                                                  db=src_database)
        self.pax_manager = query_pax.QueryPax(MongoDB=server,
                                              db=src_database,
                                              collection_str='pax',
                                              verbose=verbose,
                                              max_entries=max_entries,
                                              username=username,
                                              password=password,
                                              authSource=authSource)
        self.kegg_manager = query_kegg_orthology.QueryKO(
            server=server,
            database=src_database,
            verbose=verbose,
            max_entries=max_entries,
            username=username,
            password=password,
            authSource=authSource)
        self.taxon_manager = query_taxon_tree.QueryTaxonTree(
            collection_str='taxon_tree',
            verbose=verbose,
            max_entries=max_entries,
            username=username,
            MongoDB=server,
            password=password,
            db=src_database,
            authSource=authSource)
        self.protein_manager = query_protein.QueryProtein(
            username=username,
            password=password,
            server=server,
            collection_str='protein',
            max_entries=max_entries,
            database=src_database)
        self.client, self.db, self.col = mongo_util.MongoUtil(
            MongoDB=server,
            username=username,
            password=password,
            authSource=authSource,
            db=destination_database).con_db(collection)
        self.bad_kinlawid = [
            24416, 24417, 24418, 24419, 24420, 24421, 24422, 24423
        ]
        self.collation = Collation(locale='en',
                                   strength=CollationStrength.SECONDARY)