{"id":2961,"library":"gprofiler-official","title":"gprofiler-official","description":"The official Python 3 interface to the g:Profiler toolkit, providing functional enrichment analysis of GO and other terms, conversion between identifier namespaces, and mapping orthologous genes. It is currently at version 1.0.0, released in April 2019, and appears to have a stable, though not rapid, release cadence based on its history.","status":"active","version":"1.0.0","language":"en","source_language":"en","source_url":"https://pypi.org/project/gprofiler-official/","tags":["bioinformatics","gene enrichment","gprofiler","genomics","api-client"],"install":[{"cmd":"pip install gprofiler-official","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Required if 'return_dataframe=True' is used for results processing.","package":"pandas","optional":true}],"imports":[{"symbol":"GProfiler","correct":"from gprofiler import GProfiler"}],"quickstart":{"code":"import os\nfrom gprofiler import GProfiler\n\n# Initialize GProfiler object\n# user_agent is optional but good practice to identify your application.\n# Setting return_dataframe=True makes results easier to work with using pandas.\ngp = GProfiler(\n    user_agent=os.environ.get('GPROFILER_USER_AGENT', 'MyAwesomeBioTool/1.0'),\n    return_dataframe=True\n)\n\n# Example: Functional enrichment analysis (g:GOSt)\n# Query a list of genes for Homo sapiens\ngenes_query = ['NR1H4', 'TRIP12', 'UBC', 'FCRL3', 'PLXNA3', 'GDNF', 'VPS11']\nprint(f\"Querying genes: {genes_query}\")\nresults = gp.profile(organism='hsapiens', query=genes_query)\n\nprint(\"\\nFunctional Enrichment Results (head):\")\nif results is not None and not results.empty:\n    print(results.head())\nelse:\n    print(\"No enrichment results found or query failed.\")\n\n# Example: Gene ID conversion (g:Convert)\n# Convert gene IDs from one namespace to another\nconvert_query = ['NR1H4', 'TRIP12']\nprint(f\"\\nConverting gene IDs: {convert_query}\")\nconverted_genes = gp.convert(\n    organism='hsapiens',\n    query=convert_query,\n    target_namespace='ENTREZGENE_ACC'\n)\nprint(\"\\nGene ID Conversion Results (head):\")\nif converted_genes is not None and not converted_genes.empty:\n    print(converted_genes.head())\nelse:\n    print(\"No conversion results found or query failed.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the `GProfiler` client and perform basic functional enrichment analysis (g:GOSt) and gene ID conversion (g:Convert). It's recommended to provide a `user_agent` for API calls and to set `return_dataframe=True` for convenient result handling with pandas."},"warnings":[{"fix":"Review the API documentation for version 1.0.0 and update your code accordingly. For legacy projects requiring Python 2, use `pip install gprofiler-official==0.2.3`.","message":"The 1.0.x series introduced breaking changes compared to the 0.3.x series. Code written for older versions (e.g., 0.3.5) will not be compatible with 1.0.0 without modifications.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Ensure your project is running on Python 3. If Python 2 support is strictly necessary, use version 0.2.3 specifically.","message":"The library is exclusively for Python 3 since version 0.3. Earlier versions (e.g., 0.2.x) were Python 2 compatible. Attempting to use recent versions with Python 2 will result in errors.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Check for identifier discrepancy warnings in the g:Profiler output. You may need to manually map ambiguous genes or re-submit the query with explicit mappings to ensure all identifiers are correctly interpreted.","message":"If identifiers in your query have multiple possible mappings in g:Profiler, they might be excluded by default. This can lead to incomplete results.","severity":"gotcha","affected_versions":"All"},{"fix":"Install `pandas` explicitly if you intend to use the DataFrame output: `pip install pandas`.","message":"Using `return_dataframe=True` (as shown in quickstart) requires the `pandas` library to be installed. If `pandas` is not present, this will lead to an `ImportError` or `ModuleNotFoundError` when results are being processed.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}