Protein Repeats from First Principles

Some natural proteins display recurrent structural patterns. Despite being highly similar at the tertiary structure level, repeating patterns within a single repeat protein can be extremely variable at the sequence level. We use a mathematical definition of a repetition and investigate the occurrences of these in sequences of different protein families. We found that long stretches of perfect repetitions are infrequent in individual natural proteins, even for those which are known to fold into structures of recurrent structural motifs. We found that natural repeat proteins are indeed repetitive in their families, exhibiting abundant stretches of 6 amino acids or longer that are perfect repetitions in the reference family. We provide a systematic quantification for this repetitiveness. We show that this form of repetitiveness is not exclusive of repeat proteins, but also occurs in globular domains. A by-product of this work is a fast quantification of the likelihood of a protein to belong to a family.

Some natural proteins display recurrent structural patterns. Despite being highly similar at the tertiary structure level, repeating patterns within a single repeat protein can be extremely variable at the sequence level. We use a mathematical definition of a repetition and investigate the occurrences of these in sequences of different protein families. We found that long stretches of perfect repetitions are infrequent in individual natural proteins, even for those which are known to fold into structures of recurrent structural motifs. We found that natural repeat proteins are indeed repetitive in their families, exhibiting abundant stretches of 6 amino acids or longer that are perfect repetitions in the reference family. We provide a systematic quantification for this repetitiveness. We show that this form of repetitiveness is not exclusive of repeat proteins, but also occurs in globular domains. A by-product of this work is a fast quantification of the likelihood of a protein to belong to a family.
Several natural proteins are coded with tandem copies of similar amino acid stretches. These molecules are broadly classified according to the length of the minimal repeating unit 1 . Short repetitions of up to five residues usually form fibrillar structures, while repetitions longer than about 60 residues frequently fold as independent globular domains. There is a class of repetitive proteins, repeat proteins, that lays in between these for which folding of the repeating units is coupled and domains are not obvious to define 2,3 . Despite being highly similar at the tertiary structure level, repeats within a single protein or in different members of a protein family can be extremely variable at the sequence level 4 , complicating the detection and classification of repeats 1 .
There are many methods to identify repeats in sequences. Some are based on the self-alignment of the primary structure 5 and others implement spectral analysis of pseudo-chemical characteristics of the amino acids 6 . Since the same structural motif can be encoded by sequences that seem completely unrelated, it is not surprising that alignment-based methods fail to infer true structural repeats. The solutions to find inexact repeats in sequences 7,8 include alphabet replacements using scoring matrices, sophisticated notions of sequence similarity based on an allowed percentage of mismatches, and elaborated mathematical representations such as Hidden Markov Models. To a very large extent these solutions have been satisfactory. However, these methods rely on the fine-tuning of different parameters in order to account for the inexactness of repeats (thresholds for alphabet scoring matrices, allowed percentage of mismatches, e-values for Hidden Markov Models and others). The definition of what constitutes or not a hit for the model remains subject to determination of some threshold.
In this work we turn to "first principles", using a mathematical definition of repetition, in contrast to the biological repeat, and we consider a repetition finding method with no adjustable parameters. We are not just interested in repetitions, but in maximal repetitions, that we will abbreviate as MR. We give the mathematical definition below, but in the context of a protein sequence, a MR is a block of amino acids that occurs two or more times as perfect copies, and any of its extensions (to the left, to the right or both) occurs fewer times. In case that a protein sequence contains a long block that appears twice, as exactly equal copies except for one letter, then we say that there are two repetitions, one to the left and one to the right of that single letter. It is well known that long stretches of perfect repetitions are infrequent in natural proteins, even in those that fold into structures of recurrent structural motifs. However, we observe that a large portion of a protein sequence can be described by stretches of amino acids that occur in other members of a protein family. Thus, a protein family operates as a catalogue of all the possible variations that a block can adopt in any of its members. We quantify how well a given sequence is covered by the repetitions occurring in its family. The method is implemented efficiently by an algorithm with a O(n log n) computational complexity, where n is the size of the protein sequence being tested plus the size of the family dataset. From this quantification we directly obtain a way to decide if one family is more The familiarity function. We define the familiarity function that measures how much of a given protein sequence is covered by MRs from certain family. The greater the familiarity value, the more likely it is for the protein sequence to belong to the family. We first introduce the classical notion of coverage of a sequence by a set of MRs, which measures the number of positions in the sequence that are covered by the MRs in the set. We write  ⁎ for the set of all sequences over , and ⁎ ( ) P A the set of all the parts of ⁎  , which represents the collection of all the different sets of sequences over . As usual, we write  and  for the set of natural and rational numbers, respectively.    Fig. 1C).

