Skip to main content

Cytotransfrom

PyPI PyPI - Python Version PyPI - Wheel PyPI - License Codecov GitHub Workflow Status (with event)

Description

Cytotransform is a python package for transforming flow cytometry data. It implements the following transformations according to the GatingML 2.0 definitions (https://flowcyt.sourceforge.net/gating/latest.pdf):

  • Parametrized logarithmic transformation
  • Parametrized inverse hyperbolic sine transformation (asinh)
  • Logicle transformation
  • Hyperlog transformation

Each transformation is implemented as a Transform class with a transform method that takes a numpy array as input and returns the transformed array. The Transform class also has a transform_inverse method that takes a numpy array as input and returns the inverse transformed array. Each implementation includes validation of the input parameters. The transform classes support multiprocessing out of the box and if n_jobs is set to more than 0, then the input data will be split into n batches depending on the number of cores available and each batch will be transformed in parallel. If n_jobs is set to -1, then all available cores will be used. If n_jobs is set to 0, then no multiprocessing will be used.

Cytotransform is thanks to the fantastic community of scientists and developers in the single cell and flow cytometry data analysis ecosystem. It implements the FastLogicle C++ library for logicle transformations originally implemented by Wayne A Moore and David R Parks (see https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4761345/). Code was inspired by the great work by Scott White (https://github.com/whitews/FlowKit) and Brian Teague (https://github.com/cytoflow).

Installation

Cytotransform can be installed from PyPi using pip:

pip install cytotransform

Usage

The transform and inverse_transform methods take a numpy array or Pandas DataFrame as input and return a numpy the transformed array/dataframe.

Parametrized logarithmic transformation

from cytotransform import ParametrizedLogTransform
transformer = ParametrizedLogTransform(m=4.5, t=262144, n_jobs=-1)
transformed_data = transformer.transform(data)
data = transformer.inverse_transform(transformed_data)

Parametrized inverse hyperbolic sine transformation (asinh)

from cytotransform import AsinhTransform
transformer = AsinhTransform(m=4.5, t=262144, a=0.0, n_jobs=-1)
transformed_data = transformer.transform(data)
data = transformer.inverse_transform(transformed_data)

Logicle transformation

from cytotransform import LogicleTransform
transformer = LogicleTransform(t=262144, w=0.5, m=4.5, a=0.0, n_jobs=-1)
transformed_data = transformer.transform(data)
data = transformer.inverse_transform(transformed_data)

Hyperlog transformation

from cytotransform import HyperlogTransform
transformer = HyperlogTransform(t=262144, w=0.5, m=4.5, a=0.0, n_jobs=-1)
transformed_data = transformer.transform(data)
data = transformer.inverse_transform(transformed_data)

License

Cytotransform is licensed under the MIT license, is free to use, and comes with no warranty whatsoever.

Metadata

Release files for cytotransform 0.2.12

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

Source distribution (sdist)

Source distribution for cytotransform 0.2.12
File Size Uploaded Provenance Actions
cytotransform-0.2.12.tar.gz 14.3 kB Without provenance Details for cytotransform-0.2.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cytotransform 0.2.12
File Interpreter ABI Platform Actions
cytotransform-0.2.12-cp311-cp311-manylinux_2_35_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.35+ x86-64 Details for cytotransform-0.2.12-cp311-cp311-manylinux_2_35_x86_64.whl

Total release size: 1.1 MB

Release files / cytotransform-0.2.12.tar.gz

Download URL cytotransform-0.2.12.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
63b10c2b4b8b25998919d7d91569a4dbe026221058ea5d5ff9f6686c01c31c00
BLAKE2b-256 checksum
How to use checksums
8312808a54fe92c7dc4c7244d81b086d899762f761340acb105368ec0ad5b730
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure

Release files / cytotransform-0.2.12-cp311-cp311-manylinux_2_35_x86_64.whl

Download URL cytotransform-0.2.12-cp311-cp311-manylinux_2_35_x86_64.whl
Size 1.1 MB
Tags CPython 3.11 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
d05af177898747e03cf7d33ec13d1fa7aca06b335fb745c4ceda9087703bf4da
BLAKE2b-256 checksum
How to use checksums
86f1973c39c57bc7dad4cdc28eeb0fbfbf0e965fd7dabe21399a814ba0bbb87a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure

Security for cytotransform 0.2.12

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