Skip to main content

Introduction

The HeartMAP REST API provides a programmatic interface to perform single-cell RNA sequencing analysis of heart tissue. The API is built with FastAPI and supports various analysis pipelines, from basic quality control to comprehensive multi-chamber analysis.

API Information

title
string
HeartMAP API
version
string
1.0.0

Starting the Server

Prerequisites

Install FastAPI and Uvicorn:
pip install fastapi uvicorn

Running the Server

There are multiple ways to start the HeartMAP API server:

Option 1: Using Uvicorn Directly

uvicorn api_server:app --host 0.0.0.0 --port 8000

Option 2: Using the Python Script

python api_server.py

Option 3: Using the HeartMapAPI Class

from heartmap.api import HeartMapAPI

# Create API instance
api = HeartMapAPI(config_path="config.yaml")

# Run server
api.run(host="0.0.0.0", port=8000, debug=False)

Server Options

host
string
default:"0.0.0.0"
Host address to bind the server
port
integer
default:"8000"
Port number for the server
debug
boolean
default:"false"
Enable debug logging

Quick Start Example

Once the server is running, verify it’s working:
curl http://localhost:8000/
{
  "message": "HeartMAP API",
  "version": "1.0.0"
}

Available Analysis Types

The API supports four types of analysis pipelines:

Basic

Quality control and basic preprocessing

Advanced Communication

Cell-cell communication analysis

Multi-Chamber

Multi-chamber comparative analysis

Comprehensive

Complete analysis pipeline with all features

API Features

  • File Upload: Upload .h5ad files for analysis
  • Multiple Pipelines: Choose from basic to comprehensive analysis
  • Configurable: Override default configuration parameters
  • Health Monitoring: Built-in health check endpoint
  • Model Discovery: List available analysis models
  • Dynamic Configuration: Update configuration at runtime

Interactive Documentation

When the server is running, access the interactive API documentation:

Next Steps

API Endpoints

Explore all available endpoints

Authentication

Learn about API authentication

Build docs developers (and LLMs) love