🎓 CCLLM: Cellular Community Large Language Model to identify motifs of cell organization in spatial transcriptomics
CCLLM is a graph-based LLM framework designed to identify conservative topological patterns of cell type combinations as CC motifs from cellular communities in SRT data.
CCLLM constructs a cellular community by cell spatial coordinates, where nodes represent individual cells and edges represent hypothetical spatial relations. The graph structure of the cellular community is then encoded a descriptive prompt template consisting of system instruction, graph structure, task description, and output format. CCLLM leverages prompt engineering to capture contextual information from the cellular community, and is fine-tuned using Low-Rank Adaptation (LoRA) to enable CC motifs identification and provide end-to-end biological interpretation.
These instructions guide you on how to run CCLLM locally.
git clone https://github.com/Springff/CCLLM.git
cd CCLLMCreate and activate a conda environment:
conda create -n myenv python=3.9
conda activate myenvInstall dependencies:
pip install -r requirements.txtImportant: You need to obtain a license for the Llama3 model and follow Meta's official instructions for downloading and configuring it.
Hugging Face: Llama3-8b-Instruct
Please consult the official Llama3 documentation for the correct download and usage instructions.
Place the downloaded Llama3 model in the llama3_models directory (recommended), or modify the model path in llama3_0.py.
python ./CCLLM.pyCCLLM/
├── CCLLM.py # Main execution script
├── requirements.txt # Python dependency file
├── README.md # This document
├── Llama3_models/ # Directory for Llama3 models
├── CCLLM-Llama3/ # Directory for LoRA module
└── ...