genetools


Namegenetools JSON
Version 0.7.5 PyPI version JSON
download
home_pagehttps://github.com/maximz/genetools
SummaryGeneral genetics/genomics utilities.
upload_time2024-10-23 18:33:18
maintainerNone
docs_urlNone
authorMaxim Zaslavsky
requires_python>=3.8
licenseMIT license
keywords genetools
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # genetools: single-cell analysis recipes (work in progress)

[![](https://img.shields.io/pypi/v/genetools.svg)](https://pypi.python.org/pypi/genetools)
[![CI](https://github.com/maximz/genetools/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/maximz/genetools/actions/workflows/ci.yaml)
[![](https://img.shields.io/badge/docs-here-blue.svg)](https://genetools.maximz.com)
[![](https://img.shields.io/github/stars/maximz/genetools?style=social)](https://github.com/maximz/genetools)
[![codecov](https://codecov.io/gh/maximz/genetools/branch/master/graph/badge.svg)](https://codecov.io/gh/maximz/genetools)

## Plot gallery

<table>
<tr>
<td>

[![](tests/baseline/test_scatterplot_discrete.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%test_scatterplot_discrete)

</td>
<td>

[![](tests/baseline/test_stacked_bar_plot.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%test_stacked_bar_plot)

</td>
</tr>

<tr>
<td>

[![](tests/baseline/test_scatterplot_continuous.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%test_scatterplot_continuous)

</td>
<td>

[![](tests/baseline/test_stacked_bar_plot_autocompute_frequencies.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%test_stacked_bar_plot_autocompute_frequencies)

</td>
</tr>

<tr>
<td>

[![](tests/baseline/test_dotplot.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%20test_dotplot)

</td>
<td>

[![](tests/baseline/test_relative_density.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%test_relative_density)

</td>
</tr>

</table>

## 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](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](https://genetools.maximz.com) and the [tests](https://github.com/maximz/genetools/tree/master/tests) for examples.

## Development

Setup:

```bash
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:

```bash
# 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:

- Main: Github Actions
- Docs: [https://app.netlify.com/sites/genetools](https://app.netlify.com/sites/genetools)


# Changelog

## 0.7.0

* Many new stats, plotting, and helper functions. See PRs [#24](https://github.com/maximz/genetools/pull/24) and [#73](https://github.com/maximz/genetools/pull/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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/maximz/genetools",
    "name": "genetools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "genetools",
    "author": "Maxim Zaslavsky",
    "author_email": "maxim@maximz.com",
    "download_url": "https://files.pythonhosted.org/packages/75/33/a13a69adc54cf5a7757d06665d014e4b6955feec92f45bbeff6f2a739dcf/genetools-0.7.5.tar.gz",
    "platform": null,
    "description": "# genetools: single-cell analysis recipes (work in progress)\n\n[![](https://img.shields.io/pypi/v/genetools.svg)](https://pypi.python.org/pypi/genetools)\n[![CI](https://github.com/maximz/genetools/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/maximz/genetools/actions/workflows/ci.yaml)\n[![](https://img.shields.io/badge/docs-here-blue.svg)](https://genetools.maximz.com)\n[![](https://img.shields.io/github/stars/maximz/genetools?style=social)](https://github.com/maximz/genetools)\n[![codecov](https://codecov.io/gh/maximz/genetools/branch/master/graph/badge.svg)](https://codecov.io/gh/maximz/genetools)\n\n## Plot gallery\n\n<table>\n<tr>\n<td>\n\n[![](tests/baseline/test_scatterplot_discrete.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%test_scatterplot_discrete)\n\n</td>\n<td>\n\n[![](tests/baseline/test_stacked_bar_plot.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%test_stacked_bar_plot)\n\n</td>\n</tr>\n\n<tr>\n<td>\n\n[![](tests/baseline/test_scatterplot_continuous.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%test_scatterplot_continuous)\n\n</td>\n<td>\n\n[![](tests/baseline/test_stacked_bar_plot_autocompute_frequencies.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%test_stacked_bar_plot_autocompute_frequencies)\n\n</td>\n</tr>\n\n<tr>\n<td>\n\n[![](tests/baseline/test_dotplot.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%20test_dotplot)\n\n</td>\n<td>\n\n[![](tests/baseline/test_relative_density.png)](https://github.com/maximz/genetools/blob/master/tests/test_plots.py#:~:text=def%test_relative_density)\n\n</td>\n</tr>\n\n</table>\n\n## Other features\n\n* Compare clustering results by computing co-clustering percentage.\n* Map marker genes against reference lists to find names for your clusters.\n* pandas shotrcuts:\n  * Split single cell barcodes conveniently.\n  * Defensive pandas merging and concatenation methods with strict correctness checks.\n\nFull documentation: [https://genetools.maximz.com](https://genetools.maximz.com).\n\n## Install\n\nRun `pip install --upgrade 'genetools[scanpy]'`.\n\nOr if you don't use scanpy: `pip install --upgrade genetools`.\n\n## Usage\n\nTo use genetools in a project, add `import genetools`. Review the [documentation](https://genetools.maximz.com) and the [tests](https://github.com/maximz/genetools/tree/master/tests) for examples.\n\n## Development\n\nSetup:\n\n```bash\ngit clone git://github.com/maximz/genetools\ncd genetools\npip install --upgrade pip wheel\npip install -r requirements_dev.txt\npre-commit install\n```\n\nCommon commands:\n\n```bash\n# lint\nmake lint\n\n# one-time: generate test anndata, and commit so we have reproducible tests in CI\nrm -r data\nmake regen-test-data\n\n# run tests locally\n# this is done in a debian-based docker image to ensure image style matches what Github Actions CI will produce\n# failing image snapshot tests are recorded in tests/results/\nmake build-docker-test-image # whenever requirements_dev.txt change\nmake test\n\n# generate baseline figures (also happens in docker)\nmake regen-snapshot-figures\n\n# regenerate test data, and baseline figures (also happens in docker)\nmake regen-test-data\n\n# run tests locally without docker, therefore omitting the snapshot tests\n# (the @snapshot_image tests are still executed but the images are not compared. the @pytest.mark.snapshot_custom are skipped altogether.)\nmake test-without-figures\n\n# docs\nmake docs\n\n# bump version before submitting a PR against master (all master commits are deployed)\nbump2version patch # possible: major / minor / patch\n\n# also ensure CHANGELOG.md updated\n```\n\nCI:\n\n- Main: Github Actions\n- Docs: [https://app.netlify.com/sites/genetools](https://app.netlify.com/sites/genetools)\n\n\n# Changelog\n\n## 0.7.0\n\n* Many new stats, plotting, and helper functions. See PRs [#24](https://github.com/maximz/genetools/pull/24) and [#73](https://github.com/maximz/genetools/pull/73).\n\n## 0.6.0\n\n* Two new functions to customize tick labels on any existing plot:\n    * `wrap_tick_labels`: add text wrapping\n    * `add_sample_size_to_labels`: add group sample sizes with a `(n=N)` suffix\n* Make writing PDF figures a deterministic process and make the PDF text editable.\n* Scatterplot improvements:\n    - Adjust default marker shape and size to work better for most plots.\n    - 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.\n    - Change legends so that only one marker is drawn to indicate a group's style.\n\n## 0.5.0 (2022-01-10)\n\n* Improve scatter plots and stacked bar plots.\n* Introduce `HueValueStyle` for granular styling of each hue.\n\n## 0.4.0 (2020-07-22)\n\n* Centered log ratio (CLR) normalization for Cite-seq protein data.\n\n## 0.3.0 (2020-06-03)\n\n* Pandas helpers for easier normalization\n\n## 0.2.0 (2020-06-03)\n\n* Far faster implementation of `stats.coclustering`\n* Introducing `helpers.make_slurm_command`\n* Global submodule import (no longer need to import submodules individually)\n\n## 0.1.0 (2020-03-06)\n\n* First release on PyPI.\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "General genetics/genomics utilities.",
    "version": "0.7.5",
    "project_urls": {
        "Homepage": "https://github.com/maximz/genetools"
    },
    "split_keywords": [
        "genetools"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "951c592d53e6b3dacd6cf93389e4a78be1ae2d24b01b4e97692974abbcd7e989",
                "md5": "a46114da4726d026d3ddf91ca0c1399b",
                "sha256": "c25ecdd26d47ed76372051317c242e36294177db492272c29fcb3add4285d0b7"
            },
            "downloads": -1,
            "filename": "genetools-0.7.5-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a46114da4726d026d3ddf91ca0c1399b",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 45534,
            "upload_time": "2024-10-23T18:33:16",
            "upload_time_iso_8601": "2024-10-23T18:33:16.103767Z",
            "url": "https://files.pythonhosted.org/packages/95/1c/592d53e6b3dacd6cf93389e4a78be1ae2d24b01b4e97692974abbcd7e989/genetools-0.7.5-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7533a13a69adc54cf5a7757d06665d014e4b6955feec92f45bbeff6f2a739dcf",
                "md5": "f5a6f21b4c81a091e1bd14d260a7fe92",
                "sha256": "abe71d77ca936bcfc3f513502f93a1cc3b2b091f316c11da46face2da3799b4f"
            },
            "downloads": -1,
            "filename": "genetools-0.7.5.tar.gz",
            "has_sig": false,
            "md5_digest": "f5a6f21b4c81a091e1bd14d260a7fe92",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1845063,
            "upload_time": "2024-10-23T18:33:18",
            "upload_time_iso_8601": "2024-10-23T18:33:18.023950Z",
            "url": "https://files.pythonhosted.org/packages/75/33/a13a69adc54cf5a7757d06665d014e4b6955feec92f45bbeff6f2a739dcf/genetools-0.7.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-23 18:33:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "maximz",
    "github_project": "genetools",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "genetools"
}
        
Elapsed time: 0.59197s