Cool stuff the Ensembl VEP can do: write your own plugin

Plugins can be an excellent way to extend the functionality of the VEP. They can be used to look-up information in external databases or use the Ensembl API to add to or filter your VEP output. Many plugins have already been written, both by us and external groups, but with a bit of Perl you can easily write your own.

If you just want to look up values in a custom file, then you may not need a plugin for this and can just use custom annotations. Similarly, if you’re just filtering by the values that are already in the results, there’s an existing script for this. Plugins really come into their own when you want to look up values in databases, use custom logic to extract data from flatfiles, or alter things based on the VEP results or what you find in the database.

A great example of an existing plugin is the Downstream plugin. It prints the downstream protein sequence of a frameshift variant. To do this, it pulls in the consequence from the VEP result, if the consequence is frameshift, it then finds the transcript, gets the sequence, inserts/deletes the relevant base(s) then prints the translation of the variant transcript. To do this, it makes use of the Ensembl Variation Perl API to get the transcript variation object, and BioPerl to translate and print the sequence.

Like this plugin, your own plugin can access any publicly available databases and make use of existing Perl modules. The best place to start with plugins is to look at what is already available, there might be one that already does what you need it to, or close enough that you can easily cannibalise it to your own needs. If you need to start from scratch, we have some hints and tips available.

In the spirit of open source, if you’ve made a plugin you think would be generally useful to the community, we are happy accept pull requests to our GitHub repository or to just promote it on our plugins page, attributing it to you of course. Just let us know.