Metadata-Version: 2.1
Name: LatInt
Version: 0.1.0
Summary: Collection of modules to easily interpret Deep Learned latent spaces
Home-page: https://github.com/sifrimlab/LatInt
Author: LMIB
Author-email: david.wouters@kuleuven.be
Project-URL: Bug Reports, https://github.com/sifrimlab/LatInt
Project-URL: Source, https://github.com/sifrimlab/LatInt
Keywords: deep-learning
Classifier: Development Status :: 3 - Alpha
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: tqdm
Requires-Dist: matplotlib
Requires-Dist: torch
Requires-Dist: scanpy
Requires-Dist: anndata (==0.8)

# 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:
```bash
pip install latint
```

- Load your latent space by calculating it from your trained model and input data:
```python
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

```python
adata = ad.AnnData(data, dtype=data.dtype)
adata.obsm["latent"] = latent 
```
- Add metadata of the input data to the adata object

```python
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.*
