def __init__(self, domain, **kwargs): self._config = kwargs.get('config') if self._config is None: self._config = get_config_object() self._api_vers = self._config.get_from_config_setting_cascade([('apis', 'taxomachine_api_version'), ('apis', 'api_version')], "2") self.use_v1 = (self._api_vers == "1") r = self._config.get_from_config_setting_cascade([('apis', 'taxomachine_raw_urls'), ('apis', 'raw_urls')], "FALSE") self._raw_urls = (r.lower() == 'true') if 'cache_taxa' in kwargs: cache_taxa = kwargs.get('cache_taxa', False) else: cache_taxa = self._config.get_config_setting('apis', 'cache_taxa', 'false').lower() in ['true', '1'] if cache_taxa: self._ott_id2taxon = {} else: self._ott_id2taxon = None self._contexts = None self._valid_contexts = None self.prefix = None _WSWrapper.__init__(self, domain, **kwargs) self.domain = domain self._wr = weakref.proxy(self)
def __init__(self, **kwargs): self._config = get_config_object(None, **kwargs) self._oti = kwargs.get('oti') self._phylografter = 'http://www.reelab.net/phylografter' self._phylesystem_api = kwargs.get('phylesystem') self._taxomachine = kwargs.get('taxomachine') self._treemachine = kwargs.get('treemachine')
def __init__(self, ott_dir=None, **kwargs): self._config = kwargs.get('config') if self._config is None: self._config = get_config_object() if ott_dir is None: ott_dir = self._config.get_config_setting('ott', 'parent') if ott_dir is None: raise ValueError( 'Either the ott_dir arg must be used or "parent" must ' 'exist in the "[ott]" section of your config (~/.peyotl/config by default)' ) self.ott_dir = ott_dir if not os.path.isdir(self.ott_dir): raise ValueError('"{}" is not a directory'.format(self.ott_dir)) # self.skip_prefixes = ('environmental samples (', 'uncultured (', 'Incertae Sedis (') self.skip_prefixes = ('environmental samples (', ) self._ott_id_to_names = None self._ott_id2par_ott_id = None self._version = None self._root_name = None self._root_ott_id = None self._name2ott_ids = None self._ott_id_to_flags = None self._ott_id_to_sources = None self._ott_id_to_ranks = None self._flag_set_id2flag_set = None self._taxonomic_sources = None self._ncbi_2_ott_id = None self._forward_table = None
def __init__(self, ott_dir=None, **kwargs): self._config = kwargs.get('config') if self._config is None: self._config = get_config_object() if ott_dir is None: ott_dir = self._config.get_config_setting('ott', 'parent') if ott_dir is None: raise ValueError('Either the ott_dir arg must be used or "parent" must ' 'exist in the "[ott]" section of your config (~/.peyotl/config by default)') self.ott_dir = ott_dir if not os.path.isdir(self.ott_dir): raise ValueError('"{}" is not a directory'.format(self.ott_dir)) # self.skip_prefixes = ('environmental samples (', 'uncultured (', 'Incertae Sedis (') self.skip_prefixes = ('environmental samples (',) self._ott_id_to_names = None self._ott_id2par_ott_id = None self._preorder2ott_id = None self._version = None self._root_name = None self._root_ott_id = None self._name2ott_ids = None self._ott_id_to_flags = None self._ott_id_to_sources = None self._ott_id_to_ranks = None self._flag_set_id2flag_set = None self._taxonomic_sources = None self._ncbi_2_ott_id = None self._forward_table = None
def __init__(self, domains=None, phylesystem_api_kwargs=None, collections_api_kwargs=None, amendments_api_kwargs=None, **kwargs): if domains is None: domains = get_domains_obj(**kwargs) self.domains = domains self._phylografter = None self._phylesystem_api = None self._collections_api = None self._amendments_api = None self._amendments = None self._taxomachine = None self._treemachine = None self._oti = None self._tree_of_life_wrapper = None self._graph_wrapper = None self._taxonomy_wrapper = None self._tnrs_wrapper = None self._studies_wrapper = None self._study_wrapper = None self._config = kwargs.get('config') if self._config is None: self._config = get_config_object() if phylesystem_api_kwargs is None: self._phylesystem_api_kwargs = {} else: self._phylesystem_api_kwargs = dict(phylesystem_api_kwargs) if collections_api_kwargs is None: self._collections_api_kwargs = {} else: self._collections_api_kwargs = dict(collections_api_kwargs) if amendments_api_kwargs is None: self._amendments_api_kwargs = {} else: self._amendments_api_kwargs = dict(amendments_api_kwargs)
def __init__(self, domain, **kwargs): self._config = kwargs.get('config') if self._config is None: self._config = get_config_object() self._api_vers = self._config.get_from_config_setting_cascade( [('apis', 'taxomachine_api_version'), ('apis', 'api_version')], "2") self.use_v1 = (self._api_vers == "1") r = self._config.get_from_config_setting_cascade( [('apis', 'taxomachine_raw_urls'), ('apis', 'raw_urls')], "FALSE") self._raw_urls = (r.lower() == 'true') if 'cache_taxa' in kwargs: cache_taxa = kwargs.get('cache_taxa', False) else: cache_taxa = self._config.get_config_setting( 'apis', 'cache_taxa', 'false').lower() in ['true', '1'] if cache_taxa: self._ott_id2taxon = {} else: self._ott_id2taxon = None self._contexts = None self._valid_contexts = None self.prefix = None _WSWrapper.__init__(self, domain, **kwargs) self.domain = domain self._wr = weakref.proxy(self)
def __init__(self, **kwargs): self._config = kwargs.get('config') if self._config is None: self._config = get_config_object() self._oti = kwargs.get('oti') self._phylesystem_api = kwargs.get('phylesystem') self._collections_api = kwargs.get('collections') self._amendments_api = kwargs.get('amendments') self._taxomachine = kwargs.get('taxomachine') self._treemachine = kwargs.get('treemachine')
def __init__(self, domain, **kwargs): self._config = get_config_object(None, **kwargs) self._api_vers = self._config.get_from_config_setting_cascade( [('apis', 'taxomachine_api_version'), ('apis', 'api_version')], "2") self.use_v1 = (self._api_vers == "1") r = self._config.get_from_config_setting_cascade( [('apis', 'taxomachine_raw_urls'), ('apis', 'raw_urls')], "FALSE") self._raw_urls = (r.lower() == 'true') self._contexts = None self._valid_contexts = None self.prefix = None _WSWrapper.__init__(self, domain, **kwargs) self.domain = domain
def __init__(self, domain, **kwargs): self._config = get_config_object(None, **kwargs) self._current_synth_info = None self._current_synth_id = None self.prefix = None r = self._config.get_from_config_setting_cascade([('apis', 'treemachine_raw_urls'), ('apis', 'raw_urls')], "FALSE") self._raw_urls = (r.lower() == 'true') self._api_vers = self._config.get_from_config_setting_cascade([('apis', 'treemachine_api_version'), ('apis', 'api_version')], "2") self.use_v1 = (self._api_vers == "1") _WSWrapper.__init__(self, domain, **kwargs) self.domain = domain
def __init__(self, domain, **kwargs): self._config = get_config_object(None, **kwargs) self._api_vers = self._config.get_from_config_setting_cascade( [('apis', 'oti_api_version'), ('apis', 'api_version')], "2") self.use_v1 = (self._api_vers == "1") self._node_search_prop = None self._search_terms = None self._tree_search_prop = None self._study_search_prop = None self.indexing_prefix = None self.query_prefix = None r = self._config.get_from_config_setting_cascade( [('apis', 'oti_raw_urls'), ('apis', 'raw_urls')], "FALSE") self._raw_urls = (r.lower() == 'true') _WSWrapper.__init__(self, domain, **kwargs) self.domain = domain
def __init__(self, domain, **kwargs): self._config = kwargs.get('config') if self._config is None: self._config = get_config_object() self._current_synth_info = None self._current_synth_id = None self.prefix = None r = self._config.get_from_config_setting_cascade([('apis', 'treemachine_raw_urls'), ('apis', 'raw_urls')], "FALSE") self._raw_urls = (r.lower() == 'true') self._api_vers = self._config.get_from_config_setting_cascade([('apis', 'treemachine_api_version'), ('apis', 'api_version')], "2") self.use_v1 = (self._api_vers == "1") _WSWrapper.__init__(self, domain, **kwargs) self.domain = domain
def __init__(self, domain, **kwargs): self._config = get_config_object(None, **kwargs) self._api_vers = self._config.get_from_config_setting_cascade([('apis', 'oti_api_version'), ('apis', 'api_version')], "2") self.use_v1 = (self._api_vers == "1") self._node_search_prop = None self._search_terms = None self._tree_search_prop = None self._study_search_prop = None self.indexing_prefix = None self.query_prefix = None r = self._config.get_from_config_setting_cascade([('apis', 'oti_raw_urls'), ('apis', 'raw_urls')], "FALSE") self._raw_urls = (r.lower() == 'true') _WSWrapper.__init__(self, domain, **kwargs) self.domain = domain
def __init__(self, domains=None, phylesystem_api_kwargs=None, **kwargs): if domains is None: domains = get_domains_obj(**kwargs) self.domains = domains self._phylografter = None self._phylesystem_api = None self._taxomachine = None self._treemachine = None self._oti = None self._tree_of_life_wrapper = None self._graph_wrapper = None self._taxonomy_wrapper = None self._tnrs_wrapper = None self._studies_wrapper = None self._study_wrapper = None self._config = get_config_object(None, **kwargs) if phylesystem_api_kwargs is None: self._phylesystem_api_kwargs = {} else: self._phylesystem_api_kwargs = dict(phylesystem_api_kwargs)