scBoolSeq: Linking scRNA-Seq Statistics and Boolean Dynamics.
Project description
scBoolSeq
scRNA-Seq data binarisation and synthetic generation from Boolean dynamics.
Installation
Pip
pip install scboolseq
Conda
conda install -c conda-forge -c colomoto scboolseq
Docker
scBoolSeq
is included in the ColoMoTo Docker distribution.
Usage
Python API
Here a minimal example is presented, using the same dataset as the CLI usage guide. For further information, please check the documentation.
import pandas as pd
from scboolseq import scBoolSeq
# read in the normalized expression data
nestorowa = pd.read_csv("data_Nestorowa.tsv.gz", index_col=0, sep="\t")
nestorowa.iloc[1:5, 1:5]
# HSPC_031 HSPC_037 LT-HSC_001 HSPC_001
# Kdm3a 6.877725 0.000000 0.000000 0.000000
# Coro2b 0.000000 6.913384 8.178374 9.475577
# 8430408G22Rik 0.000000 0.000000 0.000000 0.000000
# Clec9a 0.000000 0.000000 0.000000 0.000000
#
# NOTE : here, genes are rows and observations are columns
scbool_nest = scBoolSeq()
##
## Binarization
##
# scBoolSeq expects genes to be columns, thus we transpose the DataFrame.
scbool_nest.fit(nestorowa.T) # compute binarization criteria
binarized = scbool_nestorowa.binarize(nestorowa.T)
binarized.iloc[1:5, 1:5]
# Kdm3a Coro2b 8430408G22Rik Phf6
# HSPC_031 1.0 NaN NaN 0.0
# HSPC_037 0.0 1.0 NaN 0.0
# LT-HSC_001 0.0 1.0 NaN 1.0
# HSPC_001 0.0 1.0 NaN 1.0
##
## Synthetic RNA-Seq generation from Boolean states
##
# We load in a boolean trace obtained from the simulation of a Boolean model
boolean_trace = pd.read_csv("boolean_dynamics.csv", index_col=0)
boolean_trace
# Kdm3a Coro2b 8430408G22Rik Phf6
# init 1.0 0.0 1.0 0.0
# transient_1 0.0 1.0 1.0 0.0
# transient_2 0.0 1.0 0.0 1.0
# stable_state 0.0 1.0 1.0 1.0
synthetic_scrna_pseudocounts = scbool_nestorowa.sample_counts(boolean_trace)
Contributors
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scBoolSeq-2.0.1.tar.gz
(23.3 kB
view details)
Built Distribution
scBoolSeq-2.0.1-py3-none-any.whl
(25.8 kB
view details)
File details
Details for the file scBoolSeq-2.0.1.tar.gz
.
File metadata
- Download URL: scBoolSeq-2.0.1.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a53aa243ad1c766d57487780a8512ac75d8b07c14974d7ba590673c8175f2e84 |
|
MD5 | fc28fce5f59ef264605421264a7dec93 |
|
BLAKE2b-256 | fdc87a86a7fca5a2081a44a20709b4695eb93017911834efb365fe997468a4e9 |
File details
Details for the file scBoolSeq-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: scBoolSeq-2.0.1-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9d299d15ac38570e31b87bc6b1418be16133b9acb226223123847502b0de2b8 |
|
MD5 | 522118b594a95e8d74d4633265b96092 |
|
BLAKE2b-256 | 1163e3d4344ec2b5cfe0c30423ea6c5254d0ab1affb2df40387c003cefb1ddf4 |