microbetag.config ================= .. py:module:: microbetag.config Classes ------- .. autoapisummary:: microbetag.config.Config Functions --------- .. autoapisummary:: microbetag.config.get_value microbetag.config.load_config microbetag.config.load_abundance Module Contents --------------- .. py:class:: Config(conf: dict, config_file: str = None) Parses a microbetag configuration file (yaml) to init a microbetag run. :param conf: A dictionary where the YAML configuration file has been loaded :param config_file: Filepath to the configuration YAML file. .. attention:: It is essential to use the corresponding to the microbetag version you are using configuration template file. Otherwise, the Config class will fail to create an instance and microbetag will exit. You may find microbetag configuration templates by version at: https://github.com/hariszaf/microbetag/tree/fix-phylomint/config_files .. rubric:: Example >>> with open(args.config, "r") as yaml_file: yaml_conf = yaml.safe_load(yaml_file) >>> conf = Config(yaml_conf, args.config) .. py:method:: export_to_log(log_file='parameters.log') Dumps the Config instance in a JSON file. .. py:function:: get_value(conf, key, default=None) Retrieves the 'value' field for a given key from a nested configuration dictionary. Returns: any: The value associated with conf[key]['value'], or the provided default if not found or None. .. py:function:: load_config(yaml_file) .. py:function:: load_abundance(abd_file: str) -> tuple[pandas.DataFrame, str, str, str] Load a tsv/csv format abundance table assuming the sequence id is procided in the first column and the taxonomy in the last one :param abd_file: Filepath to abundance table file. :returns: - seq_id2tax: A :class:`pandas.DataFrame` with the sequence id and their corresponding taxonomy - seq_id_col: The name of the column with the sequence identifier (e.g. ``seqId``) - tax_col: The name of the column with the taxonomy :rtype: A tuple including