Getting started with Slivka-Bio

Pick the role that matches how you work to see the most relevant tasks, tools, and documentation.

Most users should start with Jalview and the Slivka-Bio Docker stack. Use the Python/Jupyter guide if you want to script jobs.

Run workflows locally with Jalview and the Slivka-Bio Docker stack

recommended

The Slivka-Bio Docker stack is the quickest way to run Slivka-Bio workflows on your own machine and access them from Jalview Develop. It starts Slivka-Bio and MongoDB with Docker Compose and exposes the API at http://localhost:4040.

Start the Slivka-Bio Docker stack
# Get the Docker Compose setup
git clone https://github.com/bartongroup/slivka-bio-docker.git
cd slivka-bio-docker

# Start Slivka-Bio and MongoDB
docker compose up -d

Connect Jalview Develop

Install Jalview Develop, then add http://localhost:4040/ as a Slivka service URL.

  • On macOS: Settings > Slivka Services > New Service URL
  • On Windows: Tools > Preferences > Slivka Services > New Service URL

Local services will then appear under Web Service > Slivka. You can configure more than one Slivka URL, so Jalview can show both the public DRSASP server and your local Docker server.

Access Slivka from Python or Jupyter

Use the slivka-client package to script jobs, stream status, and pull results into data pipelines. Install from conda, PyPI, or directly from GitHub, then follow the quick workflow below (mirroring our Colab demo).

Step 1: Install the client

Conda
conda install -c slivka -c conda-forge slivka-client
Pip (from PyPI)
pip install slivka-client
Pip (Latest from GitHub)
pip install git+https://github.com/bartongroup/slivka-python-client.git

Step 2: Point the client at a Slivka server

Connect to the Dundee-hosted services by default, or swap in your own deployment URL.

from slivka_client import SlivkaClient

slivka_server_url = "https://www.compbio.dundee.ac.uk/slivka/"
client = SlivkaClient(slivka_server_url)
service = client["clustalo"]
print(f"Connected to {client.url}")

Step 3: Submit a job with an input FASTA

Download a sample alignment file, then submit it to the Clustal Omega service.

from pathlib import Path
from urllib.request import urlretrieve

data_dir = Path("data")
data_dir.mkdir(exist_ok=True)
fasta_path = data_dir / "fam83b-pandda-chains-for-align-test.fa"
urlretrieve(
    "https://raw.githubusercontent.com/bartongroup/slivka-bio-docker/main/demo/data/fam83b-pandda-chains-for-align-test.fa",
    fasta_path,
)

with open(fasta_path, "rb") as handle:
    job = service.submit_job(
        data={
            "iterations": 1,
            "max-guidetree-iterations": 1,
            "max-hmm-iterations": 1,
        },
        files={"input": handle},
    )
print(f"Submitted job: {job.id}")

Step 4: Poll status and download results

Refresh the job until it finishes, save each output, and print the multiple sequence alignment.

import time

from pathlib import Path

while job.status not in ("COMPLETED", "FAILED"):
    print(f"Status: {job.status}")
    time.sleep(3)

downloads = Path("downloads") / job.id
downloads.mkdir(exist_ok=True)

for result_file in job.files:
    target_path = Path("downloads") / result_file.id
    result_file.dump(f"{target_path}")
    print(f"Saved {result_file.label} to {target_path}")
    if result_file.label == "alignment":
        print(target_path.read_text())

Explore examples and API helpers in the slivka-python-client repository, then point your code at https://www.compbio.dundee.ac.uk/slivka/.