{"id":20844832,"url":"https://github.com/lkremer/cafe_fig","last_synced_at":"2025-05-09T02:23:38.956Z","repository":{"id":83467468,"uuid":"93158027","full_name":"LKremer/CAFE_fig","owner":"LKremer","description":"A tool to extract and visualize the results of CAFE (Computational Analysis of gene Family Evolution)","archived":false,"fork":false,"pushed_at":"2019-09-05T14:11:24.000Z","size":507,"stargazers_count":56,"open_issues_count":10,"forks_count":16,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-20T04:20:38.146Z","etag":null,"topics":["cafe","ete3","evolution","gene-families","molecular-evolution","phylogenetic-trees"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LKremer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-06-02T11:10:39.000Z","updated_at":"2024-02-29T02:08:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"34b60d48-4142-4e7b-bd66-aa1a7794c17a","html_url":"https://github.com/LKremer/CAFE_fig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LKremer%2FCAFE_fig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LKremer%2FCAFE_fig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LKremer%2FCAFE_fig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LKremer%2FCAFE_fig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LKremer","download_url":"https://codeload.github.com/LKremer/CAFE_fig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225115177,"owners_count":17423063,"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":["cafe","ete3","evolution","gene-families","molecular-evolution","phylogenetic-trees"],"created_at":"2024-11-18T02:11:10.299Z","updated_at":"2024-11-18T02:11:10.820Z","avatar_url":"https://github.com/LKremer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"CAFE_fig, a visualization tool for CAFE.\n=========\n\n[CAFE](https://hahnlab.github.io/CAFE/) (Computational Analysis of gene Family\nEvolution) is a software that provides a statistical foundation for evolutionary\ninferences about changes in gene family size.\n\nThe visualization and interpretation of CAFE results usually requires custom\nscripts. Here, I provide such a custom script.\n\nCAFE_fig takes a .cafe output file and produces:\n- a summary tree that shows the average expansion/contraction of families across the phylogeny\n- a tree that denotes which branches evolve under which lambda (if a model with multiple lambdas was used)\n- a tree for each family of interest, i.e. families that the user specified by ID or families that showed significant change at a user-specified clade of interest\n\n\n\nRequirements\n------------\n\n\nCAFE_fig requires Python3.4+ and ETE3:\nInstall ETE3 with\n\n`pip3 install 'ete3==3.0.0b35'`\n\nIt's important that you use ETE3 version 3.0.0b35 since it appears that the latest ETE3 version causes problems that are beyond my control (see issue [#1](https://github.com/LKremer/CAFE_fig/issues/1)). This ETE3 version runs well with PyQt4 but not PyQt5, so if you're experiencing issues it's worth a try to switch to PyQt4. \n\n\nUsage\n------------\n\n```\nusage: CAFE_fig.py [-h] [-f FAMILIES [FAMILIES ...]] [-c CLADES [CLADES ...]]\n                   [-pb PB] [-pf PF] [-d DUMP] [-g GFX_OUTPUT_FORMAT]\n                   [--count_all_expansions]\n                   report_cafe\n\nParses a CAFE output file (.cafe) and plots a summary tree that shows the\naverage expansion/contraction across the phylogeny; a tree that shows which\nclades evolved under the same lambda (if available); and a gene family\nevolution tree for each user-specified gene family.\n\npositional arguments:\n  report_cafe           the file report.cafe (or similar name)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -f FAMILIES [FAMILIES ...], --families FAMILIES [FAMILIES ...]\n                        only show families with these IDs\n  -c CLADES [CLADES ...], --clades CLADES [CLADES ...]\n                        only show families that are expanded/contracted at\n                        this clade. Format: [clade]=[leaf],[leaf] where clade\n                        is the name of the last common ancestor of the two\n                        leaves, e.g.: Isoptera=zne,mna\n  -pb PB                branch p-value cutoff (default: 0.05)\n  -pf PF                family p-value cutoff (default: 0.05)\n  -d DUMP, --dump DUMP  don't open trees in a window, write them to files in\n                        the specified directory instead (default: off)\n  -g GFX_OUTPUT_FORMAT, --gfx_output_format GFX_OUTPUT_FORMAT\n                        output format for the tree figures when using --dump\n                        [svg|pdf|png] (default: pdf)\n  --count_all_expansions\n                        count and write down the number of *all* expansions\n                        and contractions (default: only count significant\n                        expansions/contractions)\n```\n\n\nExample outputs\n------------\n\nSummary tree that shows the average expansion/contraction (radius of node circles),\nthe numbers of expanded/contracted families (+/-), and the estimated gene gain/loss\nrates (blue: low rate; red: high rate).\n![example_tree](screenshots/expansions_contractions.png)\n\nExample output for a specific gene family. Numbers and node sizes represent the family size at each node.\nSignificant expansions are shown in green, significant contractions in magenta.\n![example_tree](screenshots/Ir_group_B.png)\n\n\nExample usage\n------------\n\nTo recreate the plots shown above, use this command:\n\n`python3 ./CAFE_fig.py example_result.cafe -c Isoptera=zne,mna -pb 0.05 -pf 0.05 --dump test/ -g .pdf --count_all_expansions`\n\nThis reads \"example_result.cafe\" and dumps all figures in PDF format to the directory \"test/\". The summary tree (\"summary.pdf\") will show the whole phylogeny and the number of expansions and contractions (including insignificant ones!) as shown below. Further family-wise trees will be created and dumped in the directory \"test/families\". These trees will only be created for families that showed a significant (p\u003c=0.05) expansion/contraction at the node \"Isoptera\", which is the last common ancestor of \"zne\" and \"mna\".\n\nSignificant contractions are marked in magenta, significant expansions are marked in green (p\u003c=0.001 = \\*\\*\\*, p\u003c=0.01 = \\*\\*, p\u003c=0.05 = \\*).\n\nKnown issues\n------------\n\nThe error message `module 'ete3' has no attribute 'TreeStyle'` is caused by a known problem with ete3 that is beyond my control.\n[Check this link for possible solutions!](https://github.com/etetoolkit/ete/issues/354). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkremer%2Fcafe_fig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flkremer%2Fcafe_fig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkremer%2Fcafe_fig/lists"}