geomux


Namegeomux JSON
Version 0.2.9 PyPI version JSON
download
home_page
SummaryA tool to assign identifiers to cell barcodes
upload_time2023-10-02 21:20:39
maintainer
docs_urlNone
authorNoam Teyssier
requires_python>=3.9,<3.13
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # geomux

A tool that assigns guides to cell barcodes. 

Uses a hypergeometric distribution to calculate the pvalue of observing the
specific count of a guide for each guide in each barcode.
This can be used to calculate the MOI of the cell and assigned guides for each cell.
The resulting dataframe can then be used to intersect with your original data
to assign every cell to a barcode and allows you to filter
for the MOI you're interested in working with.

## Installation

```bash
pip install geomux
```

## Usage

Geomux can be used either as a commandline tool or as a python module

### Commandline

when pip installing, an executable will be placed in your bin path. So you can call it directly from wherever in your filesystem

```bash
# example usage
geomux -i <input.tab / input.h5ad> -o <output.tsv>
```

You can also run the help flag to see the help menu for parameter options.

```txt
$ geomux --help

usage: geomux [-h] -i INPUT [-o OUTPUT] [-u MIN_UMI] [-t THRESHOLD] [-c CORRECTION] [-j N_JOBS] [-q]

options:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Input table to assign
  -o OUTPUT, --output OUTPUT
                        output table of barcode assignments (default=stdout)
  -u MIN_UMI, --min_umi MIN_UMI
                        minimum number of UMIs to consider a cell (default=5)
  -c MIN_CELLS, --min_cells MIN_CELLS
                        minimum number of cells to consider a guide (default=100)
  -t THRESHOLD, --threshold THRESHOLD
                        Pvalue threshold to use after pvalue correction (default=0.05)
  -C CORRECTION, --correction CORRECTION
                        Pvalue correction method to use (default=bh)
  -j N_JOBS, --n_jobs N_JOBS
                        Number of jobs to use when calculating hypergeometric distributions (default=1)
  -q, --quiet           Suppress progress messages
```

### Python Module

#### Processing a 3-column TSV of [barcode, guide, n_umi]

```python
from geomux import Geomux, read_table

input = "filename.tsv"

matrix = read_table(input)
gx = Geomux(
    matrix,
    cell_names=matrix.index.values,
    guide_names=matrix.columns.values,
)
gx.test()
assignments = gx.assignments()
```

#### Processing an h5ad file format

```python
from geomux import Geomux, read_anndata

input = "filename.h5ad"

matrix = read_anndata(input)
gx = Geomux(
    matrix,
    cell_names=matrix.index.values,
    guide_names=matrix.columns.values,
)
gx.test()
assignments = gx.assignments
```

## Outputs

The results of `geomux` will be an assignment dataframe that has as many
observations as there are input cells.

The columns of this dataframe will include:

- cell_id
    - The name of the cell provided or the index.
- assignment
    - A list representing all significant guides within that cell.
- moi
    - The number of significant guides within the cell.
- n_umi
    - The number of UMIs observed in the cell.
- p_value
    - The adjusted p-value of the hypergeometric test for that cell/guide test.
- log_odds
    - The log odds of observing the highest scoring guide compared to the second highest.
