Command line
Five commands. inspect says what Ligase makes of files you already
have, check type-checks a pipeline without running it, run computes
what is not already known, audit asks whether a step repeats, and
methods says how the results were produced.
inspect is the one that stands alone: it takes files rather than a
pipeline, and there is nothing to write before running it. The other four
take the pipeline file as their last argument and default to pipeline.py
in the current directory. run, audit and methods all check the
pipeline first, so check is never a prerequisite — it is the fast way to
ask the question on its own.
Every command exits 0 when all is well, 1 on a finding — a dimension
mismatch, a failed step, a step that does not repeat — and 2 when it could
not look at all, because a file is missing or a pipeline will not import.
The difference between 1 and 2 is what lets ligase inspect a b && …
mean what it looks like it means.
ligase inspect
The only command that needs no pipeline, and the one to try first on files you already have. It loads each file, says what kind it read it as, and prints every dimension the loader worked out along with where it read each one from — and, given two or more files, compares them exactly as one step’s inputs are compared and prints the diagnostic. Nothing is executed, nothing is cached, and no pipeline.py has to exist.
ligase inspect FILE [FILE ...]Arguments
| Argument | Description |
|---|---|
FILE | The files to inspect, read by extension; two or more are compared against each other. |
Examples
# say what one file is
ligase inspect refs/genome.fasta
# and whether two of them agree
ligase inspect refs/genome.fasta aln/sample01.bam
# refuse to start a run over files that disagree
ligase inspect refs/genome.fasta aln/*.bam && snakemakeligase check
What makes the rest of Ligase worth having, and the command a pipeline lives or dies by. It imports your pipeline file, builds the graph from the step signatures, and compares every connection’s dimensions. No step body runs, nothing is computed, and no tool is invoked — it reads file headers only, so it finishes in milliseconds on a pipeline that would take all night.
ligase check [--cache DIR] [pipeline]Arguments
| Argument | Description |
|---|---|
pipeline | The pipeline to check. Default: pipeline.py. |
Options
| Option | Description |
|---|---|
--cache DIR | Where to look for the pipeline’s remote inputs. Default: ./.ligase. |
Examples
# check `pipeline.py` in the current directory
ligase check
# check a pipeline somewhere else
ligase check analysis/variants.pyligase run
Checks the pipeline, then computes whatever is not already known. A step runs when its code, its parameters, its inputs’ contents or one of its tools’ versions has changed, and not otherwise. Independent steps run at the same time.
ligase run [-j N] [--force] [--cache DIR] [--worker [NAME]] [--lease SECONDS] [--replay | --refresh] [pipeline]Arguments
| Argument | Description |
|---|---|
pipeline | The pipeline to run. Default: pipeline.py. |
Options
| Option | Description |
|---|---|
-j, --jobs N | How many steps may run at once. Default: one per core. |
--force | Run every step, cache or no cache. |
--cache DIR | Where to keep the cache. Default: ./.ligase. |
--worker NAME | Be one worker among several, dividing this pipeline with the others through the shared store; name is what to call this one. Default: a name chosen for you). Needs a store every worker can see. This is not an alternative to --jobs: --jobs is how many steps this machine runs at once, and --worker is how many machines there are. |
--lease SECONDS | How long a worker may hold a step before another worker may compute it too. Default: 3600). Set it above your longest step: too short duplicates work, too long leaves other workers waiting after a crash, and neither is a wrong answer. |
--replay | Serve every recorded query from its record and reach no network; a query with no record is an error. |
--refresh | Ask every recorded query’s source again and report what changed, keeping the existing records. |
Examples
# run what is not already cached
ligase run
# run up to eight steps at once
ligase run -j 8
# recompute everything, cache or no cache
ligase run --force
# keep the cache off your home directory
ligase run --cache /scratch/ligaseligase audit
Answers the opposite question to the cache: not can this be skipped but does this repeat. It runs one step twice more and compares what came out, both as bytes and as what those bytes mean. A step whose bytes move while its result does not is reproducible — the ordinary case for a tool that writes its own command line into its output.
ligase audit [--sample ID] [-j N] [--cache DIR] step [pipeline]Arguments
| Argument | Description |
|---|---|
step | The step to audit, by name. |
pipeline | The pipeline it is in. Default: pipeline.py. |
Options
| Option | Description |
|---|---|
--sample ID | Audit only the node for this sample. Default: all of them. |
-j, --jobs N | How many steps may run at once in the run beforehand. |
--cache DIR | Where to keep the cache. Default: ./.ligase. |
Examples
# run `align` twice more and compare
ligase audit align
# audit one sample's node only
ligase audit align --sample SRR8525904ligase methods
Writes the paragraph you put in a paper: every tool at the version it actually ran at, every parameter as it was hashed, every reference by accession and checksum, and the works to cite. --bundle packages it so somebody else can check the results, and --verify is that check.
ligase methods [--bundle DIR] [--thin] [--verify DIR] [-j N] [--cache DIR] [pipeline]Arguments
| Argument | Description |
|---|---|
pipeline | The pipeline to write up. Default: pipeline.py. |
Options
| Option | Description |
|---|---|
--bundle DIR | Write a reproducibility bundle into this directory. |
--thin | Leave the object bodies out of the bundle and name the store they are in; smaller, and only readable where that store is. |
--verify DIR | Check the bundle in this directory against this machine. |
-j, --jobs N | How many steps may run at once in the run beforehand. |
--cache DIR | Where to keep the cache. Default: ./.ligase. |
Examples
# print the methods paragraph and the reference list
ligase methods
# write a reproducibility bundle
ligase methods --bundle paper/bundle
# check a bundle against this machine
ligase methods --verify paper/bundleligase store
ligase store {status,push,pull} ...Ligase keeps step outputs, canonical forms and recorded response bodies in a content-addressed store. A local store is always the first tier; a second one — a bucket, or a directory on a shared mount — can sit behind it, consulted on a miss and written through on a put, so a lab computes something once between them. Name it with LIGASE_STORE or a [store] table in ligase.toml.
ligase store status
ligase store status [--cache DIR]Print the store this project is configured to use, where that setting was read from, whether this build of Ligase can open it at all, and how much the local tier holds that the remote does not. The last number is a difference between two stores, so it is exact up to a bound and sampled above it; the output says which it is.
Options
| Option | Description |
|---|---|
--cache DIR | The cache to report on. Default: ./.ligase. |
ligase store push
ligase store push [--cache DIR]Write every object and index row in the local tier that the remote does not hold. A run writes through as it goes, so this is for making up a push that did not happen — a run with the store unreachable, or a store configured after the fact.
Options
| Option | Description |
|---|---|
--cache DIR | The cache to push from. Default: ./.ligase. |
ligase store pull
ligase store pull [--cache DIR]Fetch what the local index refers to and the local tier lacks, verifying each object against the name it was asked for. This moves what THIS cache already knows about, so on a machine with no index yet there is nothing to pull: use ligase run, which is what works out which objects the pipeline needs.
Options
| Option | Description |
|---|---|
--cache DIR | The cache to pull into. Default: ./.ligase. |