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.

Installation

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

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

Python Quickstart

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

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.1.tar.gz (10.6 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.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lineage_simulator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fe362613f3fe85d2bff686acdedcf6defbe42ca659a20ffb4c527c578c2e318b
MD5 19746bed7f9cd4ca7c37a1088ed76c54
BLAKE2b-256 5d8ec9edd80f0012311fac38c43e43dc0836a79ceb3e79f1d3636826c5bddbb8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lineage_simulator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cafe85150bd58dc4bfe63ac804454df62133c9082f9b8bbf75c9dd4353b8b2ed
MD5 1326b31872bc45a91f2f5005942dca5a
BLAKE2b-256 c768ade6fb693c0ac387a9ff8a3a93eae560c0f0ad86004c35f049fd68e2a6f7

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