jhliu17/SOAR

The source code and benchmark suite for Single-Cell Omics Arena (SOAR)

Python

0

14 commits

updated Aug 4, 2025

See the code

README

🧫 Single-Cell Omics Arena

Single-Cell Omics Arena (SOAR) is a comprehensive benchmark framework designed to evaluate and improve the performance of instruction-tuned large language models (LLMs) in automated cell type annotation from single-cell omics data.

Updates

  • [2025-08-03] 🎉 We are excited to provide a command line interface and the pre-built package soar_benchmark for easier usages.
  • [2025-05-12] 🎉 We are excited to announce that Single-Cell Omics Arena (SOAR) is now open-source! We welcome contributions from the community to help advance automated cell type annotation using LLMs.

Installation

  1. Create an environment with Python >= 3.11
  2. Clone the repo via git clone [email protected]:jhliu17/SOAR.git
  3. Install soar_benchmark via pip install -e .

API Key Setup

To execute LLMs provided by OpenAI or hosted on Hugging Face Transformers, an env file (env.toml) should be set up in the project folder. A template env file is provided as env_sample.toml.

Cell Type Annotation with LLMs

Annotation Interface

To print out all supported LLMs, please run:

soar annotate -h

This will print out all available annotation options using LLMs.

soar currently supports the following LLMs for cell type annotation:

  • Qwen2 series (1.5B, 7B, 72B)
  • Meta Llama-3 70B
  • Mixtral-8x7B
  • GPT-4o
  • GPT-4o-mini

where all LLMs can leverage zero-shot prompting or zero-shot chain-of-thought prompting to finish cell type annotations.

Each model has specific hardware requirements and configurations:

  • Smaller models (1.5B-7B): Single GPU with 16GB VRAM
  • Larger models (70B-72B): Multi-GPU setup with 4-8 GPUs
  • Mixtral-8x7B: 4 GPUs recommended for optimal performance

For example, to reproduce the SOAR-RNA benchmark result on GPT-4o using zero-shot prompting, one can run

soar annotate soar_rna_with_gpt4_o_zero_shot

Custom Dataset

If one would like to leverage a provided LLM annotation configuration to annotate their own dataset, this can be achieved by

soar annotate soar_rna_with_gpt4_o_zero_shot --config.dataset.json-path YOUR_DATASET_PATH

where the custom dataset should follow the same structure as soar_benchmark/datasets/soar_rna.json.

One can further fine-tune the preset configuration by overriding some arguments. For example, increasing the new token number limit to 2048.

soar annotate soar_rna_with_gpt4_o_zero_shot --config.generation.max-new-tokens 2048

# To see more tunable options
soar annotate soar_rna_with_gpt4_o_zero_shot -h

Custom LLM Configuration

If you would like to implement a custom annotation configuration. Please refer to the detailed configuration settings including batch sizes, memory requirements, and hardware specifications in:

  • Model configs: soar_benchmark/configs/cell_type_annotation/experiment_soar_rna.py

Once you have implemented a custom configuration, you can use it by calling the built-in annotation function

from soar_benchmark import start_annotation_task

# Your custom configuration
custom_configuration = CellTypeAnnotationTaskConfig(...)

# Start annotation
start_annotation_task(custom_configuration)

Evaluations

To run evaluations on annotated results, please refer to

python -m analysis.cell_type_annotation.squad_eval --chat_results_path outputs/.../qwen2-72b-instruct.json --squad_eval_results_path outputs/.../few_shot_squad_eval_inflect.json

Metrics

To evaluate the free-format cell type annotations generated by LLMs, we employ seven widely used metrics from natural language processing and question answering. These include ROUGE (R-1, R-2, R-L) for measuring n-gram and sequence overlap, METEOR for capturing semantic similarity through surface forms, stems, and synonyms, and BLEU (BLEU-1, BLEU-2, and geometric average) for n-gram overlap, particularly suited for short phrases. Additionally, the Exact Match (EM) and F1 score are used to assess token-level precision and recall, ensuring fair evaluation despite label variability and synonym usage.

SOAR-RNA Benchmark

Zero-shot Cell Type Annotation

ModelR-1R-2R-LMET.B-1B-2BLEU
CellMarker2.031.8813.3631.7623.8341.0718.0527.23
SingleR16.515.9816.492.9624.410.000.00
ScType12.373.4412.2420.1821.476.7310.77
DeepSeek-LLM-67B33.1313.4732.7424.2728.2710.0716.87
Qwen2-72B32.3914.7632.0529.9618.596.6711.13
Llama-3-70B30.1613.4529.8327.3522.318.8514.33
Mixtral-8×7B20.9513.4020.7816.9417.617.1610.23
Mixtral-8×22B39.8518.1939.9528.6042.0619.4029.18
Cell2Sentence26.8711.4826.7619.4525.2411.7917.25
GPT-4o mini52.6327.4552.2641.0845.7423.2932.64
GPT-4o58.4532.0758.1245.3962.8542.6851.79