Definition 3 The
The familiarity function measures how much of a sequence is covered by a set of MRs that occur in a family. (see Fig. 1D). If the familiarity function is evaluated with the same sequence in the two arguments, familiarity (s, s) the result tells how much of the sequence s is covered by its own MRs. For example, the familiarity(s 5 , s 5 ) of s 5 = abcabca is 4.5 because the set of MRs of s 5 is {a, abca}, and then = + + + + + + = . In these examples, s 6 reaches a higher coverage than s 5 when using MRs internal to each of them.

Definition 4 The familiarity function
For a given set of sequences, let t be the concatenation of its elements separated by pairwise different symbols. Then, familiarity (s, t) indicates how much of the sequence s coincides with the MRs in t. For example, the familiarity (s 5 , t 1 ) of s 5 = abcabca and t 1 = aa$ 1 ab$ 2 adddd$ 3 bca is around 1.21 because the set of MRs of t 1 is {a, b, d, dd, ddd}, and then = + + + + + + ≈ . . Hereafter we will just use the name of a family in the second argument of the familiarity function, to denote the concatenation of all the sequences present in that family, separated by pairwise different symbols.

Results and Discussion
Maximal repetitions inside protein sequences. Since some proteins contain visible repetitive motifs in structure, we wondered how much of that repetitiveness is maintained at the sequence level. We analyzed the occurrence of exact repetitions on members of the Ankyrin repeat protein family (ANK t ), for which many structures have been solved. Ankyrins constitute the most abundant class of natural repeat proteins, and have been extensively studied 10 . We computed the MRs inside each protein, for all possible lengths (from a minimum length of 1 to the maximum possible, the length of the sequence minus 1). Figure 2 shows the coverage given by MRs inside s = IκBα(Uniprot ID: P25963), a member of the ANK t , for different minimum MRs lengths ((IκBα, i) for i = 1, … , 6). We found that this protein has 102 MRs distributed as follows: 20 MRs of length 1, 65 MRs of length 2, 11 MRs of length 3, 3 MRs of length 4, 2 MRs of length 5 and only one MR of length 6. The detected MRs are not evenly distributed along the sequence but clustered at specific positions. In most cases the shorter MRs are nested within longer MRs. Moreover, several MRs occur in the same parts of the sequence. These are overlapping occurrences of MRs.
We analyzed the coverage of the primary structure of the protein IκBα using sets of MRs of increasing minimum length (Fig. 3, black dots). Trivially, the coverage is maximum when MRs of length 1 are considered, because in general every amino acid occurs at least twice inside the protein and then, every position in the protein is covered by some MR of length 1. The coverage is reduced as the minimum MR length is increased, reaching 0 for the values of i = 7, … , |s|, as there are no exact repetitions larger than or equal to 7 residues. Coverage values for all the members of the ANK t were calculated for maximal lengths i = 0, … , 10 (see Supplementary Table S1). For each ANK t protein, the set M(s, 1) produces almost full coverage (the coverage function is ≃ 1). However, the set of MRs of length i decays rapidly as i increases, and very soon the set of MRs becomes empty. The set of MRs of lengths i > = 6 contrasts with the repetitions that can be found in structures, where no sequence information is taken into account 3 . In general, most of the Ankyrin repeat proteins (ANKs) analyzed in this work, are almost entirely covered by structural repeats.
There is a subtype of ANK proteins, which are synthetic constructs composed of (nearly) identical repetitions, for which, as expected, we detected long MRs in sequence. The molecules, such as DARPINs, OR264, OR266 and NRC, have a much larger coverage than natural ANKs, realized by their long perfect repeats (which are directly connected to the construction methods) 11,12 (see Supplementary Table S1).
The results we obtained for ANK t were contrasted with results of two other protein families. WD-40 proteins (WD t ) are non-solenoid repetitive proteins with mainly β composition, that fold into a globular-like β-propeller fold. For these proteins, the distribution of MR lengths is similar to that of ANKs, with infrequent exact repetitions larger than 6 residues (see Supplementary Table S3). Additionally we tested our program in a non-repetitive globular scaffold using members from the Dehalogenase family (DEH t ). Results are shown in Supplementary  Table S2. Analogously to repeat proteins, the coverage function decreases as the minimum length of the MR considered (i) increases. But in this globular family, the coverage function reaches zero for lower i values (indicating that the MRs in DEH t proteins are shorter than the MRs in repeat proteins). The low coverage of the sequences may be consequence of their divergence during evolutionary time scales. Most of existing methods for repeat detection in protein sequences partially fail when proteins are too divergent with respect to a consensus sequence. However, the identification of the individual occurrences of repeats is simple to observe at the structural level. The higher conservation of the repetitive patterns in structures has been recently exploited to visually classify and annotate these kind of proteins 13 . Since protein sequences encode protein structures, we believe there must be a way to unravel the sequence repetitiveness despite the dissimilarity among the repeats.
Maximal repetitions in protein families. As we have seen previously, long stretches of perfect repetitions are infrequent in natural proteins, even for those which are known to fold into structures of recurrent structural motifs. Sequence-wise, repeats are known to be imperfect. Unfortunately, the methods that assume repeats to be degenerated fail to make a complete detection. Also these methods do not allow to conclude if some individual motifs actually occur or not. For instance, in ANKs, there are some specific sub-motifs that are characteristic of the family when looking at the statistical profile of ANK repeats, as a TPLH motif and variations of it; however, when looking at particular individual sequences it is hard to say whether they correspond to ANK instances or not. All possible variations of typical blocks should be represented in at least one member of the family. Sequence To verify if this hypothesis can be generalized, we extended our analysis through 25 families of repeat proteins and to 20 globular families. For each family we separately detected the set of MRs, excluding ten sequences to be part of a testing set. Afterwards, we calculated the familiarity of every sequence on the testing set against the set of MR of each family. Results can be seen on Fig. 4. A point represents a test sequence. The x-axis indicates the family against which familiarity is evaluated, and the y-axis indicates the value of familiarity of the test sequence to the protein family. When the test sequence belongs to the family indicated in the x-axis, the point is colored red, and black otherwise. In most cases, the highest familiarity values occur when the protein belongs to the testing family. Some exceptions arise when the original family of the protein and the testing family are closely related, such as HEAT and ARM, LDLreceptorA and LDLreceptorB, or WD40 and PD40. Inversely, there are some proteins that obtain a low value of familiarity against the family they belong to (as low as proteins from other families). Many of these testing proteins are multidomain proteins and only a segment of them belongs to the testing family.
To our surprise, we were not able to see differences between the familiarity values of repeat families (upper panel of Fig. 4) and globular families (lower panel of Fig. 4). Our hypothesis is that this high familiarity value between a protein sequence and the set of proteins that constitute the family to which it belongs, is a common feature of protein families that are equilibrated ensembles whose members are mostly composed of exact repetitions ranging from dipeptides to decapeptides. This also suggests that natural proteins are built up from fragments longer than dipeptides but shorter than decapeptides, in line with the general ideas implemented by 'fragment assembly' of structural predictions 14 .
There are however, some notable exceptions in the results of familiarity values in our experiments. In the case of ANK t , protein P14585 is composed of more than 1,400 residues, but its ANK region encompasses only about 200 amino acids. As a consequence of this, the coverage (and familiarity) obtained for this sequence in the context of the ANK f set does not display values significantly higher than for the other sets corresponding to foreign families. Other exceptional cases within the ANK t group of sequences that are not well explained by MRs found in the ANK f set are proteins that fold into ANK-like structures but strongly differ from the rest of the family in their sequence patterns. These cases correspond to sequences Q5ZSV0 and Q5ZXN6 from Legionella sp and sequence Q6IV60 which is a viral protein. All these cases are non-eukaryote proteins. The ANK motif is known to be particularly enriched in eukaryotes and within specific eukaryote pathogens (including bacteria and viruses) that use ANK-like proteins to mimic their host counterparts and proceed with the infectious processes 15 . The origin of non-eukaryote ANK-like proteins has been discussed with no consensus about whether they correspond to horizontally transferred molecules with subsequent divergent evolution, or they originated by convergent evolutionary processes.
How are maximal repetitions distributed in the families? For each family dataset (ANK f , DEH f , WD f and HET f ) we evaluated how its MRs are distributed within the proteins members of the family. We counted how many proteins in the family contain each of the MRs that are found in that family (Fig. 5A shows the case of ANK f , and Supplementary Fig. S1 shows the case for the remaining datasets). We observe that there is a large number of short MRs occurring in many different proteins (e.g. "TP" appears over 85% of ANK f proteins), and a small number of long MRs occurring in just a few different proteins (e.g. "GNPFTPLHCAVINDHE" appears only in two proteins from ANK f ). The longest MR sequence (2,563 residues) has only two instances and appears in two very similar proteins (F1MVI7 and G3MYJ1).
Considering that MRs with lengths i > = 6 are found mainly in proteins with respect to their families, we focused on MRs corresponding to those i values. ANK f has a total of 38,051 proteins but MRs larger than 6 residues do not appear in all of them (the most popular MR of length 6 appears in 4,085 proteins, but in average MRs of this length appear in less than 1,000 proteins). Thus, there is no block larger or equal to six, common to the whole family. The coverage of each member of the ANK family by MRs in ANK f comes from many different proteins. In this sense, the ANK proteins seem to be a mosaic of exact MRs that are spread along their whole sequence. The number of mismatches in individual sequences of a given family, found by pairwise alignments inside each sequence, vanishes dramatically if we consider the repeating blocks in other proteins from the family.
In ANK f we observe that, starting from MRs of lengths i > = 6, Fig. 5A,B are very similar. This shows that MRs occur at most once within each protein sequence. It also proves that long stretches of perfect repetitions are infrequent in natural proteins, even for specific members that are known to fold into structures of recurrent structural   motifs. However, there is a collection of recurring MRs that are spread along the members of a family than can be used to (partially) reconstruct any given sequence of the family. The same analysis over other families (DEH f and WD f ) shows similar results to those for ANK f (see Supplementary Fig. S1). We also considered a dataset of sequences constructed by scrambling the proteins of a given family (this dataset constructed by permutating the amino acids of each sequence from HET f dataset). The result differs completely from the results for actual families (Supplementary Fig. S1). We only found short MRs.
We made the same analysis for the HET f dataset (Supplementary Fig. S1). Although the HET f has longer MRs than the scrambled protein family dataset, these MRs are notoriously shorter than the MRs in the ANK f , DEH f and WD f families. This experiment gives evidence for the difference between sets of sequences that constitute an actual protein family and sets of proteins which do not constitute a family, as compared to sequences that do not correspond to actual proteins.

