DeepLoc: Protein Localization Prediction
DeepLoc: Protein Localization Prediction
doi: 10.1093/bioinformatics/btx431
Advance Access Publication Date: 7 July 2017
Original Paper
Sequence analysis
Abstract
Motivation: The prediction of eukaryotic protein subcellular localization is a well-studied topic in
bioinformatics due to its relevance in proteomics research. Many machine learning methods have
been successfully applied in this task, but in most of them, predictions rely on annotation of homo-
logues from knowledge databases. For novel proteins where no annotated homologues exist, and
for predicting the effects of sequence variants, it is desirable to have methods for predicting protein
properties from sequence information only.
Results: Here, we present a prediction algorithm using deep neural networks to predict protein sub-
cellular localization relying only on sequence information. At its core, the prediction model uses a
recurrent neural network that processes the entire protein sequence and an attention mechanism
identifying protein regions important for the subcellular localization. The model was trained and
tested on a protein dataset extracted from one of the latest UniProt releases, in which experimen-
tally annotated proteins follow more stringent criteria than previously. We demonstrate that our
model achieves a good accuracy (78% for 10 categories; 92% for membrane-bound or soluble), out-
performing current state-of-the-art algorithms, including those relying on homology information.
Availability and implementation: The method is available as a web server at [Link]
dk/services/DeepLoc. Example code is available at [Link]
ization. The dataset is available at [Link]
Contact: jjalma@[Link]
C The Author 2017. Published by Oxford University Press. All rights reserved. For Permissions, please e-mail: [Link]@[Link]
V 3387
3388 [Link] Armenteros et al.
recently. In this paper we take advantage of progress in deep learn- test set, which results in overly optimistic performances that do not
ing, specifically recurrent neural networks (RNNs) with long short- reflect the true generalization to new unseen proteins. An example
term memory (LSTM) cells, attention models and convolutional of a state-of-the-art method that uses this dataset set is Sherloc2,
neural networks (CNNs), to propose an end-to-end sequence-based which reports an accuracy of 93% for 11 locations.
model. LSTMs contain memory cells that can hold information This paper has four major contributions:
from past inputs to the network for in principle an arbitrary number
1. We construct a new dataset from a recent version of UniProt
of positions (Hochreiter and Schmidhuber, 1997). Attention
where proteins have experimental evidence for their subcellular
(Bahdanau et al., 2014) makes it possible to detect sorting signals in
locations according to the new stricter definition. We perform
proteins regardless of their position in the sequence. In addition,
stringent homology partitioning to avoid overfitting, providing
CNNs are able to train filters that detect short motifs in the input se-
realistic accuracy measures on new proteins.
quence irrespectively of where they occur, and have shown promis-
2. We show that models trained on the Höglund dataset have poor
ing performance for protein subcellular localization when combined
sequence lengths were used. The networks applies a recurrent calcu- two separate RNNs and the input to the final classifier is then the
lation at each sequence position t concatenated outputs of the last hidden state of both RNNs. The
forwards and backwards RNNs will then be better at remembering
ht ¼ fE ðxt ; ht1 Þ; t ¼ 1 . . . L (2)
motifs in the C-terminus and N-terminus respectively. Nevertheless,
where fE is an RNN denoted the encoder, xt is the input features of for long sequences these algorithms still have to remember informa-
X at position t and h ¼ ½h1 ; . . . ; hL is the hidden states of the RNN tion across many steps. To solve this problem, as well as identify
where ht is a vector of same length as the number of hidden units in protein regions important for classification, we augmented the bidir-
the RNN. The encoder can be viewed as a trainable feature extrac- ectional RNN encoder with an attentive decoder (Bahdanau et al.,
tor encoding the amino acid sequence into a feature space suitable 2014). Using the last hidden state of the encoder hL as input the at-
for subcellular localization prediction. Naively, the final subcellullar tentive decoder fD is run for D decoding steps. Note that D does not
location y could be predicted by applying a classifier fy to the final depend on the input sequence length L. At each step, the hidden
hidden state of the encoder hL state of the attentive decoder d r is used by an attention function fA
to assign a normalized importance weight to each sequence position
y ¼ fy ðhL Þ : (3) of the encoder hidden states h ¼ ½h1 ; . . . ; hL as
However, this approach is not ideal for several reasons. Firstly the d r ¼ fD ðhL ; d r1 ; cr1 Þ; r ¼ 1 . . . D (4)
RNN has to remember all useful information across the entire, often
very long, input sequence. In subcellular localization this is espe- et;r ¼ fA ðht ; d r Þ ¼ tanhðht W e þ d r1 W d ÞvT (5)
cially problematic since most of the information is known to reside
in the beginning (N-terminus) and end (C-terminus) of the sequence. exp et;r
Secondly all information about the protein has to be compressed at;r ¼ ; (6)
P
L
into the same size vector regardless of the length of the protein. exp et0 ;r
t0 ¼1
Two different solutions were used to alleviate these problems,
Bidirectional RNNs and Attention RNNs. In bidirectional RNNs, where d r is the hidden state of the decoder at step r, matrices W d
the protein sequence is processed both forwards and backwards by and W e and column vector v are the trainable parameters of the
3390 [Link] Armenteros et al.
attention function. d r is vector of same size as the number of hidden PðyjXÞ ¼ PðyjB; XÞPðBjA; XÞpðAjXÞ : (9)
units in the decoder LSTM, which can be different from the dimen-
An example path is A ¼ Non-Secretory Pathway, B ¼ N-terminal
sionality of the encoder ht . at;r is the normalized importance weights
Sequence and y ¼ Mitochondria. Each of the nine binary classifiers
and cr is a weighted average of the encoder RNN hidden states cal-
is implemented by a logistic output connected to the fully connected
culated as
dense layer. By construction, the tree probabilities are normalized
P
X y pðyjXÞ ¼ 1.
L
cr ¼ at;r ht : (7)
t¼1
2.3 Datasets
The initial value of cr , i.e. c0 , is a learned parameter vector that is 2.3.1 DeepLoc dataset
trained as part of the neural network model. The subcellular local- The protein data used to train DeepLoc were extracted from the
ization is then predicted using the weighted average of the encoder UniProt database, release 2016_04 (The UniProt Consortium,
Table 1. Number of proteins in each location and sublocations that were grouped together under the same main location
Nucleus 4043 Envelope, inner and outer membrane, matrix, lamina, chromosome, nucleus speckle
Cytoplasm 2542 Cytoplasm (cytosol and cytoskeleton)
Extracellular 1973 Extracellular
Mitochondrion 1510 Envelope, inner and outer membrane, matrix, intermembrane space
Cell membrane 1340 Apical, apicolateral, basal, basolateral, lateral, cell membrane, cell projection
Endoplasmic reticulum (ER) 862 ER membrane and lumen, microsome, rough ER, smooth ER, Sarcoplasmic reticulum
Plastid 757 Plastid membrane, stroma and thylakoid
Golgi apparatus 356 Golgi apparatus membrane and lumen
Lysosome/Vacuole 321 Contractile, lytic and protein storage vacuole, vacuole lumen and membrane, lysosome lumen and
membrane
Peroxisome 154 Peroxisome matrix and membrane
Prediction of protein subcellular localization using deep learning 3391
2.4 Comparison to current prediction algorithms never optimized any parameters on the test set leaving the reported
The performance of our models were compared with a number of performances unbiased.
current prediction algorithms using the following approaches: To decrease the training time, the maximum protein length was
LocTree2 (Goldberg et al., 2012), MultiLoc2 (Blum et al., 2009) 1000. If a protein exceeded this length, amino acids from the middle
and SherLoc2 (Briesemeister et al., 2009) were run with local of the sequence were removed in order to not to lose information
command-line versions installed on our own server, while CELLO about the N-terminal and C-terminal sorting signals. 9.98% of the
(Yu et al., 2006), iLoc-Euk (Chou et al., 2011) and WoLF PSORT proteins were truncated using this rule.
(Horton et al., 2007) were run on their web servers. YLoc The performance measurements used to assess the performance
(Briesemeister et al., 2010) was run offline by the maintainer of the of our models were accuracy and the Gorodkin measure (Gorodkin,
web service. Results for YLoc are given with the option to include 2004). For the binary prediction, the accuracy and the Matthew’s
GO terms turned on. For MultiLoc2 and SherLoc2, a newer version Correlation Coefficient (Matthews, 1975) (MCC) were used. The
of InterProScan (5.21-60) was used instead of the recommended one Gorodkin measure can be seen as a generalization of MCC that
comparison with a single decoding step. Increasing the decoding prediction accuracy we trained an ensemble of 16 models using
steps beyond 10 resulted in a reduction in the accuracy. Lastly, the nested cross validation. Eight of the models were trained using a
A-BLSTM models predicted whether the proteins were membrane- softmax output distribution (class probability from softmax func-
bound or soluble with accuracies of 0.9163 and 0.9111 respectively. tion) and eight of the models using the hierarchical tree distribution
From the amino acid encoding comparison, we found that the (joint probability of multiple logistic functions). Further we mitigate
CONV A-BLSTM model using protein profiles encoding had the the effect of the class imbalances by using a cost matrix (Zhou and
highest accuracy, with a difference of 2% compared to the A- Liu, 2006) to recalculate the class probabilities based on the number
BLSTM model. Therefore, we decided to use this encoding and this of samples in the training set. The full ensemble achieved an accur-
model for the rest of the experiments. acy of 0.7797 and Gorodkin of 0.7347 on the subcellular localiza-
tion and an accuracy of 0.9234 and a MCC of 0.8435 on the
3.2 Dataset comparison membrane-bound or soluble prediction. We found that the softmax
To compare the generalization performance of models trained on either models had a slightly higher accuracy than the hierarchical tree
Fig. 2. t-SNE representation of the context vector cr for a Conv A-BLSTM trained on the DeepLoc and Höglund dataset and visualized for the respective test sets
Prediction of protein subcellular localization using deep learning 3393
Table 5. Confusion matrix of the test set on the final DeepLoc model using profiles encoding
Table 6. Confusion matrix for the membrane-bound predictor proteins, which generates a model that learns to predict the wrong
labels. Secondly, the homology reduction threshold 80% used for
Type Number of predicted proteins constructing the Höglund dataset might not be stringent enough,
since it produces similar training and test examples.
Soluble 968 38
Membrane-bound 96 647 In Figure 2, we compared the attention context vector for models
trained on either the DeepLoc or Höglund datasets. For the
Höglund trained model, all locations are almost perfectly separated
subcellular localization and an accuracy of 0.9130 and a MCC of implying that there is little variation within the Höglund dataset
0.8237 on the membrane-bound or soluble prediction. By omitting classes and that the training and test sets are relatively similar. This
the profile generation, we achieved a faster prediction at the cost of supports the finding of poor generalization performance for models
decrease in accuracy. trained on the Höglund dataset. Hence, we believe that the high per-
Tables 5 and 6 show the confusion matrices of the full ensemble formance reported for algorithms trained on this dataset is actually
described above for subcellular localization and membrane-bound results from overfitting. The true variation within each protein class
prediction respectively. The primary sources of error are confusion is larger as indicated by the better generalization performance for
of the nucleus and cytoplasm, lysosome/vacuole misclassified as cell- models trained on the DeepLoc dataset. This is further corroborated
membrane and Golgi misclassified as cytoplasm. In Figure 3, we by the poorer separation of classes for the DeepLoc trained models
show the attention vector a, i.e. how important different regions of in the same figure.
the sequence are for the classification. In general, the DeepLoc We compared the performance of the final DeepLoc model with
model assigns large importance to the N-terminal for secreted pro- other current prediction algorithms in Table 7. We found that the
teins whereas e.g. membrane proteins have regions of importance DeepLoc model performs significantly better than the other
interspersed across the protein length. approaches. Here we note that the DeepLoc performance is a true
To compare the performance of the final DeepLoc model to test set performance, whereas the performances of the other meth-
other approaches we benchmarked a number of current prediction ods may be overestimated since some sequences in our test set may
algorithms on the DeepLoc test set as seen in Table 7. The accuracy have been included in their training sets. Further we emphasize that
of the final DeepLoc model (0.7797) is significantly better than all the DeepLoc method is a purely sequence-based method and does
other methods with iLoc-Euk achieving the second best accuracy of not rely on annotation information from homologous proteins. Due
0.6820. to the stringent homology partitioning applied in the dataset con-
struction, the model should generalize to new proteins without
known close homologues.
4 Discussion We note that we also compared the performance against the
In this paper we have introduced the DeepLoc dataset: a well LocTree3 prediction method (Goldberg et al., 2014), which is a
assembled protein collection with reliable subcellular localization in- combination of LocTree2 and a BLAST search of a database of pro-
formation. Secondly we have provided a deep neural network based teins with known subcellular location. However, as 75% of the pro-
prediction algorithm achieving state-of-the-art performance on this teins in the DeepLoc test set are also in the LocTree3 BLAST
new dataset. The context-dependent annotation vector generated by database, the measured accuracy was artificially high at 91%, since
the attention mechanism is able to represent a protein based on its LocTree3 simply retrieves the same subcellular location used for
subcellular localization. In addition, the attention based prediction labelling our test set.
method allows visualization of the biologically plausible regions The compartment specific prediction performance of the final
used to predict the subcellular localization of the proteins which we DeepLoc model is shown in Table 5. The main source of error is the
believe will provide relevant information. low performance on the Golgi apparatus, lysosome/vacuole and per-
The comparison of the generalization performances for models oxisome. One possible cause is the low number of samples used to
trained on our new DeepLoc dataset and the Höglund dataset train these classes. However, this finding could also be associated
showed that DeepLoc trained models generalized much better than with the similarity between the proteins from these locations and
the Höglund trained model. Here we discuss a number of explan- other compartments. For example, Table 5 shows that the lysosome/
ations for these findings. Firstly, with the Uniprot database change vacuole is usually misclassified as cell membrane and the peroxi-
the Höglund dataset could contain many wrongly annotated some as cytoplasm.
3394 [Link] Armenteros et al.
Table 7. Accuracy and Gorodkin measure achieved by current Figure 3 allows us to visualize what regions in the sequence are
predictors and the final DeepLoc model on the DeepLoc test set relevant for each subcellular localization to perform the prediction.
For the extracellular proteins, the model focuses mainly on the signal
Method Accuracy Gorodkin
peptide, which can be seen as a small region at the N-terminus of the
LocTree2 0.6120 0.5250 sequence. In contrast, the attention is scattered across the sequence for
MultiLoc2 0.5592 0.4869 plasma membrane proteins, which could indicate that the algorithm is
SherLoc2 0.5815 0.5112 detecting the transmembrane helices. For the ER proteins we can see
YLoc 0.6122 0.5330 attention at the N-terminus, where the signal peptide is located, and
CELLO 0.5521 0.4543 also some attention at the C-terminus, which could mean the presence
iLoc-Euk 0.6820 0.6412
of KDEL or KKXX signals. Golgi proteins have the importance on the
WoLF PSORT 0.5671 0.4785
N-terminus slightly shifted to the right, in comparison with other pro-
DeepLoc 0.7797 0.7347
teins from the secretory pathway, as they are mostly type II transmem-
The highest scores are shown in bold. brane proteins with signal anchors. Mitochondrial and chloroplastic
proteins have large regions at the N-terminus, which clearly correlates
to the mitochondrial and chloroplastic transit peptides. The lyso-
In addition to the mentioned under-represented classes, proteins
somal/vacuolar proteins do not seem to have a clear important region
from the cytoplasm and nucleus are also difficult to differentiate
across their sequences. Finally, for peroxisomal proteins, some regions
(Fig. 2, Table 4) because they both lack N-terminal sorting signals.
at the N-terminus and at the C-terminus are observed, which could
The only difference between them is the nuclear localization signal
mean that the model is detecting PTS2 and PTS1 signals.
(NLS), which is a highly variant short sequence that can be located
in multiple regions of the protein sequence, making it hard to recog-
nize. Figure 3 shows the positions in the sequence that the attention
mechanism focuses on to generate the attention context vector cr.
For the nucleic and cytoplasmic proteins, the model focuses on the
5 Conclusion
beginning of the sequence (checking for the absence of an N-ter- We have shown that convolutional BLSTM neural networks with at-
minal sorting signal). Moreover, the model also gives importance to tention mechanism are able to accurately predict the protein subcellular
small regions across the sequence. The main difference is that there localization and if a protein is membrane-bound or soluble just using
is a higher density of these regions in nucleus examples than in cyto- the sequence information. Further we have introduced the DeepLoc
plasm, which could indicate that the model is able to identify some dataset. The DeepLoc model trained on this dataset is able to generalize
of the most represented NLS. better than using previous datasets for subcellular localization. In
Prediction of protein subcellular localization using deep learning 3395
addition, DeepLoc obtained the highest accuracy using the independent Dieleman,S. et al. (2015) Lasagne: First Release. Geneva, Switzerland,
test set, when compared with the current methods. Zenodo.
There are several perspectives of this project that we would like Emanuelsson,O. et al. (2007) Locating proteins in the cell using TargetP,
SignalP and related tools. Nature Protoc., 2, 953–971.
to pursue in the future. One of those is to make better use of existing
Goldberg,T. et al. (2012) LocTree2 predicts localization for all domains of
knowledge about sorting signals. DeepLoc 1.0 is trained in a rela-
life. Bioinformatics, 28, i458–i465.
tively ‘naive’ way, where the networks have been provided only
Goldberg,T. et al. (2014) Loctree3 prediction of localization. Nucleic Acids
with protein profiles and their location labels. It would be beneficial Res., 42, W350–W355.
to explicitly model known sorting signals such as N-terminal signal Gorodkin,J. (2004) Comparing two k-category assignments by a k-category
peptides and transit peptides. correlation coefficient. Comput. Biol. Chem., 28, 367–374.
In addition, it should be investigated whether performance can Henikoff,S. and Henikoff,J.G. (1992) Amino acid substitution matrices from
be enhanced by training several models with a narrower taxonom- protein blocks. Proc. Natl. Acad. Sci. USA, 89, 10915–10919.
ical scope instead of treating all eukaryotes by one model. Hobohm,U. et al. (1992) Selection of representative protein data sets. Protein