Zero-shot Chain-of-thought Cell Type Annotation

ModelR-1R-2R-LMET.B-1B-2BLEU
CellMarker2.0-------
SingleR-------
ScType-------
DeepSeek-LLM-67B40.7917.5040.4731.1333.7213.1021.02
Qwen2-72B46.5623.9346.3437.0936.8517.9225.69
Llama-3-70B42.2521.2442.0234.0925.9411.6417.38
Mixtral-8×7B42.3721.3741.8235.4531.5713.8320.90
Mixtral-8×22B51.6526.7351.2641.9740.9619.4028.19
Cell2Sentence-------
GPT-4o mini51.6326.6051.1740.8450.2927.8937.45
GPT-4o57.6731.5557.3445.3655.2732.1542.15

SOAR-MultiOmics Benchmark

RNA-seq

ModelR-1R-2R-LMET.B-1B-2BLEU
Qwen2-72B21.836.0220.5711.5420.775.3210.51
Llama-3-70B27.4111.7127.5517.7327.4110.1016.64
Mixtral-8×7B33.4118.2833.6526.1133.0918.4524.71
Mixtral-8×22B27.6611.2927.6716.2730.638.0612.90
Cell2Sentence28.0318.2928.4220.6341.3535.2938.20
GPT-4o mini39.6321.2839.2629.9237.4021.0528.06
GPT-4o41.0023.1041.3730.2043.7526.3233.93

ATAC-seq

ModelR-1R-2R-LMET.B-1B-2BLEU
Qwen2-72B19.558.6418.4311.8016.073.797.80
Llama-3-70B31.7613.0131.8319.3929.8410.2317.47
Mixtral-8×7B29.7114.9529.3624.2123.089.7715.02
Mixtral-8×22B30.3813.1330.2219.3924.088.3312.99
Cell2Sentence26.5410.0726.4517.2936.0422.6728.58
GPT-4o mini38.1517.0137.0628.0835.4617.1424.66
GPT-4o38.4716.8838.3125.2338.8421.1828.68

jhliu17/SOAR

The source code and benchmark suite for Single-Cell Omics Arena (SOAR)

Python

0

14 commits

updated Aug 4, 2025

See the code

README

🧫 Single-Cell Omics Arena

Single-Cell Omics Arena (SOAR) is a comprehensive benchmark framework designed to evaluate and improve the performance of instruction-tuned large language models (LLMs) in automated cell type annotation from single-cell omics data.

Updates

  • [2025-08-03] 🎉 We are excited to provide a command line interface and the pre-built package soar_benchmark for easier usages.
  • [2025-05-12] 🎉 We are excited to announce that Single-Cell Omics Arena (SOAR) is now open-source! We welcome contributions from the community to help advance automated cell type annotation using LLMs.

Installation

  1. Create an environment with Python >= 3.11
  2. Clone the repo via git clone [email protected]:jhliu17/SOAR.git
  3. Install soar_benchmark via pip install -e .

API Key Setup

To execute LLMs provided by OpenAI or hosted on Hugging Face Transformers, an env file (env.toml) should be set up in the project folder. A template env file is provided as env_sample.toml.

Cell Type Annotation with LLMs

Annotation Interface

To print out all supported LLMs, please run:

soar annotate -h

This will print out all available annotation options using LLMs.

soar currently supports the following LLMs for cell type annotation:

  • Qwen2 series (1.5B, 7B, 72B)
  • Meta Llama-3 70B
  • Mixtral-8x7B
  • GPT-4o
  • GPT-4o-mini

where all LLMs can leverage zero-shot prompting or zero-shot chain-of-thought prompting to finish cell type annotations.

Each model has specific hardware requirements and configurations:

  • Smaller models (1.5B-7B): Single GPU with 16GB VRAM
  • Larger models (70B-72B): Multi-GPU setup with 4-8 GPUs
  • Mixtral-8x7B: 4 GPUs recommended for optimal performance

For example, to reproduce the SOAR-RNA benchmark result on GPT-4o using zero-shot prompting, one can run

soar annotate soar_rna_with_gpt4_o_zero_shot

Custom Dataset

If one would like to leverage a provided LLM annotation configuration to annotate their own dataset, this can be achieved by

soar annotate soar_rna_with_gpt4_o_zero_shot --config.dataset.json-path YOUR_DATASET_PATH

