Writing a pack for your laboratory’s words

A pack is a file of words that adds to the Dictionary. For example, a pack can tell Ingence that noco and nocodazole name the same thing in your laboratory’s file names. It also says what kind of thing that is. A pack adds words. It doesn’t add rules. This guide shows how to make a pack, install it, test it and share it.

You need a project to install it into (Add a folder) and a text editor. You do not need to write any code.

When a pack is the right tool

For a word that only one project uses, answer in the Dashboard. Ingence asks what it means and saves your answer in that project’s answer log (Teaching Ingence your words). A pack is for words you want to take with you:

  • to every project your laboratory makes, so people don’t have to answer the same question twice;

  • to a colleague, or to another laboratory that names things the way yours does;

  • to the Ingence project, if the words belong to a whole field, such as microscopy.

A pack cannot settle a word that has two meanings: only an answer can. So if a word means two things in your laboratory, answer it in the Dashboard.

Two ways to start

From what you already taught. If a project holds answers, export them as a pack:

ingence teach export-answers -p PROJECT --out ours.yaml --section hela-bench --author "A. Person" --licence MIT

--section gives the pack its name, hela-bench here. Without it, the name is taught. A second pack exported the same way would then clash with the first in a project that installs both. The file lists each word you defined or assigned, with who answered and when. The command leaves out answers that apply to one folder only, because they name that project’s folders. It says how many it left out. If the file already exists, the command doesn’t write anything. Add --overwrite to replace it.

Read every line of the file before you share it. It holds the names of the people who answered. It may also hold words that only your laboratory uses (What never goes in a shared pack).

By hand. Make a file such as this one. The words are real and the bench is invented. On this bench, the technique is a wound healing assay and the drug is nocodazole. The confocal microscope is a Leica SP8.

hela-bench.yaml
pack:
  name: hela-bench
  version: "1"
  author: A. Person
  licence: MIT
section: hela-bench
theme_kind: technique
summary: The techniques, drugs and microscopes of one invented bench.

entries:
  - {term: wound_healing_assay, canonical: wound healing assay,
     surfaces: [woundhealing, "wound-healing", woundassay]}
  - {term: nocodazole_drug, canonical: nocodazole,
     surfaces: [nocodazole, noco], theme_kind: reagent}
  - {term: leica_sp8, canonical: Leica SP8 confocal,
     surfaces: [sp8, leicasp8], theme_kind: instrument}

What each part says

The pack: block is the pack’s manifest, its description of itself. It sits at the top of the file so that the pack travels as one file.

  • name is what a project calls the pack. It uses lowercase letters, digits, _ and -, up to 64 characters. Ingence refuses a name that a shipped pack already uses (microscopy, biochemistry and the others).

  • version is text. Write it in quotes, because Ingence reads an unquoted 1.10 as the number 1.1. Raise it when the words change.

  • author and licence say who wrote the pack and under what terms. The field is spelled licence. Ingence ignores a field spelled license, and doesn’t say so. Choose the license with care, because a pack is meant to be shared.

  • schema and digest are for a pack that teach export-answers wrote. schema is the version of the record format the pack was written for, in quotes. digest is a fingerprint of the pack’s words, so that Ingence can tell a damaged or edited pack. Leave both out of a pack you write by hand. Ingence checks each one only if the pack has it.

Below the block the file follows the shape the shipped words use.

  • section names the group of words. It also names the pack where a file doesn’t have a pack: block. A pack exported with teach export-answers takes it from --section. summary says in one line what the words are. The Dictionary section, in Advanced, shows it.

  • theme_kind is the kind of thing the words are, as a default for every entry. Kinds include technique, reagent, instrument, software, format and measurement. An entry can name its own kind, as nocodazole_drug does. Use a kind the shipped words already use, where one fits. The Dictionary reference lists them with their words.

  • entries is the list of words. Each entry has a term, which names the meaning, and its surfaces, the spellings that carry it. It can also have a canonical, the name shown to people.

Spellings are text, written in a list in brackets. Capitals do not matter, and a hyphen or an underscore inside a spelling does not stop it matching. List the spellings people really write: the short form, the long form and the form with a hyphen. A spelling can be a phrase of several words, such as "leica sp8". It matches those words with spaces or with underscores between them. Put quotation marks around a spelling that holds punctuation ("wound-healing") or a space, or that looks like a number ("2"). Ingence refuses a bare word where a list belongs, or a number where a spelling belongs. Its message names the entry.

