Abstract
Motivation Convolutional neural network (CNN) has been widely used in functional motifs identification for large-scale DNA/RNA sequences. Currently, however, the only way to interpret such a convolutional kernel is a heuristic construction of a position weight matrix (PWM) from fragments scored highly by that kernel.
Results Instead of using heuristics, we developed a novel, exact kernel-to-PWM transformation whose equivalency is theoretically proven: the log-likelihood of the resulting PWM generating any DNA/RNA sequence is exactly the sum of a constant and the convolution of the original kernel on the same sequence. Importantly, we further proved that the resulting PWM’s performance on sequence classification/regression can be exactly the same as the original kernel’s under popular CNN frame-works. In simulation, the exact transformation rivals or outperforms the heuristic PWMs in terms of classifying sequences with sequence- or structure-motifs. The exact transformation also faithfully reproduces the output of CNN models on real-world cases, while the heuristic one fails, especially on the case with little prior knowledge on the form of underlying true motifs. Of note, the time complexity of the novel exact transformation is independent on the number of input sequences, enabling it to scale well for massive training sequences.
Availability Python scripts for the transformation from kernel to PWM, the inverted transformation from PWM to kernel, and a proof-of-concept for the maximum likelihood estimation of optimal PWM are available through https://github.com/gao-lab/kernel-to-PWM.
Contact gaog{at}mail.cbi.pku.edu.cn