Skip to content

Ontologies

Malva uses ontologies to organise several of its metadata columns. An ontology is a controlled vocabulary whose terms are linked by parent-child relationships, so that selecting one term can also cover its subtypes.

Why ontologies matter

Free-text metadata is inconsistent: one study may call a tissue liver, another hepatic, and a third may spell it differently. When Malva loads data, it maps the free-text values onto ontology terms. Filtering and grouping then work on the terms instead of on the raw strings, and searching a term matches every value that resolves to it or to one of its descendants.

The ontology-backed columns

Three columns in the results tables are ontology-backed. Their Filter buttons open the ontology browser.

Column Ontology Level labels
Cell type Malva Cell Type Ontology Family, Lineage, Subtype, Specific
Disease MONDO Category, Class, Disease, Subtype
Organ UBERON System, Organ, Region, Structure

Using the ontology browser

Click Filter on an ontology-backed column to open the browser.

  • Search for a term by name. The results list matches terms by their labels and synonyms, so you can search for an abbreviation and find the formal term.
  • Browse the columns of the browser by clicking a term to reveal its children.
  • Select terms with the checkboxes. You can select several at once.
  • Double-click a term to select only that term and clear everything else.
  • The browser shows a cell count next to each term, and the footer states how many terms are selected. Use Clear all to reset.

Selecting a term filters the table to rows whose value is that term or any of its descendants. For example, selecting immune system in the organ column keeps the rows of every organ under the immune system.

Grouping rows by level

The Group rows by selector groups the table by a chosen depth of the ontology. The selector shows the label of each level and the number of groups it produces, such as System (4) or Organ (12). Choosing a level replaces the raw column values with the corresponding ancestor terms, which is a quick way to roll many subtypes up into a few categories. A small badge in the column header shows the active grouping level.

How terms are matched

Metadata values are mapped to ontology nodes during data harmonisation and also at filter time. Matching is normalised: node identifiers are compared case-insensitively, with spaces treated as underscores, so that Acute kidney injury and acute_kidney_injury resolve to the same term. Searches within the browser expand against node labels and synonyms as described above.

How the ontologies are built

Malva ships its ontologies as flat node maps in the file data/ontologies/, one JSON file per ontology:

  • cell_type_malva_v1.json is generated from the live cell-type entries in the Malva database and curated by hand. Its nodes carry Cell Ontology identifiers such as CL:0000738.
  • disease_mondo.json is derived from the MONDO OBO ontology and curated into a hierarchy. Its nodes keep the original MONDO: curies and their synonyms.
  • organ_uberon.json is derived from the UBERON OBO ontology in the same way, keeping UBERON: curies.

Each node stores its identifier, label, parent, children, depth, and its source curie and synonyms. New ontologies can be added by dropping a file into data/ontologies/; Malva discovers them automatically, so no code change is needed. The same files are shared with the catalog pipeline that harmonises incoming metadata, which is why the ontology identifiers appear consistently across the database.

Programmatic access

The ontology definitions are also available through the API. See Metadata and data for the GET /api/ontology/fields and GET /api/ontology/<field>/<ontology_id> endpoints.