Paul Brennan1. 1. Centre for Medical Education, School of Medicine, Cardiff University, Cardiff, Wales, UK.
Abstract
Protein schematics are valuable for research, teaching and knowledge communication. However, the tools used to automate the process are challenging. The purpose of the drawProteins package is to enable the generation of schematics of proteins in an automated fashion that can integrate with the Bioconductor/R suite of tools for bioinformatics and statistical analysis. Using UniProt accession numbers, the package uses the UniProt API to get the features of the protein from the UniProt database. The features are assembled into a data frame and visualized using adaptations of the ggplot2 package. Visualizations can be customised in many ways including adding additional protein features information from other data frames, altering colors and protein names and adding extra layers using other ggplot2 functions. This can be completed within a script that makes the workflow reproducible and sharable.
Protein schematics are valuable for research, teaching and knowledge communication. However, the tools used to automate the process are challenging. The purpose of the drawProteins package is to enable the generation of schematics of proteins in an automated fashion that can integrate with the Bioconductor/R suite of tools for bioinformatics and statistical analysis. Using UniProt accession numbers, the package uses the UniProt API to get the features of the protein from the UniProt database. The features are assembled into a data frame and visualized using adaptations of the ggplot2 package. Visualizations can be customised in many ways including adding additional protein features information from other data frames, altering colors and protein names and adding extra layers using other ggplot2 functions. This can be completed within a script that makes the workflow reproducible and sharable.
Entities:
Keywords:
BIOCONDUCTOR; R package; protein; schematic; visualization.
Protein schematics are abundant in research papers, reviews, text books and on the internet
[1]. Thus, they represent one of the most common molecular visualizations shown and seen by researchers and students. Constructing protein schematics is often time consuming and is not performed in a reproducible and easily shared manner. The schematics frequently reflect domain expertise, but often also reflect the opinions of an individual researcher in a manner that is not obvious.There are solutions in other languages: a Java and JavaScript tool
[1,
2] that can be used for protein visualization. For visualization on the internet, there is also the BioJS solution, which can be used for proteins
[3]. Both of these tools are useful but not easily integrated into the Bioconductor workflow. The
GenVisR package contains the option to produce highly customisable publication-quality graphics for genomic data
[4]. The focus on genomic data reduces the usefulness of drawing protein schematics, particularly those illustrating multiple proteins and protein families.For these reasons, a protein visualization package was produced using R to allow compatibility with the Bio- conductor suite of bioinformatics packages. It uses the UniProt Proteins API
[5,
6] as a resource of protein features and the
ggplot2 package
[7] as a basis for drawing the schematics. Multiple proteins can be drawn from similar or different families. The only limitation is the availability of UniProt entries.Schematic customisation is possible. Protein chains, domains, regions, motifs or phosphorylation sites can be drawn separately or together. Colors can be altered and protein names (labels) can be changed. All of this can be done in a scripted manner that facilitates code sharing, visualization reproducibility and good practice in scientific computing
[8].
Methods
System requirements
The Bioconductor pacakge, drawProteins, is designed to work with Bioconductor 3.7 and R version 3.5.
Implementation
This package has been created to allow the creation of protein schematics based on the data obtained from the Uniprot Protein Database.The basic workflow of drawProteins is:To provide one or more Uniprot IDsGet a list of feature from the Uniprot APIDraw the chains of the proteinsAdd features as desireddrawProteins uses the package httr to interact with the Uniprot API and extract a JSON object into R. The JSON object is used to create a data frame. Adaptations of the graphing package
ggplot2 are then used to create the protein schematic.
Operation
Currently, drawProteins obtains the protein feature information from the UniProt Protein API
[5,
6]. At least one working Uniprot accession number must be provided. More than one can be provided but they must be in the same vector, separated by a space. The space is replaced to create a url that can be used to query the Uniprot API
[9].The
get_features() function uses the Uniprot API to return the features of a protein - the chain, domain information and other annotated features such as “repeats” and “motifs”. Post-translational modifications, such as phosphorylations, are also provided by the UniProt API.The
httr::content() function is then used to extract the content. From the
get_features() function, this will provide lists of lists. The length of the parent lists corresponds to the number of accession numbers provided. Interestingly, the order is different to that of the UniProt accession numbers provided. The lists inside the parent list are a list of six, one for each protein, that contains names of the proteins and the features.As an example, the script below will retrieve, from UniProt, the details of a the human version of a protein called
RelA or NF-kappaB, p65, a well-studied transcription factor
[10].With internet access, this can be retrieved from Uniprot with this code:The next step in the workflow is to convert the data from the Uniprot API into a dataframe that can be used with ggplot2.The
feature_to_dataframe() function will convert the list of lists of six provided by the
get_features() function to a dataframe, which can then be used to plot the schematics.The
feature_to_dataframe() function will also add an “order” value to allow plotting. The order goes from the bottom in the manner of a graph.The rel_data object is a data frame with 9 variables and observations that include protein features. The variables are show below. A data frame of this type could be created independently of UniProt.The first step is to create the plot area with the
draw_canvas() function. The x-axis of the canvas is based on the length of the protein (or the longest protein in the case of drawing multiple proteins). The y-axis is based on the number of proteins being drawn. The
draw_canvas() function requires a data frame.Usually, the next step is to draw the protein chains using the
draw_chains() function. This requires a ggplot2 object and a data frame in that order. The data frame does not have to be the same as that used for
draw_canvas() but must contain the variables
type, description, begin, end, entryName, order.Protein domains can be added with the
draw_domains() function, which also requires a ggplot2 object and a data frame in that order. Again, the data frame does not have to be the same as that obtained from UniProt but must contain the variables
type, description, begin, end, and order. Thus custom domains can be added with the
draw_domains() function. Note that the chain and the domain are drawn to scale in terms of their number of amino acids (
Figure 1).
Figure 1.
Protein domain schematic of RelA/p65.
The default output gives a grey background and labels the domain. RHD = Rel Homology Domain.
Protein domain schematic of RelA/p65.
The default output gives a grey background and labels the domain. RHD = Rel Homology Domain.To show this visualization better, a white background helps, as does removing the y-axis and the grid (
Figure 2). Changing the size of the text using the base_size argument also aids visualization. This can be done with this code:
Figure 2.
Protein domain schematic of RelA/p65.
The background can be customized using theme functions from ggplot2. RHD = Rel Homology Domain.
The background can be customized using theme functions from ggplot2. RHD = Rel Homology Domain.
Use cases
Putting the RelA workflow together and adding titles
The UniProt API provides information on protein regions, protein motifs and protein phosphorylation sites. By using the functions shown in the script below, it is possible to show the features of the protein desired to create. Altering colors and adding customisation is possible.For the human protein RelA, also known as the p65 subunit of NFkappaB, a transcription factor with diverse functions including a role in leukaemia, inflammation and cancer, here is a good workflow that generates a nice schematic of the protein showing domains and phosphorylation sites (
Figure 3).
Figure 3.
More detailed protein domain schematic of RelA/p65.
By drawing the domains, regions and motifs a more detailed protein schematic is generated. RHD = Rel Homology Domain; TAD = Transactivation Domain. Yellow circles denote phosphorylation sites.
More detailed protein domain schematic of RelA/p65.
By drawing the domains, regions and motifs a more detailed protein schematic is generated. RHD = Rel Homology Domain; TAD = Transactivation Domain. Yellow circles denote phosphorylation sites.
Drawing schematic for multiple proteins
With internet access, the script below shows the workflow and generates a visualization of the five human proteins of the NF-kappaB transcription factor family (
Figure 4).
Figure 4.
Protein domain schematic of human NF-kappaB proteins.
The five members of the NF-kappaB transcription factors family can be illustrated by drawing the domains, regions and motifs as detailed on the UniProt database. The lengths of the chains, domains and motifs are proportional to the number of amino acids. RHD = Rel Homology Domain; TAD = Transactivation Domain. Yellow circles denote phosphorylation sites.
Protein domain schematic of human NF-kappaB proteins.
The five members of the NF-kappaB transcription factors family can be illustrated by drawing the domains, regions and motifs as detailed on the UniProt database. The lengths of the chains, domains and motifs are proportional to the number of amino acids. RHD = Rel Homology Domain; TAD = Transactivation Domain. Yellow circles denote phosphorylation sites.The proteins, domains and phosphorylation sites (yellow circles) are drawn and positioned according to amino acid number.
Working with BioMart
It is possible to use bioMart
[11,
12] to pull out the UniProt accession numbers for a Gene Ontology (GO) term. For example, the GO term for “MAP kinase activity”. This has a GO number of
GO:0004707. This example script borrows heavily on the biomaRt users guide written by Steffen Durinck, Wolfgang Huber and Mike Smith
[13]. The script below generates a visualization containing 14 protein schematics (
Figure 5).
Figure 5.
Protein domain schematic of human MAP kinases.
Using bioMart with the Gene Ontology term for "MAP kinase activity", it is possible to draw multiple human MAP kinases using data from UniProt. Yellow circles denote phosphorylation sites.
Protein domain schematic of human MAP kinases.
Using bioMart with the Gene Ontology term for "MAP kinase activity", it is possible to draw multiple human MAP kinases using data from UniProt. Yellow circles denote phosphorylation sites.
Customizing the draw functions
Various customizations are possible:Alter chain color and outline.Change the labels to a custom list (but remember that the plots are drawn from the bottom up)Change the size and color of the phosphorylation symbols.These are illustrated with the script below which generates
Figure 6.
Figure 6.
Customizing the protein schematic of the NF-kappaB family.
Using arguments in the draw_chains() and draw_phospho() functions, it is possible customize colors and labels.
Customizing the protein schematic of the NF-kappaB family.
Using arguments in the draw_chains() and draw_phospho() functions, it is possible customize colors and labels.
Discussion
After 20 years of manual drawing of protein schematics and experience in proteomic studies
[14–
17], the need for a more sustainable and programmatic method seemed important and worthwhile. It seemed wise to develop an approach that would integrate protein visualizations with other bioinformatic tools available in Bioconductor. This package represents an approach to enabling the reproducible and programmatic generation of protein schematics.The plan is to develop this package further in terms of generating use cases and adding features. A list of issues for future development has already been added by the author on
GitHub. Bug reports, feedback on desired features or code contributions can be made through
GitHub.The challenge with protein visualization is that specialist domain knowledge sometimes trumps databases. Thus, while integrating knowledge from UniProt is an excellent starting point, it is also essential to allow customisation of plots. This can be done by adding or removing information about the proteins, protein features and post-translational modification to the dataframe object made with R.
Data availability
All data underlying the results are available as part of the article and no additional source data are required.
Software availability
The drawProteins package is available at:
http://bioconductor.org/packages/drawProteins/Source code is available at:
https://github.com/brennanpincardiff/drawProteinsArchived source code as at time of publication:
https://github.com/brennanpincardiff/drawProteins/tree/v1.0.2 and
https://doi.org/10.5281/zenodo.1306619
[18]License: MIT+The author describes the creation of a Bioconductor/R package for generic visualization of 2D protein diagrams. The tool does not address 3D visualizations or visualization of protein sequences or alignments. Rather it allows the user to view the position of protein annotations within an arbitrary number of proteins. By default, UniProt sequence identifiers and associated annotations are supported. The demonstrated examples depict protein domains/motifs and phosphorylation sites. Identifying a set of proteins to view from the Gene Ontology via bioMart is also demonstrated. There are likely to be many additional useful queries that could be achieved by similar bioMart queries.The package leans on ggplot2 functionality for the actual drawing of each protein schematic. The drawings consist of simple elements: colored rectangles and circles that can be nested, overlaid, and labeled. A few simple use cases are illustrated. The writing is brief and straightforward. The code is available under an open access document.I was able to install the package and run through the examples in the paper in a few minutes with only minor difficulties.In particular, I had trouble getting this line to work in the example:```output <- getBM(attributes = c('uniprotswissprot', 'hgnc_symbol'), filters = 'go', values = 'GO:0004707', mart = ensembl)```Perhaps some problem with the way the single quotes are being encoded in that section?Overall the tool is quite basic but also appears to be customizable. I anticipate it could be useful to many who wish to automate visualization of protein drawings and integrate these with visualization of various types omics data.I have read this submission. I believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.The paper describes a protein annotation visualization tool for R/Bioconductor that has already been in use for more than a year. The software is mature, I was able to install it easily, all the examples of code in the manuscript are functional. I only noticed a small deviation in the biomaRt example, most likely caused by slightly different data returned by biomaRt.The manuscripts describes the purpose and functioning of the package in sufficient detail. However, I found the introduction a bit too brief, especially in terms of mentioning other similar software and advantages of drawProteins. For example, I found a Bioconductor package called Pviz that may be able to generate protein annotation visualizations.As a minor remark, the last sentence in this paragraph on page 3 seems unclear to me:"The feature_to_dataframe() function will also add an “order” value to allow plotting. The order goes from the bottom in the manner of a graph."Finally, a suggestion. The software would be even more useful if it could handle reading and writing of standard protein annotation files in GFF or similar format. UniProt wikipedia page describes how it is applied to proteins in this example: https://www.uniprot.org/uniprot/P0A7B8.gff Although GFF is much more popular with genomic data, it seems to be ocassionally used for annotating protein sequences.I have read this submission. I believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.
Authors: Zachary L Skidmore; Alex H Wagner; Robert Lesurf; Katie M Campbell; Jason Kunisaki; Obi L Griffith; Malachi Griffith Journal: Bioinformatics Date: 2016-06-10 Impact factor: 6.937
Authors: Fredrik Salmen; Joachim De Jonghe; Tomasz S Kaminski; Anna Alemany; Guillermo E Parada; Joe Verity-Legg; Ayaka Yanagida; Timo N Kohler; Nicholas Battich; Floris van den Brekel; Anna L Ellermann; Alfonso Martinez Arias; Jennifer Nichols; Martin Hemberg; Florian Hollfelder; Alexander van Oudenaarden Journal: Nat Biotechnol Date: 2022-06-27 Impact factor: 68.164
Authors: Paul E Gray; Bethany A Pillay; Stuart G Tangye; Jin Yan Yap; William A Figgett; John Reeves; Sarah K Kummerfeld; Jennifer Stoddard; Gulbu Uzel; Huie Jing; Helen C Su; Dianne E Campbell; Anna Sullivan; Leslie Burnett; Jane Peake; Cindy S Ma Journal: J Clin Immunol Date: 2021-10-17 Impact factor: 8.542
Authors: Nandan P Deshpande; Stephen M Riordan; Claire J Gorman; Shaun Nielsen; Tonia L Russell; Carolina Correa-Ospina; Bentotage S M Fernando; Shafagh A Waters; Natalia Castaño-Rodríguez; Si Ming Man; Nicodemus Tedla; Marc R Wilkins; Nadeem O Kaakoush Journal: Genome Med Date: 2021-08-19 Impact factor: 11.117
Authors: Daniel Wells; Emmanuelle Bitoun; Daniela Moralli; Gang Zhang; Anjali Hinch; Julia Jankowska; Peter Donnelly; Catherine Green; Simon R Myers Journal: Elife Date: 2020-08-03 Impact factor: 8.140
Authors: Nicholas D Leigh; Sofia Sessa; Aline C Dragalzew; Duygu Payzin-Dogru; Josane F Sousa; Anthony N Aggouras; Kimberly Johnson; Garrett S Dunlap; Brian J Haas; Michael Levin; Igor Schneider; Jessica L Whited Journal: Evol Dev Date: 2020-03-12 Impact factor: 2.839
Authors: Ismael Lamas-Toranzo; Noelia Fonseca Balvís; Ana Querejeta-Fernández; María José Izquierdo-Rico; Leopoldo González-Brusi; Pedro L Lorenzo; Pilar García-Rebollar; Manuel Avilés; Pablo Bermejo-Álvarez Journal: Elife Date: 2019-10-22 Impact factor: 8.140