- tested
    - A bool flag representing whether the cell was included in the test (or `False` if it was filtered for low UMI counts)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "geomux",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<3.13",
    "maintainer_email": "",
    "keywords": "",
    "author": "Noam Teyssier",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/44/68/e68b2fb064bcd36608edc61f67cdf0de28e45525fa7d59cb98496f5d89ef/geomux-0.2.9.tar.gz",
    "platform": null,
    "description": "# geomux\n\nA tool that assigns guides to cell barcodes. \n\nUses a hypergeometric distribution to calculate the pvalue of observing the\nspecific count of a guide for each guide in each barcode.\nThis can be used to calculate the MOI of the cell and assigned guides for each cell.\nThe resulting dataframe can then be used to intersect with your original data\nto assign every cell to a barcode and allows you to filter\nfor the MOI you're interested in working with.\n\n## Installation\n\n```bash\npip install geomux\n```\n\n## Usage\n\nGeomux can be used either as a commandline tool or as a python module\n\n### Commandline\n\nwhen pip installing, an executable will be placed in your bin path. So you can call it directly from wherever in your filesystem\n\n```bash\n# example usage\ngeomux -i <input.tab / input.h5ad> -o <output.tsv>\n```\n\nYou can also run the help flag to see the help menu for parameter options.\n\n```txt\n$ geomux --help\n\nusage: geomux [-h] -i INPUT [-o OUTPUT] [-u MIN_UMI] [-t THRESHOLD] [-c CORRECTION] [-j N_JOBS] [-q]\n\noptions:\n  -h, --help            show this help message and exit\n  -i INPUT, --input INPUT\n                        Input table to assign\n  -o OUTPUT, --output OUTPUT\n                        output table of barcode assignments (default=stdout)\n  -u MIN_UMI, --min_umi MIN_UMI\n                        minimum number of UMIs to consider a cell (default=5)\n  -c MIN_CELLS, --min_cells MIN_CELLS\n                        minimum number of cells to consider a guide (default=100)\n  -t THRESHOLD, --threshold THRESHOLD\n                        Pvalue threshold to use after pvalue correction (default=0.05)\n  -C CORRECTION, --correction CORRECTION\n                        Pvalue correction method to use (default=bh)\n  -j N_JOBS, --n_jobs N_JOBS\n                        Number of jobs to use when calculating hypergeometric distributions (default=1)\n  -q, --quiet           Suppress progress messages\n```\n\n### Python Module\n\n#### Processing a 3-column TSV of [barcode, guide, n_umi]\n\n```python\nfrom geomux import Geomux, read_table\n\ninput = \"filename.tsv\"\n\nmatrix = read_table(input)\ngx = Geomux(\n    matrix,\n    cell_names=matrix.index.values,\n    guide_names=matrix.columns.values,\n)\ngx.test()\nassignments = gx.assignments()\n```\n\n#### Processing an h5ad file format\n\n```python\nfrom geomux import Geomux, read_anndata\n\ninput = \"filename.h5ad\"\n\nmatrix = read_anndata(input)\ngx = Geomux(\n    matrix,\n    cell_names=matrix.index.values,\n    guide_names=matrix.columns.values,\n)\ngx.test()\nassignments = gx.assignments\n```\n\n## Outputs\n\nThe results of `geomux` will be an assignment dataframe that has as many\nobservations as there are input cells.\n\nThe columns of this dataframe will include:\n\n- cell_id\n    - The name of the cell provided or the index.\n- assignment\n    - A list representing all significant guides within that cell.\n- moi\n    - The number of significant guides within the cell.\n- n_umi\n    - The number of UMIs observed in the cell.\n- p_value\n    - The adjusted p-value of the hypergeometric test for that cell/guide test.\n- log_odds\n    - The log odds of observing the highest scoring guide compared to the second highest.\n- tested\n    - A bool flag representing whether the cell was included in the test (or `False` if it was filtered for low UMI counts)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A tool to assign identifiers to cell barcodes",
    "version": "0.2.9",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dfa3c28cbb23458db8db82b90912b81b006c346a9b8122661cd984e2cc139f9d",
                "md5": "991fc7e2b5381d03c59083c592de26c7",
                "sha256": "b6a2db00fc42f269ba4bb874bba74f85fd5566b48203afc051aca9c9acb8db0e"
            },
            "downloads": -1,
            "filename": "geomux-0.2.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "991fc7e2b5381d03c59083c592de26c7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<3.13",
            "size": 8408,
            "upload_time": "2023-10-02T21:20:37",
            "upload_time_iso_8601": "2023-10-02T21:20:37.974037Z",
            "url": "https://files.pythonhosted.org/packages/df/a3/c28cbb23458db8db82b90912b81b006c346a9b8122661cd984e2cc139f9d/geomux-0.2.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4468e68b2fb064bcd36608edc61f67cdf0de28e45525fa7d59cb98496f5d89ef",
                "md5": "ab8f5083388d7d2aaa05389a006304ab",
                "sha256": "b98bccc9213432cb8126bd2240be0d96844f41667fd73d1b09e9bac31f9c41a4"
            },
            "downloads": -1,
            "filename": "geomux-0.2.9.tar.gz",
            "has_sig": false,
            "md5_digest": "ab8f5083388d7d2aaa05389a006304ab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<3.13",
            "size": 7956,
            "upload_time": "2023-10-02T21:20:39",
            "upload_time_iso_8601": "2023-10-02T21:20:39.277160Z",
            "url": "https://files.pythonhosted.org/packages/44/68/e68b2fb064bcd36608edc61f67cdf0de28e45525fa7d59cb98496f5d89ef/geomux-0.2.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-02 21:20:39",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "geomux"
}
        
Elapsed time: 0.12207s