Skip to main content

Writing plugins

The parsomics plugin system enables users to easily add support for processing the output files of new protein annotation tools.

Conventions

Versioning and formatting

The parsomics plugins must follow the versioning and formatting conventions of the parsomics project. Read them here.

Only add data to certain tables

As you may have already read in the user documentation, parsomics plugins can only populate existing database tables. Plugins should only add data to the following tables:

  • tool
  • run
  • source
  • proteinannotationfile
  • proteinannotationentry
Important

Plugins should never remove data from any table.

Use utils from parsomics-core

The parsomics-core library exposes many utils (i.e. utilities) for plugin development. The purpose of these utils is to avoid duplicate work by centralizing a functions that are needed by many plugins. For example, plugins commonly need to search proteins by their names, so parsomics-core exposes search_protein_by_name.

These utils also help in standardizing the codebase across different plugins, improving maintainability, and allows distributing features and fixes to many plugins at once (as long as they update their parsomics-core dependency).

These utils can be imported from parsomics-core.plugin_utils. For example:

from parsomics_core.plugin_utils import search_protein_by_name

Tutorial

The parsomics team has put together a tutorial for developing protein annotation plugins. Throughout the tutorial, you will recreate the parsomics-plugin-interpro plugin, which adds support for InterproScan protein annotations. You can check out the complete source code of the plugin on GitLab.

Each step of the tutorial contains "Explanation" and "Hands on" sections. The "Hands on" section puts the explanation into practice, implementing part of the parsomics-plugin-interpro plugin. By the end of the tutorial, you should have a working copy of that plugin, as well as all the knowledge you need to create your own!