{"id":16265066,"url":"https://github.com/robaina/pathwayenrichment","last_synced_at":"2026-01-21T17:35:14.753Z","repository":{"id":57463130,"uuid":"396009277","full_name":"Robaina/pathwayEnrichment","owner":"Robaina","description":"Tools to perform a permutation-based cell pathway analysis","archived":false,"fork":false,"pushed_at":"2023-01-16T12:23:06.000Z","size":93,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T10:38:02.968Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Robaina.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-14T12:56:40.000Z","updated_at":"2024-05-27T09:49:19.000Z","dependencies_parsed_at":"2023-02-10T03:15:22.673Z","dependency_job_id":null,"html_url":"https://github.com/Robaina/pathwayEnrichment","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robaina%2FpathwayEnrichment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robaina%2FpathwayEnrichment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robaina%2FpathwayEnrichment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robaina%2FpathwayEnrichment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robaina","download_url":"https://codeload.github.com/Robaina/pathwayEnrichment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247730069,"owners_count":20986404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T17:05:57.476Z","updated_at":"2026-01-21T17:35:14.719Z","avatar_url":"https://github.com/Robaina.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Permutation-based pathway enrichment analysis\n\nPython tools to perform a permutation-based pathway enrichment analysis. Currently supporting KEGG pathways.\n\n# Usage\n\n```python\nfrom pathwayenrichment.representation import ClusterPermutator\nfrom pathwayenrichment.databaseparser import KEGGPathwayParser\nfrom pathwayenrichment.utils import randomPartition\n```\n\nFirst, let's download the KEGG database for Dokdonia, a marine bacterium. To this end, we employ KEGG's entry code for Dokdonia (dok). We will then parse the database to obtain a list of genes and associated cellular pathways and systems.\n\n\n```python\nKEGGparser = KEGGPathwayParser.fromKEGGidentifier('dok', only_curated_pathways=True)\ngene_pathways, gene_systems = KEGGparser.getGenePathways()\nsystem_pathways = KEGGparser.getSystemPathways()\ngene_info = KEGGparser.getGeneInfoFromKEGGorthology()\ngene_list = list(gene_pathways.keys())\nprint(f'There are a total of {len(gene_list)} genes')\n```\n\n    There are a total of 786 genes\n\n\nNow, we simulate a set of gene clusters to perform a pathway enrichment analysis on them. To this end, we will randomly partition the set of genes into clusters.\n\n\n```python\ngenes_under_study = gene_list[:300]\nclusters = dict(zip(\n    ['A', 'B', 'C', 'D'],\n    randomPartition(gene_list, bin_sizes=[75, 25, 150, 50])\n))\n```\n\nNow we are ready to instantiate a ClusterPermutator to run the enrichment analysis. We will permute the total set of genes to form new random clusters 10000 times, our sample size to compute the sample p-value.\n\n\n```python\npermutator = ClusterPermutator(clusters, gene_pathways, system_pathways)\nres = permutator.sampleClusterPermutationSpace(sample_size=10000, n_processes=4)\n```\n\n    Finished permutation sampling\n\n\n\n```python\n# Here are the first 10 pathways with lowest sample p-value\n{k:v for k,v in list(res['pathway']['A'].items())[:10]}\n```\n\n\n\n\n    {'03018 RNA degradation [PATH:dok03018]': (0.2777777777777778, 0.0484),\n     '00020 Citrate cycle (TCA cycle) [PATH:dok00020]': (0.18181818181818182,\n      0.0691),\n     '02020 Two-component system [PATH:dok02020]': (0.2, 0.1527),\n     '00541 O-Antigen nucleotide sugar biosynthesis [PATH:dok00541]': (0.19047619047619047,\n      0.1641),\n     '03060 Protein export [PATH:dok03060]': (0.2, 0.1683),\n     '02024 Quorum sensing [PATH:dok02024]': (0.14814814814814814, 0.218),\n     '00520 Amino sugar and nucleotide sugar metabolism [PATH:dok00520]': (0.14285714285714285,\n      0.2211),\n     '02010 ABC transporters [PATH:dok02010]': (0.15, 0.2422),\n     '00040 Pentose and glucuronate interconversions [PATH:dok00040]': (0.3333333333333333,\n      0.25),\n     '00053 Ascorbate and aldarate metabolism [PATH:dok00053]': (0.2, 0.25)}\n\n\n\nHere, we see the 10 pathways with lowest sample p-values within cluster _A_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobaina%2Fpathwayenrichment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobaina%2Fpathwayenrichment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobaina%2Fpathwayenrichment/lists"}