Convolutional neural networks (CNNs) have been shown to perform exceptionally well in a variety of tasks, including biological sequence classification. Available implementations, however, are usually optimized for a particular task and difficult to reuse. To enable researchers to utilize these networks more easily we implemented pysster, a Python package for training CNNs on biological sequence data. Sequences are classified by learning sequence and structure motifs and the package offers an automated hyper-parameter optimization procedure and options to visualize learned motifs along with information about their positional and class enrichment. The package runs seamlessly on CPU and GPU and provides a simple interface to train and evaluate a network with a handful lines of code. Using an RNA A-to-I editing data set and CLIP-seq binding site sequences we demonstrate that pysster classifies sequences with higher accuracy than other methods and is able to recover known sequence and structure motifs. pysster is freely available at https://github.com/budach/pysster.
Develop a Python-based framework for training convolutional neural networks on biological sequence data.
Main points
Pysster is Python package for training convolutional neural networks on biological sequences.
Pysster is built on top of TensorFlow and Keras.
Demonstrate the use of Pysster to generate models of
RNA-binding proteins (RBP) binding to RNA sequences
RNA editing in RNA sequences
Pros
Pysster provides a straightforward library for training convolutional neural networks to classify individual biological sequences, and makes it easy to load said sequences from flat files (e.g. FASTAs) and train a model on them.
Pysster supports hyper-parameter optimization.
Pysster can be run on the CPU and GPU. It is unclear if it can be run on other devices supported by tensorflow (e.g. TPU).
Allows user-defined alphabets, and thus extension to new biological sequences.
Pysster supports additional position-wise information in addition to the primary biological sequences being considered.
Pysster allows the user to visualize the motifs in the kernels learned.
In addition to simply visualizing the convolutional filters, Pysster allows the user to determine if a given filter's use when classifying a particular class is localized to a particular region of the input sequences. This is done by a bar plot of the enrichment in kernel activations that are above a threshold at each position in the input sequences.
The authors show how Pysster can be used to visualize the output activation of all of the convolutional filters for a set of sequences. (Figure S2, which presents a heatmap with a row for each kernel and a column for each input sequence). This is interesting, as motif co-occurence seems relevant for problems where protein complex localization (i.e. not just a single protien's being site) is relevant (e.g. splice site disruption)
The authors provide tutorials for using Pysster to reproduce the models from their paper (e.g. the RNA-editing prediction model)
Cons
Beyond grid search, pysster does not seem to support more sophisticated hyperparameter search algorithms or 3rd party hyperparameter search packages
Pysster does not seem to support models for tasks other than classification (e.g. regression, autoencoding).
It is unclear if Pysster can be applied to non-deep learning models, although I imagine that such an extension would only require a little tinkering.
Pysster seems to only support splitting training/validation/testing data by region (e.g. chromosome).
Pysster's data class seems a little rigid, and only seems to support training examples composed of a single fixed-length sequence.
The documentation is provided within the GitHub. A dedicated site with more rich documentation could be easier to navigate and digest.
Preprint: https://doi.org/10.1101/230086 Publication: https://doi.org/10.1093/bioinformatics/bty222