Skip to main content

Transformer model with single-cell perturbation predictions

Project description

pertTF is a transformer model designed for single-cell perturbation predictions.

Installation

Prerequisite environment

pertTF require torch > 2.3.0 and cuda > 12.0

best way to install is to set up a seperate envrionment with conda or mamba

# create independent environment (recommonded)
mamba create -n pertTF_env python=3.10 cuda-toolkit=12.8 'gxx>=6.0.0,<12.0' cudnn ca-certificates -y -c pytorch -c nvidia -c conda-forge

# pip install required packages
# it is best to install torch == 2.6.0 to match the flash attention compiled wheel below
# higher versions of torch may present difficulties for installing flash attention 2 
pip install torch==2.6.0 torchvision orbax==0.1.7 torchdata torchmetrics pandas scanpy numba --upgrade "numpy<1.24" datasets transformers==4.33.2 wandb torch_geometric pyarrow sentencepiece huggingface_hub omegaconf

flash attention is strongly recommended for training or finetuning

# flash attention 2 installation
#check ABI true/false first
python -c "import torch;print(torch._C._GLIBCXX_USE_CXX11_ABI)"
# install appropraite version (the example below is for ABI=FALSE)
pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl 

# flash attention 3 installation (recommended for torch > 2.6.0 and hopper GPUs)
# To install flash attention v3 (1.5-2x speed up over v2) requires > 30mins, > 400GB RAM, 32 CPUS (aim for more than this)
git clone https://github.com/Dao-AILab/flash-attention.git
cd flash-attention
python setup.py install 

pertTF installation

You can install and use pertTF in two ways.

The first way, pertTF is avaiable on PyPI. Use the following command to install pertTF:

pip install -i https://test.pypi.org/simple/ pertTF

The second way is suitable for you to run the most recent pertTF source code. First, fork our pertTF GitHub repository:

git clone https://github.com/davidliwei/pertTF.git

Then, in your python code, you can directly use the pertTF package:

import sys
sys.path.insert(0, '/content/pertTF/')

Tutorials

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

perttf-0.1.1.tar.gz (479.3 kB view details)

Uploaded Source

Built Distribution

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

perttf-0.1.1-py3-none-any.whl (88.7 kB view details)

Uploaded Python 3

File details

Details for the file perttf-0.1.1.tar.gz.

File metadata

  • Download URL: perttf-0.1.1.tar.gz
  • Upload date:
  • Size: 479.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for perttf-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c5423a477547ba988f9812e9ee2811d270677d6cb10387f2fe3895fc3c2f85f7
MD5 7f1d723e3c5af0cd8da925e6c69e3452
BLAKE2b-256 e21b038f9fd014b060c16d32218bd2ad8bd07e753e4bcdcddee40abc30ac0dc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for perttf-0.1.1.tar.gz:

Publisher: publish-pypi.yml on davidliwei/pertTF

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

File details

Details for the file perttf-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: perttf-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 88.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for perttf-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c73518c57cd9feda54d1ba7872b46b6b6cd49f95333b76f08936d451fd028ee1
MD5 644dc0f739a144832216f3337085b3c4
BLAKE2b-256 f2258c899787ecb1f489468ffba9ad002dba348288c4b9aaf658ef4b9a3cbf65

See more details on using hashes here.

Provenance

The following attestation bundles were made for perttf-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on davidliwei/pertTF

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