BioContext7

API Reference

Complete API reference for BioContext7 search, docs, and pipeline generation endpoints

REST API

BioContext7 provides a FastAPI-based REST API for tool discovery and pipeline generation.

Start the API Server

bc7 serve --transport http --port 3000

Or with uvicorn directly:

uvicorn bio_pipeline_maker.api.server:app --host 0.0.0.0 --port 3000

GET /v2/tools/search

Search the unified tool registry.

Query Parameters:

ParameterTypeDescription
qstringFree-text search query
operationstringEDAM operation filter (e.g., operation:0292)
topicstringEDAM topic filter
formatstringResponse format (json, compact)
limitintegerMax results (default: 10)

Example:

curl "http://localhost:3000/v2/tools/search?q=alignment&limit=5"

Response:

{
  "tools": [
    {
      "id": "star",
      "name": "STAR",
      "description": "Spliced Transcripts Alignment to a Reference",
      "operations": ["operation:0292"],
      "topics": ["topic:3308"],
      "homepage": "https://github.com/alexdobin/STAR"
    }
  ],
  "total": 142,
  "query": "alignment"
}

Tool Details

GET /v2/tools/docs/{tool_id}

Get detailed documentation for a specific tool.

Path Parameters:

ParameterTypeDescription
tool_idstringTool identifier from bio.tools

Example:

curl "http://localhost:3000/v2/tools/docs/star"

Response:

{
  "id": "star",
  "name": "STAR",
  "description": "Spliced Transcripts Alignment to a Reference",
  "version": "2.7.11b",
  "operations": [
    {
      "uri": "http://edamontology.org/operation_0292",
      "term": "Sequence alignment"
    }
  ],
  "inputs": [
    {
      "data_uri": "http://edamontology.org/data_2044",
      "format_uri": "http://edamontology.org/format_1930",
      "term": "FASTQ"
    }
  ],
  "outputs": [
    {
      "data_uri": "http://edamontology.org/data_0863",
      "format_uri": "http://edamontology.org/format_2573",
      "term": "BAM"
    }
  ],
  "homepage": "https://github.com/alexdobin/STAR",
  "documentation": ["https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf"],
  "containers": {
    "docker": "quay.io/biocontainers/star:2.7.11b--h5ca1c30_0",
    "singularity": "https://depot.galaxyproject.org/singularity/star:2.7.11b--h5ca1c30_0"
  }
}

Pipeline Generation

POST /v2/pipelines/create

Generate a pipeline from a natural language description.

Request Body:

{
  "intent": "RNA-seq from FASTQ to differential expression",
  "target": "nextflow",
  "options": {
    "prefer_nfcore": true,
    "max_healing_iterations": 3
  }
}

Response:

{
  "success": true,
  "target": "nextflow",
  "files": {
    "main.nf": "// Nextflow DSL2 pipeline...",
    "nextflow.config": "// Configuration..."
  },
  "tools_discovered": 5,
  "lsp_iterations": 2,
  "stub_test_passed": true
}

Python API

PipelineMaker

The core class for programmatic pipeline generation.

from bio_pipeline_maker import PipelineMaker
 
maker = PipelineMaker()
 
result = await maker.create(
    intent="RNA-seq pipeline from FASTQ to gene counts",
    target="nextflow",
)
 
if result.success:
    print(f"Tools discovered: {result.tools_discovered}")
    print(f"LSP iterations: {result.lsp_iterations}")
    print(result.files["main.nf"])

Registry Clients

Access individual registries directly.

from bio_pipeline_maker.registry import BioToolsClient, UniProtClient
 
# Search bio.tools
async with BioToolsClient() as client:
    results = await client.search("alignment", operation="operation:0292")
    for tool in results.tools:
        print(f"{tool.name}: {tool.operations}")
 
# Query UniProt
async with UniProtClient() as client:
    protein = await client.get_protein("P53_HUMAN")
    print(f"{protein.name}: {protein.sequence[:50]}...")

On this page