def register(self, plugin):
if not plugin or not isinstance(plugin, BasePlugin):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if self.is_registered(plugin.name):<EOL><INDENT>raise ValueError("<STR_LIT>".format(plugin.name))<EOL><DEDENT>self._plugins.append(plugin)<EOL>
Register a plugin. New plugins are added to the end of the plugins list.

:param samtranslator.plugins.BasePlugin plugin: Instance/subclass of BasePlugin class that implements hooks
:raises ValueError: If plugin is not an instance of samtranslator.plugins.BasePlugin or if it is already
    registered
:return: None