where the custom dataset should follow the same structure as soar_benchmark/datasets/soar_rna.json.

One can further fine-tune the preset configuration by overriding some arguments. For example, increasing the new token number limit to 2048.

soar annotate soar_rna_with_gpt4_o_zero_shot --config.generation.max-new-tokens 2048

# To see more tunable options
soar annotate soar_rna_with_gpt4_o_zero_shot -h

Custom LLM Configuration

If you would like to implement a custom annotation configuration. Please refer to the detailed configuration settings including batch sizes, memory requirements, and hardware specifications in:

  • Model configs: soar_benchmark/configs/cell_type_annotation/experiment_soar_rna.py

Once you have implemented a custom configuration, you can use it by calling the built-in annotation function

from soar_benchmark import start_annotation_task

# Your custom configuration
custom_configuration = CellTypeAnnotationTaskConfig(...)

# Start annotation
start_annotation_task(custom_configuration)

Evaluations

To run evaluations on annotated results, please refer to

python -m analysis.cell_type_annotation.squad_eval --chat_results_path outputs/.../qwen2-72b-instruct.json --squad_eval_results_path outputs/.../few_shot_squad_eval_inflect.json

Metrics

To evaluate the free-format cell type annotations generated by LLMs, we employ seven widely used metrics from natural language processing and question answering. These include ROUGE (R-1, R-2, R-L) for measuring n-gram and sequence overlap, METEOR for capturing semantic similarity through surface forms, stems, and synonyms, and BLEU (BLEU-1, BLEU-2, and geometric average) for n-gram overlap, particularly suited for short phrases. Additionally, the Exact Match (EM) and F1 score are used to assess token-level precision and recall, ensuring fair evaluation despite label variability and synonym usage.

SOAR-RNA Benchmark

Zero-shot Cell Type Annotation

ModelR-1R-2R-LMET.B-1B-2BLEU
CellMarker2.031.8813.3631.7623.8341.0718.0527.23
SingleR16.515.9816.492.9624.410.000.00
ScType12.373.4412.2420.1821.476.7310.77
DeepSeek-LLM-67B33.1313.4732.7424.2728.2710.0716.87
Qwen2-72B32.3914.7632.0529.9618.596.6711.13
Llama-3-70B30.1613.4529.8327.3522.318.8514.33
Mixtral-8×7B20.9513.4020.7816.9417.617.1610.23
Mixtral-8×22B39.8518.1939.9528.6042.0619.4029.18
Cell2Sentence26.8711.4826.7619.4525.2411.7917.25
GPT-4o mini52.6327.4552.2641.0845.7423.2932.64
GPT-4o58.4532.0758.1245.3962.8542.6851.79

Zero-shot Chain-of-thought Cell Type Annotation

ModelR-1R-2R-LMET.B-1B-2BLEU
CellMarker2.0-------
SingleR-------
ScType-------
DeepSeek-LLM-67B40.7917.5040.4731.1333.7213.1021.02
Qwen2-72B46.5623.9346.3437.0936.8517.9225.69
Llama-3-70B42.2521.2442.0234.0925.9411.6417.38
Mixtral-8×7B42.3721.3741.8235.4531.5713.8320.90
Mixtral-8×22B51.6526.7351.2641.9740.9619.4028.19
Cell2Sentence-------
GPT-4o mini51.6326.6051.1740.8450.2927.8937.45
GPT-4o57.6731.5557.3445.3655.2732.1542.15

SOAR-MultiOmics Benchmark

RNA-seq

ModelR-1R-2R-LMET.B-1B-2BLEU
Qwen2-72B21.836.0220.5711.5420.775.3210.51
Llama-3-70B27.4111.7127.5517.7327.4110.1016.64
Mixtral-8×7B33.4118.2833.6526.1133.0918.4524.71
Mixtral-8×22B27.6611.2927.6716.2730.638.0612.90
Cell2Sentence28.0318.2928.4220.6341.3535.2938.20
GPT-4o mini39.6321.2839.2629.9237.4021.0528.06
GPT-4o41.0023.1041.3730.2043.7526.3233.93

ATAC-seq

ModelR-1R-2R-LMET.B-1B-2BLEU
Qwen2-72B19.558.6418.4311.8016.073.797.80
Llama-3-70B31.7613.0131.8319.3929.8410.2317.47
Mixtral-8×7B29.7114.9529.3624.2123.089.7715.02
Mixtral-8×22B30.3813.1330.2219.3924.088.3312.99
Cell2Sentence26.5410.0726.4517.2936.0422.6728.58
GPT-4o mini38.1517.0137.0628.0835.4617.1424.66
GPT-4o38.4716.8838.3125.2338.8421.1828.68