Skip to main content

BactFit

License BSD-3 PyPI Python Version

A package for fitting the shape of rod shaped bacterial cells to an ideal cell model. This is an analogue of colicoords, but using allowing cells to have multiple bends as the cell midline can be an N degree polynomial.

Once the cell model(s) have been generated, SMLM localisations can be transformed to an ideal cell model. This allows for the generation of heatmaps and cell renders that are representative of the cells in the dataset.

Bactfit is compatible with binary masks and Picasso localisation data, see examples. Bactfit Cells and CellLists can be saved/loaded from hdf5 files. Multiple CellLists can also be combined and saved as a single CellList.

BactFit has been integrated into napari-moltrack and napari-bacseg.

Author: Piers Turner, Kapanidis Group, University of Oxford.

Installation

Create new conda environment (or venv) and activate it:

conda create -name bactfit python=3.9
conda activate bactfit

You can install BactFit via [pip]:

pip install bactfit

To update BactFit to the latest version, use:

pip install bactfit --upgrade

To install latest development version from [GitHub]:

pip install git+https://github.com/piedrro/BactFit.git

BactFit Algorithm

The cell models consist of polynomial midline and a cell radius.

  1. An initial midline is generated using a Voronoi diagram to the contour/outline of each cell.
  2. By buffering the midline using Shapely, a cell model is generated.
  3. This model is then optimised such that the directed hausdorff distance between the model and the cell contour/outline is minimised.

BactFit Heatmap

The BactFit heatmap is generated by transforming the localisation coordinates to the ideal cell model. Heatmaps can be generated if the localisations include X and Y coordinates. This heatmap was made from 700 localisations originating from 800 cells, see example.

Feature Image

BactFit Cell Render

The BactFit cell render is generated by transforming the localisation coordinates to the ideal cell model. Heatmaps can be generated using Picasso SMLM rendering so must include Picasso fit metrics alongside X and Y coordinates. This render was made from 700 localisations originating from 800 cells, see example.

Feature Image

Metadata

Release files for bactfit 0.1.6

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

Source distribution (sdist)

Source distribution for bactfit 0.1.6
File Size Uploaded Provenance Actions
bactfit-0.1.6.tar.gz 1.4 MB Without provenance Details for bactfit-0.1.6.tar.gz

Built distribution (wheel)

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

Total release size: 2.9 MB

Release files / bactfit-0.1.6.tar.gz

Download URL bactfit-0.1.6.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
fa6a6ff73e34ace7ad358e194d54a3483cc67040cdb62d27afd7bb8ea3f614bf
BLAKE2b-256 checksum
How to use checksums
9af3e799c1d8f3a91063432be28c56b6a7578c3b2edc88cb9da03d8bb3f488b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / bactfit-0.1.6-py3-none-any.whl

Download URL bactfit-0.1.6-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3f9cda796d73569eaba0778d318fc9977719d20e5d9bd23fb2cb4622664a3854
BLAKE2b-256 checksum
How to use checksums
b932a2bf2eb0a62284983af5e38abb426d00d9fd37a19e810636d727e4a407c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Security for bactfit 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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