diff --git a/docs/source/api.rst b/docs/source/api.rst index fc427a6e..3261b9f8 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -3,6 +3,11 @@ refineGEMs package Here is an overview on all functions. All imports are mocked in ``autodoc_mock_imports`` in the ``conf.py`` file to enable automatic building. +.. warning:: + | *Will be deprecated from version 2.0.0 onwards.* + | Due to massive restructuring and extension, all functions have been moved into new modules. + | If you used any functions from refineGEMs until now and want to use version 2.0.0 in the future, make sure to check your code after the version change. + refineGEMs.biomass module ------------------------- @@ -105,4 +110,5 @@ refineGEMs.sboann module .. automodule:: refinegems.sboann :members: :undoc-members: - :show-inheritance: \ No newline at end of file + :show-inheritance: + diff --git a/docs/source/conf.py b/docs/source/conf.py index 74bb4cea..e836e260 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -94,6 +94,7 @@ # -- Autodoc ----------------------------------------------------------------- # we need those to display the code comments otherwise the functions cannot be imported +''' autodoc_mock_imports = ["psycopg2", "gffutils", "cplex.exceptions", @@ -115,10 +116,12 @@ "ols_client", "charges", "click", + "databases", "yaml", "sortedcontainers", "colorama", "matplotlib", "seaborn", "venn" - ] \ No newline at end of file + ] +''' \ No newline at end of file diff --git a/docs/source/in_silico_media_generation.rst b/docs/source/in_silico_media_generation.rst index 4e31a287..6df7127c 100644 --- a/docs/source/in_silico_media_generation.rst +++ b/docs/source/in_silico_media_generation.rst @@ -1,5 +1,11 @@ From laboratory to *in silico* medium -========================================== +====================================== + +.. warning:: + | *Will be deprecated from version 2.0.0 onwards.* + | Using the new setup, the generation of *in silico* media changed slightly. + | Please refer to the newer documentation page after the version change or when using `SPECIMEN `__. + .. hint:: If you want to use the medium with ``refineGEMs.growth`` add the definition to the database schema ``sbo_media_db.sql`` diff --git a/docs/source/index.rst b/docs/source/index.rst index 12b72530..8cda8fdc 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -5,6 +5,13 @@ to help with the curation of genome-scale metabolic models (GEMS). .. hint:: For bug reports please write issues on the `GitHub page `__ or open a discussion `here `__. +.. warning:: + | *Will be deprecated from version 2.0.0 onwards.* + | Due to massive restructuring and extension, all functions have been moved into new modules. + | If you used any functions from refineGEMs until now and want to use version 2.0.0 in the future, make sure to check your code after the version change. + | For the main pipeline in main.py see `SPECIMEN `__ as it will be deprecated from version 2.0.0 onwards. + | Beware that SPECIMEN only runs with refineGEMs 2.0.0 (starting with developmental versions). + Overview -------- diff --git a/docs/source/modules/biomass.rst b/docs/source/modules/biomass.rst index 78715c5f..03747f37 100644 --- a/docs/source/modules/biomass.rst +++ b/docs/source/modules/biomass.rst @@ -1,6 +1,10 @@ Correcting the biomass objective function ========================================= +.. warning:: + | *Will be deprecated from version 2.0.0 onwards.* + | Functions have been moved to :py:mod:`refinegems.curation.biomass` and :py:mod:`refinegems.utility.util`. + The biomass objective function (BOF) of CarveMe does not add up to 1 mmol/gDW/h directly after the draft reconstruction. However, to get feasible results from a model this reaction should add up to 1 mmol/gDW/h. Thus, the module `biomass` was created to check if the BOF of a model is consistent and if necessary the BOF is adjusted diff --git a/docs/source/modules/examples.ipynb b/docs/source/modules/examples.ipynb index fafbffbd..609c19a8 100644 --- a/docs/source/modules/examples.ipynb +++ b/docs/source/modules/examples.ipynb @@ -5,7 +5,10 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Examples on how to use refineGEMs" + "# Examples on how to use refineGEMs\n", + "\n", + ".. warning::\n", + "\t *Will be deprecated from version 2.0.0 onwards.*" ] }, { diff --git a/docs/source/modules/gapfill.rst b/docs/source/modules/gapfill.rst index 416432a4..af0fd2e1 100644 --- a/docs/source/modules/gapfill.rst +++ b/docs/source/modules/gapfill.rst @@ -1,6 +1,10 @@ Filling gaps with refineGEMs ============================ +.. warning:: + | *Will be deprecated from version 2.0.0 onwards.* + | New options for gap filling can be found under :py:mod:`refinegems.classes.gapfill`. + There are two possibilities to use refineGEMs to fill gaps. Manual gap filling diff --git a/docs/source/modules/growth.rst b/docs/source/modules/growth.rst index d394fdda..1f566f4f 100644 --- a/docs/source/modules/growth.rst +++ b/docs/source/modules/growth.rst @@ -1,6 +1,10 @@ Growth simulation with refineGEMs ================================= +.. warning:: + | *Will be deprecated from version 2.0.0 onwards.* + | Functions have been (mostly) moved and extenden in :py:mod:`refinegems.analysis.growth`. + Interpreting the results ------------------------ Outputs a table with the column headers: diff --git a/docs/source/modules/pathways.rst b/docs/source/modules/pathways.rst index 30d85aa7..25597d67 100644 --- a/docs/source/modules/pathways.rst +++ b/docs/source/modules/pathways.rst @@ -1,6 +1,10 @@ Addition of KEGG Pathways ========================= +.. warning:: + | *Will be deprecated from version 2.0.0 onwards.* + | Functions have been moved to :py:mod:`refinegems.curation.pathways`. + The KEGG database holds information on metabolic pathways. You can use this module to add KEGG pathways with the libSBML Groups plugin. The workflow of the script is as follows: diff --git a/docs/source/modules/polish.rst b/docs/source/modules/polish.rst index b8db234a..53cad797 100644 --- a/docs/source/modules/polish.rst +++ b/docs/source/modules/polish.rst @@ -1,6 +1,10 @@ Polishing a CarveMe model ========================= +.. warning:: + | *Will be deprecated from version 2.0.0 onwards.* + | Functions have been moved to :py:mod:`refinegems.curation.polish`. + CarveMe version 1.5.1 leads to some irritations in the model, the scripts in ``polish`` enable for example the addition of BiGG IDs to the annotations as well as a correct formatting of the annotations. .. warning:: diff --git a/docs/source/modules/sboann.rst b/docs/source/modules/sboann.rst index bc4d571e..3abcda44 100644 --- a/docs/source/modules/sboann.rst +++ b/docs/source/modules/sboann.rst @@ -1,6 +1,10 @@ SBOannotator with refineGEMs ============================ +.. warning:: + | *Will be deprecated from version 2.0.0 onwards.* + | Use SBOannotator directly or - after the version change - the access point :py:mod:`refinegems.utility.connections.run_SBOannotator` instead. + RefineGEMs offers access to the functionalities of `SBOannotator `__\ :footcite:p:`Leonidou2023_sboann`. The ``sboann`` module is splitted into a lot of small functions which are all annotated, however when using it for SBO-Term annotation it only makes sense to run the function ``sbo_annotation``: diff --git a/docs/source/pipeline.rst b/docs/source/pipeline.rst index dd830ea6..b3c15b06 100644 --- a/docs/source/pipeline.rst +++ b/docs/source/pipeline.rst @@ -1,6 +1,11 @@ Pipeline: From genome sequence to draft model ============================================= +.. warning:: + | *Will be deprecated from version 2.0.0 onwards.* + | The idea for this workflow has been incorporated into `SPECIMEN `__ under the name PGAB (PGAP-based) workflow. + | Beware that SPECIMEN only runs with refineGEMs 2.0.0 (starting with developmental versions). + Generating a model for an organism where no information on genes and proteins is obtainable via any database causes the problem that the model will not contain valid database identifiers for any GeneProduct. To resolve this issue the workflow in Figure :numref:`workflow` can be used. diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 8ab1230f..0020e81b 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -4,6 +4,12 @@ Usage Usage as standalone application ------------------------------- +.. warning:: + | ``main.py`` will be deprecated from version 2.0.0 onwards.* + | For the main pipeline in main.py see the CarveMe-ModelPolisher-based (CMPB) workflow in `SPECIMEN `__. + | Beware that SPECIMEN only runs with refineGEMs 2.0.0 (starting with developmental versions). + + The script ``main.py`` can be used directly in the command line after entering the virtual environment with ``pipenv shell`` or ``conda activate ``. @@ -140,6 +146,11 @@ The repository structure has the following intention: Usage as python module ---------------------- +.. warning:: + | *Function calls will be deprecated from version 2.0.0 onwards.* + | Due to massive restructuring and extension, all functions have been moved into new modules. + | If you used any functions from refineGEMs until now and want to use version 2.0.0 in the future, make sure to check your code after the version change. + See :doc:`examples ` to learn how to use refineGEMs. Note that at this time most of the modules only make sense when you use the respective main functions: diff --git a/pyproject.toml b/pyproject.toml index 64850788..d31e4ea8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "refineGEMs" -version = "1.4.2" +version = "1.5.0" requires-python = ">=3.9, <3.11" authors = [ {name = "Famke Baeuerle", email = "famke.baeuerle@gmail.com"}, @@ -39,11 +39,12 @@ dependencies = [ "biopython>=1.79", "bioregistry", "bioservices", + "Deprecated", "importlib-resources<=5.13.0", # MEMOTE > 0.14.0 -> depinfo >=2.0.0 "memote>=0.13.0, <2.0.0", "pandas>=1.2.4", - "numpy>=1.20.3", + "numpy>=1.20.3, <2.0.0", "gffutils>=0.10.1", "markupsafe>=2.0.1", "depinfo>=1.7.0", diff --git a/src/refinegems/analysis_biocyc.py b/src/refinegems/analysis_biocyc.py index 144c5302..56ebaf8b 100644 --- a/src/refinegems/analysis_biocyc.py +++ b/src/refinegems/analysis_biocyc.py @@ -11,6 +11,9 @@ SmartTable one: Should contain 'Accession-2' and 'Reactions of gene', SmartTable two: Should contain 'Reaction', 'Reactants of reaction', 'Products of reaction', 'EC-Number', 'Reaction-Direction' and 'Spontaneous?' SmartTable three: Should contain 'Compound', 'Chemical Formula' and 'InChI-Key'. + +.. warning:: + *Deprecated as of version 2.0.0*: This idea for a gapfilling approach can be found in refinegems.classes.gapfill.BioCycGapFiller. """ # Get all possible genes by filtering .gff according to 'bio_type=protein_coding' & 'product=hypothetical protein' # Compare the list of genes with the ones already in the model & add all missing genes @@ -29,6 +32,11 @@ from refinegems.io import parse_fasta_headers import os +import warnings +mes = 'The refinegems.analysis_biocyc module will be deprecated from version 2.0.0 onwards. This idea for a gapfilling approach can be found in refinegems.classes.gapfill.BioCycGapFiller.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "Gwendolyn O. Döbel and Dr. Reihaneh Mostolizadeh" diff --git a/src/refinegems/analysis_db.py b/src/refinegems/analysis_db.py index 6927056e..899761df 100644 --- a/src/refinegems/analysis_db.py +++ b/src/refinegems/analysis_db.py @@ -1,4 +1,7 @@ #!/usr/bin/env python +""".. warning:: + *Deprecated as of version 2.0.0*: Functionalities can be found in refinegems. @TODO +""" import re import requests import sqlite3 @@ -13,6 +16,11 @@ from ratelimit import limits, sleep_and_retry from multiprocessing import Pool +import warnings +mes = 'The refinegems.analysis_db module will be deprecated from version 2.0.0 onwards. For more information, refer to the documentation for 2.0.0.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "Famke Baeuerle, Gwendolyn O. Döbel and Tobias Fehrenbach" diff --git a/src/refinegems/analysis_kegg.py b/src/refinegems/analysis_kegg.py index 818f662d..5f4ae859 100644 --- a/src/refinegems/analysis_kegg.py +++ b/src/refinegems/analysis_kegg.py @@ -8,6 +8,10 @@ and the KEGG identifier of your organism. Due to the KEGG REST API this is relatively slow (model of size 1500 reactions - 20 min). + +.. warning:: + *Deprecated as of version 2.0.0*: The functions have been sorted into different modules. The main idea of the + gap filling via KEGG can be found in refinegems.classes.gapfill.KEGGapFiller """ import pandas as pd @@ -19,6 +23,11 @@ from refinegems.entities import get_model_genes, compare_gene_lists, get_model_reacs_or_metabs from refinegems.analysis_db import get_bigg2other_db, compare_bigg_model +import warnings +mes = 'The refinegems.analysis_kegg module will be deprecated from version 2.0.0 onwards. For more information, refer to the documentation for 2.0.0.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "Famke Baeuerle" diff --git a/src/refinegems/biomass.py b/src/refinegems/biomass.py index 2efc65f0..8b3dcb17 100644 --- a/src/refinegems/biomass.py +++ b/src/refinegems/biomass.py @@ -2,6 +2,10 @@ """Most functions within this module were copied from the MEMOTE GitHub page and modified by Gwendolyn O. Döbel. This module provides functions to be used to assess the biomass weight as well as normalise it. + +.. warning:: + *Deprecated as of 2.0.0*: Functionalities have been split into refinegems.curation.biomass and refinegems.utility.entities. + For more information, refer to the updated documentation of version 2.0.0. """ import os @@ -15,6 +19,11 @@ from memote.utils import truncate from typing import Union +import warnings +mes = 'The refinegems.biomass module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.curation.biomass and refinegems.utility.entities modules from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "MEMOTE and Gwendolyn O. Döbel" diff --git a/src/refinegems/charges.py b/src/refinegems/charges.py index 73dde510..952b336c 100644 --- a/src/refinegems/charges.py +++ b/src/refinegems/charges.py @@ -4,12 +4,20 @@ When iterating through all metabolites present in a model, you will find several which have no defined charge (metab.getPlugin('fbc').isSetCharge() = false). This can lead to charge imbalanced reactions. This script takes information on metabolite charges from the ModelSEED database. A charge is automatically added to a metabolite if it has no defined charge and if there is only one charge denoted in ModelSEED. When multiple charges are present, the metabolite and the possible charges are noted and later returned in a dictionary. It is possible to use the correct_charges_from_db function with other databases. The user just needs to make sure that the compounds dataframe has a 'BiGG' and a 'charge' column. + +.. warning:: + *Deprecated as of version 2.0.0*: Functionalities can be found in the submodule refinegems.curation.charges. """ import pandas as pd from libsbml import Model as libModel from refinegems.modelseed import get_modelseed_compounds +import warnings +mes = 'The refinegems.charges module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.curation.charges module from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "Famke Baeuerle" diff --git a/src/refinegems/comparison.py b/src/refinegems/comparison.py index 36eb22c1..5d0a22b1 100644 --- a/src/refinegems/comparison.py +++ b/src/refinegems/comparison.py @@ -2,6 +2,10 @@ """ Provides functions to compare and visualize multiple models Can mainly be used to compare growth behaviour of multiple models. All other stats are shown in the memote report. + +.. warning:: + *Deprecated as of version 2.0.0*: Functionalities have been split into refinegems.analysis.comparison and refinegems.classes.report. See the documentation + for version 2.0.0 for more information. """ import pandas as pd @@ -17,6 +21,11 @@ from refinegems.growth import growth_one_medium_from_default, growth_one_medium_from_minimal from refinegems.investigate import initial_analysis, get_reactions_per_sbo +import warnings +mes = 'The refinegems.growth module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.analysis.comparison and refinegems.classes.report modules from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "Famke Baeuerle" def plot_initial_analysis(models: list[libModel]): diff --git a/src/refinegems/curate.py b/src/refinegems/curate.py index e8b9a38d..d236ce18 100644 --- a/src/refinegems/curate.py +++ b/src/refinegems/curate.py @@ -2,6 +2,9 @@ """ Functions to enable annotation of entities using a manual curated table While working on GEMs the user might come across ill-annotated or missing metabolites, reactions and genes. This module aims to enable faster manual curation by allowing to edit an excel table directly which is used to update the given model. This module makes use of the cvterms module aswell. + +.. warning:: + *Deprecated as of version 2.0.0*: The (not removed) functionalities can be accessed via refinegems.curation.curate from 2.0.0 onwards. """ import pandas as pd from tqdm.auto import tqdm @@ -9,6 +12,11 @@ from refinegems.cvterms import add_cv_term_reactions, add_cv_term_metabolites, metabol_db_dict, get_id_from_cv_term from refinegems.entities import create_gpr_from_locus_tag, create_reaction +import warnings +mes = 'The refinegems.curate module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.curation.curate module from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "Famke Baeuerle" diff --git a/src/refinegems/cvterms.py b/src/refinegems/cvterms.py index 38d28691..c6eb13de 100644 --- a/src/refinegems/cvterms.py +++ b/src/refinegems/cvterms.py @@ -2,10 +2,18 @@ """ Helper module to work with annotations (CVTerms) Stores dictionaries which hold information the identifiers.org syntax, has functions to add CVTerms to different entities and parse CVTerms. + +.. warning:: + *Deprecated as of version 2.0.0*: The functionalities have been moved to refinegems.utility.cvterms """ import logging from libsbml import BIOLOGICAL_QUALIFIER, BQB_IS, BQB_OCCURS_IN, BQB_IS_HOMOLOG_TO, MODEL_QUALIFIER, BQM_IS_DESCRIBED_BY, Unit, CVTerm, Species, Reaction, GeneProduct, Group, SBase +import warnings +mes = 'The refinegems.growcvtermsth module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.utility.cvterms module from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "Famke Baeuerle and Gwendolyn O. Döbel" metabol_db_dict = { diff --git a/src/refinegems/databases.py b/src/refinegems/databases.py index 9ae65009..fa2c33e0 100644 --- a/src/refinegems/databases.py +++ b/src/refinegems/databases.py @@ -1,4 +1,7 @@ #!/usr/bin/env python +""" +.. warning:: + *Deprecated as of version 2.0.0*: The functionalities have been moved to refinegems.utility.databases""" import io import re import sqlite3 @@ -9,6 +12,11 @@ from os import path from importlib.resources import files +import warnings +mes = 'The refinegems.databases module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.utility.databases module from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = 'Gwendolyn O. Döbel' PATH_TO_DB = files('refinegems.data.database').joinpath('data.db') diff --git a/src/refinegems/entities.py b/src/refinegems/entities.py index d2400bb6..8d74ffde 100644 --- a/src/refinegems/entities.py +++ b/src/refinegems/entities.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +"""*Deprecated as of 2.0.0*: Functionalities can be found in the refinegems.utility.entities module from 2.0.0 onwards. +""" import re import pandas as pd from Bio import Entrez @@ -8,6 +10,11 @@ from refinegems.io import search_ncbi_for_gpr from typing import Union +import warnings +mes = 'The refinegems.entities module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.utility.entities module from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "Famke Baeuerle and Gwendolyn O. Döbel" diff --git a/src/refinegems/gapfill.py b/src/refinegems/gapfill.py index 31cb8dc0..5b1301ad 100644 --- a/src/refinegems/gapfill.py +++ b/src/refinegems/gapfill.py @@ -7,6 +7,9 @@ * 'KEGG': ~ 2h * 'BioCyc': ~ 45mins - 1h * 'KEGG+BioCyc': ~ 3 - 4h + + .. warning:: + *Deprecated as of version 2.0.0*: The gap filling approach have been extended and restructured into OOP. They can be found under refinegems.classes.gapfill from 2.0.0 onwards. """ import ast import math @@ -22,6 +25,11 @@ from colorama import init as colorama_init from colorama import Fore +import warnings +mes = 'The refinegems.gapfill module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.classes.gapfill module from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "Famke Baeuerle and Gwendolyn O. Döbel" '''Skeleton for functions that could be used for a lab strain/organism which is in no database contained diff --git a/src/refinegems/growth.py b/src/refinegems/growth.py index 10a70dfa..c95655d7 100644 --- a/src/refinegems/growth.py +++ b/src/refinegems/growth.py @@ -2,6 +2,9 @@ """ Provides functions to simulate growth on any medium Tailored to work with the media denoted in the local db, should work with any medium as long as its defined in a csv with ; as delimiter and BiGG Ids for the compounds. Use refinegems.io.load_medium_custom and hand this to the growth_one_medium_from_default or growth_one_medium_from_minimum function. + +.. warning:: + *Deprecated as of version 2.0.0*: This module had a mahor restructering, but the functionalities can be found in refinegems.analysis.growth. """ import logging @@ -14,6 +17,12 @@ __author__ = "Famke Baeuerle" +import warnings +mes = 'The refinegems.growth module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.analysis.curation module from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + + def set_fluxes_to_simulate(reaction: Reaction) -> Reaction: """Helper function: Set flux bounds to -1000.0 and 1000.0 to enable model simulation with growth_one_medium_from_minimal/default diff --git a/src/refinegems/investigate.py b/src/refinegems/investigate.py index db117c90..88e16383 100644 --- a/src/refinegems/investigate.py +++ b/src/refinegems/investigate.py @@ -2,6 +2,10 @@ """ Provides functions to investigate the model and test with MEMOTE These functions enable simple testing of any model using MEMOTE and access to its number of reactions, metabolites and genes. + +.. warning:: + *Deprecated in 2.0.0*: The functionalities have mainly been moved to refinegems.analysis.investigate and refinegems.utility.connections. + For more information, refer to the updated docs for version 2.0.0. """ import os @@ -17,6 +21,12 @@ from memote.support import consistency_helpers as con_helpers from refinegems.io import load_model_cobra, load_model_libsbml, search_sbo_label +import warnings +mes = 'The refinegems.investifate module will be deprecated from version 2.0.0 onwards. Most functionalities can be found in the refinegems.analysis.investigate module from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + + __author__ = "Famke Baeuerle and Alina Renz" DISSIPATION_RXNS = { diff --git a/src/refinegems/io.py b/src/refinegems/io.py index f4e7650d..fa0b6d5c 100644 --- a/src/refinegems/io.py +++ b/src/refinegems/io.py @@ -4,6 +4,9 @@ Depending on the application the model needs to be loaded with cobra (memote) or with libSBML (activation of groups). The media definitions are denoted in a csv within the data folder of this repository, thus the functions will only work if the user clones the repository. The manual_annotations table has to follow the specific layout given in the data folder in order to work with this module. + +.. warning:: + *Deprecated in 2.0.0*: The functionalities have been moved to the refinegems.utility.io module as of 2.0.0 """ import cobra @@ -23,6 +26,12 @@ from libsbml import SBMLReader, writeSBMLToFile, SBMLValidator, SBMLDocument from datetime import date +import warnings +mes = 'The refinegems.io module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.utility.io module from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + + __author__ = "Tobias Fehrenbach, Famke Baeuerle and Gwendolyn O. Döbel" diff --git a/src/refinegems/modelseed.py b/src/refinegems/modelseed.py index 5ff023c8..50d5464e 100644 --- a/src/refinegems/modelseed.py +++ b/src/refinegems/modelseed.py @@ -2,6 +2,9 @@ """ Reports mismatches in charges and formulae based on ModelSEED Extracts ModelSEED data from a given tsv file, extracts all metabolites from a given model. Both lists of metabolites are compared by charge and formula. + +.. warning:: + *Deprecated since 2.0.0*: From 2.0.0 onwards, the functionalities can be found in refinegem.curation.db_access.modelseed """ import pandas as pd import re @@ -11,6 +14,10 @@ __author__ = "Famke Baeuerle and Jan-Philipp Leusch" +import warnings +mes = 'The refinegems.modelseed module will be deprecated from version 2.0.0 onwards. The functionalities can be found in the refinegems.curation.db_access.modelseed module from 2.0.0 onwards.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) def get_modelseed_compounds() -> pd.DataFrame: """Extracts compounds from ModelSEED which have BiGG Ids diff --git a/src/refinegems/pathways.py b/src/refinegems/pathways.py index a7d2aaaa..49059ab2 100644 --- a/src/refinegems/pathways.py +++ b/src/refinegems/pathways.py @@ -2,6 +2,9 @@ """ Provides functions for adding KEGG reactions as Group Pathways If your organism occurs in the KEGG database, extract the KEGG reaction ID from the annotations of your reactions and identify, in which KEGG pathways this reaction occurs. Add all KEGG pathways for a reaction then as annotations with the biological qualifier ‘OCCURS_IN’ to the respective reaction. + +.. warning:: + *Deprecated since 2.0.0*: The functionalities can be found in the refinegems.curation.pathways module from 2.0.0 onwards. """ from tqdm.auto import tqdm @@ -12,6 +15,11 @@ __author__ = "Famke Baeuerle" +import warnings +mes = 'The refinegems.pathways module will be deprecated from version 2.0.0 onwards. Use the refinegems.curation.pathways module to find the functionalities.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + def load_model_enable_groups(modelpath: str) -> libModel: """Loads model as document using libSBML and enables groups extension diff --git a/src/refinegems/polish.py b/src/refinegems/polish.py index 0b3996a0..2df1111a 100644 --- a/src/refinegems/polish.py +++ b/src/refinegems/polish.py @@ -2,6 +2,8 @@ """Can be used to polish a model (created with CarveMe v.1.5.1) The newer version of CarveMe leads to some irritations in the model, these scripts enable for example the addition of BiGG Ids to the annotations as well as a correct formatting of the annotations. + +*Deprecated since version 2.0.0*: From 2.0.0 onwards, you can find the functionalities in refinegems.curation.polish """ import re, logging @@ -20,6 +22,10 @@ __author__ = "Famke Baeuerle and Gwendolyn O. Döbel" +import warnings +mes = 'The refinegems.polish module will be deprecated from version 2.0.0 onwards. Use the refinegems.curation.polish module to find the functionalities.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) #------------------------------------------------ Constant variables --------------------------------------------------# BIOCYC_TIER1_DATABASES_PREFIXES = ['META', 'ECO', 'ECOLI', 'HUMAN'] diff --git a/src/refinegems/sboann.py b/src/refinegems/sboann.py index 4cd07071..60b31d93 100644 --- a/src/refinegems/sboann.py +++ b/src/refinegems/sboann.py @@ -6,6 +6,10 @@ Commented by Famke Bäuerle and extended by Nantia Leonidou. It is splitted into a lot of small functions which are all annotated, however when using it for SBO-Term annotation it only makes sense to run the "main" function: sbo_annotation(model_libsbml, database_user, database_name) if you want to continue with the model. The smaller functions might be useful if special information is needed for a reaction without the context of a bigger model or when the automated annotation fails for some reason. + +.. Warning:: + + *Deprecated in version 2.0.0*: Use the SBOannotar or the `run_SBOannotator()` function in the `connection` module in 2.0.0. """ import re @@ -16,6 +20,10 @@ __author__ = "Elisabeth Fritze, Gwendolyn O. Döbel, Famke Baeuerle and Nantia Leonidou" +import warnings +mes = 'The sboann module will be deprecated from version 2.0.0 onwards. Use SBOannotator or the the 2.0.0 function refinegems.utility.connections.run_SBOannotator' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) def getCompartmentlessSpeciesId(speciesReference: SpeciesReference) -> str: """Determines wheter a species has compartment by its refernece diff --git a/src/refinegems/util.py b/src/refinegems/util.py index 869c1189..cc9c2d04 100644 --- a/src/refinegems/util.py +++ b/src/refinegems/util.py @@ -1,10 +1,19 @@ -"""Collection of utility functions.""" +"""Collection of utility functions. + +.. warning:: + *Deprecated in version 2.0.0*: From 2.0.0 onwards, see refinegems.utility.util for these functionalities. +""" import libchebipy import pandas as pd import requests from refinegems.analysis_db import BIGG_METABOLITES_URL +import warnings +mes = 'The refinegems.util module will be deprecated from version 2.0.0 onwards. Use the refinegems.utility.util module to find the functionalities.' +warnings.warn(mes,DeprecationWarning) +warnings.warn(mes,FutureWarning) + __author__ = "Gwendolyn O. Döbel and Carolin Brune" def add_info_from_ChEBI_BiGG(missing_metabs: pd.DataFrame, charge=True, formula=True, iupac=True) -> pd.DataFrame: