Skip to main content
Glama
README.md
# gget-cryo

Search [EMDB](https://www.ebi.ac.uk/emdb/) (3D cryo-EM density maps) and [EMPIAR](https://www.ebi.ac.uk/empiar/) (raw cryo-EM imaging datasets) from Python or as an MCP server for LLM agents.

## Features

- **EMDB search** — filter by resolution, method, deposition year, keyword
- **EMPIAR search** — filter by keyword, release year, movie count, detector
- **Cross-referencing** — look up which EMPIAR datasets produced a given EMDB map, and vice versa
- **MCP server** — expose all searches as tools for Claude, GPT, or any MCP-compatible LLM

## Installation

```bash
pip install -r requirements.txt
```

## Usage

### As a Python library

```python
from gget_cryo import emdb_search, empiar_search, emdb_to_empiar

# Find ribosome maps better than 3.5 A deposited since 2024
results = emdb_search(keyword="ribosome", max_resolution=3.5, year_range=(2024, 2026))
print(results["hit_count"])

# Find EMPIAR datasets with >1000 raw movies
results = empiar_search(keyword="spike", n_movies_min=1000)

# Cross-reference: what raw data produced EMD-3061?
empiar_ids = emdb_to_empiar("EMD-3061")
```

### As an MCP server

Run directly:

```bash
python3 mcp_server.py
```

Or add to your Claude Code MCP config (`~/.claude/settings.json`):

```json
{
  "mcpServers": {
    "gget-cryo": {
      "command": "python3",
      "args": ["/path/to/gget-cryo/mcp_server.py"]
    }
  }
}
```

This exposes four tools: `search_emdb`, `search_empiar`, `cross_ref_emdb_to_empiar`, `cross_ref_empiar_to_emdb`.

### Demo

```bash
python3 demo.py
```

## API details

### Resolution convention

Resolution is in Angstroms. **Lower = better.** To find maps better than 3.5 A, use `max_resolution=3.5`.

### EMPIAR search limitations

EMPIAR's search index doesn't include detector or movie-count fields. When you filter by `n_movies_min` or `detector`, each candidate entry is fetched individually — so the result is exact only among the candidates checked (controlled by `max_candidates`).

## License

[MIT](LICENSE)