  Learning language of protein sequences, which captures non-local interactions
between amino acids close in the spatial structure, is a long-standing
bioinformatics challenge, which requires at least context-free grammars.
However, complex character of protein interactions impedes unsupervised
learning of context-free grammars. Using structural information to constrain
the syntactic trees proved effective in learning probabilistic natural and RNA
languages. In this work, we establish a framework for learning probabilistic
context-free grammars for protein sequences from syntactic trees partially
constrained using amino acid contacts obtained from wet experiments or
computational predictions, whose reliability has substantially increased
recently. Within the framework, we implement the maximum-likelihood and
contrastive estimators of parameters for simple yet practical grammars. Tested
on samples of protein motifs, grammars developed within the framework showed
improved precision in recognition and higher fidelity to protein structures.
The framework is applicable to other biomolecular languages and beyond wherever
knowledge of non-local dependencies is available.
