Skip to main content

juzi

Project description

:tangerine: juzi

Various methods for analyzing cell states and types in cancer single-cell sequencing data (experimental).

Installation

pip install juzi

cell states (cs)

Identifying intra-sample programs.

from juzi.cs.nmf import multisample_nmf

# Perform NMF independently across multiple samples
Hs = multisample_nmf(
    [C1, C2, C3, ...],
    k=[5, 6, 7, 8, 9],
    robust_scale=True,
    clip_quantile=0.99,
    target_sum=1e5,
    max_exp=10.0,
    max_iter=500,
    alpha=0.,
    tol=0.0001,
    loss="frobenius",
    init="nndsvda",
    n_jobs=8,
    prefer="threads",
    seed=123
) 

Identifying consensus (intra-sample) and shared (inter-sample) programs.

from juzi.cs.nmf import factor_consensus, factor_similarity

# Compute a set of clustered consensus factors between NMF runs
HC, HS, labels, correlation = factor_consensus(
    np.array_split(Hs[0], [5, 6, 7, 8, 9]),
    n_clusters=8,
    eps=1e-8,
    method="agglomerative",
    metric="euclidean",
    linkage="ward",
)

# Compute similarity matrix between factors computed across different samples
S, K, ids = factor_similarity(
    Hs,
    distance="cosine",
    top_k=500,
    drop_zeros=True,
    intra_sample=False,
    eps=1e-8
)

Scoring top gene sets identified across factors.

from juzi.cs.tools import score_gene_sets

# Score a set of genes using the subsetted expression matrix
cell_scores = score_gene_set(
    X_subset,
    scale_by_sv=True
)

marker genes (mg)

Various marker genes for cell types, subtypes, and pathways.

from juzi.mg import available_sets

# Check available marker gene sets
print(available_sets())

# Load breast cancer gene sets (e.g. PAM50)
from juzi.mg import CancerBreast
markers = CancerBreast()

# Load cancer pathway gene sets (e.g. HIPPO)
from juzi.mg import CancerPathways
markers = CancerPathways()

# Load cell cycle gene sets (e.g. G1S)
from juzi.mg import CellCycle
markers = CellCycle()

# List available sets in a given marker class
markers.info()

# Get all genes from all sets in a flattened list
markers.all()

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

juzi-0.0.15.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

juzi-0.0.15-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file juzi-0.0.15.tar.gz.

File metadata

  • Download URL: juzi-0.0.15.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for juzi-0.0.15.tar.gz
Algorithm Hash digest
SHA256 05d1dd3a8b36688813bb4beea02a8d395b3abb346f8df17dedbaa8e18bdba8bc
MD5 8845e01c8f1a8a7a311d19296379d7f6
BLAKE2b-256 f5c5d165a10dc5bf894ab4c3d9d37205817592597bea77c5ba309c0c7d8a8919

See more details on using hashes here.

File details

Details for the file juzi-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: juzi-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for juzi-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 c4baacbb3d6000d4cc0e0d90159bee1e27231108bb054f40d21962ff00e504bf
MD5 f614d579527e95fdfe3931a35825f3a1
BLAKE2b-256 75c2b772e0235dd8c4a525fe0641718f11ad6d956d0c0ca648b490aa498e5a50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page