{'fraction_non_alphanumeric': 0.04439037825927286, 'fraction_numerical': 0.01625045905251561, 'mean_word_length': 4.183202474423031, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Recognition of an organism from fragments of its complete genome

This paper considers the problem of matching fragment to organism using its complete genome. Our method is based on the probability measure representation of a genome. We first demonstrate that these probability measures can be modelled as recurrent iterated function systems (RIFS) consisting of four contractive similarities. Our hypothesis is that the multifractal characteristic of the probability measure of a complete genome, as captured by the RIFS, is preserved in its reasonably long fragments. We compute the RIFS of fragments of various lengths and random starting points, and compare with that of the original sequence for recognition using the Euclidean distance. A demonstration on five randomly selected organisms supports the above hypothesis.


I. INTRODUCTION
The DNA sequences of complete genomes provide essential information for understanding gene functions and evolution. A large number of these DNA sequences is currently available in public databases such as Genbank at ftp://ncbi.nlm.nih.gov/genbank/genomes/ or KEGG at http://www.genome.ad.jp/kegg/java/org list.html). A great challenge of DNA analysis is to determine the intrinsic patterns contained in these sequences which are formed by four basic nucleotides, namely, adenine (a), cytosine (c), guanine (g) and thymine (t).
Some significant contribution results have been obtained for the long-range correlation in DNA sequences [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16]. Li et al. [1] found that the spectral density of a DNA sequence containing mostly introns shows 1/f β behaviour, which indicates the presence of long-range correlation when 0 < β < 1. The correlation properties of coding and noncoding DNA sequences were first studied by Peng et al. [2] in their fractal landscape or DNA walk model. The DNA walk [2] was defined as that the walker steps "up" if a pyrimidine (c or t) occurs at position i along the DNA chain, while the walker steps "down" if a purine (a or g) occurs at position i. Peng et al.
[2] discovered that there exists long-range correlation in noncoding DNA sequences while the coding sequences correspond to a regular random walk. By undertaking a more detailed analysis, Chatzidimitriou et al. [5] concluded that both coding and noncoding sequences exhibit long-range correlation. A subsequent work by Prabhu and Claverie [6] also substantially corroborates these results. If one considers more details by distinguishing c from t in pyrimidine, and a from g in purine (such as two or threedimensional DNA walk models [15] and maps given by Yu and Chen [16]), then the presence of base correlation has been found even in coding sequences. On the other hand, Buldyrev et al. [12] showed that long-range correlation appears mainly in noncoding DNA using all the DNA sequences available. Based on equal-symbol correlation, Voss [8] showed a power law behaviour for the sequences studied regardless of the proportion of intron contents. These studies add to the controversy about the possible presence of correlation in the entire DNA or only in the noncoding DNA. From a different angle, fractal analysis has proven useful in revealing complex patterns in natural objects. Berthelsen et al. [17] considered the global fractal dimensions of human DNA sequences treated as pseudorandom walks.
In the above studies, the authors only considered short or long DNA segments. Since the first complete genome of the free-living bacterium Mycoplasma genitalium was sequenced in 1995 [18], an ever-growing number of complete genomes has been deposited in public databases. The availability of complete genomes induces the possibility to establish some global properties of these sequences. Vieira [19] carried out a low-frequency analysis of the complete DNA of 13 microbial genomes and showed that their fractal behaviour does not always prevail through the entire chain and the autocorrelation functions have a rich variety of behaviours including the presence of anti-persistence. Yu and Wang [20] proposed a time series model of coding sequences in complete genomes. For fuller details on the number, size and ordering of genes along the chromosome, one can refer to Part 5 of Lewin [21]. One may ignore the composition of the four kinds of bases in coding and noncoding segments and only consider the global structure of the complete genomes or long DNA sequences. Provata and Almirantis [22] proposed a fractal Cantor pattern of DNA. They mapped coding segments to filled regions and noncoding segments to empty regions of a random Cantor set and then calculated the fractal dimension of this set. They found that the coding/noncoding partition in DNA sequences of lower organisms is homogeneous-like, while in the higher eucariotes the partition is fractal. This result doesn't seem refined enough to distinguish bacteria because the fractal dimensions of bacteria computed [22] are all the same. The classification and evolution relationship of bacteria is one of the most important problems in DNA research. Yu and Anh [23] proposed a time series model based on the global structure of the complete genome and considered three kinds of length sequences. After calculating the correlation dimensions and Hurst exponents, it was found that one can get more information from this model than that of fractal Cantor pattern. Some results on the classification and evolution relationship of bacteria were found [23]. The correlation property of these length sequences has been discussed [24]. The multifractal analysis for these length sequences was done in [25].
Although statistical analysis performed directly on DNA sequences has yielded some success, there has been some indication that this method is not powerful enough to amplify the difference between a DNA sequence and a random sequence as well as to distinguish DNA sequences themselves in more details [26]. One needs more powerful global and visual methods. For this purpose, Hao et al. [26] proposed a visualisation method based on counting and coarse-graining the frequency of appearance of substrings with a given length. They called it the portrait of an organism. They found that there exist some fractal patterns in the portraits which are induced by avoiding and under-represented strings. The fractal dimension of the limit set of portraits was also discussed [27,28]. There are other graphical methods of sequence patterns, such as chaos game representation [29,30].
Yu et al. [31] introduced a representation of a DNA sequence by a probability measure of k-strings derived from the sequence. This probability measure is in fact the histogram of the events formed by all the k-strings in a dictionary ordering. It was found [31] that these probability measures display a distinct multifractal behaviour characterised by their generalised Rényi dimensions (instead of a single fractal dimension as in the case of self-similar processes). Furthermore, the corresponding C q curves (defined in [32]) of these generalised dimensions of all bacteria resemble classical phase transition at a critical point, while the "analogous" phase transitions (defined in [32]) of chromosomes of nonbacteria exhibit the shape of double-peaked specific heat function. These patterns led to a meaningful grouping of archaebacteria, eubacteria and eukaryote. Anh et al. [33] took a further step in providing a theory to characterise the multifractality of the probability measures of the complete genomes. In particular, the resulting parametric models fit extremely well the D q curves of the generalised dimensions and the corresponding K q curves of the above probability measures of the complete genomes.
A conclusion of the work reported in Yu et al. [31] and Anh et al. [33] is that the histogram of the k-strings of the complete genome provides a good representation of the genome and that these probability measures are multifractal. This multifractality is, in most cases studied, characteristic of the DNA sequences, hence can be used for their classification.
In this paper, we consider the problem of recognition of an organism based on fragments of their DNA sequences. The identification of the organisms in a culture commonly relies on their molecular identity markers such as the genes that code for ribosomal RNA. However, it is usual that most fragments lack the marker, "making the task of matching fragment to organism akin to reconstructing a document that has been shredded" (M. Leslie, "Tales of the sea", New Scientist, 27 January 2001). A well-known method to tackle the task is the random shotgun sequencing method, which scans the sequences of all fragments looking for overlaps to be able to piece the fragments together. It is obvious that this technique is extremely time-consuming and many crucial fragments may be missing. This paper will provide a different method to approach this problem. Our starting point is the probability measure of the k-strings and its multifractality. We model this multifractality using a recurrent iterated function system ( [34,35]) consisting of four contractive similarities (to be described in Section IV). This branching number of four is a natural consequence of the four basic elements (a, c, g, t) of the DNA sequences. Each of these RIFS is specified by a matrix of incidence probabilities P = (p ij ), i, j = 1, ..., 4, with p i1 +p i2 +p i3 +p i4 = 1 for i = 1, ..., 4. It is our hypothesis that, for reasonably-long fragments, the multifractal characteristic of the measure of a complete genome as captured by the matrix P is preserved in the fragments. We thus represent each fragment by a vector ( 1 4 (p 11 + p 21 + p 31 + p 41 ) , 1 4 (p 12 + p 22 + p 32 + p 42 ) , 1 4 ( p 13 + p 23 + p 33 + p 43 ) in R 3 + . We will see that, for fragments of lengths longer than 1/20 of the original sequence and with random starting points, these vectors are very close, using the Euclidean distance, to the vector of the complete sequence.
We will demonstrate the technique on five organisms, namely, A. fulgidus, B. burgdorferi, C. trachomatis, E. coli and M. genitalium. As remarked in Yu et al. [31], substrings of length k = 6 are sufficient to represent DNA sequences. For each organism, we compute the histograms for the 6-strings of its complete genome, and 4 cases of fragments of lengths 1/4, 1/8, 1/15 and 1/20 of the complete sequence. The starting position of each fragment is chosen randomly. The RIFS of the complete genome and each of the fragments are computed next. The numerical results are reported in Section V. Some conclusions will be drawn in Section VI.

II. MEASURE REPRESENTATION OF COMPLETE GENOMES
We first outline the method of Yu et al. [31] in deriving the measure representation of a DNA sequence. We call any string made up of k letters from the set {g, c, a, t} a k-string. For a given k there are in total 4 k different k-strings. In order to count the number of each kind of kstrings in a given DNA sequence, 4 k counters are needed. We divide the interval [0, 1) into 4 k disjoint subintervals, and use each subinterval to represent a counter. Letting s = s 1 · · · s k , s i ∈ {a, c, g, t}, i = 1, · · · , k, be a substring with length k, we define where and We then use the subinterval [x l (s), x r (s)) to represent substring s. Let N (s) be the times of substring s appearing in the complete genome. If the number of bases in the complete genome is L, we define to be the frequency of substring s. It follows that {s} F (s) = 1. We can now view F (s) as a function of x and define a measure µ k on [0, 1) by We then have µ k ([0, 1)) = 1 and µ k ([x l (s), x r (s))) = F k (s). We call µ k (x) the measure representation of an organism. As an example, the measure representation of M. genitalium for k = 3, ..., 6 is given in FIG. 1. A fractal-like behaviour is apparent in the measures. Remark: The ordering of a, c, g, t in (2) follows the natural dictionary ordering of k-strings in the onedimensional space. A different ordering of a, c, g, t would change the nature of the correlations of the measure. But in our case, a different ordering of a, c, g, t in Eq. (2) gives the same multifractal spectrum (D q curve which will be defined in the next section) when the absolute value of q is relatively small (see FIG. 2 in [31]). Hence the multifractal characteristic is independent of the ordering. In the comparison of different organisms using the measure representation, once the ordering of a, c, g, t in (2) is given, it is fixed for all organisms [31].

III. MULTIFRACTAL ANALYSIS
The most common algorithms of multifractal analysis are the so-called fixed-size box-counting algorithms [36]. In the one-dimensional case, for a given measure µ with support E ⊂ R, we consider the partition sum q ∈ R, where the sum runs over all different nonempty boxes B of a given side ǫ in a grid covering of the support E, that is, The exponent τ (q) is defined by and the generalized fractal dimensions of the measure are defined as and where Z 1,ǫ = µ(B) =0 µ(B) log µ(B). The generalized fractal dimensions are estimated through a linear regression of 1 q − 1 log Z ǫ (q) against log ǫ for q = 1, and similarly through a linear regression of Z 1,ǫ against log ǫ for q = 1. D 1 is called information dimension and D 2 is called correlation dimension. The D q of the positive values of q give relevance to the regions where the measure is large, i.e., to the k-strings with high probability. The D q of the negative values of q deal with the structure and the properties of the most rarefied regions of the measure.

IV. IFS AND RIFS MODELS AND THE MOMENT METHOD FOR PARAMETER ESTIMATION
In this paper, we propose to model the measure defined in Section II for a complete genome by a recurrent IFS. As we work with measures on compact intervals, the theory of Section II is narrowed down to the one-dimensional case (i.e. d = 1). Consider a system of contractive maps S = {S 1 , S 2 , · · · , S N }. Let E 0 be a compact interval of R, E σ1σ2···σn = S σ1 • S σ2 • · · · • S σn (E 0 ) and E n = ∪ σ1,···,σn∈{1,2,···,N } E σ1σ2···σn .
Then E = ∩ ∞ n=1 E n is the attractor of the IFS. Given a set of probabilities p i > 0, N i=1 p i = 1, we pick an x 0 ∈ E and define iteratively the sequence where the indices σ n are chosen randomly and independently from the set {1, 2, · · · , N } with probabilities P (σ n = i) = p i . Then every orbit {x n } is dense in the attractor E [37,38]. For n large enough, we can view the orbit {x 0 , x 1 , · · · , x n } as an approximation of E. This iterative process is called a chaos game. Given a system of contractive maps S = {S 1 , S 2 , · · · , S N } on a compact metric space E * , we associate with these maps a matrix of probabilities P = (p ij ) such that j p ij = 1, i = 1, 2, · · · , N . Consider a random sequence generated by a chaos game: where x 0 is any starting point and σ n is chosen with a probability that depends on the previous index σ n−1 : The choice of the indices σ n as prescribed by (13) presents a fundamental difference between this iterative process and that defined by (11) of the usual chaos game. Then (E * , S, P) is called a recurrent IFS. The flexibility of RIFS permits the construction of more general sets and measures which do not have to exhibit the strict selfsimilarity of IFS. This would offer a more suitable framework to model fractal-like objects and measures in nature. Let µ be the invariant measure on the attractor E of an IFS or RIFS, χ B the characteristic function for the Borel subset B ⊂ E; then from the ergodic theorem for IFS or RIFS [37], In other words, µ(B) is the relative visitation frequency of B during the chaos game. A histogram approximation of the invariant measure may then be obtained by counting the number of visits made to each pixel on the computer screen. The coefficients in the contractive maps and the probabilities in the IFS or RIFS model are the parameters to be estimated for a given measure which we want to simulate. Vrscay [38] introduced a moment method to perform this task. If µ is the invariant measure and E the attractor of the IFS or RIFS in R, the moments of µ are If S i (x) = c i x + d i , i = 1, · · · , N , then the following well-known recursion relations hold for the IFS model: Thus, setting g 0 = 1, the moments g n , n ≥ 1, may be computed recursively from a knowledge of g 0 , · · · , g n−1 [38]. For the RIFS model, we have where g (j) n , j = 1, · · · , N , are given by the solution of the following system of linear equations: For n = 0, we set g  If we denote by G k the moments obtained directly from a given measure using (15), and g k the formal expression of moments obtained from (16) for the IFS model or from (17)(18)(19) for the RIFS model, then through solving the optimal problem min ci,di,pi or pij for some chosen n, we can obtain the estimates of the parameters in the IFS or RIFS model. From the measure representation of a complete genome, it is natural to choose N = 4 and S 1 (x) = x/4, S 2 (x) = x/4 + 1/4, S 3 (x) = x/4 + 1/2, S 4 (x) = x/4 + 3/4 in the IFS or RIFS model. Based on the estimated values of the probabilities, we can use the chaos game to generate a histogram approximation of the invariant measure of the IFS or RIFS, which then can be compared with the given measure of the complete genome.

V. APPLICATION TO THE RECOGNITION PROBLEM
The measure representations for a large number of complete genomes, as described in Section II, were obtained in Yu et al. [31]. It was found that substrings with k = 6 seem to provide a limiting measure that can be used for the classification and recognition of DNA sequences. Hence we will use 6-strings in this paper. We then estimated their IFS and RIFS models using the moment method described in Section 4. The chaos game algorithm was next performed to generate an orbit as in (11) or (12) with (13). From these orbits, simulated approximations of the invariant measures of IFS or RIFS were obtained via the ergodic theorem (14). In order to clarify how close the simulated measure is to the original measure, we convert a measure to its walk representation: We denote by {t j , j = 1, 2, · · · , 4 k } the density of a measure and t ave its average, then define the walk T j = j k=1 (t k − t ave ), j = 1, 2, · · · , 4 k . The two walks of the given measure and the measure generated by the chaos game of an IFS or RIFS are then plotted in the same figure for comparison. We found that RIFS is a better model to simulate complete genomes. We determine the "goodness" of the measure simulated from the RIFS model relative to the original measure based on the following relative standard error (RSE) We next pick out five organisms (without any particular a priori reason) from about 50 organisms whose complete genomes are currently available. These are A. fulgidus, B. burgdorferi, C. trachomatis, E. coli and M. genitalium. Fragments of different length rates ranging from 1/20 to 1/4 and with random starting points along the sequences were then selected. Here the length rate of a fragment means the length of this fragment divided by the length of the genome of the same organism. It should be noted that column i in the matrix P describes the activity of similarity S i in each RIFS. To be able to represent each fragment on a three-dimensional plot, we define    P 1 = (p 11 + p 21 + p 31 + p 41 )/4, P 2 = (p 12 + p 22 + p 32 + p 42 )/4, P 3 = (p 13 + p 23 + p 33 + p 43 )/4.

(21)
Each fragment is then represented by the vector (P 1 , P 2 , P 3 ) . The values of these vectors are provided in Table I, and the vectors are plotted in FIG. 5. It is seen that the vectors of the fragments from the same organism cluster together, and this clustering holds for all selected lengths. This accuracy is uniform for all five organisms randomly selected.
In matching a fragment to organism, the D q curve, which depicts the generalised dimension of the invariant measure as described in Section III, can also be used. We computed these curves for the above five organisms at a variety of length sizes, to 1/100th of the original sequence. The results were reported for M. genitalium in FIG. 6. It is seen that this method also performs very well. However, it suffers a drawback that many different organisms seem to have the same or closely related D q curve. In this sense, the method based on the RIFS has higher resolution in distinguishing the genomes. If necessary, the entire matrix P may be used, instead of (21), in this comparison. This would enhance the matching, but will not be as economical as (21). Yu et al. [39] used the entire matrix P to define the distance between two organisms in higher dimensional space and then the evolutionary tree of more than 50 organisms was constructed. The RIFS model can also be used to simulate the measure representation of proteins based on the HP model [40].

VI. CONCLUSION
This paper provides a method for matching fragment to organism taking advantage of the multifractal characteristic of the measure representation of their genomes. It was demonstrated empirically that the underlying mechanism of this multifractality can be captured by a recurrent IFS, whose theory is well founded in the fractal geometry literature. Fast algorithms for the computation of these RIFS and related quantities as well as tools for comparison are available. The method seems to work reasonably well with low computing cost. This fast and economical method can be performed at a preliminary stage to cluster fragments before a more extensive method, such as the random shotgun sequencing method as mentioned in the Introduction, is decided to be brought in for higher accuracy.