Skip to main content

LatInt: a Python package to help Interpret your Latent Space

The goal of this package is to facilitate the interpretation and quality control of low-dimensional latent spaces generated by dimensionality reduction methods, using heterogeneous input feature types (e.g. Numerical as well as image-based inputs).

In development:

This package was the results of the collective efforts of our lab prompted by the immediate need for some of these functions, and as such are extremely tailored to our workflows. It's actively under development and extra modules, generalization and documentation are all still underway. If you use a module that requires components of the learning of your latent space, such as a model or a dataset, it is assumed the learning has been done using pytorch. In the future we will generalize this.

Modules:

Getting started:

  • Install package:
pip install latint
  • Load your latent space by calculating it from your trained model and input data:
from latint.load import getLatentFromModel

latent = getLatentFromModel(model, data)
  • However you load your latent space, the result should either be a numpy array OR an anndata object, with the latent space accessible in adata.obsm['latent_key']
  • Note: The rest of this package assumes you're inputting either of them, some will specifically need the anndata object if the input data or metadata is also required for its functionality.

Optional:

  • Encapsulate latent space and input data in an anndata object
adata = ad.AnnData(data, dtype=data.dtype)
adata.obsm["latent"] = latent 
  • Add metadata of the input data to the adata object
metadata_df = pd.read_csv("/path/to/your/metadata.csv")
addMetadataFromPandas(adata, metadata_df)

Documentation

The generation of the documentation website is a work in progress, but all functional modules have clearly written docstrings.

Dependencies:

  • numpy
  • pandas
  • tqdm
  • matplotlib
  • torch
  • scanpy
  • anndata==0.8 We take a specific version of anndata because some mismatch between anndata and scanpy exists.

Release files for LatInt 0.1.0

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

Source distribution (sdist)

Source distribution for LatInt 0.1.0
File Size Uploaded
LatInt-0.1.0.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for LatInt 0.1.0
File Interpreter ABI Platform
LatInt-0.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 23.1 kB

Release files / LatInt-0.1.0.tar.gz

Download URL LatInt-0.1.0.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
374e002b02170aefb01c6c6bdcb6ff27dbc448c274f290aa411e12e8860cb335
BLAKE2b-256 checksum
How to use checksums
ee84f2684268499a8555c095f909f429c91d0d53fde67452ed2430875608a7cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.61.2 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

Release files / LatInt-0.1.0-py2.py3-none-any.whl

Download URL LatInt-0.1.0-py2.py3-none-any.whl
Size 12.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
90d9b02f3c3b2cd9e5e0dbbd0ccce4eaee7dbf75aef6a83f3702692a6fd02839
BLAKE2b-256 checksum
How to use checksums
073334aca4953cf9a3cc482818712525c188d09f19aac9fc4d9b8526e92d45fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.61.2 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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