Skip to content

SidhuK/metaboheatmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MetaboHeatMap

A R/Shiny based app for visualizing metabolomics data through heatmaps

GitHub last commit DOI

Available online at here or locally using the source code in this repository.

MetaboHeatMap The Shiny App Home Page

Introduction

MetaboHeatMap is a R/Shiny based app for visualizing metabolomics data through heatmaps. It is designed specifically to be used for small to medium sized metabolomics datasets (<=500 compounds for best results) .Ideally, the data is normalized and filtered before being used in the app. The app can be used in two ways:

  1. Online: The app is available online at here. The app is hosted on a free account and may be slow at times. The app is also limited to 25 concurrent users. If you are unable to access the app, please try again later, or contact me on Twitter or Mastodon and I will try my best to resolve the issue.
  2. Locally: The app can be run locally using the source code in this repository. Any IDE configured to run R/Shiny apps can be used.

Example Heatmaps

Features

This R/Shiny based app is designed to be used for visualizing metabolomics data through heatmaps. It is based on the PHeatMap Package and uses the Shiny Package to create a web app interface. In its current release, the app has the following features:

  • Heatmap Generation: The app can be used to generate heatmaps from metabolomics data.
  • Data Processing:
    • Data Validation: Automatic validation of input files and data structure
    • Data Filtering: Option to filter data based on threshold values
    • Data Normalization: Support for z-score and min-max normalization
  • Performance Optimization:
    • Caching System: Intelligent caching to avoid unnecessary recomputation
    • Progress Indicators: Visual feedback for long-running operations
  • Clustering: The app can be used to cluster the samples and compounds/metabolites in the heatmap.
    • The major clustering algorithms supported by the app are:
      • Correlation
      • Euclidean
      • Manhattan
      • Maximum
      • Canberra
      • Binary
    • Sample Clustering: The app can be used to cluster the samples in the heatmap.
    • Compound Clustering: The app can also be used to cluster the compounds/metabolites in the heatmap.
  • Visualization Options:
    • Color Schemes: Multiple color palettes including viridis and magma
    • Heatmap Size: Customizable heatmap dimensions
    • Display Cell Values: Option to show numerical values in cells
    • Font Customization: Adjustable font sizes and colors
  • Export Features:
    • High-Quality Downloads: PNG export with timestamp-based naming
    • Customizable Resolution: 300 DPI export for publication-ready figures

Additionally, the app has some custom CSS Formatting to ensure it is responsive and can be used on any device with a web browser, including mobile devices, although desktops are recommended for best results.

Data Preprocessing & Upload

Before starting the app, the data must be preprocessed and uploaded to the app.

Data Preprocessing

The app now includes built-in data preprocessing capabilities:

  • Validation: Automatic checks for:
    • File format (CSV only)
    • Data structure integrity
    • Non-empty files
    • Minimum required dimensions
  • Filtering: Option to remove low-value compounds based on threshold
  • Normalization: Two normalization methods available:
    • Z-score normalization
    • Min-max scaling

The sample data provided in this repository is a randomly generated dataset. The data must be in CSV format with the following structure:

  • The first column must be named 'compound' and contain the names of the compounds/metabolites. The names of the compounds must be unique, and the column heading is case sensitive.
  • The first row must be named 'sample' and contain the names of the samples. The names of the samples must be unique,
  • The remaining cells must contain the values of the metabolites for each sample. The values must be numeric.
  • The data must be in a rectangular format. That is, the number of columns must be equal to the number of samples, and the number of rows must be equal to the number of compounds/metabolites.
  • For best results, the data should be normalized and filtered before being used in the app. The app does not perform any normalization or filtering on the data.

Data Upload

To upload the data, simply click on the 'Browse' button on the home page of the app. This will open a file selection dialog box. Select the data file and click 'Open'. The app will then load the data for visualization.

Usage

Once the data is uploaded, you must then select the parameters for the heatmap. Once the parameters are selected, click on the 'Generate Heatmap' button to generate the heatmap. The heatmap generation could take from a few seconds to a few minutes depending on the size of the data and the parameters selected. Heatmap generated can be viewed and downloaded from the 'Heatmap' tab.

Online App

The app is available online at here. The app is hosted on a free account and may be slow at times. The app is also limited to 25 concurrent users. If you are unable to access the app, please try again later, or contact me on Twitter or Mastodon and I will try my best to resolve the issue.

Installation

To run the app locally:

  1. Clone the repository using the following command:
git clone https://github.com/SidhuK/metaboheatmap

or download the repository as a zip file and extract it.

  1. Open the project in RStudio or any other IDE configured to run R/Shiny apps.
  2. Install the required packages using the following command:
install.packages(c("shiny", "pheatmap"))
  1. Run the app using the following command:
shiny::runApp()
  1. The app will be available locally and can be accessed using the URL provided in the R console.
  2. Once the app starts, upload the data and proceed according to the instructions in the Usage section.
  3. To stop the app, press the 'Stop' button in the R console or simply close the R console.

License

This project is licensed under the MIT License - see the LICENSE file for details. This license applies to the source code of the app only. The data used in the app is randomly generated and is not licensed. The data is provided for demonstration purposes only, and should not be used for any other purpose.

Acknowledgments

The app uses the following packages:

Citation

If you use this app in your research, please use the following citation:

@software{karat_sidhu_2023_7631526,
  author       = {Karatatiwant Singh Sidhu},
  title        = {SidhuK/metaboheatmap: Version 1.0},
  month        = feb,
  year         = 2023,
  publisher    = {Zenodo},
  version      = {Shiny\_1},
  doi          = {10.5281/zenodo.7631526},
  url          = {https://doi.org/10.5281/zenodo.7631526}
}

Planned Features

The development of this app is an ongoing process. New features are being added regularly to enhance the user experience and provide more insights into the data. The following features are currently in development:

  • Advanced Data Preprocessing: Additional normalization methods and filtering options
  • Batch Processing: Support for processing multiple datasets simultaneously
  • Export Options: Additional export formats (PDF, SVG)
  • Data Integration: Integration with metabolomics databases
  • Interactive Features: Click-and-zoom functionality for detailed analysis
  • Documentation and Tutorials: Comprehensive documentation and tutorials

These features are expected to be added in the coming months, depending on the availability of time and resources.

The list of planned features is not exhaustive and may be updated at any time.

Contact

If you have any questions or suggestions, please contact me on Twitter or Mastodon. You can also open an issue on the GitHub Repository.

Error Handling

The app includes robust error handling for:

  • File upload issues
  • Data format problems
  • Processing errors
  • Download failures

Users will receive clear error messages and suggestions for resolution when issues occur.