Skip to main content

genetools: single-cell analysis recipes (work in progress)

CI codecov

Other features

  • Compare clustering results by computing co-clustering percentage.
  • Map marker genes against reference lists to find names for your clusters.
  • pandas shotrcuts:
    • Split single cell barcodes conveniently.
    • Defensive pandas merging and concatenation methods with strict correctness checks.

Full documentation: https://genetools.maximz.com.

Install

Run pip install --upgrade 'genetools[scanpy]'.

Or if you don't use scanpy: pip install --upgrade genetools.

Usage

To use genetools in a project, add import genetools. Review the documentation and the tests for examples.

Development

Setup:

git clone git://github.com/maximz/genetools
cd genetools
pip install --upgrade pip wheel
pip install -r requirements_dev.txt
pre-commit install

Common commands:

# lint
make lint

# one-time: generate test anndata, and commit so we have reproducible tests in CI
rm -r data
make regen-test-data

# run tests locally
# this is done in a debian-based docker image to ensure image style matches what Github Actions CI will produce
# failing image snapshot tests are recorded in tests/results/
make build-docker-test-image # whenever requirements_dev.txt change
make test

# generate baseline figures (also happens in docker)
make regen-snapshot-figures

# regenerate test data, and baseline figures (also happens in docker)
make regen-test-data

# run tests locally without docker, therefore omitting the snapshot tests
# (the @snapshot_image tests are still executed but the images are not compared. the @pytest.mark.snapshot_custom are skipped altogether.)
make test-without-figures

# docs
make docs

# bump version before submitting a PR against master (all master commits are deployed)
bump2version patch # possible: major / minor / patch

# also ensure CHANGELOG.md updated

CI:

Changelog

0.7.6

  • Keep core genetools imports working when optional Scanpy helper imports fail.

0.7.0

  • Many new stats, plotting, and helper functions. See PRs #24 and #73.

0.6.0

  • Two new functions to customize tick labels on any existing plot:
    • wrap_tick_labels: add text wrapping
    • add_sample_size_to_labels: add group sample sizes with a (n=N) suffix
  • Make writing PDF figures a deterministic process and make the PDF text editable.
  • Scatterplot improvements:
    • Adjust default marker shape and size to work better for most plots.
    • Adjust HueValueStyle so that an explicit marker size is not specified there, only a marker size scaling factor. The scatterplot itself is responsible for defining the base marker size, while the palette of HueValueStyles should be drawable at any marker size.
    • Change legends so that only one marker is drawn to indicate a group's style.

0.5.0 (2022-01-10)

  • Improve scatter plots and stacked bar plots.
  • Introduce HueValueStyle for granular styling of each hue.

0.4.0 (2020-07-22)

  • Centered log ratio (CLR) normalization for Cite-seq protein data.

0.3.0 (2020-06-03)

  • Pandas helpers for easier normalization

0.2.0 (2020-06-03)

  • Far faster implementation of stats.coclustering
  • Introducing helpers.make_slurm_command
  • Global submodule import (no longer need to import submodules individually)

0.1.0 (2020-03-06)

  • First release on PyPI.

Metadata

Release files for genetools 0.7.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 genetools 0.7.6
File Size Uploaded Provenance Actions
genetools-0.7.6.tar.gz 1.8 MB Without provenance Details for genetools-0.7.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for genetools 0.7.6
File Interpreter ABI Platform Actions
genetools-0.7.6-py2.py3-none-any.whl Python 3, Python 2 none any Details for genetools-0.7.6-py2.py3-none-any.whl

Total release size: 1.9 MB

Release files / genetools-0.7.6.tar.gz

Download URL genetools-0.7.6.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
7b66e80f1b5024af184508948bde5837a731e89f89becf55a17d732af4326bb1
BLAKE2b-256 checksum
How to use checksums
de2ef70597732332598dc8fb10c3e2b12df8d8d2ec75028ee144cd0dc3c7aa2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / genetools-0.7.6-py2.py3-none-any.whl

Download URL genetools-0.7.6-py2.py3-none-any.whl
Size 45.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6968118ea17c10d7d6fdeceea94495678a8794f7419e1cb20f988e74002feecc
BLAKE2b-256 checksum
How to use checksums
a94a28be82aa9315b1bb78e01a1db328b69f7672d58dfdbd6849d5ba6ff530dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for genetools 0.7.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