Giter VIP home page Giter VIP logo

metaspace_analysis's Introduction

METASPACE knowledge base analysis

Scripts for all analyses of the METASPACE knowledge to reproduce the Figures of the manuscript: Rose et al. "METASPACE: A community-populated knowledge base for spatial metabolomics"

Running all analyses

To reproduce all Figures/run all case studies, python scripts and notebooks must be executed in the following order:

  1. Modify the directories for saving all data in the config.py file.

  2. Download all METASPACE datasets by running scripts/download_all_datasets.py

  3. Generate general statistics figures of the manuscript (knowledge base statistics): KB_stats.ipynb

  4. Generate case study 1 of the manuscript (dataset similarity analysis): CaseStudy1_DatasetSimilarities.ipynb

  5. Create sets of context representative datasets: get_representative_datasets.ipynb

  6. Download all ion images for representative datasets: scripts/download_images.py

  7. Compute all colocalizations: scripts/coloc_pval_{SCENARIO}.py

  8. Perform single pixel integration: scripts/single_pixel_{SCENARIO}.py

  9. Generate case study 2 of the manuscript (single-pixel analysis): CaseStudy2_SinglePixel.ipynb (Note that the cluster assignment might change due to random initialization and therefore require manual selection of a new cluster)

  10. Generate case study 3 of the manuscript (colocalization analysis): CaseStudy3_colocalization.ipynb (Figure 4 requires the linex2metaspace package, which can be installed from the github repository).

  11. 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)

  12. Create the main figure of the manuscript. This figures uses plots from all case studies: CaseStudy2_SinglePixel.ipynb (Note that some plots are added to the pdf manually using Inkscape and therefore not added in this notebook).

Additional notes:

  • 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).

  • 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. Since this table contains IDs of private METASPACE datasets, we cannot make it public. The code can be commented out to plot only uploaded public datasets over time.

  • Results for the publication for the case studies 1-3 have been performed on datasets uploaded before 02.02.23.

metaspace_analysis's People

Contributors

tdrose avatar krtiteca avatar

Watchers

 avatar

metaspace_analysis's Issues

Clean up repo and doc for workflow.

The repository contains many analyses/scripts which did not end up in the final results. These should be cleaned up before analysis.
Also, The full workflow to reproduce all figures should be documented.

Move to metaspace-converter package

After the update of the metaspace2anndata package to metaspace-converter, scripts & notebooks need to be updated to the package interface.

Add co-regulation code

@krtiteca Since we are cleaning up the manuscript to prepare for submission, let's continue here the progress/comments about adding the co-regulation code to the repository.

Todo's for figures

The following things need to be worked on for the figures:

  • 4A&F: reorder to Brain, Kidney, Lung
  • Consistent use of '*' throughout all plots
  • Decrease point size in 2K
  • 2H: improve visibility of overlapping text/bar (and supplement)
  • Update all formulas from C39H79N2O6P+H to [C39H79N2O6P+H]+
  • Look up all formulas for mentioned molecules, to put them in the figure captions.
  • Single pixel Brain: Better consistent colorscheme, Improve plot H such that it adds more value to the figure.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.