# EGA Platform Profile

## Overview

The [European Genome-phenome Archive (EGA)](https://ega-archive.org/) is a service for permanent archiving and sharing of genetic and phenotypic data resulting from biomedical research projects. EGA provides controlled access via GA4GH standards.

## Supported GA4GH Specs

| Spec | Support | Notes |
|------|---------|-------|
| htsget v1.3 | Full | Streaming access to BAM/CRAM/VCF |
| Beacon v2 | Full | Variant discovery across datasets |
| Crypt4GH v1 | Full | File-level encryption for data transfer |
| Passports v1 | Full | ELIXIR AAI with GA4GH Passport visas |
| refget v2 | Full | Reference sequence retrieval |

## Configuration

```toml
# profiles/ega.toml
[platform]
name = "ega"
display_name = "European Genome-phenome Archive"
base_url = "https://ega-archive.org"

[auth]
method = "passport"
issuer = "https://login.elixir-czech.org/oidc"
# Requires ELIXIR AAI credentials with appropriate visa grants

[htsget]
enabled = true
base_url = "https://htsget.ega-archive.org"

[beacon]
enabled = true
base_url = "https://beacon.ega-archive.org"

[crypt4gh]
enabled = true
# EGA uses Crypt4GH for encrypted file transfer
```

## Quick Start

```python
from ai4gh.specs.beacon.client import BeaconClient

async with BeaconClient(
    base_url="https://beacon.ega-archive.org",
) as client:
    info = await client.get_info()
    print(f"Beacon: {info.name}")
```

## Authentication

EGA uses ELIXIR AAI with GA4GH Passport visas:

1. Register at [ELIXIR AAI](https://elixir-europe.org/services/compute/aai)
2. Request data access through the EGA portal
3. GA4GH Passport visas are issued upon approval

```python
from ai4gh.specs.passports.models import Passport

# Decode and validate a GA4GH Passport
passport = Passport.from_jwt(token, issuer="https://login.elixir-czech.org/oidc")
```

## Compliance Testing

```bash
ai4gh test beacon https://beacon.ega-archive.org
ai4gh test htsget https://htsget.ega-archive.org
```
