Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

ontoparse: a command line suite for working with ontology files

Motivation and scope

This project was originally developed to provide my lab members with a tool to quickly extract cross-references between ontology terms (e.g., MESH –> MONDO). Currently, this is all it does, however I plan to expand this tool as needed (e.g., to extract ID –> name maps, adjacency matrices, etc).

Install

Pre-build binaries

Installer scripts

macOS and Linux:

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/phicks22/ontoparse/releases/latest/download/ontoparse-installer.sh | sh

Windows PowerShell:

powershell -ExecutionPolicy Bypass -c "irm https://github.com/phicks22/ontoparse/releases/latest/download/ontoparse-installer.ps1 | iex"

The ontoparse CLI

xrefs

Extract cross-references (xrefs) from ontologies. Currenly supports OBO format-version 1.2.

ontoparse xref <FILE> --to <PREFIX> [--from <PREFIX>] [--separator <SEP>]
  • Arguments

    • <FILE>: An ontology OBO file.
  • Required options

    • --to <PREFIX>: An anchor prefix to map from (e.g, MESH).
  • Optional arguments

    • --from <PREFIX>: An anchor prefix to map from (e.g., UBERON). Must contain term entries in the file. Defaults to the most frequent prefix in the file.
    • --separator <SEP>: Delimiter of the output table. Defaults to \t.

Examples

From the primary prefix (i.e., UBERON):

ontoparse xref uberon.obo --to MESH

Or you can specify:

ontoparse xref uberon.obo --to MESH --from UBERON

You can also map from other prefixes if they exist:

ontoparse xref uberon.obo --to MESH --from CL

Write the output to tsv:

ontoparse xref uberon.obo --to MESH > uberon_to_mesh.tsv

You may also change the separator:

ontoparse xref uberon.obo --to MESH --separator "," > uberon_to_mesh.csv