Towards a catalogue of repetitions.
We computed the set of MRs of length 6 or longer from the ANK f dataset, this is  ANK ( ,6) f . The minimum length value of 6 was selected to be able to compare what was observed in small structural repetitions with a structural tiling methodology 3 . As a result we obtained 4,390,695 MRs with a length of 6 residues which exponentially decreases as the MRs length increases. The most frequent MRs, for instance TPLHLA and GADVNA (and their variants), coincide with the most popular motifs in the ANK HMM profile (Pfam ID: PF00023). We computed the proportion between instances of the MRs and the number of proteins containing them. The most well known motifs, have a proportion close to 1. However, we found several other motifs to be quite popular, as LISHGA, GHLDVV and ELLISH. They have a higher proportion between instances of the MRs and the number of proteins containing them (between 2 and 3), and they are conserved along repeat domains in the ANK f dataset. The particularity of these motifs is that their occurrences are not evident when visually observing the sequence logo representation for the ANK HMM profile, because they are composed of highly frequent amino acids at some positions and infrequent amino acids in others. The identified motifs respect the short length covariation in between positions, which is not taken into account in HMMs, in which the positions are assumed to be independent. Consequently, strategies like scanning sequences with HMM profiles need to apply a threshold to accept or not a subsequence as a hit. This can lead to spurious amino acid combinations producing false positives or false negative results. Using short exact sequences in order to look for MRs, considers implicitly the natural covariation among the residues that constitute them and at the same time allows us to avoid the use of thresholds.

