Skip to main content

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.

  1. In the source code directory, copy .env.example to a new file named .env in the same location.
  2. Generate and copy a Jupyter Notebooks access token in your Mascope account management.
  3. Replace placeholders in the .env file 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
    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:

  • BinningWidget

    Interactive 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_callbacks

    Functions which can be attached as callbacks to figure click events.

  • ClickEventHandler

    Class 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:

  • FilteringWidget

    Interactive notebook widget to filter a subset of the data currently loaded into MascopeDataWrapper. With the filters applied, all the data propertites exposed by MascopeDataWrapper return the filtered data.

mascope_data/

Module providing tools to load and interface with Mascope data.

Names exported to package namespace:

  • MascopeDataBrowser

    Interactive notebook widget to browse and load data from Mascope server.

  • MascopeDataWrapper

    A 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:

  • MassDefectWidget

    Interactive notebook widget to visualize the dataset based on mass defect, providing various ways of scaling and normalization.

sample_timeseries/

Module providing tools to perform sample peak timeseries analysis on the loaded dataset.

Names exported to package namespace:

  • SampleTimeSeriesWidget

    Interactive 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:

  • SpectrumWidget

    Interactive notebook widget to visualize the dataset spectrums.

timeseries/

Module providing tools to perform timeseries analysis on the loaded dataset.

Names exported to package namespace:

  • TimeSeriesWidget

    Interactive 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mascope_jupyter_widgets-2025.6.12.tar.gz (102.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mascope_jupyter_widgets-2025.6.12-py3-none-any.whl (124.6 kB view details)

Uploaded Python 3

File details

Details for the file mascope_jupyter_widgets-2025.6.12.tar.gz.

File metadata

File hashes

Hashes for mascope_jupyter_widgets-2025.6.12.tar.gz
Algorithm Hash digest
SHA256 dbd6236e67a68004fe633101beec36714f90c4b1ff5507db5b572e153b4cdad3
MD5 5f8f6a2ae2668d8471dc364e1617c498
BLAKE2b-256 3f8b0a2471e52abb2f64c1e383fe6555edc410fc306d42b26e74effdf576a919

See more details on using hashes here.

File details

Details for the file mascope_jupyter_widgets-2025.6.12-py3-none-any.whl.

File metadata

File hashes

Hashes for mascope_jupyter_widgets-2025.6.12-py3-none-any.whl
Algorithm Hash digest
SHA256 2c7ce05b2cd80ab2a2c44525a7813239553a84c63e5ccc5b7c3fec4e8844463e
MD5 fd9e11e0da69e4842c65a114a55428da
BLAKE2b-256 e33f9789b2f95378f59d4ba3d11bec4e69a337d5666b404fc9be5d8c5d0b86f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page