Python implementation of BayesPrism
Project description
This is a Python implementation of BayesPrism.
Usage
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")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pybayesprism-0.1.0.tar.gz
(1.5 MB
view hashes)
Built Distribution
Close
Hashes for pybayesprism-0.1.0-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 90f167259b563c9a1f48fdb6a766f7dc7d287bde8062acb461733745d5aaa99a |
|
| MD5 | 3c8f62865e31895af98f621787ee3f14 |
|
| BLAKE2b-256 | a4fd3735bc5bf8c1db77cb0954f1c281b42a50e01e20f2315c97cdd3d0ff78a0 |