This GitHub repository is associated with our paper available on bioRxiv: https://www.biorxiv.org/content/10.1101/2024.07.01.599554v1
All code to analyze the data and generate figures is available at https://github.com/hansenlab/mNSF_paper
Tutorial for using mNSF on example datasets are publicly available at https://github.com/hansenlab/mNSF/blob/main/tutorial/dlpfc.md (use DLPFC data as example) and https://github.com/hansenlab/mNSF/blob/main/tutorial/mouse.md (use mouse saggital section data as example).
-
- Basic end-to-end workflow using synthetic data
- Data preparation, model training, and result visualization
- Parameter selection guidance
-
- Techniques for handling large-scale spatial transcriptomics data
- Optimizing induced points selection
- Memory and computational efficiency strategies
-
- In-depth analysis of how different parameters affect mNSF performance
- Interactive visualizations of parameter interactions
- Practical guidelines for parameter tuning
-
- Understanding spatial autocorrelation in mNSF factors
- Calculating and interpreting Moran's I statistics
- Visualizing different levels of spatial structure
-
- Statistical approaches for determining optimal factor count
- Using deviance explained and elbow methods
- Practical guidelines for different dataset complexities
-
- Connecting mNSF factors to biological meaning
- Techniques for visualizing gene-factor relationships
- Step-by-step interpretation framework
You can install everything from the PyPI repository using pip install -e . but Tensorflow will most likely not install. A safer way would be to use conda to setup most of the packages then use pip to install.
- Git clone and activate your environment of choice.
- Install tensorflow.
pip install -e .
- Git clone this repo
git clone https://github.com/hansenlab/mNSF/and entercd mNSF. - Install
conda. I recommend this distribution: https://github.com/conda-forge/miniforge. Do not install the fullanaconda, it's highly bloated. - Create a new environment and install using
conda env create -n mnsf -f environment.yml
conda activate mnsfThe package should be available right away.
- Install tensorflow.
CPU only
conda install tensorflow
GPU
If you have a GPU and is operating in a Linux system, you can in the `mnsf` environment.conda install tensorflow-gpu
This package is managed by twine. Assuming twine is installed in your python version, you build the distribution by
python setup.py sdist
inside the repository directory, and then you upload to PyPI by
twine upload dist/*
(requires an account on PyPI)