microbetag.helpers ================== .. py:module:: microbetag.helpers .. autoapi-nested-parse:: Handlers classes allowing the different steps Attributes ---------- .. autoapisummary:: microbetag.helpers.emojis Classes ------- .. autoapisummary:: microbetag.helpers.Emojis microbetag.helpers.PathwayComplementarity microbetag.helpers.MappingPaths microbetag.helpers.Faprotax microbetag.helpers.NetworkHandler microbetag.helpers.AbdTableHandler microbetag.helpers.BinsHandler microbetag.helpers.SeedComplementarityHandler Functions --------- .. autoapisummary:: microbetag.helpers.manta_input_net microbetag.helpers.otf_seqid_ncbi_gtdb_map Module Contents --------------- .. py:class:: Emojis .. py:data:: emojis .. py:class:: PathwayComplementarity(config: microbetag.config.Config) Sets variables regarding pathway complementarity tasks based on user's config (.yml) file :param config: An instance of the :class:`.config.Config` class. .. note:: From the :class:`.config.Config` class, the following attributes are being used: - `base_dir` - `ouput_dir` - `prev_path_compl` - `kofam_database` - `complement_max_length` - `ko_merged_file` - `pc_percentage` .. py:method:: setup_kegg_annotations() Sets up KEGG annotations and directories. .. py:method:: get_kofam_db_path() Returns the KOfam database path. .. py:method:: handle_missing_kofam_db() Handles the case when the KOfam database path is missing. .. py:method:: initialize(conf) Main function to initialize pathway complementarity settings. .. py:method:: output_dirs() Paths to output folders and files .. py:class:: MappingPaths Sets paths to mapping files .. py:class:: Faprotax(config) Paths to FAPROTAX `collapse_table.py` script and database .. py:class:: NetworkHandler(config) Set network-related configuration variables based on whether a network is already available or not. Check whether all the sequence identifiers present in the network as nodes, are also among those of the abundance table. .. py:method:: process_network(config) Process network edgelist and check bin consistency. .. py:class:: AbdTableHandler(config) Handles processing and validation of the abundance table related variables. :param config: Instance of the :class:`Config` class .. py:method:: load_abundance_table(config) Reads and validates the abundance table. .. py:method:: load_metadata_file(config) Load metadata file if provided .. py:class:: BinsHandler(config) Handles bin/genomes/MAGs related variables in case of using microbetag with local/custom genomes. .. py:class:: SeedComplementarityHandler(config) Handles variables related to building GENRES and the seed complementarity module. :param config: Instance of the :class:`Config` class .. py:method:: reconstrucion_paths(config) Set pathways for seeds related files and folders .. py:method:: seeds_paths(config) .. py:function:: manta_input_net(config: microbetag.config.Config) -> bool Wrapper for building the intermediate network CYJSON file; input for manta .. py:function:: otf_seqid_ncbi_gtdb_map(config: microbetag.config.Config) -> tuple[dict, dict, pandas.DataFrame] Builds a dataframe with sequence ids of nodes A and B found associated in the co-occurrence network followed by their corresponding NCBI Taxonomy ids and the representative GTDB genomes. :returns: - pairs_of_interest: {("",""). ("","")} - relative_genomes: {ncbi_id: [gc, gc, gc], ..} - mspecies_map_df: A data frame with the sequence ids of the abundance data and their mapped NCBI Taxonomy IDs and their corresponding GTDB representative genomes. :rtype: A tuple containing .. note:: Strictly for the on-the-fly version