Concluding Remarks
We posed the question: How repetitive are natural repeat-proteins? We committed to a mathematical definition of a repetition and found that long stretches of perfect repetitions are infrequent in natural proteins, even for those which are known to fold into structures of recurrent structural motifs. However, we found that repeat proteins have abundant short stretches of amino acids that are perfect repetitions in the reference family. We provided a systematic quantification for this repetitiveness.
Our solution finds all the maximal perfect repetitions, using no adjustable parameters. We use a reference family of protein sequences, that operates as a catalogue of all the possible variations that repeating blocks can adopt. We show that a large portion of each protein sequence can be described by stretches of amino acids occurring in members of the reference family. Thus, each family determines an expected covering of its sequences by family repetitions. This yields a continuous measure of likelihood for any sequence to belong to a given family, quantified by the familiarity function. The method could be used as a guiding tool in the design of synthetic proteins, establishing a minimum and a maximum value of a candidate sequence in relation to existing families.
The familiarity function can be implemented with an algorithm whose computational complexity is O(n log n), where n is the size of the protein sequence plus the size of the family dataset. This allows to compute the classification very efficiently.
This work is rooted in the general analysis of 26 repeat protein families and 20 globular protein families, and further focus was applied to the families ANK, WD40 and DEH. The study can be extended to cover the complete protein universe or a substantial part of it. Moreover, the approach does not require a detailed curation of the sequences present in the families. We have limited our current work to the identification of MRs in families and to the computation of the familiarity function. Detailed statistical work remains to be done on MRs in families, such as the average distance between different occurrence of MRs inside the same protein sequence, the number of different MRs per length in each protein sequence. We also suggest to identify the subset of overlapping MRs (and the size of the overlap), the subset of non-overlapping MRs, the subsets of MRs that can be placed one after another, and the subset of MRs that exclude the occurrence of others.
These statistics may yield relations between maximal repeats with some known functional features and to some further conditions for the construction of synthetic proteins.

