## Introduction

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 unit1. 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 define2,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 level4, complicating the detection and classification of repeats1.

There are many methods to identify repeats in sequences. Some are based on the self-alignment of the primary structure5 and others implement spectral analysis of pseudo-chemical characteristics of the amino acids6. 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 sequences7,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 repetitive than another. In addition, this quantification allows us to derive a measure of likelihood for a given sequence to belong to a given family.

### Notation and preliminary definitions

Let be an alphabet, which is a finite set of symbols. We consider sequences of symbols in . The length of a sequence s is denoted by |s|. We address the positions of a sequence s by counting from 1 to |s|. With s[i..j] we denote the sequence that starts in position i and ends in position j in s. If i or j are out of range then s[i..j] is equal to the empty sequence. We say u occurs in s if u = s[i..j] for some i, j. In case s starts with u we say that s is an extension of u.

Definition 1 (Gusfield8) A maximal repetition (MR) is a sequence that occurs more than once in s and each of its extensions occurs fewer times. We write to denote the set of MRs of lengths greater than or equal to n, that occur in the sequence s.

The set of MRs of s1 = abcdeabcdfbcdebcd is {abcd, bcde, bcd}. Observe that abcd and bcde are the longest MRs, occurring twice. But bcd is also a MR because it occurs four times in s1 and every extension of bcd occurs fewer times. On the contrary, bc is not a MR because both bc and bcd occur four times, contradicting the condition that the extension must occur fewer times (see Fig. 1A). The set of MRs of s2 = aaaa is {aaa, aa, a} where aaa is a MR occurring twice, aa occurs three times and a four times. The set of MRs of s3 = ab is empty.

From the given examples is easy to see that MR occurrences can be nested and overlapping. The MRs in any given sequence s can have lengths between 1 and a maximum of |s| − 1 (this maximum is reached only when the sequence is a chain of the same letter, as aaaa). The total number of different MR patterns in a sequence of length |s| is at most |s| (a mathematical argument ensures that there can be no more different MR patterns than the number of positions in the sequence9).

## 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 (ANKt), for which many structures have been solved. Ankyrins constitute the most abundant class of natural repeat proteins and have been extensively studied10. 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 ANKt, 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 ANKt were calculated for maximal lengths i = 0, …, 10 (see Supplementary Table S1). For each ANKt 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 account3. 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 ANKt were contrasted with results of two other protein families. WD-40 proteins (WDt) 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 (DEHt). 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 DEHt 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 proteins13. 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 statistical profiles, usually assume that positions are independent. Therefore, when combining different amino acids at adjacent positions, blocks that are not representative of the family can be constructed, since natural covariations are not taken into account. The opposite, i.e. natural occurring blocks that are a consequence of combinations of amino acids with low frequencies may not be detected as part of the motif. We overcome this problem by looking for natural occurring blocks in members of the family. This additionally solves the problem of position independence since these are implicitly used in the short repetitions.

Given a sequence s and a family f our method consists in finding the repetitions in the family f that have some occurrence in the sequence s. We first compute the sets , where t is the concatenation of the sequences in f separated by pairwise different symbols, for all the possible values of i, namely i goes from 1 to |s|. We then compute the coverage made by the elements of on the sequence s using the function. As example, Fig. 3 presents the coverage of the IκBα protein considering sets of MRs from different families. The coverage was calculated by the coverage(IκBα, ) function, using t = IκBα alone, ANKf, DEHf, WDf and HETf datasets and i = 0, …, 10. The HETf dataset is a selection of proteins from different families. We observe that, as the minimum MR length increases above i = 3 the coverage(IκBα, (IκBα, i)) decays under 0.02 (black line), while the coverage remains close to 1 for MRs detected in larger datasets up to i = 6. The coverage only keeps significantly high for longer MRs when using the set of MRs obtained from the ANK family, to which the protein belongs. With these results, we computed the familiarity (IκBα, t) function for t = IκBα alone, ANKf, DEHf, WDf and HETf datasets. Although the definition of familiarity requires the values of for each i in [0..|s|], in all the cases we analyzed it was enough to consider i just in [0..10], because the coverage for larger values of i is negligible. Hereafter we consider the familiarity function with lengths i [0..10]. The maximum coverage is obtained for familiarity (IκBα, ANKf) = 9.70347. familiarity function applied to IκBα together with other families have values less than 6.20 (see Supplementary Table S4, Uniprot ID = P25963). This function indicates that IκBα belongs to the ANKf family.

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 predictions14.

There are however, some notable exceptions in the results of familiarity values in our experiments. In the case of ANKt, 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 ANKf set does not display values significantly higher than for the other sets corresponding to foreign families.

Other exceptional cases within the ANKt group of sequences that are not well explained by MRs found in the ANKf 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 processes15. 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 (ANKf, DEHf, WDf and HETf) 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 ANKf 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 ANKf proteins) and a small number of long MRs occurring in just a few different proteins (e.g. “GNPFTPLHCAVINDHE” appears only in two proteins from ANKf). 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. ANKf 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 ANKf 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 ANKf 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 (DEHf and WDf) shows similar results to those for ANKf (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 HETf 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 HETf dataset (Supplementary Fig. S1). Although the HETf has longer MRs than the scrambled protein family dataset, these MRs are notoriously shorter than the MRs in the ANKf, DEHf and WDf 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 ANKf dataset, this is . The minimum length value of 6 was selected to be able to compare what was observed in small structural repetitions with a structural tiling methodology3. 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 ANKf 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 (ANKf) and WD40 repeat protein (WDf) 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).

#### Haloacid Dehalogenase globular family dataset (DEHf)

A globular family was retrieved from the SFLD site (http://sfld.rbvi.ucsf.edu/django/superfamily/3/) from which we selected the Haloacid Dehalogenase superfamily.

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 ANKf and WDf 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 ANKf and WDf to have an equivalent size to the DEHf (~24 M residues).

#### Heterogeneous dataset (HETf)

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 (HETf scrambled)

We constructed a new dataset, scrambling the amino acids of each sequence from HETf dataset.

### Protein test groups dataset

#### ANK test group dataset (ANKt)

We used the set of ANK proteins with known structure, 73 in total, that were analyzed in the publication from Parra and coworkers16.

#### WD40 test group dataset (WDt)

50 Structures corresponding to members of the WD40 Protein Family, not included in the WDf set, were randomly selected to conform this group.

#### Haloacid Dehalogenase test group dataset (DEHt)

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 DEHf set.

#### Globular Non Family test group dataset (HETt)

50 Structures corresponding to a set of unrelated globular proteins was used to conform this group17.

The algorithm findpat9, 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 (target sequence or sequences for the family of proteins). The code can be downloaded from http://www.dc.uba.ar/people/profesores/becher/software/familiarity.tar.bz2.