Skip to main content

A workflow to run cross-conditional models for genomics data.

Project description

Patches

Tests Docs License: MIT Code style: black

Patches takes as input a collection of observations or gene expression profiles obtained from multiple conditions referred to as groups -- for example, age, treatment or injury stage. Each group is characterized by a unique set of categories or attributes -- for example, 'young' or 'old' represent attributes of the group 'age'. Given an anndata object with metadata for the observations contained in separate columns of anndata.obs, Patches can:

  • Learn conditional and condition agnostic latent representations for observations.
  • Transfer observations across combinations of conditions.
  • Provide attribute specific scores for each gene, associating gene expression with effects of attributes.


Table of Contents

  1. Installation
  2. Repository structure
    1. Workflow API (for general users)
    2. Developer API (for advanced users)
  3. Getting started
  4. Release notes
  5. Issues and contact
  6. License and citation

Installation

  • You will need Python 3.10 or newer in your system. If you don't have a Python environment setup, we recommend installing it through Mambaforge.

  • Install everything with:

pip install git+https://github.com/Computational-Morphogenomics-Group/Ladder.git@patches

Repository Structure

Alongside Patches, this repository provides the low and high-level API's (called Ladder, still in development at time of Patches release) for running similar models with data from multiple conditions built on anndata.

  • All code is contained under the src directory. (add modules and stuff here)
  • Tests are contained under the tests directory.
  • All documentation can be generated and is serviced through the docs directory.

Workflow API

The high-level workflow API provides a very easy interface to apply models considered in the study (scVI, scANVI, Patches; all built on the Pyro framework) to multicondition datasets easily.

  • This is recommended for users that want to directly apply the model, without worrying much for technical details.
  • Consult the workflow docs for hyperparameters you can define and how to define them.
from ladder.data import get_data
from ladder.scripts import CrossConditionWorkflow, InterpretableWorkflow # Workflow APIs, read docs on which one you'd like for your case!

# Initialize workflow object
workflow = InterpretableWorkflow(anndata, verbose=True, random_seed=42)

# Define the condition classes & batch key to prepare the data
factors = ["time", "age", "broad_type"]
workflow.prep_model(factors, batch_key="sample", model_type='Patches', model_args={'ld_normalize' : True}) # Define model and optimizer hyperparams

# Train the model
workflow.run_model(max_epochs=2000, convergence_threshold=1e-5, convergence_window=2000) # Define convergence hyperparams

Developer API

The low-level developer API explicitly performs all actions condensed into workflows. This allows for:

  • Implementing and running additional models using the Pyro framework.
  • Data preparation functions to provide ease for running the models and downstream visualizations.
  • Evaluation of generative accuracy alongside mixing/separation of conditional effects using defined metrics.

This API is designed to be specifically used by those who are interested in specialized applications or those who would like to extend the codebase. Please use the issue tracker for any questions / encountered problems.

Getting started

Please check out the documentation for all instructions and tutorials.

Release notes

See the changelog.

Issues and contact

For additional questions, please reach out to:

If you encounter any bugs, please report it through the issue tracker. In general, providing a minimally reproducible example is the best way to facilitate easy debugging of issues.

License and citation

This project is licensed under the terms of the MIT License. If the codebase has been of any use to you, please cite:

Beker, O., Amador, D., Nima, J., Deursen, S., Woappi, Y., & Dumitrascu, B. (2024). Patches: A Representation Learning framework for Decoding Shared and Condition-Specific Transcriptional Programs in Wound Healing. bioRxiv.

BibTeX:

@article {Beker2024.12.23.630186,
	author = {Beker, Ozgur and Amador, Dreyton and Nima, Jose Pomarino and Deursen, Simon Van and Woappi, Yvon and Dumitrascu, Bianca},
	title = {Patches: A Representation Learning framework for Decoding Shared and Condition-Specific Transcriptional Programs in Wound Healing},
	elocation-id = {2024.12.23.630186},
	year = {2024},
	doi = {10.1101/2024.12.23.630186},
	publisher = {Cold Spring Harbor Laboratory},
	URL = {https://www.biorxiv.org/content/early/2024/12/24/2024.12.23.630186},
	eprint = {https://www.biorxiv.org/content/early/2024/12/24/2024.12.23.630186.full.pdf},
	journal = {bioRxiv}
}

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

scladder-0.1.0.tar.gz (10.5 MB view details)

Uploaded Source

Built Distribution

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

scladder-0.1.0-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file scladder-0.1.0.tar.gz.

File metadata

  • Download URL: scladder-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for scladder-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e37fd7271033bd7cdf6583537290444ce27c9563619b8a89f6826703ec2cedf7
MD5 0aed8d4f05fbb271fa2a611a06c9c5eb
BLAKE2b-256 bca0aa8955a741a1197a7eebfa061d0f3348cce64fb906f2aed280131de54f5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for scladder-0.1.0.tar.gz:

Publisher: release.yaml on Computational-Morphogenomics-Group/Ladder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scladder-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: scladder-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for scladder-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a345e0abeb24d2557b5223039a6fb35841d04ec3f0edfd64d5c456fd9f0ab2fa
MD5 c9c5a4c881b1eac174ab5962bed8496b
BLAKE2b-256 d5e2c1c14149fae4b159c33c8d8fe777a8664b1e4dbb22136ffb064a3858a00b

See more details on using hashes here.

Provenance

The following attestation bundles were made for scladder-0.1.0-py3-none-any.whl:

Publisher: release.yaml on Computational-Morphogenomics-Group/Ladder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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