Materials and Methods
Protein family datasets. Ankyrin repeat protein (ANK f ) and WD40 repeat protein (WD f ) families datasets. From Uniprot Uniref90 we run hmmsearch from the hmmer suit for a specific HMM family taken from PFAM. Included only sequences that contain at least one hit for the specific family hmm. We excluded those protein sequences containing undefined or ambiguous residues (X, B, Z, J).
It was reduced to a 90% identity for non redundancy with cd-hit. Once reduced, the total number of residues in that family was 24,031,515 which was a shorter amount of residues when compared to ANK f and WD f datasets. In order to be fair with all the datasets and avoid a bias due to random matches product of the dataset size, we reduced the ANK f and WD f to have an equivalent size to the DEH f (~24 M residues).
Heterogeneous dataset (HET f ). We constructed a random dataset by taking a sample of proteins from Uniref90 in such a way that the total size in number of residues was equivalent to the other datasets and the selected proteins do not belong to any of the above mentioned families.
Scrambled heterogeneous dataset (HET f scrambled). We constructed a new dataset, scrambling the amino acids of each sequence from HET f dataset.
Protein test groups dataset. ANK test group dataset (ANK t ). We used the set of ANK proteins with known structure, 73 in total, that were analyzed in the publication from Parra and coworkers 16 .
WD40 test group dataset (WD t ). 50 Structures corresponding to members of the WD40 Protein Family, not included in the WD f set, were randomly selected to conform this group.
Haloacid Dehalogenase test group dataset (DEH t ). 50 Structures corresponding to members of the DEH Protein Family were randomly selected to conform this group. These structures were selected from the SFLD site, from those proteins that were not included when building the DEH f set.

Globular Non Family test group dataset (HET t ).
50 Structures corresponding to a set of unrelated globular proteins was used to conform this group 17 .
Additional datasets. In order to show that our algorithm is generally applicable we generated datasets for several families both from the repeat and globular types. We retrieved Hidden Markov Models from Pfam for the selected families and searched instances that gave at least one hit to them in the Uniref90 database (a clustered version of UniRef 18 ). Since there is not an exhaustive catalogue of repeat proteins we retrieved the Hidden Markov Models for all the repeat protein families that are used in the publication from Espada and coworkers 2 . For the globular proteins we retrieved 20 families from the SCOPe database 19 selecting representatives for the following classes: a. alpha proteins, b. beta proteins, alpha and beta proteins (c. a/b and d. a+b), and e. membrane and cell surface proteins and peptides. All the selected families are listed in Supplementary Table S5.
Repeat finding algorithm. The algorithm findpat 9 , is the current most efficient algorithm to find exact repetitions (it is particularly well suited for very large inputs). The algorithm requires a parameter ml for the minimum length of a MR to be reported, it can be any value greater than or equal to 1. For the special case of ml equal to 0 findpat returns all possible blocks of the given sequence. To avoid the use of multiple different special symbols $ i , for as many i as needed, we modified the program to have an unique special symbol $ as a symbol that can not be part of MRs. The algorithm findpat runs in time O(n log n), where n is the length of the whole input