pybayesprism


Namepybayesprism JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryPython implementation of BayesPrism
upload_time2024-08-01 15:40:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            This is a Python implementation of [BayesPrism](https://github.com/Danko-Lab/BayesPrism).


Usage
```python

import os
import pandas as pd
from pybayesprism import process_input, prism, extract

os.system("curl -L -O https://github.com/ziluwang829/pyBayesPrism/raw/main/data/data.tar.gz")
os.system("mkdir -p BP_data")
os.system("tar -xzvf data.tar.gz -C BP_data")

bk_dat = pd.read_csv("BP_data/bk_dat.csv", sep=",", index_col=0)
sc_dat = pd.read_csv("BP_data/sc_dat.csv", sep=",", index_col=0)


cell_state_labels = pd.read_csv("BP_data/cell_state_labels.csv", header=None).iloc[:,0].tolist()

cell_type_labels = pd.read_csv("BP_data/cell_type_labels.csv", header=None).iloc[:,0].tolist()

sc_dat_filtered = process_input.cleanup_genes(sc_dat, "count.matrix", "hs", \
                  ["Rb", "Mrp", "other_Rb", "chrM", "MALAT1", "chrX", "chrY"], 5)
                  
sc_dat_filtered_pc = process_input.select_gene_type(sc_dat_filtered, ["protein_coding"])

my_prism = prism.Prism.new(reference = sc_dat_filtered_pc, 
                          mixture = bk_dat, input_type = "count.matrix", 
                          cell_type_labels = cell_type_labels, 
                          cell_state_labels = cell_state_labels, 
                          key = "tumor", 
                          outlier_cut = 0.01, 
                          outlier_fraction = 0.1)

bp_res = my_prism.run(n_cores = 36, update_gibbs = True)     

theta = extract.get_fraction(bp_res, "final", "type")
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pybayesprism",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Zilu Wang <zw427@cornell.edu>",
    "download_url": "https://files.pythonhosted.org/packages/3a/20/339f9b912ecf6fb8a5ef10cedfa245f07939d29eeaf3195bff69c4874450/pybayesprism-0.1.0.tar.gz",
    "platform": null,
    "description": "This is a Python implementation of [BayesPrism](https://github.com/Danko-Lab/BayesPrism).\n\n\nUsage\n```python\n\nimport os\nimport pandas as pd\nfrom pybayesprism import process_input, prism, extract\n\nos.system(\"curl -L -O https://github.com/ziluwang829/pyBayesPrism/raw/main/data/data.tar.gz\")\nos.system(\"mkdir -p BP_data\")\nos.system(\"tar -xzvf data.tar.gz -C BP_data\")\n\nbk_dat = pd.read_csv(\"BP_data/bk_dat.csv\", sep=\",\", index_col=0)\nsc_dat = pd.read_csv(\"BP_data/sc_dat.csv\", sep=\",\", index_col=0)\n\n\ncell_state_labels = pd.read_csv(\"BP_data/cell_state_labels.csv\", header=None).iloc[:,0].tolist()\n\ncell_type_labels = pd.read_csv(\"BP_data/cell_type_labels.csv\", header=None).iloc[:,0].tolist()\n\nsc_dat_filtered = process_input.cleanup_genes(sc_dat, \"count.matrix\", \"hs\", \\\n                  [\"Rb\", \"Mrp\", \"other_Rb\", \"chrM\", \"MALAT1\", \"chrX\", \"chrY\"], 5)\n                  \nsc_dat_filtered_pc = process_input.select_gene_type(sc_dat_filtered, [\"protein_coding\"])\n\nmy_prism = prism.Prism.new(reference = sc_dat_filtered_pc, \n                          mixture = bk_dat, input_type = \"count.matrix\", \n                          cell_type_labels = cell_type_labels, \n                          cell_state_labels = cell_state_labels, \n                          key = \"tumor\", \n                          outlier_cut = 0.01, \n                          outlier_fraction = 0.1)\n\nbp_res = my_prism.run(n_cores = 36, update_gibbs = True)     \n\ntheta = extract.get_fraction(bp_res, \"final\", \"type\")\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python implementation of BayesPrism",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/ziluwang829/pyBayesPrism",
        "Issues": "https://github.com/ziluwang829/pyBayesPrism/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a4fd3735bc5bf8c1db77cb0954f1c281b42a50e01e20f2315c97cdd3d0ff78a0",
                "md5": "3c8f62865e31895af98f621787ee3f14",
                "sha256": "90f167259b563c9a1f48fdb6a766f7dc7d287bde8062acb461733745d5aaa99a"
            },
            "downloads": -1,
            "filename": "pybayesprism-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3c8f62865e31895af98f621787ee3f14",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1533389,
            "upload_time": "2024-08-01T15:40:34",
            "upload_time_iso_8601": "2024-08-01T15:40:34.506510Z",
            "url": "https://files.pythonhosted.org/packages/a4/fd/3735bc5bf8c1db77cb0954f1c281b42a50e01e20f2315c97cdd3d0ff78a0/pybayesprism-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a20339f9b912ecf6fb8a5ef10cedfa245f07939d29eeaf3195bff69c4874450",
                "md5": "cb83b94f8ce5da39b3176658b0640207",
                "sha256": "7ce59a07eb0f5edcd9b840a311886c654e369fa1e62f0ee1569388fdbc91bc3e"
            },
            "downloads": -1,
            "filename": "pybayesprism-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cb83b94f8ce5da39b3176658b0640207",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1526955,
            "upload_time": "2024-08-01T15:40:35",
            "upload_time_iso_8601": "2024-08-01T15:40:35.937696Z",
            "url": "https://files.pythonhosted.org/packages/3a/20/339f9b912ecf6fb8a5ef10cedfa245f07939d29eeaf3195bff69c4874450/pybayesprism-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-01 15:40:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ziluwang829",
    "github_project": "pyBayesPrism",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pybayesprism"
}
        
Elapsed time: 0.53091s