Getting started with Slivka-Bio

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

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/.