Skip to content

Pull a dictionary from the command line

Fetch a monomer dictionary once, cache it on disk, and then run the engine offline against that exact version. This is the path to use in pipelines and CI, where you do not want a network call per molecule.

Install the cli extra:

pip install "helmshaker[cli]"

Log in

helmshaker login --janus-env beta

This uses the device-authorization flow: it prints a URL and a code for you to approve in a browser. It works headless and over SSH. Add --loopback if you prefer the browser-redirect flow.

In CI, skip login and set the token in the environment instead:

export HELMSHAKER_TOKEN="$JANUS_TOKEN"

Find the dictionary you want

helmshaker library dictionaries --tmr https://api.core.minerva.roche.com/gateway/tmr-tst

This prints each dictionary's name, current version and primary key. Either the name or the pk works as --dictionary.

Pull and cache it

helmshaker library pull --tmr https://api.core.minerva.roche.com/gateway/tmr-tst \
    --dictionary peptides --version 1.2.0

Omit --version for the latest. Add --refresh to refetch when a fresh cache already exists.

Confirm what you now hold:

helmshaker library list
helmshaker library show peptides@1.2.0

Use it offline

Every engine command resolves monomers against the cache:

helmshaker parse    'PEPTIDE1{C.A.A.A.C}$$$$V2.0' --dictionary peptides
helmshaker validate 'PEPTIDE1{C.A.A.A.C}$$$$V2.0' --dictionary peptides
helmshaker mw       'PEPTIDE1{C.A.A.A.C}$$$$V2.0' --dictionary peptides
helmshaker convert  'RNA1{[moe](A)[sp].[moe](U)}$$$$V2.0' --to fasta --dictionary oligos

validate exits non-zero when validation fails, so it gates a pipeline step directly.

From Python

The same cache backs MonomerLibrary.from_cache, so a dictionary pulled by the CLI is immediately available to your code with no network access:

from helmshaker import MonomerLibrary

library = MonomerLibrary.from_cache("peptides", "1.2.0")