dclab

raw JSON →
0.71.8 verified Fri May 01 auth: no python

Library for real-time deformability cytometry (RT-DC) data analysis. Provides data loading, filtering, and normalization for deformability cytometry datasets. Current version 0.71.8, requires Python >=3.9, <4. Released about every 3-6 months on PyPI.

pip install dclab
error ModuleNotFoundError: No module named 'dclab'
cause dclab not installed or virtual environment not activated.
fix
Run pip install dclab or conda install -c conda-forge dclab.
error ValueError: File format not recognized.
cause The file provided to `new_dataset` is not a valid .rtdc, .tdms, or .h5 file.
fix
Ensure the file has the correct extension and is valid. Use dclab.rtdc_dataset.RTDCFile for low-level checks.
breaking In version 0.70.0, the `filter` module was restructured. `dclab.filter.xxx` is no longer available; use `dclab.features` and `dclab.features.xxx` instead.
fix Replace `from dclab.filter import ...` with `from dclab.features import ...`.
breaking Python 3.9 support dropped in version 0.72.0 (upcoming). Currently requires Python >=3.9; future versions will require >=3.10.
fix Update Python environment to 3.10 or later.
gotcha `new_dataset` fails silently if the file format is unsupported. It will raise a `ValueError` only if the file cannot be parsed at all.
fix Always wrap `new_dataset` in a try/except block to catch `ValueError` and `OSError`.

Load an RT-DC dataset from a .rtdc file and print the first five area values.

import dclab
from dclab import new_dataset

ds = new_dataset('path/to/file.rtdc')
print(ds)
# Access features:
area_um = ds['area_um']
print('Area (um^2):', area_um[:5])