Skip to content

mhbsiam/picasso

 
 

Repository files navigation

Picasso — Forked

This is a fork of pachterlab/picasso. See the original repository for core documentation. This fork extends Picasso with an updated environment and applies single-cell analysis on NTM (nontuberculous mycobacteria) lung disease data.


What I Added

Addition Description
env/conda_env.yaml Updated conda environment with Python 3.10 + PyTorch ≥ 2.0
picasso_v2.ipynb Analysis notebook applying Picasso to NTM scRNA-seq data
figures/ Generated publication-style output figures
cell_type.png Picasso embedding colored by cell type (see below)

Applied Analysis: NTM Lung Disease scRNA-seq

I applied Picasso to single-cell RNA-seq data from NTM (nontuberculous mycobacteria) lung disease samples. Cells are embedded onto flipped elephant-shaped coordinates and colored by cell type identity.


Picasso embedding of NTM lung scRNA-seq data, colored by cell type

Additional figures generated from this analysis:

Figure Description
figures/picasso_180flipped_elephantcell_type_simplified_v5.pdf Simplified cell type map
figures/picasso_180flipped_elephantNTM_DE_eff_size_v6.pdf Differential expression effect sizes
figures/picasso_180flipped_elephantSymptomatic_DA_lfc_v7.pdf Symptomatic vs. non-symptomatic log fold change

Environment Setup (Updated for Python 3.10 + PyTorch 2.0)

The original environment files (Python 3.7) are preserved. I added a modern alternative:

conda env create -f env/conda_env.yaml
conda activate picasso_env

This installs:

  • Python 3.10
  • PyTorch ≥ 2.0 (with CUDA support)
  • NumPy ≥ 1.23, SciPy ≥ 1.10, Pandas ≥ 2.0
  • AnnData ≥ 0.9, Matplotlib ≥ 3.7

For the original Python 3.7 environments, see env/env3.7_LINUX.yml or env/env3.7_MACOS.yml.


Running with a Checkpoint

The checkpoints/ckpt.pth file contains a pre-trained model state. To load it:

from Picasso import Picasso

pic = Picasso(adata, mapPoints)
pic.fit(checkpt="checkpoints/ckpt.pth")

This resumes training from the saved checkpoint rather than starting from scratch.


Original Picasso

Picasso maps points of an input matrix to user-defined, n-dimensional shape coordinates while minimizing reconstruction error via an autoencoder neural network.


Original Picasso example — single-cell data embedded onto elephant coordinates

Examples for running Picasso can be found in examplePicasso.ipynb. The notebook can be run in Google Colab:

Open In Colab

Elephant coordinates from Mayer et al. 2010.


Citation

If you use Picasso, please cite the original authors:

Pachter Lab. Picasso. GitHub. https://github.com/pachterlab/picasso

About

Picasso: a methods for embedding points in 2D in a way that respects distances while fitting a user-specified shape.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 95.4%
  • Wolfram Language 4.1%
  • Python 0.5%