create SHarable, interactive, stANdalone html dashboard from Tabular proteomIcs data
Project description
🧘 Shanti
create SHarable, interactive, stANdalone html dashboard from Tabular proteomIcs data
Shanti is a Python library for creating interactive, standalone HTML dashboards from proteomics data (specifically tabular data in Excel format). This package simplifies the process of creating volcano plots and histograms. This tool uses Bokeh library in the background to generate a HTML file that contains interactive plots and tables. The HTML files can be opened in a browser (Firefox, Chrome, Safari, Edge) and shared with colleagues. Your colleagues can explore proteomics data with without requiring any server or software installation.
📦 Installation
You can install the package with pip:
pip install shanti
🚀 Key Components
load_data() loads proteomics data from Excel files, processes it, and prepares it for visualization. The volcano plot visualization includes threshold curves for significance. The curves are calculated based on the threshold function in CurveCurator package. Some default parameters are already set in example snippet below. Only one parameter fc_lim needs to adjusted frequently.
make_histogram() creates histograms of the control and treated sample groups. The bin sizes are set to 20 but can be adjusted in the source code.
create_interactive_dashboard() generates an interactive Bokeh dashboard
- A volcano plot showing log2 fold change vs. -log10 adjusted p-value
- Histograms overlaid with selected proteins from volcano plot
- Filter sliders and search functionality
- A protein data table and a peptide data table
DataProcessor is the internal Class that handles
- Statistical calculations specifically for protein level data
- Classification of volcano data points based on significance thresholds
- Creation of histograms for protein abundance visualization
📂 Input Files Required
- Protein data Excel file (e.g. Shanti_Test_Proteins.xlsx)
- Peptide data Excel file (e.g. Shanti_Test_PeptideGroups.xlsx)
🧪 Usage
Here's a simple example to demonstrate how to use the shanti package:
from shanti import load_data, make_histogram, create_interactive_dashboard
# Load data with custom parameters
source = load_data(
file_path = "shanti/data/Shanti_Test_Proteins.xlsx",
sheet_name=0,
alpha = 0.05,
dfn = 10,
dfd = 10,
loc = 0,
scale = 1,
two_sided=False,
fc_lim = 0.25,
l2fc_col = "KO_WT_l2FC",
pAdj_col = "KO_WT_pAdj"
)
Create histograms for visualization:
hist1, hist1_data_filtered, hist1_bin_edges_log, hist1_bottoms, hist1_bar_height = make_histogram(
source=source,
hist_col="AN_KO_Mean",
title="KO dTAG",
visible=True,
x_axis_label="protein count"
)
hist2, hist2_data_filtered, hist2_bin_edges_log, hist2_bottoms, hist2_bar_height = make_histogram(
source,
hist_col="AN_WT_Mean",
title="DMSO",
visible=True,
x_axis_label="protein count"
)
Generate the interactive dashboard:
dashboard_path = create_interactive_dashboard(
source,
l2fc_col="KO_WT_l2FC",
pAdj_col="KO_WT_pAdj",
html_title="Shanti Tool",
color_column="color",
volcano_title="KO dTAG vs DMSO Comparison",
volcano_tools="pan, box_zoom, wheel_zoom, tap, box_select, reset, save",
plot2=hist1,
plot3=hist2,
hist1_data_filtered=hist1_data_filtered,
hist2_data_filtered=hist2_data_filtered,
hist1_bin_edges_log=hist1_bin_edges_log,
hist2_bin_edges_log=hist1_bin_edges_log,
hist1_bottoms=hist1_bottoms,
hist2_bottoms=hist1_bottoms,
hist1_bar_height=hist1_bar_height,
hist2_bar_height=hist1_bar_height,
hist1_col="AN_KO_Mean",
hist2_col="AN_WT_Mean",
table_columns=["UniProtID", "Gene", "Description", "Peptides", "PeptidesU", "PSMs"],
peptides_file="shanti/data/Shanti_Test_PeptideGroups.xlsx",
peptide_columns=["UniProtID", "Sequence", "ProteinGroups", "Proteins", "PSMs", "Position", "MissedCleavages", "QuanInfo"],
output_path="dashboard.html"
)
📊 Final Output
The result is a fully interactive HTML dashboard (dashboard.html) which you can open in any browser.
- Volcano Plot showing log fold change vs p-value
- Histograms comparing protein abundance distribution overlaid with selected proteins
- Interactive tables of proteins and peptides
- Ability to click/select proteins and see related peptides instantly
🧑💻 For Developers
To extend or modify this tool:
- Check the shanti source folder
- Edit the histogram, volcano, or dashboard layout logic
- Test using Jupyter notebooks or scripts
🙋 FAQ
Q: What kind of Excel format is expected? A: The protein file should contain fold change and p-value columns. The peptide file should contain UniProt IDs and sequence-level info.
Q: Does it support .csv files? A: Not yet, but it's easy to adapt by editing the load_data function.
📬 Questions?
Feel free to open an issue or reach out with feedback!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shanti-0.1.0.tar.gz.
File metadata
- Download URL: shanti-0.1.0.tar.gz
- Upload date:
- Size: 29.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a52302057bbc81f4c4714aeb657292bb6d0dfa15d0243e7d5f5db8de812c6e7f
|
|
| MD5 |
baf5d11961f6ee79243c9d7d8427c66b
|
|
| BLAKE2b-256 |
62ef16a1fcbaacc235103fadade1b1f6c1fb50360729a113b141774adaaac678
|
File details
Details for the file shanti-0.1.0-py3-none-any.whl.
File metadata
- Download URL: shanti-0.1.0-py3-none-any.whl
- Upload date:
- Size: 39.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c91d231ba60c095b7ff05db214a7aa34b09b02fdd176ecd5957c39b88e0d1453
|
|
| MD5 |
bcad91367566dd93d410b60a5e7acd6a
|
|
| BLAKE2b-256 |
8d04b4c2f5a62d305e6dc4446c51f278b70b0f8abe88e1572460f7cfb37fe65f
|