Skip to main content

gset

GSET (Gene Signals from Embedding Trajectories) selects a compact set of genes from time-resolved single-cell data.

The selected genes are bridges between consecutive gene programs and the core genes of the programs. They can be given to a network inference method such as CardamomOT.

Installation

pip install gset

Python 3.11 or newer.

Use

import anndata as ad
from gset import select_genes

adata = ad.read_h5ad("my_data.h5ad")    # raw counts in X, the time of every cell in adata.obs["time"]
genes = adata.var_names[select_genes(adata, budget=30, n_programs=3)]

select_genes returns the indices of the selected genes. By default a third of the budget goes to the cores and two thirds to the bridges, and the programs are found by clustering, with their number given. Other settings:

# the numbers of cores and bridges (the budget is their sum), and of the two channels of the bridges
genes = select_genes(adata, n_cores=10, n_bridges=20, n_kl=14, n_ot=6, n_programs=3)

# programs built around one query gene each, in the order in which the programs become active.
# The program of a query gene is the gene and its program_size - 1 nearest genes.
queries = [adata.var_names.get_loc("Lox"), adata.var_names.get_loc("Birc5")]
genes = select_genes(adata, budget=30, query_genes=queries, program_size=10)

# programs of your own: the program of every gene (0, 1, 2, ...) and the order of the programs
genes = select_genes(adata, budget=30, labels=labels, order=[0, 1, 2])

# the co-expression encoder of the experiments on the real data, for thousands of genes
genes = select_genes(adata, budget=30, n_programs=3, coexpr_encoder="real_data")

# the data as a list of count matrices (cells x genes), one per timepoint, instead of an AnnData object
genes = select_genes([X_t0, X_t1, X_t2], budget=30, n_programs=3)

With several replicates, pass a list of such lists. All the settings are described in help(select_genes).

The co-expression embedding, which gives the KL signal, has two encoders. The default one ("simulation") is meant for panels of tens to a few hundred genes. The other one ("real_data") is for thousands of genes.

Metadata

Release files for gset 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gset 0.1.2
File Size Uploaded Provenance
gset-0.1.2.tar.gz 23.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gset 0.1.2
File Interpreter ABI Platform
gset-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 46.9 kB

Release files / gset-0.1.2.tar.gz

Download URL gset-0.1.2.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fefc8ca80860ad065a3c3d3c11ac16f1c66b508fb2d289b9a54fd9bc5a1a89c1
BLAKE2b-256 checksum
How to use checksums
2f6ac8d5e46c015fdb8ac856bcad9eb3ed621b0c15fc5f31780496d904c164c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release files / gset-0.1.2-py3-none-any.whl

Download URL gset-0.1.2-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
540501a9c08fd0df7ef69e986211606ca0dbb44e4c5262328df251bff5e80dbb
BLAKE2b-256 checksum
How to use checksums
16ff86c1fe6749de83a5dea05ad68451bacb35d7c6b71b8435406274b3917f04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Security for gset 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page