A few optional fields exist for words with special behavior. For example, extension_only marks a spelling that counts only as a file ending. The shipped packs use these fields. Read the microscopy pack before you use one.

A pack can also be a folder. It holds a pack.yaml with the name, version and summary, beside one or more section files. Use a folder when the words are long enough to split across files.

Install it, test it, remove it

ingence teach pack install ours.yaml -p PROJECT
ingence teach pack list -p PROJECT
ingence teach pack remove NAME -p PROJECT

install reads the whole pack first. If it cannot load the pack, it refuses it and says why, for example:

  • a spelling list that is not a list;

  • a name already taken;

  • a pack that needs a newer Ingence;

  • words that do not match their digest.

Ingence doesn’t install any part of a refused pack. Otherwise install says how many spellings your pack and the shipped words both claim and now tie on, if any.

install copies the pack into the project, so install it into every project that should read it. list shows each installed pack, its version, a short fingerprint, and whether a scan loads it. remove deletes the project’s copy, and never changes the file you installed from. To install a changed pack under the same name, remove the old one first.

Ingence reads a pack from the next scan. In the Dashboard, press Re-run. By hand, run ingence index --rebind -p PROJECT and then ingence infer -p PROJECT. A project that has never listed its files doesn’t have anything to read again, so run ingence index -p PROJECT instead.

To test your words, try the pack on a small folder of your own with the same kind of names. Or copy the practice folder from The command line and add a file named for one of your words. Then:

ingence teach vocabulary -p PROJECT
ingence teach collisions -p PROJECT

In the vocabulary list, your words show pack in the origin column. collisions lists each spelling that has more than one meaning, with the ties your pack made. It also lists the spellings that an answer of yours settled.

When a pack and the shipped words disagree

Two meanings can claim one spelling. The shipped words include the words every laboratory uses, so this happens whenever a pack uses a common word.

  • Your answer always wins. An answer wins over every pack and over the shipped words. This holds for an answer given in the Dashboard or imported into the answer log.

  • A pack stands level with the shipped words. Where both claim one spelling, Ingence reports a tie. It names both meanings, doesn’t give a result on that word, and asks you. install says how many spellings became ties.

So a common word in your pack can change what a project reads. A word Ingence read before becomes a tie. A rule that needs it then doesn’t give a result until you answer. After you install, run ingence teach collisions -p PROJECT and read the list. If a spelling is there that you did not mean to claim, take it out of your pack. Where two packs of your own claim one spelling, they are level too, and the word is a tie.

What never goes in a shared pack

A pack you keep inside your laboratory can hold your laboratory’s words. A pack you post, send to another laboratory or offer to the Ingence project is public. You cannot take back a word in a public file. Before you share a pack, read the whole file and take out:

  • People’s names: a colleague’s name or initials, and a folder named for a person. In an exported pack, also the names of the people who answered. The author line is the one place for a name, and you choose it.

  • Names of unpublished work: a construct, a gene, a strain, a cell line, a compound, a project or a grant. Also any word that would tell a reader what your laboratory is working on.

  • Identifiers: participant, specimen, sample or instrument serial numbers, and anything that looks like a code from a real study.

  • Paths and server names: anything that reveals where your data lives.

Keep only words that many laboratories in your field would know. These include techniques, kinds of reagent, kinds of instrument, file types and measures. The Ingence project checks each word of a pack offered to it against that standard. You can suggest brand and supplier names with a reason. The project decides on each one separately, because such names help read real folders but also go out of date.

An exported pack records who answered. So taking out an answers block changes the pack’s words. The digest then no longer matches, and Ingence says so when you install the pack. Delete the digest line, and share the pack as a file (Sharing it).

Sharing it

To share a pack, send the file. A colleague installs it with ingence teach pack install and the path to the file, as above.

You can also install a pack from a web address. Ingence fetches it only when someone runs the command with that address, and never by itself. A pack from an address must name its schema, and a digest that its words match, or Ingence refuses it. Ingence also refuses it if the file is larger than 4 MB (--largest changes that, in bytes). It refuses it too if the fetch takes longer than 30 seconds (--timeout changes that, in seconds). A pack you wrote by hand doesn’t have a digest, so share it as a file.

To offer a pack to the Ingence project, use the Pack submission form on GitHub. Attach the file rather than pasting it. To ask for a pack, or how to write one, use Discussions.