Skip to main content

A Single-Cell Lineage Simulator with Fate-Aware Gene Expression

Project description

LineageSim: A Single-Cell Lineage Simulator with Fate-Aware Gene Expression

A simulator for single-cell lineage tracing data that generates fate-aware gene expression — progenitor cells carry transcriptomic signatures of their descendants' fates, capturing a key property of real developmental data.

QuickStart

Requires Python >= 3.11.

Install as a package and import directly in your code:

# Using pip
pip install lineage-simulator

# Using uv
uv add lineage-simulator

Then in your code

from lineagesim.simulator import LineageSim

sim = LineageSim()
tree, expression = sim.generate_dataset(
    n_cells=8192,
    n_genes=1000,
    beta=0.2,
)
# tree: dict mapping cell IDs to metadata (fate, parent, depth, etc.)
# expression: (n_cells, n_genes) array of observed counts

For development:

uv sync

CLI Usage

# See all available options
uv run lineagesim generate --help

# Generate with default parameters
uv run lineagesim generate -o dataset.h5ad

# An example showing full control of simulation parameters
uv run lineagesim generate \
    --n-cells 4096 --n-genes 500 --n-cif 32 \
    --beta 0.3 --sigma 0.5 --commit-depth 7 \
    --gene-effect-prob 0.3 --scale-s 1.0 \
    --protocol UMI --skip-technical-noise \
    --seed 42 -o dataset.h5ad

Parameters

generate_dataset() accepts the following parameters:

Parameter Type Default Description
n_cells int 8192 Number of cells to simulate
n_genes int 1000 Number of genes to simulate
n_CIF int 32 Number of Cell Identity Factors (latent dimensions)
sigma float 0.2 Brownian motion noise std dev
beta float 0.2 Fate signal strength
gene_effect_prob float 0.3 Probability that a CIF affects a gene
scale_s float 1.0 Transcription rate scaling factor
protocol str "UMI" Sequencing protocol ("UMI" or "nonUMI")
skip_technical_noise bool False If True, return true counts without technical noise
commit_depth int 7 Depth at which fate commitment occurs

Contribution Guide

PRs are welcome!

License

MIT

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

lineage_simulator-0.1.2.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

lineage_simulator-0.1.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file lineage_simulator-0.1.2.tar.gz.

File metadata

  • Download URL: lineage_simulator-0.1.2.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for lineage_simulator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e4e179fc1576149a3c8d5f861634a988b60840fd0b2b48e90746adaad2f6df17
MD5 7f82a402de0164dfa2292dd1b0160b12
BLAKE2b-256 34ae86251e92d40a8a1712907afc2bd4b1f9661e3a7192ba5bf4bb67b626c932

See more details on using hashes here.

File details

Details for the file lineage_simulator-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lineage_simulator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 df70ee57a975caa74e6c2886639a7afa93f481326d27908c79bc3982c77d675b
MD5 1e9afbe99ae3e6a2aca9d6ae5ced501b
BLAKE2b-256 c1ec1f466aed4bcbe7179e55c46803eccdb43ce54470b400bad44b7dd5c610f9

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