Skip to main content

Step 8: Edit plugin_initializer.py

This file creates the object that wraps all of the plugin's functionality.

Explanation

The plugin_initializer.py file instantiates the PluginInitializer class as an initializer object. This object standardizes the way that parsomics-core accesses the populate function that you implemented in the populate.py file. It also includes some metadata about the plugin, such as the plugin name.

Hands on

  1. The template most likely generated the entire file correctly. All you need to do is remove the triple quotes and double check that the fields of the PluginInitializer object are being correctly initialized.

  2. Stage plugin_initializer.py and commit it.

Result

plugin_initializer.py
from parsomics_core.plugin_utils import PluginInitializer

from parsomics_plugin_interpro.populate import populate_interpro

initializer = PluginInitializer(
subject="interpro",
plugin_name="parsomics-plugin-interpro",
populate_func=populate_interpro,
)