{"id":20752775,"url":"https://github.com/pedrofale/tumorevo","last_synced_at":"2025-04-28T14:21:45.529Z","repository":{"id":62592079,"uuid":"430239036","full_name":"pedrofale/tumorevo","owner":"pedrofale","description":"Simulate tumor evolution and generate bulk and single-cell data from it.","archived":false,"fork":false,"pushed_at":"2025-01-21T19:33:59.000Z","size":824,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T03:18:41.864Z","etag":null,"topics":["cancer","simulation","single-cell","spatial-transcriptomics","tumor-evolution"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedrofale.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-21T00:24:51.000Z","updated_at":"2025-01-21T19:35:40.000Z","dependencies_parsed_at":"2024-01-11T16:47:07.713Z","dependency_job_id":"d264aff7-4d4e-4e2e-a1a7-f4a4ad9354c2","html_url":"https://github.com/pedrofale/tumorevo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrofale%2Ftumorevo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrofale%2Ftumorevo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrofale%2Ftumorevo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrofale%2Ftumorevo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedrofale","download_url":"https://codeload.github.com/pedrofale/tumorevo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326896,"owners_count":21571644,"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":["cancer","simulation","single-cell","spatial-transcriptomics","tumor-evolution"],"created_at":"2024-11-17T08:42:40.224Z","updated_at":"2025-04-28T14:21:45.508Z","avatar_url":"https://github.com/pedrofale.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tumorevo\n\n[![PyPI](https://img.shields.io/pypi/v/tumorevo.svg?style=flat)](https://pypi.python.org/pypi/tumorevo)\n[![Tests](https://github.com/pedrofale/tumorevo/actions/workflows/main.yaml/badge.svg)](https://github.com/pedrofale/tumorevo/actions/workflows/main.yaml)\n\nSimulate tumor evolution under different spatial constraints. This package aims to be as awesome as [demon](https://github.com/robjohnnoble/demon_model).\n`tumorevo` simulates tumor growth and and produces a Muller plot, a 2D slice of the tumor, and a clone tree.\n\n## Installation\n\n```bash\n$ pip install tumorevo\n```\n\n## Usage\n\n`tumorevo` contains two command line utilities: `tumorsim` and `tumorfig`.\n\n### Simulating tumor evolution\n`tumorsim` can be used to simulate the evolution of a tumor according to a specified spatial structure.\n```bash\n$ tumorsim --mode 1 --steps 2000 --genes 20 --carrying-capacity 5 --grid-size 20 --division-rate 0.2 --dispersal-rate 0.1\n100%|████████████████████| 1999/1999 [00:07\u003c00:00, 251.69it/s]\n```\n\nThis will create a folder containing:\n* `parents.csv`: file indicating each clones's parent;\n* `trace_counts.csv`: file indicating the number of cells of each clone at each time step;\n* `genotypes.csv`: file containing the genotypes of each clone;\n* `grid.csv`: file containing the regular grid of genotypes if `mode` \u003e 0.\n\nFull overview:\n```\n$ tumorsim --help\nUsage: tumorsim [OPTIONS]\n\n  Simulate tumor evolution under different spatial constraints.\n\nOptions:\n  -m, --mode INTEGER              Spatial structure.\n  -k, --carrying-capacity INTEGER\n                                  Deme carrying capacity.\n  -g, --genes INTEGER             Number of genes.\n  -s, --steps INTEGER             Number of steps in simulation.\n  --grid-size INTEGER             Grid size.\n  --division-rate FLOAT           Divison rate.\n  --mutation-rate FLOAT           Mutation rate.\n  --dispersal-rate FLOAT          Dispersal rate.\n  -r, --random_seed INTEGER       Random seed for the pseudo random number\n                                  generator.\n  --log INTEGER                   Logging level. 0 for no logging, 1 for info,\n                                  2 for debug.\n  -o, --output-path TEXT          Output directory\n  --help                          Show this message and exit.\n```\n\n### Plotting tumor evolution\n`tumorfig` can be used to create a Muller plot of the tumor's evolution, the 2D spatial organization of the tumor cells, and a clone tree.\n```bash\n$ tumorfig out/trace_counts.csv out/parents.csv --plot --grid-file out/grid.csv --normalize --remove\n```\n\nThis will open a figure like this:\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/pedrofale/tumorevo/raw/main/figures/example.png\", width=\"700px\"\u003e\n\u003c/div\u003e\n\nFull overview:\n```\n$ tumorfig --help\nUsage: tumorfig [OPTIONS] GENOTYPE_COUNTS GENOTYPE_PARENTS\n\n  Plot the evolution of a tumor.\n\nOptions:\n  -c, --cells INTEGER           Number of cells in slice plot.\n  -r, --average-radius INTEGER  Average radius of circles in slice plot.\n  --grid-file TEXT              Path to grid file.\n  --colormap TEXT               Colormap for genotypes.\n  --dpi INTEGER                 DPI for figures.\n  --plot                        Plot all the figures.\n  --do-muller                   Make a Muller plot.\n  --do-slice                    Make a slice plot.\n  --do-tree                     Make a clone tree plot.\n  --normalize                   Normalize the abundances in the Muller plot.\n  --labels                      Annotate the clone tree plot.\n  --remove                      Remove empty clones in the clone tree plot.\n  -o, --output-path TEXT        Directory to write figures into.\n  --help                        Show this message and exit.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrofale%2Ftumorevo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedrofale%2Ftumorevo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrofale%2Ftumorevo/lists"}