{"id":41132863,"url":"https://github.com/tdrose/metaspace_analysis","last_synced_at":"2026-01-22T18:33:38.511Z","repository":{"id":220165367,"uuid":"677291557","full_name":"tdrose/metaspace_analysis","owner":"tdrose","description":"Large-scale analysis of the METASPACE knowledge base | Publication: https://doi.org/10.1101/539478 ","archived":false,"fork":false,"pushed_at":"2024-04-10T16:18:00.000Z","size":434722,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-10T20:05:46.672Z","etag":null,"topics":["data-science","imaging-mass-spectrometry","knowledge-base"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tdrose.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}},"created_at":"2023-08-11T07:50:49.000Z","updated_at":"2024-04-15T11:33:41.439Z","dependencies_parsed_at":"2024-04-10T17:52:43.655Z","dependency_job_id":null,"html_url":"https://github.com/tdrose/metaspace_analysis","commit_stats":null,"previous_names":["tdrose/metaspace_analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tdrose/metaspace_analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdrose%2Fmetaspace_analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdrose%2Fmetaspace_analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdrose%2Fmetaspace_analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdrose%2Fmetaspace_analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdrose","download_url":"https://codeload.github.com/tdrose/metaspace_analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdrose%2Fmetaspace_analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28668119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-science","imaging-mass-spectrometry","knowledge-base"],"created_at":"2026-01-22T18:33:38.084Z","updated_at":"2026-01-22T18:33:38.504Z","avatar_url":"https://github.com/tdrose.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# METASPACE knowledge base analysis\n\nScripts for all analyses of the METASPACE knowledge to reproduce the Figures of the manuscript:\n[Rose et al. \"METASPACE: A community-populated knowledge base for spatial metabolomics\"](https://doi.org/10.1101/539478)\n\n## Running all analyses\n\nTo reproduce all Figures/run all case studies, python scripts and notebooks must be executed in the following order: \n\n1. Modify the directories for saving all data in the `config.py` file.\n\n2. Download all METASPACE datasets by running `scripts/download_all_datasets.py`\n\n3. Generate general statistics figures of the manuscript (knowledge base statistics): `KB_stats.ipynb`\n\n4. Generate case study 1 of the manuscript (dataset similarity analysis): `CaseStudy1_DatasetSimilarities.ipynb`\n\n5. Create sets of context representative datasets: `get_representative_datasets.ipynb`\n\n6. Download all ion images for representative datasets: `scripts/download_images.py`\n\n7. Compute all colocalizations: `scripts/coloc_pval_{SCENARIO}.py`\n\n8. Perform single pixel integration: `scripts/single_pixel_{SCENARIO}.py`\n\n9. Generate case study 2 of the manuscript (single-pixel analysis): `CaseStudy2_SinglePixel.ipynb` \n(Note that the cluster assignment might change due to random initialization and therefore require manual selection of a new cluster)\n\n10. Generate case study 3 of the manuscript (colocalization analysis): `CaseStudy3_colocalization.ipynb`\n(Figure 4 requires the [linex2metaspace](https://github.com/tdrose/lipidranking_metaspace) package, which can be installed from the github repository).\n\n11. Generate plots from case study 4 of the manuscript (co-regulation analysis): Run the R-script in the directory `CaseStudy4` (Further information are included as comments in the top of the file)\n\n12. Create the main figure of the manuscript. This figures uses plots from all case studies: `CaseStudy2_SinglePixel.ipynb` \n(Note that some plots are added to the pdf manually using Inkscape and therefore not added in this notebook).\n\n## Additional notes:\n* `scripts/*.py` files usually take a longer time to run and can therefore be submitted to a suitable cluster as jobs (`*.sh` slurm scripts are available for each file).\n\n* The file `figure1_stats.ipynb` requires the table `all_dataset_ids-06-09-23.csv` to create the plot in Figure 1B showing the number of datasets uploaded to METASPACE over time.\nSince this table contains IDs of private METASPACE datasets, we cannot make it public.\nThe code can be commented out to plot only uploaded public datasets over time.\n\n* Results for the publication for the case studies 1-3 have been performed on datasets uploaded before 02.02.23. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdrose%2Fmetaspace_analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdrose%2Fmetaspace_analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdrose%2Fmetaspace_analysis/lists"}