Interactive widgets to construct data analysis notebooks for Mascope
Project description
Mascope Jupyter Widgets
This repository contains interactive widgets to construct data analysis notebooks for Mascope, utilizing Mascope SDK to fetch data from the server. The package is published in PyPI and therefore is publicly available.
Example notebooks are maintained in a separate (private) repository: mascope-jupyter-notebooks.
All developer docs are in this document:
🚀 Getting started
Installation
This project uses uv for dependency management, and therefore it is a prerequisite for installation. Install uv following their instructions.
Once installed, open a terminal, navigate into the repository directory mascope-jupyter-widgets/ and run
uv sync
Environment configuration
NOTE: The .env file needs to be placed in the directory from which you launch the notebooks
To load data from the Mascope database, you will need to configure the URL as well as a personal access token.
- In the source code directory, copy
.env.exampleto a new file named.envin the same location. - Generate and copy a Jupyter Notebooks access token in your Mascope account management.
- Replace placeholders in the
.envfile with the URL of your Mascope instance and your personal access token:
MASCOPE_ACCESS_TOKEN=p3R5oN4l4cC35s70Ken
MASCOPE_URL="https://org.mascope.app"
Note: The .env file is gitignored to prevent accidental commit of personal access tokens. Never commit your actual token to the repository.
📚 Modules
The repository is structured into modules as follows:
mascope-jupyter-widgets/ Repository root
mascope-jupyter-widgets/ Package directory
binning/ Dataset binning module
click_event_handler/ Attach callbacks to figure click events
filtering/ Dataset filtering module
mascope_data/ Data loading module
mass_defect/ Mass defect analysis module
alignment/ Visualization of alignment results for
`mascope-tools` module
sample_timeseries/ Sample peak timeseries analysis module
spectrum/ Spectrum analysis module
timeseries/ Timeseries analysis module
logging_config.py Logger configuration
plot_tools.py Reusable plot utilities
widgets_config.py Global widget configuration
binning/
Module providing tools to bin data to mz-groups.
Names exported to package namespace:
-
BinningWidgetInteractive notebook widget to bin peaks of the dataset samples to mz-groups. It provides different methods and vizualisations for the binning analyze.
click_event_handler/
Module providing tools to bin data to mz-groups.
Names exported to package namespace:
-
click_event_callbacksFunctions which can be attached as callbacks to figure click events.
-
ClickEventHandlerClass to be attached to a widget, providing the click event handling. Takes the desired callback function (from
click_event_callbacks) as an argument.
filtering/
Module providing tools to select a subset of the loaded dataset based on various filtering criteria.
Names exported to package namespace:
-
FilteringWidgetInteractive notebook widget to filter a subset of the data currently loaded into
MascopeDataWrapper. With the filters applied, all the data propertites exposed byMascopeDataWrapperreturn the filtered data.
mascope_data/
Module providing tools to load and interface with Mascope data.
Names exported to package namespace:
-
MascopeDataBrowserInteractive notebook widget to browse and load data from Mascope server.
-
MascopeDataWrapperA class providing a standardized interface to the data loaded from Mascope, consisting of various pandas dataframes exposed as class properties. An instance of the data wrapper is used as the input to analysis modules.
mass_defect/
Module providing tools to perform mass defect analysis on the loaded dataset.
Names exported to package namespace:
-
MassDefectWidgetInteractive notebook widget to visualize the dataset based on mass defect, providing various ways of scaling and normalization.
alignment/
Module providing tools to visualize alignment results for the mascope-tools module.
-
Function to plot m/z shifts in ppm before and after alignment correction.plot_mz_shifts_ppm -
Function to compare initial and corrected spectra using an interactive plot.compare_initial_and_corrected_spectra
sample_timeseries/
Module providing tools to perform sample peak timeseries analysis on the loaded dataset.
Names exported to package namespace:
-
SampleTimeSeriesWidgetInteractive notebook widget to visualize the dataset sample peak timeseries.
spectrum/
Module providing tools to perform spectrum analysis on the loaded dataset.
Names exported to package namespace:
-
SpectrumWidgetInteractive notebook widget to visualize the dataset spectrums.
timeseries/
Module providing tools to perform timeseries analysis on the loaded dataset.
Names exported to package namespace:
-
TimeSeriesWidgetInteractive notebook widget to visualize the dataset based on time, providing various ways of aggregation.
📡 Publishing
The package is published in PyPI. There is a Github workflow; .github/release.yaml which automatically publishes a new version whenever there is a commit to the main branch, typically when develop is merged to main.
📝 Git conventions
To encourage consistency and homogenousity in the Git history across developers, the guidelines presented in the organization README should be followed. For project specific additions to the general guidelines, see below.
Commit message scopes
Due to the relatively small size of the repository, usage of the optional scope field is not encouraged.
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 mascope_jupyter_widgets-2025.8.18.tar.gz.
File metadata
- Download URL: mascope_jupyter_widgets-2025.8.18.tar.gz
- Upload date:
- Size: 117.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7ea1edf366032e251464a044fd7b3540563c811a93de67e4dcd3a29e05f67e4
|
|
| MD5 |
5b08883d35f73a43dabab7056b8d0bd7
|
|
| BLAKE2b-256 |
c2377224e4f6fa6d43f4b54fa1f9298718b458e030fc708a6029e1b700f2a138
|
File details
Details for the file mascope_jupyter_widgets-2025.8.18-py3-none-any.whl.
File metadata
- Download URL: mascope_jupyter_widgets-2025.8.18-py3-none-any.whl
- Upload date:
- Size: 145.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75a2d24d19f4ee361468b32b4bb4bf17220787b3c84a9c13255655d133aeac09
|
|
| MD5 |
98022f949c3428e49fa4d34e3e753cd7
|
|
| BLAKE2b-256 |
baf49819def594979832c8d529ced7a656d02fd7c4342388fb571b9cd2f2a9dc
|