Skip to main content

PyPhotoMol

Tests codecov Docs

Welcome to PyPhotoMol, a python-package to analyse mass photometry data.

Features

  • Data Import: Import HDF5 (.h5) and csv mass photometry data files, generated by Refeyn instruments (https://refeyn.com).
  • Histogram Analysis: Create histograms of mass or contrast distributions
  • Peak Detection: Automated peak finding in histograms using peak height, distance and prominence
  • Mass-Contrast Conversion: Convert between mass and contrast with calibration parameters
  • Gaussian Fitting: Fit multiple Gaussians to the histogram data
  • Comprehensive Logging: Track all operations with logbooks

Installation

PyPhotoMol requires Python 3.12 or later.

Install PyPhotoMol from PyPI with pip:

pip install pyphotomol

Verify the installation:

import pyphotomol
print(pyphotomol.__version__)

For development, clone the repository and install with uv:

git clone https://github.com/osvalB/pyphotomol.git
cd pyphotomol
uv sync --extra dev

Run tests and build the documentation:

uv run pytest
uv run build_docs.py

Quick Start

from pyphotomol import PyPhotoMol

# Create a new analysis instance
model = PyPhotoMol()

# Import data from an HDF5 file
model.import_file('data.h5')

# Create a histogram and detect peaks
model.create_histogram(use_masses=True, window=[0, 1000], bin_width=10)
model.guess_peaks(min_height=10, min_distance=4, prominence=4)

# Fit Gaussian models to detected peaks
model.fit_histogram(
    peaks_guess=model.peaks_guess,
    mean_tolerance=200,
    std_tolerance=300
)

# Create and view results
model.create_fit_table()
print(model.fit_table)

Acknowledgements

PyPhotoMol is derived from PhotoMol, an online tool presented in the following publication:

Niebling, Stephan, et al. "Biophysical Screening Pipeline for Cryo-EM Grid Preparation of Membrane Proteins." Frontiers in Molecular Biosciences 9 (2022): 903148.

Metadata

Release files for pyphotomol 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyphotomol 1.0.1
File Size Uploaded
pyphotomol-1.0.1.tar.gz 30.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyphotomol 1.0.1
File Interpreter ABI Platform
pyphotomol-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 63.4 kB

Release files / pyphotomol-1.0.1.tar.gz

Download URL pyphotomol-1.0.1.tar.gz
Size 30.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c4c898f1882e621a5a13e8fd03e174c13506bd2178c0af453beaa1b7a904157d
BLAKE2b-256 checksum
How to use checksums
ff7b5445a740edf1bff5cd5f264ec762fc7caf81e693e7d165e5a95202029add
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release files / pyphotomol-1.0.1-py3-none-any.whl

Download URL pyphotomol-1.0.1-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9dde2e6053ccee92c4e62264ad2c01a7d8f996d4546959325f6fb6c2a138161
BLAKE2b-256 checksum
How to use checksums
7f4b6645b6139138ac2d1962e933e210472cd1b1a2dd6f38f8d6a9bf8c67bdd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page