TI2BioP  methodology http://ti2biop.sourceforge.net/ to calculate two different TIs. One class was derived from the ITS2 artificial 2D structures generated from DNA strings and the other from the secondary structure inferred from RNA folding algorithms. Two alignment-free models based on Artificial Neural Networks were developed for the ITS2 class prediction using the two classes of TIs referred above. Both models showed similar performances on the training and the test sets reaching values above 95% in the overall classification. Due to the importance of the ITS2 region for fungi identification, a novel ITS2 genomic sequence was isolated from Petrakia sp. This sequence and the test set were used to comparatively evaluate the conventional classification models based on multiple sequence alignments like Hidden Markov based approaches, revealing the success of our models to identify novel ITS2 members. The isolated sequence was assessed using traditional and alignment-free based techniques applied to phylogenetic inference to complement the taxonomy of the Petrakia sp. fungal isolate.The ITS2 gene class shows a high sequence divergence among its members that have complicated its annotation and its use for reconstructing phylogenies at a higher taxonomical level (beyond species and genus). Several alignment strategies have been implemented to improve the ITS2 annotation quality and its use for phylogenetic inferences. Although, alignment based methods have been exploited to the top of its complexity to tackle both issues, no alignment-free approaches have been able to successfully address both topics. By contrast, the use of simple alignment-free classifiers, like the topological indices (TIs) containing information about the sequence and structure of ITS2, may reveal to be a useful approach for the gene prediction and for assessing the phylogenetic relationships of the ITS2 class in eukaryotes. Thus, we used the  Standard alignment methods are less effective for the functional prediction of gene and protein classes that show a high primary sequence divergence between their members http://its2.bioapps.biozentrum.uni-wuerzburg.de) was developed holding information about sequence, structure and taxonomic classification of all ITS2 in GenBank Topological Indices to BioPolymers “TI2BioP” where the spectral moments are calculated from different graphical approaches representing the structure of the biopolymers: DNA, RNA and proteins http://ti2biop.sourceforge.net/ as a public tool for the calculation of two different TIs, one class derived from the ITS2 artificial 2D structures generated from DNA strings (Nandy structures) The internal transcribed spacer 2 (ITS2) eukaryotic gene class is one of the cases showing a higher sequence divergence among its members, which have traditionally complicated ITS2 annotation and limited its use for phylogenetic inference at low taxonomical level analyses (genus and species level classifications). Despite the ITS2 high sequence variability, the ITS2 structure has been considerably conserved among all eukaryotes The ANN-models provided the highest classification accuracy (95.9 and 97.5%) during the training step compared to the linear models for Nandy-like and Mfold structures, respectively. A very similar ANN performance was obtained for the test set for both structural representations. These results support that the identification of gene signatures tend to be better when assessed with non-linear models. We also showed the utility of the artificial secondary structure when the correct 2D structure is not available  and can only be obtained by predictions based on free energy minimizations.Petrakia. Members of this fungal genus have been hard to be placed taxonomically and are potential producers of bioactive compounds Petrakia sp. strain was morphologically identified and its ITS2 sequence was used to carry out traditional and alignment-free phylogenetic analyses to support its taxonomic characterization.The performance of our two alignment-free models based on ANN was also compared with several profile Hidden Markov Models (HMMs) generated from alignments performed with CLUSTALW Petrakia genus inside the Pezizomycotina subphylum and the Dothideomycetes class.The alignment-free models identified the new query sequence as a member of the ITS2 class with high significance, while the profile HMMs showed a poor performance in doing so. We demonstrated that our TIs are useful not only in sequence identification but also in molecular evolutionary inferences. The alignment-free tree built based on TIs provided similar phylogenetic relationships among the different classes of the Ascomycota phylum in respect to the traditional phylogenetic analysis . Both analyses placed the TI2BioP allows the calculation of the spectral moments derived from inferred and artificial 2D structures of DNA, RNA and proteins Petrakia sp. ef08-038 (accession number FJ892749) comprising the ITS2 with its boundaries (http://its2.bioapps.biozentrum.uni-wuerzburg.de) shared similar secondary structure features and were used as positive dataset.In the study, a total of 4,355 out of the original 5,092 ITS2 sequences from a wide variety of eukaryotic taxa (http://www.ba.itb.cnr.it/UTR/). The sequence diversity among the ITS2 and UTRs datasets was explored comparatively using the Needleman-Wunsch (NW) figure S1).The negative set or control group comprises diverse but structurally related genomic sequences to the ITS2 class: the untranslated regions (UTRs) of eukaryotic mRNAs. They are non-coding regions with divergence among the eukaryotes but showing a more conserved secondary structure when are transcribed into RNAs Training and test series were randomly selected. The members of the test set were selected taking out at random the 20% of the overall data . The remainder of the cases was used to train the model. Sequences with ambiguity at least in one nucleotide position were removed from both groups. Each ITS2 and UTR sequence retrieved was labeled respecting its original database ID code; see k) introduced previously by Estrada et al. (1996) All sequences (positive and negative sets) were pseudo-folded into a Cartesian system by TI2BioP to obtain the artificial secondary structures as it was described above. On the other hand, they were also used to infer optimized DNA secondary structures by the Mfold algorithm implemented in the RNASTRUCTURE 4.0 software B) for the DNA/RNA sequences. B is a square matrix of n×n row and column where its non-diagonal entries are ones or zeroes if the corresponding bonds or edges share or not one nucleotide. Thus, it set up connectivity relationships between the nucleotides in certain DNA/RNA graph. The different powers of B give the spectral moments of higher order.The topological indices called “spectral moments” were calculated as the sum of the entries placed in the main diagonal of the bond adjacency matrix  between two bound nodes. The charge value q in a node is equal to the sum of the charges of all nucleotide placed on it. The electrostatic charge of one nucleotide was derived from the Amber 95 force field B in order to numerically characterize the pseudo-folding (pfμk) of DNA/RNA sequences.kB = (B)k, which are the natural powers of B.In the DNA/RNA artificial secondary structure, the number of edges (e) in the graph is equal to the number of rows and columns in In order to illustrate the calculation of the spectral moments, an example is developed below. The 2D Cartesian network of the sequence (AGCTG) is showed in the pfμ1, for k = 2 the pfμ2 and for k = 3 the pfμ3. The calculation of the spectral moments up to order three from this DNA graph is described below.Expansion of expression (1) for k = 1 gives the TI2BioPversion 1.0 ® arrange automatically the DNA/RNA sequences into a 2D Cartesian network mfμk) based on folding thermodynamics parameters for the positive and negative sets. Another two additional TIs defined as Edge Numbers and Edge Connectivity were introduced for these two DNA/RNA structural approaches; see Feature Selection and Variable Screening module of the Data Mining menu from STATISTICA software We used the The General Discrimination Analysis (GDA) was carried out for building up linear models for ITS2 alignment-free identification We used ANN method for ITS2 classification using the same series of TIs as input variables and only one output variable (ITS2 membership). We used the Multilayer Layer Perceptron (MLP) due to its ability to model functions of almost arbitrary complexity showing a simple interpretation as a form of input-output model. To select the right complexity of the network, we tested different topologies to the MLP while checking the progress against a selection set to avoid over-fitting during the two-phase (back propagation/conjugate gradient descent) training algorithm The optimal cutoff for ITS2 gene classification for ANN-models was defined by determining on the ROC-curve the model's parameter values (‘accept’ and ‘reject’ classification thresholds) giving the nearest point  to the  coordinates. This point constitutes the ideal condition for ITS2 classification . The optimal operating point was determined by computing the slope S that considers the misclassification costs for each class. The point was found by moving the straight line with slope S from the upper left corner of the ROC plot  down and to the right until it intersects the ROC curve.Three training subsets were selected to build up several profile HMMs for ITS2 gene classification: (i) 134 sequences extracted representatively from the original training set (2802 ITS2 sequences) to represent evenly the whole range of sequence similarity while retaining representative members from all the eukaryotic taxa within the training set  was used hmmbuild release 2.3.2 fast option of the hmmbuild program was used with a default value equal to 0.5. This option assigns the insert state to every column in the alignment containing gaps in at least half of the sequences. In this way, the resulting HMMs do not make an explicit use of the sequence distribution (i.e. nucleotides frequencies) of positions with high amount of gaps but rather consider them as insertion states.Alignments were edited in every case as follows: aligned positions were removed from both ends until gaps were observed in less than 10% of the aligned sequences. Thus, we removed non-informative positions from the multiple alignments that could deteriorate the resulting HMM. Edited alignments were used as input for Petrakia sp. (see below) using hmmsearch. An optimal cutoff for the ITS2 classification was determined by running each profile HMM at 20 different E-values (0.1–10). The E-value that maximizes both sensitivity and specificity was selected as the optimal classification cutoff. The performance of these models at the optimal classification cutoff was compared to that of the alignment-free models described above (sections 2.2.2 and 2.2.3).The obtained profile HMMs allowed to classify members of the test set, as well as the newly isolated ITS2 sequence from We defined an empirical threshold of ITS2 representatives with more than 60% of sequence similarity with our query fungus (Petrakia sp. ef08-038) among the members of the Ascomycota phylum for the phylogenetic analysis. This allowed the retrieval of an ITS2 subset comprising 16 sequences that encompassed several classes from the subphyla Pezizomycotina , while the remaining cases were either taxonomically characterized as mitosporic Ascomycotas  or unclassified Ascomycotas. The 16 ITS2 sequences plus our query sequence (FJ892749) were aligned with the CLUSTAL W setting a Gap Open Penalty (GOP) of 20 and a Gap Extension Penalty (GEP) of 10. The final alignment was edited removing end gaps and the phylogenetic analyses were conducted in MEGA4 software NJ trees based on different evolutionary distances computed using Jukes-Cantor (JC), Kimura 2-parameter (K2P) and Maximum Composite Likelihood (MCL) substitution models were obtained using the MEGA4. In addition, the Minimum Evolution (ME) method was assessed on the JC and K2P distance matrices. The bootstrap support (BS) values for nodes were computed from 1000 replicates.A NJ tree was built based on the hierarchic clustering that uses the Euclidean distance matrix as a multidimensional measure to form the sequences clusters. Euclidean distance (Ed) was computed from the TIs values of the same seventeen ITS2 sequences mentioned above and the complete linkage or furthest neighbor was used as cluster method.Petrakia strain was isolated from leaves of Acer psedoplatanus. The plant material was collected in Kaiserslautern, Germany. It was cut and surface-sterilized by immersion in 70% ethanol for 1 min, 5% NaOCl for 3 min and 70% ethanol for 1 sec followed by a wash in sterile distilled water. Samples were then cut into small fragments and plated onto 2% malt agar with penicillin G and streptomycin sulfate (each 200 mg/l). The mycelial culture was deposited in the culture collection of the Institute of Biotechnology and Drug Research (IBWF), Kaiserslautern.5′-GGAAGTAAAAGTCGTAACAAGG) and ITS4 (5′- TCCTCCGCTTATTGATATGC) according to White et al. DNA extraction was performed as described previously by Sacks μ0- μ15) of the bond adjacency matrix between the nucleotides arranged into the Cartesian space (pfμk) and between the nucleotides connected into the Mfold structures (mfμk). Other two additional TIs were computed (the Edge Numbers and the Edge Connectivity) for each class. The spectral moments are structural-based TIs that describe electronically the nucleotide connectivity at different orders in these two structural approaches. The Nandy-like structure is determined by the sequence order and DNA/RNA nucleotide composition. The 2D structure obtained by the Mfold software depends also of the primary sequence but its folding is driven by the optimization of thermodynamics parameters (lowest folding free energy-ΔG0).Two classes of predictors comprising 18 TIs each were calculated by the TI2BioP methodology for 19,012 genomic sequences : the spectral moments series , we carried out a feature selection as a preliminary variable screening method before the model building. We found that the four most significant variables (p<0.01) were the Edge Connectivity, the nd mfμ15 figure 3STATISTICA software These two sets of four variables were used as input predictors to build classification linear models based on the GDA implemented in the The MLP was tested at different topologies using the four predictors already selected for each secondary structural approach as input variables. From the same training set used to develop the discriminant function, an independent data set (the selection set) was selected. This subset was chosen randomly taking out the 20% of the training set being not used in the back propagation algorithm. Thus, 12,168 cases were used for the training, 3,042 represented the selection subset and the 3,802 cases were evaluated in external validation to set the comparison.The  and File S3. The structural TIs based on the folding thermodynamics rules provide a more accurate description of the DNA/RNA structure, which is supported by the classification results . Moreover, for the other alignment-free model that used Nandy-like's TIs, the “acceptance” classification threshold was 0.529 showing a sensitivity of 0.838 and a specificity of 0.988.Although ANN-based models are more complex than linear functions, the architecture of these networks is rather simple since they use just four predictors and one hidden layer made up of four neurons for the case of the TIs calculated from Mfold structures and two layers with the same amount of neurons for the Nandy structural approach figure 5Hidden Markov Models (HMM) has been widely used for classification purposes of DNA and protein sequences File S6) and when the profile HMMs based on improved MSA algorithms was applied. The use of a wider training set comprising 2802 ITS2 sequences also improved the classification performance for the profile HMMs based on DIALIGN-TX and MAFFT algorithms since this dataset better captures the vast diversity of the ITS2 class. However, the ITS2 query sequence from Petrakia sp. was identified with a higher significance level when a fungi-specific dataset aligned with MAFFT was considered for building the models (As shown in e models Table 3.File S4) and the ITS2 profile HMMs generated with the aforementioned MSA algorithms on the three training sets described in section 2.3 (File S5).We provide information about the MSA handled with CLUSTALW, DIALIGN-TX and MAFFT  assures a good classification; the maximum sensitivity obtained on the test set was only 66.66% Table 3.As a practical validation, a novel ITS2 genomic sequence was isolated from a fungal isolate as a part of its taxonomic characterization. This ITS2 sequence was used to evaluate the ability of the ANN-models and the profile HMMs to identify a novel member of this gene class and also its use into the traditional and alignment-free phylogenetic assessment.Petrakia that lives inside plants of the genus Acer, which can be a latent pathogen agent of these plants and a potentially producer of bioactive compounds Petrakia genus are placed inside the Ascomycota phylum despite the absence of a defined ascus . These fungi that produce conidia (mitospores) instead of ascospores were previously described as mitosporic Ascomycota We selected the fungal genus Petrakia such as: aerial mycelium, cover entire plate of Malt Extract Agar medium, conidiophores forming dark sporodochium, conidia pigmented, many-celled, muriform, with several cylindrical projections Our fungal isolate showed all morphological characteristics of a mitosporic Ascomycota/ genus We isolated a genomic DNA fragment of 558 bp comprising the entire  region with shorts ends at 5′and 3′positions corresponding to the 18S and 28S rDNA conserved genes, respectively  against the NCBI database was carried out to support the annotation of the newly isolated sequence by looking for hits belonging or related to the Petrakia genus. We retrieved the second best hit (HQ433006) from an uncultured fungus from the Ascomycota phylum. The score (172) and sequence similarity (89%) between our query and this hit were significant . However, the BLAST search did not find any hit from the Petrakia genus except our own submission (first hit). This confirms that Petrakia genus is not well-represented at NCBI and has not been deeply studied yet either taxonomically or as a source of novel secondary metabolites.By contrast, profile HMMs generated with different MSA algorithms and different training sets showed in general a poor classification performance on the ITS2 sequence of orrectly Table 3.Petrakia (with the exception of our sequence submission at the GenBank) precluded performing a phylogenetic analysis at the species level . We classified our fungal isolate as a mitosporic Ascomycota/Petrakia sp. according to its mycological culture features, as there is not a report with a detailed taxonomy about this genus namely in the NCBI dedicated ‘Taxonomy’ database (http://www.ncbi.nlm.nih.gov/tanonomy). Furthermore, there is no specification about its subphylum and class Petrakia may complement its taxonomy relatively to the ascus-bearing taxa. First, we assumed that our fungal isolate belonged to the Pezizomycotina subphylum, the largest within Ascomycota phylum. Our inference agree with a recent classification found in the “The dictionary of the Fungi” The lack of other ITS2 sequences from different species of the genus Petrakia isolate is similar to the Dothideomycetes class members .Two different types of distance trees were built: (1) a traditional one based on multiple alignments of ITS2 sequences and (2) another irrespective of sequence similarity supported by the TI2BioP methodology. Both phylogenetic analyses, the traditional and the alignment-free clustering, showed that the ers  and 8. Dothfigure S3). Similar outcomes were obtained when different clustering methods were computed using the Euclidean distance to plot the trees (figure S4). These two facts support the consistency of our original alignment-free clustering despite the difficulty to perform a statistical significance testing, as unlike many other statistical procedures, cluster analysis methods are mostly used when we do not have any a priori hypotheses. One way to measure the validity of the cluster information generated by the linkage function is to compare it with the original proximity data generated by the pairwise distance (Euclidean) function. If the clustering is valid, the linking of objects in the cluster tree should have a strong correlation with the distances between objects in the distance vector. The cophenet function compares these two sets of values and computes their correlation, returning a value called the cophenetic correlation coefficient (ccc) Furthermore, we evaluate the stability of our results on the NJ-tree clustering: (i) by measuring the influence of several alignment-free distances  in addition to the Euclidean distance, (ii) by assessing other clustering methods  and (iii) by calculating the cophenetic correlation coefficient for the clustering depicted in the Phyllactinia moricola (outgroup) is placed far from the rest of the members (inner group). Therefore, the NJ clustering based on the Euclidean distance matrix computed from our alignment-free indices largely agrees with the traditional NJ distance tree, which have a phylogenetic meaning since is based on evolutionary distances.The tree topologies obtained for both approaches are somewhat similar as well as the sub-topologies within the Ascomycota classes, specially the Petrakia's location among the Dothideomycetes. Moreover, These findings support the importance of including ITS2 structural information when assessing the phylogenetic relationships at higher levels in eukaryote evolutionary comparisons. Although the Euclidean distance is simply a sort of geometric distance in a multidimensional space with no phylogenetic meaning, it led to an effective hierarchical biological clustering with an evolutionary approach because it was derived from the TIs containing both sequence and structural information.Topological indices containing information about ITS2 sequences and structures are effective to produce ANN-models with a high prediction power despite the sequence diversity of this class. The use of artificial but informative DNA/RNA secondary structures is a less-costly alternative for the ITS2 classification when higher structural levels are not available or the correct structure is only rarely found by standard RNA folding algorithms. TI2BioP provided simplicity and reliability to ANN-models to search a novel ITS2 member, performing even better than the profile HMMs built up with optimized MSA algorithms for low overall sequence similarity. In addition, our alignment-free approach is effective to construct hierarchical distance-trees containing relevant biological information with an evolutionary significance.File S1Exploring ITS2 and UTRs sequence diversity by Needleman-Wunsch and Smith-Waterman procedures.(DOC)Click here for additional data file.File S2IDs, training and prediction series, values of the TIs predictors for the ITS2 and UTR sequences.(XLS)Click here for additional data file.File S3Classification results derived from ANN-models on the training, selection and test set for the two structural approaches.(XLS)Click here for additional data file.File S4MSA performed by several algorithms  using three different training sets (File S4.1–4.9).(RAR)Click here for additional data file.File S5ITS2 profile HMMs generated with the MSA showed in File S4 (File S4.1–4.9).(RAR)Click here for additional data file.File S6ROC analysis for each profile HMM at 20 different E-values (0.1–10).(XLS)Click here for additional data file.Figure S1vs all) for the ITS2 and UTRs sequences evaluated in this study using the Needleman-Wunsch (NW) (in light gray) and Smith-Waterman (SW) (in dark gray) alignment algorithms.Pair wise comparison Click here for additional data file.Figure S2Neighbor-joining trees based on JC (in black) and MCL (in red) substitution models and ME trees based on the JC (in green) and K2P (in blue) evolutionary distances.(TIF)Click here for additional data file.Figure S3Petrakia sp. ef08-038, (2) 1835168 Pyrenophora avenae [Dothideomycetes], (3) 2735013 Ampelomyces sp.DSM 2222 [Dothideomycetes], (4) 11191992 Microsphaeropsis amaranthi [mitosporic Ascomycota], (5) 20531622 leaf litter ascomycete strain its301 [unclassified Ascomycota], (6) 32442335 Botryosphaeria corticola [Dothideomycetes incertae sedis], (7) 45502431 Cenococcum geophilum [Dothideomycetes], (8) 13242223 Caloplaca chlorina [Lecanoromycetes], (9) 11993310 Rinodina bischoffii [Lecanoromycetes], (10) 29725499 Cladia aggregata [Lecanoromycetes], (11) 19070580 Pseudocyphellaria granulata [Lecanoromycetes], (12) 25136312 Graphium pseudormiticum [Sordariomycetes], (13) 3420858 Oidiodendron scytaloides [Leotiomycetes incertae sedis], (14) 28974832 Tricladium splendens [mitosporic Ascomycota], (15) 5442303 Salal mycorrhizal UBCtra179 [unclassified Ascomycota], (16) 18644046 Mollisia minutella [Leotiomycetes], (17) 1843420 Phyllactinia moricola [Leotiomycetes].Neighbour-joining trees built with different alignment-free distance metrics: Euclidean (in black), City-block (in blue), Chebychev (in red) and Power (in green) distances. Each taxa is labeled for a number as follow: (1) FJ892749 (TIF)Click here for additional data file.Figure S4Joining-tree clustering using different methods for the linkage of the Euclidean distance: Complete linkage (in black), single linkage (in blue), unweighted pair-group average (in red) and the Ward's method (in green). Taxa are labeled by numbers as in the (TIF)Click here for additional data file.


Clustering is a fundamental operation in the analysis of biological sequence data. New DNA sequencing technologies have dramatically increased the rate at which we can generate data, resulting in datasets that cannot be efficiently analyzed by traditional clustering methods.This is particularly true in the context of taxonomic profiling of microbial communities through direct sequencing of phylogenetic markers (e.g. 16S rRNA) - the domain that motivated the work described in this paper. Many analysis approaches rely on an initial clustering step aimed at identifying sequences that belong to the same operational taxonomic unit (OTU). When defining OTUs , scientists must balance a trade-off between computational efficiency and biological accuracy, as accurately estimating an environment's phylogenetic composition requires computationally-intensive analyses. We propose that efficient and mathematically well defined clustering methods can benefit existing taxonomic profiling approaches in two ways: (i) the resulting clusters can be substituted for OTUs in certain applications; and (ii) the clustering effectively reduces the size of the data-sets that need to be analyzed by complex phylogenetic pipelines .To address the challenges outlined above, we developed DNACLUST, a fast clustering tool specifically designed for clustering highly-similar DNA sequences.k-mer based filtering algorithms.Given a set of sequences and a sequence similarity threshold, DNACLUST creates clusters whose radius is guaranteed not to exceed the specified threshold. Underlying DNACLUST is a greedy clustering strategy that owes its performance to novel sequence alignment and DNACLUST can also produce multiple sequence alignments for every cluster, allowing users to manually inspect clustering results, and enabling more detailed analyses of the clustered data.We compare DNACLUST to two popular clustering tools: CD-HIT and UCLUST. We show that DNACLUST is about an order of magnitude faster than CD-HIT and UCLUST (exact mode) and comparable in speed to UCLUST (approximate mode). The performance of DNACLUST improves as the similarity threshold is increased (tight clusters) making it well suited for rapidly removing duplicates and near-duplicates from a dataset, thereby reducing the size of the data being analyzed through more elaborate approaches. Clustering of sequences (DNA or protein) is a common and basic analysis in bioinformatics that underlies many biological analyses. Clustering can be used to reveal underlying natural groupings of data. Clustering can also be used to simply reduce the size of a large dataset, such that a slower, more accurate, analysis can be applied . The resSequence analysis of the 16S rRNA is one of the most commonly used methods for measuring microbial diversity and taxonomic composition of an environment. There are two complementary approaches to the analysis of 16S data: comparative classification, and unsupervised clustering. In the comparative approach, the taxonomic identity of a new sequence can be determined if it is similar to some of the sequences present in a curated database . This apThe traditional approach for clustering 16S rRNA sequences involves building a multiple sequence alignment (MSA) of all sequences, computing a pairwise distance matrix based on the MSA and clustering the resulting matrix .Since the latest DNA sequencing technologies have become faster and cheaper, we are now faced with very large volumes of sequence data. Newer generations of sequencing technologies, e.g., 454 Life Sciences sequencing machines, can generate millions of sequences per run, each of which has a length of hundreds of base pairs. Such datasets cannot be easily clustered using the traditional approach outlined above.First of all, finding the best multiple sequence alignment is computationally intractable - this problem falls into the category of NP-hard problems, i.e. problems that can only be solved by exploring an exponential number of possible solutions. Multiple sequence alignment tools rely on heuristic alignment algorithms that are not guaranteed to generate an optimal alignment .The most common heuristic involves building a guide tree  that then guides the construction of the multiple alignment. Often, the guide tree is constructed from a preliminary distance matrix constructed from pairwise alignments of the sequences - for large data this matrix is impractical . Furthermore, determining a guide tree is difficult for large datasets since there could be many trees that fit the distance matrix equally well.An alternative to the traditional clustering approaches that rely on multiple alignments, is a simple, yet effective, greedy clustering strategy. The process starts by selecting a sequence as a "seed" for a cluster. Additional sequences are added to this cluster if they fall within a certain distance from the seed. The process continues by selecting an unclustered sequence as the seed for a new cluster, and so on until all sequences have been clustered. This basic approach is employed by the programs CD-HIT ,UCLUST , and ourThe approach we present in this paper involves searching each cluster seed against a database of all unclustered sequences, thereby "recruiting" a set of sequences to the newly created cluster. We will show that this approach allows us to leverage an efficient search data structure to rapidly cluster large sets of sequences. Our approach is particularly well suited for high-stringency clustering (high similarity between the clustered sequences), intended to remove redundancy in the dataset by co-clustering sequences that are identical or whose differences are primarily due to sequencing errors. Representative sequences from each cluster can then be used as input to more computationally intensive analyses.There are two popular tools designed for clustering large number of sequences: CD-HIT and UCLUST. CD-HIT  has beenCD-HIT uses a greedy incremental clustering algorithm. First the sequences are sorted in non-increasing order of their lengths. The first sequence becomes the first cluster representative. Each consecutive sequence is compared to all previously discovered cluster representatives, and is added to a cluster if it is within a user-selected distance threshold from the corresponding representative. Otherwise the sequence becomes the seed for a new cluster.k-mer spectrum , and the initial comparison between sequences is performed between the corresponding spectra. If the k-mer counts differ significantly, it is unlikely that the sequences match each other well. CD-HIT relies on a statistical analysis to estimate the minimum number of k-mers that two sequences are expected to have in common, assuming they have a certain similarity to each other.CD-HIT uses a "short word filtering" heuristic to avoid computing many of the costly pairwise alignments. Specifically, each sequence is represented as a k-mers shared by each sequence and all previously selected cluster representatives.This filtering approach can be computationally expensive as it requires counting the number of UCLUST follows virtually the same algorithm as CD-HIT, with two major exceptions: (i) sequences can be sorted in different ways, rather than simply by length (as done by CD-HIT); (ii) the mapping of sequences to existing cluster representatives is performed with a new search heuristic called USEARCH.By default, UCLUST operates in an inexact mode. In the inexact mode each sequence is not aligned to all cluster centers found so far. Instead UCLUST sorts the cluster centers based on the number of "words" they have in common with the query. Each query sequence is thus aligned only with a few of the cluster representatives (up to a predefined constant), which are presumed most likely to be close to it. In the exact mode UCLUST operates more or less like CD-HIT, i.e. each query sequence is aligned to all cluster centers found so far. In this mode the word based filter is not used.The inexact heuristic guarantees that the number of pairwise alignments is linear . In practice, this approximation could result in many more clusters than the exact mode, however the extent of this "blow-up" depends on the stringency of the clustering.We describe the algorithms used by our tool in the following section. In the Testing section we evaluate the performance and quality of our implementation.k-mer based filter which are also described in this section. Some definitions and general concepts are covered first.The main goal in the design of our algorithms is computational efficiency and scalability. In this section we present a simple greedy clustering algorithm which avoids most of the pairwise comparisons in practice. The clustering algorithm uses an alignment search algorithm and a edit distance  - a measure that counts the minimum number of insertions, deletions, or substitutions that are required to transform a sequence into the other; k-mer distance - a measure of the number of substrings of length k that are shared (or differ) between two sequences; and evolutionary distance - an estimate of the number of evolutionary events  that explain the differences between two sequences. In many cases more than one distance measure is used during clustering, e.g. a k-mer approach can be used to quickly discard sequences that should not belong to a same cluster, then a more precise, but slow, algorithm is applied .Clustering is intimately interconnected with the definition of the distance or similarity measure used to compare the objects being clustered. Several distance measures have been commonly used to compare sequence data, including Our approach defines the distance between two sequences to be the corresponding edit-distance where the cost function is simply unit cost for each gap or mismatch, and zero cost for matches. In the case of sequences of different lengths, we may want to allow gaps at the end and/or the beginning of the shorter sequence in the alignment, without penalty. This type of alignment is referred to as semi-global alignment. The default behavior of DNACLUST is to allow gaps at the end of a sequence but not at the beginning , however other alignment policies can be selected through command-line parameters.diameter of a cluster as the maximum distance between any two sequences in the cluster. Our algorithm (like CD-HIT and UCLUST) returns one sequence per cluster as cluster representative. There is another related but slightly different concept of the cluster center, usually picked in such a manner that the maximum or average distance from it to the rest of the items in the cluster is minimized. In the following we sometimes loosely use the term cluster center to refer to the cluster representative. Given a cluster representative, the cluster radius can be defined as the maximum distance from the cluster representative to any sequence in that cluster. Given that the edit distance measure is a metric  we also guarantee that the cluster diameter is at most twice the cluster radius.We define the A, B, and C, dist + dist ≤ dist), implying that even though the cluster radius is small the cluster diameter may be high, i.e. while the distance between all the sequences in the cluster and the cluster representative is small, individual sequences may differ significantly from each other. As a result, the cluster is not as "tight" as would be implied by the distance threshold used. Furthermore, the resulting multiple alignment is of lower quality. global alignment score. In this context, the "similarity" between two sequences can be defined as:Here the "length of the shorter sequence" refers to the length before alignment and does not include the gaps induced by the alignment.Note, however, that due to the different definitions of distance, the clusterings produced by DNACLUST, CD-HIT, or UCLUST cannot be directly compared at a given clustering threshold.The clustering problem that we study in this work has the following form: given a set of sequences and a threshold on the cluster radius, group these sequences into clusters, and identify one sequence within each cluster as the cluster representative.Given a metric distance between a set of items, any clustering of these items can have one or more of the following properties:1. The radius of every cluster is less than or equal to the specified threshold.2. The distance between any two cluster centers is strictly greater than the threshold.3. The distance between any clustered item and any cluster center (except the center of the cluster to which the item belongs) is strictly greater than the threshold. This implies that the closest center to any item is the center of its cluster.valid if it satisfies property 1. A valid clustering with the minimum number of clusters is called an optimal clustering. Unfortunately, finding an optimal clustering  is NP-hard [exact clustering. Our search and filter algorithms are designed to be able to create exact clusterings.A clustering is  NP-hard . A clustwell-separated clustering.  the same length, it has been proposed that ordering the sequences by abundance results in a better clustering ,12, espequery sequence. The distance measure can be based on either global alignment cost, or semi-global alignment cost, in which case the gap costs at one or both ends of the shorter sequence are ignored. Either of these policies can be picked by the user using the command line options. This search is the most time consuming step of the algorithm, and is described in more detail in the next section.Note, however, that a full evaluation of the phylogenetic interpretation of clustering strategies is beyond the scope of our work. Our main goal was to develop an efficient and mathematically well-defined clustering approach. More complex analyses of the data that, e.g., take into account phylogenetic signal, can be performed by post-processing the output of our software. In order to generate an exact clustering, the search step must find all the unclustered sequences that are within the specified radius from the cluster center. In this context we refer to the cluster center as the r is constructed, we also flag every unclustered sequence within distance 2r from the center of the new cluster. The flagged sequences can not be picked as cluster centers in subsequent iterations of the greedy algorithm, but may be included in a cluster constructed around an unflagged cluster center. This approach ensures that the distance between two cluster centers can not be less than two times the cluster radius. In order to implement this algorithm all we need to do is to double the search radius but only cluster the sequences that fall within the clustering threshold.This algorithm can be easily modified to construct well separated clusters (property 3 in the previous section) as follows. Each time a new cluster of radius Our alignment search algorithm is designed to find all good (semi-) global alignments of the query sequence to a large set of sequences simultaneously. The main speed up is achieved by taking advantage of the fact that we are only interested in alignments that are high-quality: have a cost which is less than or equal to a certain threshold.It is easier to explain this algorithm if we assume that all the sequences are stored in a trie data structure . We travThe pairwise alignment and the cost are computed using a dynamic programming algorithm, a variation of the Needleman-Wunsch algorithm .S1 and S2 of lengths n1 and n2. We fill an n1 × n2 table of numbers, such that the element at position  of the table - Ti,j) (- contains the score (i.e. cost) of the "best" alignment of the first i characters of S1 to the first j characters of S2. In our case, the types of differences that are allowed are insertions, deletions and substitutions, and Ti,j) , the total amount of computation needed to fill this table  is proportional to The table is initialized as follows: If we are interested in a semi-global alignment  as we backtrack through the common prefixes of sequences in a suffix trie, and update the table as necessary. On the horizontal axis of the dynamic programming table Figure  the querAlso, assuming unit cost for each gap (insertion or deletion), we do not even have to update all of the cells on the current row in the dynamic programming table after traversing an edge in the trie . As is sS1 and S2, and any i and j, dist ≥ dist where dist is the edit distance.This is due to the fact that for any two sequences The main heuristic that speeds up this algorithm relies on the observation that it is not always necessary to compute the alignments of the query to all paths in the trie all the way to each leaf. Instead, during the depth-first search, if at any point the alignment cost of the prefix is too high, the recursive search terminates without further exploring the children of the current node in the trie.in lexicographically sorted order. As we proceed to align one of the sequences (S) to the query we are also implicitly aligning all adjacent sequences that share a common prefix with S. In other words, each internal node of the virtual trie corresponds to a unique consecutive sub-list of the sorted list of sequences, in which the shared prefix of the sequences corresponds to the path from the root of the trie to that internal node.The trie data structure described above is not explicitly built in our implementation. Instead we keep a list of the sequences α characters of sequence i (ith sequence in the sorted list), and the common prefix of sequence i and sequence i + 1 is longer than α, we do not need to try to align sequence i + 1 at all. The search algorithm is very similar to the algorithm in [Effectively we first try to align the first sequence to the query (in our case the cluster representative). If the alignment is good then the first sequence is added to the search results. When aligning the second sequence, and so on, we can avoid re-aligning its common prefix with the previously aligned sequence, thereby reducing the cost of computation. Note that if we fail to align the first say rithm in , except rithm in  once, inOne valuable output of a sequence clustering algorithm is a multiple sequence alignment representing the global relationship between the sequences present in the cluster. Such a multiple alignment can be used by users to manually inspect the quality of the clustering, and can also represent the substrate for more complex analyses (e.g. computation of evolutionary distances between the sequences).We rely on a "star" multiple alignment heuristic that computes the multiple alignment from the pairwise alignments between each of the sequences and the cluster representative. The pairwise alignments between the sequences and the representative are a byproduct of our search algorithm. To construct the multiple alignment we reconcile the differences between these pairwise alignments by inserting gap characters as necessary. .k-mer based filtering [Finding the best pairwise alignment of two sequences using dynamic programming is computationally intensive. It requires quadratic time in the length of the input sequences, in the general case. In our clustering application, however, it is possible to avoid calculating a pairwise alignment altogether, if we are certain that no good alignment exists. We use iltering  to speedS of length n (e.g. one of the sequences we are trying to cluster), a k-mer is a substring of S of length k, where k is chosen to be much smaller than n. Sequence S contains n - k + 1 overlapping k-mers, some of which may be identical.Given a sequence k-mers. In the following we formalize this idea.The filter is based on the key intuition that if two sequences are within a small edit distance from each other, they must share most of their k to the possible k-mers. Given a sequence s, by counting how many times each one of the 4k k-mers appears in the sequence we obtain a vector of non-negative integers of dimension 4k . Namely the ith element of this vector, i v, counts the number of times that k-mer number i appears in s. We call this vector the k-mer spectrum of the sequence s, and it is is denoted by spectrumk (s).Let us assign numbers from 1 to 4v, define pos(v) to be the sum of the positive values in the vector. Similarly define neg(v) to be the sum of the negative values. For example, for any sequence s of length n, we have pos(spectrumk (s)) = n - k + 1 and neg(spectrumk (s)) = 0.Given a vector of integer numbers, s1 and s2, that are close to each other. The following observation bounds the maximum difference between their k-mer spectra.Consider two sequences, Observation 1. If s2 has edit distance d from s1, then, for all k, pos(kspectrum(s1) - k spectrum(s2 )) ≤ k × d and neg(kspectrum(s1 ) - k spectrum(s2)) ≥ -k × d.Proof. See part 2 of Additional file a substring of the other sequence. The following observation helps the handling of this case.Since we want to be able to report sequences that might have a good semi-global alignment to the query sequence, we have to consider the case in which one sequence is within a small edit distance from Observation 2. If a sequence s1 is a substring of s2, then, for all k, neg(kspectrum(s2 ) - k spectrum(s1)) = 0.Lemma 1. If s1 has edit distance d from s* and s* is a substring of s2, then, for all k, pos (kspectrum(s1) - kspectrum(s2 )) ≤ k × d.Proof. See part 2 of Additional file q, a sequence s, and a distance threshold d, if for any k we haveUsing Lemma 1, given a query sequence s to q exists which corresponds to a distance less than or equal to d.then we can be certain that no semi-global alignment of k-mer counts can quickly discard subtrees that do not have any sequence close to the query.  Creating an exact clustering takes more time. For these tools we have measured the running time in both settings.DNACLUST and UCLUST can produce exact or approximate (i.e. inexact) clusterings. (The definitions of these terms are provided in the Algorithm section - We have created clusterings at different similarity/identity thresholds for each tool and each setting. (Sequence identity and sequence similarity are discussed in detail in the definitions part of the Algorithm section.) The radius of the clusters created range from 0.95 up to 0.995 similarity. . In addition, for highly-similar sequences, the search heuristic used by UCLUST becomes less efficient. DNACLUST in exact mode is faster than UCLUST for any similarity threshold above 0.95.UCLUST in inexact mode is much faster than in exact mode, and thus faster than DNACLUST in most cases. In inexact mode DNACLUST is faster than UCLUST only for similarity thresholds greater than or equal to 0.98. Both DNACLUST and UCLUST in inexact mode are roughly an order of magnitude faster than CD-HIT.k-mer filtering strategy (DNACLUST in inexact mode) leads to only a small increase in the number of clusters (<3%), i.e. our inexact heuristic is more effective in terms of speeding up the algorithm without significantly affecting the results of the clustering.As seen in Table The second dataset contains all full 16S rRNA sequences from the Ribosomal Database Project . We pickThis test is meant to evaluate the performance of our algorithm on long sequences such as those that may be generated by future sequencing technologies. The running times of DNACLUST and UCLUST on the RDP dataset are shown in Table >0.95): UCLUST in the exact mode takes more than 130 hours to cluster this dataset, in contrast to just over 6 hours for DNACLUST.The sequences in the RDP dataset are almost three times longer than the earlier dataset, allowing us to evaluate how our approach scales with anticipated increases in read length. The alignment algorithm is slower on these data since, at the same level of similarity/identity between sequences, the total number of differences is higher. The trends in the performance are, however, consistent with the results observed on the twins dataset. DNACLUST still outperforms UCLUST for tighter clustering thresholds  with DNACLUST, then uses the cluster representatives (and the size of the clusters) as input for a more sophisticated but slower algorithm which could not otherwise be applied to the original dataset.In the following we compare the quality of the multiple sequence alignment (MSA) produced by DNACLUST and commonly-used multiple alignment algorithms. We are defining the quality of a multiple sequence alignment in a very strict sense, specific to the analysis of 16S rRNA data: we measure how well the distance matrix computed by DNADIST  matches the clustering criteria: i.e. if the clustering threshold (i.e. radius) is 99% identity, we expect the largest value in the distance matrix (i.e. largest diameter) to be lower than 2%.n × n matrix to store the pairwise distances, where n denotes the number of input sequences.To evaluate the quality of the multiple sequence alignment produced by our program we compare it to two of the most popular MSA tools, ClustalW  and MUSCn ≥ 38, 000 ClustalW, and for n ≥ 22, 000 MUSCLE could not run on a machine with 4 GB of RAM. Note that larger datasets could be aligned using MUSCLE given additional RAM or by specifying the main memory limit (-maxmb parameter). The total memory requirements, however, grow quadratically as a function of the number of sequences being aligned, ultimately limiting the size of datasets that can be analyzed on commodity hardware.For To compare the multiple alignment routines, we selected one of the clusters produced by DNACLUST within the twins dataset. This cluster was constructed with a 95% similarity threshold (5% cluster radius), and contained 1117 sequences. These sequences were aligned using MUSCLE and ClustalW (with and without the "-quicktree" option), resulting in three multiple sequence alignments. We compared these "traditional" MSAs to those generated by DNACLUST and UCLUST. A pairwise distance matrix was obtained based on each MSA using DNADIST [This experiment validates the clusters and corresponding MSAs produced by DNACLUST using an independent tool for measuring evolutionary distance between DNA sequences. The DNADIST distance matrices are the underlying data used in the "traditional" 16S rRNA clustering approaches. The results also demonstrate that commonly used multiple sequence alignment tools are not well suited for the alignment of a large number of sequences.DNACLUST and UCLUST rely on a star-alignment heuristic, and use the cluster representative as the one sequence against which all the other sequences are aligned. This approach guarantees that the distance between any pair of sequences within the MSA is at most twice the radius of the cluster. Furthermore, this approach is efficient: building a star MSA only requires time linear in the number of sequences, in contrast to the quadratic time needed to construct the guide tree in most traditional multiple alignment approaches. We further compared multiple sequence alignments produced by DNACLUST and UCLUST. We built clusterings using both programs  from the twins dataset at the thresholds 95%, 97% and 99% . Since computing pairwise distances is computationally intensive especially for large clusters, from each clustering we randomly selected 50 clusters containing between 100 and 500 sequences. For each cluster we also built a multiple alignment using ClustalW.We generated the pairwise distance matrix for each alignment using DNADIST, then computed the average pairwise distance of the aligned sequences. Figure Our results also show that the traditional approach for computing multiple alignments  results in an overestimate of the distances between the aligned sequences , efficient algorithms for clustering are needed.k-mer filtering approach, and to an efficient search strategy that allows us to quickly recruit sequences that could be assigned to a cluster. The software implementation is open-source and competitive with other commonly used clustering tools.In this paper we have focused on a simple greedy clustering approach. Our algorithm's running time depends on the data and the cluster radius threshold, and is particularly effective at high clustering thresholds. The efficiency of our algorithm is due to a new It should be noted that our focus has been simplicity, generality and performance. We do not claim to discover the underlying biological "truth". Such analysis require more sophisticated algorithms and are much more computationally intensive. Our tool can help in reducing the size of the data so that these, more intensive, analyses can be applied. What we provide is a mathematically well defined clustering, which is the best we can hope for given that the biological truth has yet to be unambiguously characterized in mathematical terms.We have compared our tool to state of the art software for clustering large numbers of sequences. An interesting observation is that the running time of DNACLUST decreases as the radius of the cluster is decreased, whereas the running time of UCLUST increases. Our search algorithm is more effective at higher stringencies, while the heuristics used by UCLUST are more effective when sequences are more dissimilar. This suggests that a faster algorithm could be developed that combines the best properties of both approaches.k-mer based filter and alignment search algorithms can also be used for searching against databases that contain a large number of short sequences. In this scenario, the fact that our filter is completely sensitive is very useful. If the sequence database is static, our search data structures can be built once and stored on the disk for subsequent queries. We hope to add this functionality in future versions.Our Finally, it is important to point out that there is still the need for even faster clustering tools. For very large datasets , such as the ones produced by Human Microbiome Project, all available tools take more than a few days to run. Higher performance can possibly be achieved through parallel computation, and we intend to explore such approaches in future versions of our software.The datasets analyzed by biologists are rapidly increasing in size and efficient clustering algorithms are necessary to help reduce the effective size of these datasets. Here we presented a novel approach for sequence clustering that is particularly well suited for high-stringency clustering, outperforming other state of the art clustering tools in this context. While our focus has been the analysis of 16S rRNA sequences, the algorithms we describe can be applied in other contexts as well, e.g. to identify duplicates in high-throughput sequencing data.While more relaxed clustering thresholds are often used in metagenomic studies (≤ 97% similarity), using any fixed threshold is not a good approach for creating biologically meaningful clusters . Here weThe software implementing our clustering approach is freely available under an open-source license.The authors declare that they have no competing interests.MG and MP designed the algorithms. MG developed the program. BL evaluated UCLUST. MG and MP wrote the manuscript. All authors have read and approved the manuscript.Additional information. Proofs of the lemmas, details of the k-mer filter algorithm, pseudocode, illustrations and description of the program arguments are provided in the additional information.Click here for file


The comparative modeling approach to protein structure prediction inherently relies on a template structure. Before building a model such a template protein has to be found and aligned with the query sequence. Any error made on this stage may dramatically affects the quality of result. There is a need, therefore, to develop accurate and sensitive alignment protocols.BioShell threading software is a versatile tool for aligning protein structures, protein sequences or sequence profiles and query sequences to a template structures. The software is also capable of sub-optimal alignment generation. It can be executed as an application from the UNIX command line, or as a set of Java classes called from a script or a Java application. The implemented Monte Carlo search engine greatly facilitates the development and benchmarking of new alignment scoring schemes even when the functions exhibit non-deterministic polynomial-time complexity.http://bioshell.pl/threading3d.Numerical experiments indicate that the new threading application offers template detection abilities and provides much better alignments than other methods. The package along with documentation and examples is available at:  Here we focus on the latter, still challenging problem. Accurate alignment is essential for many state-of-the-art 3D protein structure prediction algorithms [i) lack of a general consensus on scoring schemes and ii)plethora of different variants of the same scoring function described in literature but not available as a ready-to-use software.Protein structure prediction has become one of the key tasks in computational biology of the post-genomic era. Due to the growing size of structural databases, the most important and widely used method is homology modeling. This methodology relies on the existence of structures of homologous protein(s) in databases. The major parts of this procedure are gorithms -4. The di)the two sequences, ii) one sequence and one structure or iii)on the two structures. The first case, corresponding to pairvise sequence alignment is trivial and can be solved by dynamic programming. However, the other two  are NP-hard problems [Our contribution presents a versatile tool for the fast and extensive aligning of two proteins with each other. The alignment can be based on problems . Our novproblems ,7, is anproblems -12 are: i) it employs Monte Carlo (MC) to sample the alignment space so an approximate solution to NP-hard 3D threading problem can be found,ii) each scoring term type is a separate object that can be easily switched on/off and fully customized with user-provided data, e.g. in a single run, several secondary structure similarity scores may be used, each of them based on a different secondary structure prediction,iii) new potentials and scoring schemes can be easily implemented by users,iv) as a result, the user obtains the best scoring solution and a number of suboptimal alignments, ranked by their score; the alignments can be outputted in the Modeller [Modeller  format fv) it can be used as a structure alignment software, also capable of producing suboptimal structure alignments.vi) it can read in and score any arbitrary alignment provided by the user. This can be very helpful in the manual refinement of alignments or for threading force field development.The project website provides extensive documentation of the library (API) and numerous examples which show how to run the executable threading application and how to interact with the software library.i) encoding alignment as system coordinates, ii) moves , iii) scoring and iv) gathering results. Each of these components forms a separate sub-package in the source code tree: jbcl.simulations.threading, jbcl.simulations.threading.movers, jbcl.simulations.threading.ff and jbcl.simulations.threading.observers, respectively. These routines are supported by other generic BioShell components such as Monte Carlo sampling and I/O operations. For user’s convenience we provide also a stand-alone application. To run calculations, the user specifies: i) input data, ii) modification scheme and the of MC sampling and iii) scoring function (force field).The source code was divided into four main blocks: Q) and template (T) proteins is defined as a list of blocks  results in considerably higher computational cost but occasionally might lead to better alignments. The second rule states that an alignment must consist of at least the MIN_NUMBER_OF_BLOCKS, by default equal to 4. This second rule is only a technical trick that gives all movers (see below) a chance to be executed successfully and thus make the sampling process more effective. Since we do not require two neighboring blocks to be separated by a gap, it is always possible to represent a long alignment block as concatenation of several shorter ones. For instance, a perfect alignment of a 100 amino acid sequence with itself may be defined as 25 blocks of 4 residues each, by 4 blocks of 25 residues, or by many other combinations of blocks which are not separated by gaps. All of them however lead to the same alignment and have the same score. Thus the second rule does not limit the sampled conformational space. Moreover, both restricting parameters may be changed by the user from the command line.Protein-to-protein alignment between query . BlockShrink & BlockExpand can shrink or expand a block on either end within the allowed space. A block cannot shrink to a length shorter than the MIN_BLOCK_LENGTH. The length N of shrinking/expanding is generated with 1/2N distribution. BlockPartJump performs a jump of a part of a block to a neighboring block. The length of the jumping part was generated with uniform distribution which does not violate the MIN_BLOCK_LENGTH. BlockSplit can split a block into two parts with conservation of the MIN_BLOCK_LENGTH for both of the two parts. The split is performed with a uniform distribution. BlocksMerge can merge two neighboring blocks when possible. Merging continues as long as the MIN_NUMBER_OF_BLOCKS is fulfilled. BlockAnnihilate can annihilate one of the alignment blocks if the MIN_NUMBER_OF_BLOCKS is not violated. Finally, BlockCreate creates a new block. The user can define how often each of the move types is attempted. Once a mover has been executed and an alignment modified, the new conformation is accepted (or rejected) according to the Metropolis criteria [A list of blocks defines a point in the conformational space of all possible sequence alignments between two proteins. Sampling of this space is performed by a set of movers i.e. objects that attempt to modify an alignment. The following seven types of movers have been implemented so far: Shift a block, Shrink/Expand a block, Merge two blocks, Split one block into two new blocks, Jump part of the one block to a neighbor block, Create a new block and Annihilate a block. The move types have been schematically depicted in the Figure criteria . The samcriteria  or by Recriteria . The lat(i) structure based scores, such as TM-score [(ii) contact potentials such as Miyazawa-Jerningan [(iii) environmental potentials, e.g. solvent accessibility score (iv) sequence profile similarity measures, (v) secondary structure similarity measures and (vi) gap penalty functions. The full list of available scoring methods is provided in Table (i) of scores require the query structure to be provided and can be used either for benchmarking purposes  or for a structure-to-structure Monte Carlo (MC) alignment. Group (ii) scores transform a template contact map onto a query sequence based on a current alignment. Finally, scores from groups (iii), (iv), and (v) use various kinds of profiles: sequence profiles, predicted propensity for a certain secondary structure type, predicted solvent exposure level etc.Each particular alignment is assessed by a scoring function (force field). This function is defined as weighted combination of distinct terms. The scoring terms implemented in the package can be divided into six categories: TM-score  or cRMSDerningan ,19,  that have been affected. Then the program evaluates the energy difference at these positions only. Further, some of the ByAtomEnergy scores can be pre-calculated for every query-template residue position once the program is started and stored in a 2D array. Such scores implement a BigMatrixEnergy interface and SubstitutionScore is an example of it. An interesting case is StrGapPenalty derived from ContactBasedEnergy. Indeed, the penalty for a gap introduced into a template structure is assessed based on the number of lost contacts. The user can easily implement one’s own scoring function by extending one of the provided abstract classes [An inheritance diagram depicting basic relationships between the classes is shown in the Figure  BLOSSUM  or PAM [ BLOSSUM  matrix i classes .Here we use the application in two real life examples to demonstrate the robustness and possible applications of the software. The scripts used in the experiments with the relevant input data were published on the project website.Threading where both the query and the template protein structures are known is equivalent to the protein structural alignment. The calculation of such alignments is a perfect test for searching strategies. In the Bioshell-Threading package there are three scoring functions which can be used for this purpose: TM-score, RMSD and DALI-score. In this contribution we compare the TM-align  algorithhhblits[hhalign, in the global alignment mode.To test the Threading algorithm on more realistic problems, the MALIDUP  benchmarhhblits on the NEnvScore, ProbabilisticSecondaryScore, PICASSO3, GoLikeScore, TwoBodyContact with Miyazawa-Jernigan contact scoring and StrcGapPenalty. The following weights: 0.1, 0.25, 0.5, 1.0, 0.4 and 0.15, respectively were optimized on the ProSup [i.e. average TM-score and alignment overlap with manually curated alignments. The latter was measured as the percent of correctly aligned positions AL0P and the fraction of aligned positions predicted with an error of at most four positions AL4P. For the MALIDUP set it can be observed that the threading algorithm, which incorporates 3D information from the template structure . Profile-based aligners: Threading 1D and HHAlign perform comparably on these benchmarks, whereas BioShell-Threading performs much better. In particular, when compared to HHAlign (column ‘H’), it achieves approximately 0.09 higher AL0P and 0.24 higher AL4P. This is partially due to the fact, that in case of unrecognized homology, HHAlign returns a null alignment . There are some possible applications of this result. It can be used to generate alignment boundaries for protein modeling algorithms which can use such the information [The following scoring terms were used: e ProSup  dataset.ormation ,46. In tRAPTOR - another three dimensional threading where calulations even for short sequences take more than an hour [RAPTOR method however employs branch-and-bound approach and, unlike a stochastic simulation, the reach of the global optimum of a scoring function is guaranteed. Other parameters a user should optimize are: scoring function weights and probabilities of particular alignment modifications (i.e. moves). The extensive study of this parameter space is beyond the scope of this paper and will be described elsewhere. In this work, to avoid overtraining, we optimized the scoring function and movers set on ProSup data set [The computational approach utilized in this contribution is an example of a stochastic simulation rather than a typical alignment method. User has to define a number of parameters to control this process, such as the number of Monte Carlo replicas and the respective set of their temperatures. Fortunately, several methods have been devised for REMC parameters selection, e.g. ,47. In g an hour . RAPTOR data set , which hByAtomEnergy, cannot be recalculated locally just for the moved block. TMAlign, on the other hand, starts from an alignment computed by a dynamic programming procedure and evaluates TM-score a few times until convergence is reached. The threading simulation however provides a numer of different suboptimal alignments which all fall within 0.01 range in TM-score units.The 3D threading application can also be used as a structural alignment method. In the presented benchmark, it has been compared with TMAlign and yielded nearly the same results. CPU time required by TMAlign was however about two orders of magnitude shorther (minutes to an hour by the threading vs seconds by TMAlign). This result is a direct consequence of the number of times each of the two programs calls the TM-score evaluation routine. In order to test the convergence of the threading, calculations were started from a random alignment. During the simulation TM-score has to be evaluated at every Monte Carlo move which, unlike scores derived from BioShell-Threading implements a three-dimensional protein threading algorithm based on a Monte Carlo search scheme. The code has been written in Java language which makes it virtually machine independent. It implements numerous scoring (energy) functions. Some of them can be applied in regular Dynamic Programming. For others, the optimization becomes a NP-hard problem and demand more time consuming methods (e.g. MC). The package provides a ready to use command-line application and a Java software library. This makes BioShell-Threading a component that can be very easily incorporated into larger protein structure pipelines . By provProject name: Bioshell Threading 3D• Project home page:http://www.bioshell.pl/threading3d• Operating system(s): Platform independent• Programming language: Java• Other requirements: Java 1.4 or higher• License: Creative Commons by-sc-nd• Any restrictions to use by non-academics: licence required• The authors declare that they have no competing interests.PG, AK, AK, DG developed the idea and the framework of the software. PG and DG implemented the software and carried out analyses. All authors wrote, read and approved the final manuscript.


Logos are commonly used in molecular biology to provide a compact graphical representation of the conservation pattern of a set of sequences. They render the information contained in sequence alignments or profile hidden Markov models by drawing a stack of letters for each position, where the height of the stack corresponds to the conservation at that position, and the height of each letter within a stack depends on the frequency of that letter at that position.We present a new tool and web server, called Skylign, which provides a unified framework for creating logos for both sequence alignments and profile hidden Markov models. In addition to static image files, Skylign creates a novel interactive logo plot for inclusion in web pages. These interactive logos enable scrolling, zooming, and inspection of underlying values. Skylign can avoid sampling bias in sequence alignments by down-weighting redundant sequences and by combining observed counts with informed priors. It also simplifies the representation of gap parameters, and can optionally scale letter heights based on alternate calculations of the conservation of a position.http://skylign.org.Skylign is available as a website, a scriptable web service with a RESTful interface, and as a software package for download. Skylign’s interactive logos are easily incorporated into a web page with just a few lines of HTML markup. Skylign may be found at  Alignments of multiple biological sequences play an important role in a wide range of bioinformatics applications, and are used to represent sequence families that range in size from DNA binding site motifs to full length proteins, ribosomal RNAs, and autonomous transposable elements. In an alignment, sequences are organized such that each column contains amino acids (or nucleotides) related by descent or shared functional constraint. The distributions of letters will typically vary from column to column. These patterns can reveal important characteristics of the sequence family, for example highlighting sites vital to conformation or ligand binding.A sequence alignment can be used to produce a profile hidden Markov model (profile HMM). Profile HMMs provide a formal probabilistic framework for sequence comparison -3, leverdistribution, Consider a family of related sequences, and an alignment of a subset of those sequences. For each column, we can think of the observed letters as having been sampled from the relative  and absorelative ) and mixrelative ,13-15. Trelative ,17.consensus columns, in which most sequences are represented by a letter, rather than a gap character. In a typical profile HMM, a model position is created for each consensus column, and non-consensus columns are treated as insertions relative to model positions. As with letters, the per-position gap distributions may be estimated from observed or weighted counts, or combined with a Dirichlet prior.In an alignment, a subset of the columns will be information content of that position. The height of each letter within a stack depends on the frequency of that letter at that position. Logos were originally devised to represent the extent of letter conservation in each column of an alignment [A logo provides a compact graphical representation of an alignment, representing each column with a stack of letters. The total height of each stack corresponds to a measure of the invariance of the column – typically, it is the lignment ,19, and lignment .A consisting of L letters, a1 through aL . For a given column in an alignment, we capture the estimated column distribution as a length-L vector pi is the probability of observing letter ai at that column. We define the length-L vector A, such that qi is the background probability of observing letter ai, typically based on letter frequency in a large set of representative sequences.Consider an alphabet information content[elative entropy or Kullback–Leibler distance[Given n content of the c distance,21, is dbits. This value indicates the extent to which a column’s distribution When the base of the log is 2, the information content is expressed in A based on ai within a stack is pi appear near the top in the stack. An example is shown in Figure For a conventional logo, a stack’s height is spread among the letters in alphabet We present a software tool and associated web service, called Skylign, which offers several advantages over existing logo tools. It can generate both a static image file and a new interactive web plot that supports scrolling, zooming, and inspection of values underlying each letter stack. Skylign also produces a simplified representation of per-position gap probabilities, and optionally reduces visual clutter by including only overrepresented letters in a stack. Skylign’s interactive logos are robust and fast for alignments with length in the thousands, such as those representing many transposable element families.hmmbuild tool within HMMER3.1 [An important implementation detail is that Skylign produces logos for both profile HMMs and multiple sequence alignments in a unified framework. Profile logos are plotted using the per-position distributions of the profile HMM. For alignment logos, the column distributions can be estimated either from observed counts, weighted counts, or based on posterior probabilities after combining with a Dirichlet mixture prior. Estimation based on weights and priors is performed by explicitly producing a profile HMM using the HMMER3.1 .http://skylign.org, and the Skylign software package may be downloaded for independent installation.In the following sections, we describe implementation details, compare alternative visualization approaches, and illustrate the utility of these logos. Skylign can be accessed as a web service at Several logo web servers have been released since the introduction of logos ,22-24, eHistorically, all logo software has produced static images (e.g. png or vector graphics files). These are the appropriate formats for inclusion in manuscripts and slides, and may be produced with Skylign, but are suboptimal for distribution on the web. For website integration, Skylign implements interactive logos that support navigation to a requested position in the logo, scroll smoothly, and can be zoomed out for a compressed overview of several hundred positions of the logo. Because profile HMMs create positions only for consensus columns, and because a logo stack is defined only for non-empty alignment columns, not all columns in an alignment will be represented by a position in a profile logo; Skylign optionally shows the mapping between each logo position and the corresponding column in the underlying alignment. Skylign logos also support clicking on individual letter stacks to view the underlying values for all letters, as seen in Figure The data used to produce an interactive logo is stored as a JSON object, which is rendered using HTML5 Canvas and a custom JavaScript module. Adding a Skylign interactive logo to a web page is simple, requiring the addition of a few lines of markup to the page and reference to the Skylign javascript and css files.http://skylign.org.Skylign may be used in a variety of ways to create an image or interactive logo. The simplest option is to use the website submission form. Skylign also offers a web service via a RESTful interface , enablink:In addition to representing the letter distribution at each position, Skylign renders position-specific gap parameters. It does this by presenting up to three values for each position k. If we call this value, occ(k) the probability of observing a gap character (part of a deletion relative to the model) is 1 − occ(k).1. Occupancy: the probability of observing a letter at position k and the letter corresponding to position (k + 1).2. Insert probability: the probability of observing one or more letters inserted between the letter corresponding to position k, if one is observed. For mathematical convenience, profile HMMs model insertions as having a geometric length distribution with position-specific parameter ϵ and mean length 1/(1 − ϵ).3. Insert length: the expected length of an insertion following position The later two are only relevant for profile logos, since Skylign creates a logo position for each non-empty column in the alignment when producing an alignment logo.The tool LogoMat  generalihmmbuild tool from HMMER 3.1 to compute letter and gap values, with alternate option flags used for each method.Skylign can produce a profile logo based on a profile HMM, or an alignment logo based on a sequence alignment, both sharing the same interface. Generating a profile logo is a straightforward matter: a profile HMM stores estimated letter and gap parameters based on the underlying sequence alignment. Skylign simply extracts these values for use in computing stack heights, letter heights, and gap-related values. Alignment logos are more flexible, since Skylign offers four methods for computing estimated distributions from observed frequencies, demonstrated in Figure ai in that column is its log odds ratio, si := log 2(pi/qi). Letters with above-background probability will have a positive score. Total stack height is computed in the typical fashion (information content), and the height of the stack is subdivided according to the relative probabilities of the positive-scoring letters, as shown in Figure In the case of protein sequences, when observed counts are combined with a strong Dirichlet mixture prior, the posterior letter distribution often contains small but non-negligible probabilities for all 20 letters. This results in an illegible smear of letters at the bottom of the letter stack of the typical logo Figure A. To addsi. Only positive-scoring letters are included in the stack, as demonstrated in Figure Skylign also offers an option to produce a different sort of logo in which the height of each letter is its score, Logos have long been used to visually represent the position-specific patterns of conservation in sequence alignments and profile HMMs. We developed Skylign with the aim of enabling interactive manipulation and inspection of logos, while offering a variety of logo variants for alignments and profiles. The result is a logo tool that supports scrolling, zooming, inspection of underlying values, and mapping between logo positions and alignment columns. Skylign simplifies the representation of gap parameters, offers alternate calculations to determine letter heights, and can overcome sampling bias by down-weighting redundant sequences and by combining observed counts with informed priors.Skylign’s interactive logos are easily incorporated into a web page, and we have already used them in our HMMER and Dfam webservers, presenting logos for both protein and DNA profile HMMs ,27. We ahttp://skylign.org.Skylign can be accessed as a web server and web service, and may be downloaded for local use at The authors declare that they have no competing interests.TJW and RDF motivated creation of interactive web logos with improved gap representation. JC developed the code for logo rendering and the web service. TJW implemented routines in HMMER to produce logo parameters and drafted the manuscript. All authors developed code interfacing the web front end with HMMER back end. All authors read and approved the final manuscript.


The quality of multiple protein structure alignments are usually computed and assessed based on geometric functions of the coordinates of the backbone atoms from the protein chains. These purely geometric methods do not utilize directly protein sequence similarity, and in fact, determining the proper way to incorporate sequence similarity measures into the construction and assessment of protein multiple structure alignments has proved surprisingly difficult.We present Formatt, a multiple structure alignment based on the Matt purely geometric multiple structure alignment program, that also takes into account sequence similarity when constructing alignments. We show that Formatt outperforms Matt and other popular structure alignment programs on the popular HOMSTRAD benchmark. For the SABMark twilight zone benchmark set that captures more remote homology, Formatt and Matt outperform other programs; depending on choice of embedded sequence aligner, Formatt produces either better sequence and structural alignments with a smaller core size than Matt, or similarly sized alignments with better sequence similarity, for a small cost in average RMSD.Considering sequence information as well as purely geometric information seems to improve quality of multiple structure alignments, though defining what constitutes the best alignment when sequence and structural measures would suggest different alignments remains a difficult open question. Cα atoms of the protein backbones. It seems that this extra information could be used to improve protein structural alignment. However, a meaningful way to incorporate sequence information into structural alignment algorithms in order to improve their performance has remained elusive.Researchers in protein biology must often build structural alignments of multiple homologous proteins. Generally, both the protein sequence and its 3D structure are available to a structural alignment program. The structural alignment program typically produces both a rigid body transformation that aligns the structures in space, plus a sequence alignment derived from that structural alignment that proposes homologous residue-residue correspondences. For a recent survey of the best current structural alignment programs available, see . In the Cα atoms of the protein backbones, then this alignment can always be computed without ever looking at the protein sequences. At the opposite end of the spectrum, we could imagine a “true” correct alignment to be one that aligns residues that have evolved from residues in a common ancestor protein. Ignoring the fact that constructing a gold-standard benchmark to test alignment algorithms according to this standard is impossible without knowing ground truth, such an alignment might result in aligned regions with very little geometric similarity, since there are known examples of proteins with high sequence similarity but markedly different folds [One of the reasons it has not been clear how best to incorporate sequence information into structural alignment programs is that it is unclear what the goal is, or rather, the goal might be problem-dependent. When a sequence alignment and a structure alignment of two protein sequences give different answers, which one is correct? If the correct alignment is defined solely based on the geometric location of the nt folds .structural information to improve sequence alignments, whereas the goal of this paper is to use sequence information to improve structural alignments. Even though the “correct” alignment in both scenarios is presumably the same, these are two very different problems, because the natural assumptions on the inputs to the two problems are completely different: i.e., sequence alignment programs cannot assume structural information is available for all proteins.Several researchers have developed algorithms, including 3DCoffee , and SALInstead of asking if  structural information can help sequence alignment algorithms, this paper instead focuses on what we believe is a substantially easier computational problem: we ask if sequence information can help structural alignment algorithms in the typical setting where purely structural alignment algorithms are employed, specifically when 3D structural information is available for all the proteins in the set. We suspected it would help, because anecdotally, for even the best structural alignment programs, we knew there were always cases where it seemed a human being could hand-“correct” the alignment into something that made more sense from a sequence point of view, with little or no loss in geometric fidelity. The kinds of errors produced by structure alignment programs that do not take sequence into account can be illustrated by an example pair of proteins, aligned by our group’s own structure alignment program, Matt . Figure To avoid these offset problems, we modify Matt to also take into account sequence similarity, in order to correct this type of register error. In particular, we introduce “Formatt” which stands for “Frame Offset Repair Matt” which uses the same geometric information that Matt uses to decide what regions of the protein should be considered alignable. Formatt allows Matt to construct its bent alignment, which breaks a protein up into small tightly aligned blocks, between which are regions where Matt would greedily align the backbone between blocks (the Matt “extension phase”) using solely geometric criteria. Formatt, by contrast, considers both geometric and sequence similarity criteria in choosing which residues to align in these regions.Note that our Matt structural aligner is specifically optimized for more distant homology  and as wWe test the performance of Formatt against the original Matt , againstThe metrics under which we tested performance on HOMSTRAD include the correct gold-standard reference alignments (which were curated by hand). On the SABMark “Twilight Zone” benchmark , which whttp://bcb.cs.tufts.edu/formattwhere we also make available HOMSTRAD and SABMark benchmark reference alignments aligned by Formatt.Formatt source code is freely available for download under the Gnu Public License at The Matt structural aligner  belongs The chief limitation of Matt’s approach is that the regions in between the original, closely-aligned, 5-9 amino acid blocks are still aligned purely according to this balance between core length and RMSD, and thus the final alignment may choose arbitrarily between different possible alignments of similar RMSD values. This can lead to otherwise obvious sequence similarities being discarded due to negligible differences in RMSD. By preserving sequence information, and allowing the input from a pure sequence alignment tool to influence the final alignment, we aim to improve the alignments of these regions between closely-aligned blocks.Formatt produces an initial “bent” alignment of 5-9 amino acid blocks, identically to Matt. It then extends each aligned block as follows: given a region of residues between blocks, produce candidate alignments using a sequence aligner : n is the number of columns in the alignment and m is |{i,j|i,j←0⋯k∧i≠j}| such that neither i nor j are gaps. Similarly, we can report Staccato Seq scores for both core and partial alignments.In order to evaluate the effect of partial alignment, we report not only the aligned core length  but also a partial core length. We define partial core length as the total length of the alignment, In order to determine whether sequence-based or structure-based alignment performs better for a given region of the multiple alignment, we implement the Staccato scores described by Shatsky et al. .A and columns c∈A, let the “Seq” sequence conservation score Seq=9×(1−(Seq′ + 4)/9.75), where Given a multiple structure alignment N is the number of sequences in the alignment A.Let the weights above be defined as c∈A, let the “Str” structural conservation score f is defined as 0.07 as it was in [Also given an alignment A and columns t was in .ω×Seq + (1−ω)×Str, where ω is set as 0.5, equally weighting the sequence and structure scores, just as in [Finally, the overall Staccato “cons” conservation score is simply st as in .We diverge from the Staccato paper in the way that we compute these scores in one important respect: by default, we only consider core positions in the alignment  when scoring a multiple alignment.In addition, we also compute a partial Seq score identical to the Seq score in the Staccato paper, treating an alignment of a gap with any residue or with another gap as a score of zero. We report these values alongside the final conservation score.In order to quantitatively assess Formatt’s performance, we evaluate it against two well-known benchmark sets, HOMSTRAD  and SABMThe HOMSTRAD multiple-alignment benchmark consists of a manually curated set of 1,028 alignments, each of which contains between two and 41 structures. To duplicate the benchmark in , we testThe SABMark benchmark is divided into superfamily and “Twilight Zone” benchmark datasets, each of which contains subsets of 3 to 25 remotely homologous protein structures. We test Formatt and its competitors on the 209 subsets in the “Twilight Zone” set. Note that for these more distant homologs, we do not have a gold-standard set of “correct” alignments, and must determine alignment quality by objective means, such as core length, average pairwise RMSD, as well as the Staccato scores, as introduced by  and discAs can be seen in Table Table et al[.126×x−0.213 divides same-family from different-family domains. Thus, given two possible alignments a1 and a2, with Staccato “cons” scores of c1and c2, and core lengths of l1 and l2 respectively, we could view these as points in the space defined by “cons” score and core length. We could then compute the y-intercept of a line with a slope of .0126 through each point; we would then favor the alignment with the lower y-intercept. We suggest that this would be a plausible way to rationally quantify the trade-off between alignment quality and core length. In this implementation, we have followed the example of Shatsky et al in equalet al. A plot We remark that, while results are not shown in the tables above, we also tested Promals3D on the HOMSTRAD benchmark set. Note that Promals3D outputs only a sequence alignment without coordinates, so an RMSD or other structural scores were not calculated. However, when we compared the Promals3D to the HOMSTRAD gold-standard alignments, the average percentage correct was only 43%. We tested a subset of the HOMSTRAD benchmark set against 3DCoffee and the results were even worse. Thus, we conclude that Promals3D and 3DCoffee are not producing competitive alignments on this benchmark.We have introduced Formatt and showed that incorporating sequence information can improve the quality of structural alignments, both in terms of gold-standard alignment benchmarks, and in terms of objective measures of sequence and structural alignment quality such as the Staccato score . We wereFormatt is a variant of the Matt  multipleThe question of what makes a good alignment is not simple to answer. Recall Figure ω of 0.5 when weighting the Staccato sequence and structural conservation scores to produce the combined “Cons” score, in order to determine whether sequence-based alignment or structure-based alignment performed better in a given region. Clearly, this ωrepresents a possible tuning parameter, which a computational biologist aligning proteins known to be of closer or more remote homology might use to adjust the performance of Formatt. As the “Cons” score itself does not incorporate core length, it favors shorter, tighter alignments. One possible improvement could be to compute a score that trades off this score against core length, as in [As mentioned above, we followed  in usingh, as in . AnotherLikewise, while Formatt performed similarly regardless of the choice of CLUSTALW, ProbCons, or MUSCLE as a sequence aligner, MAFFT produced distinctly shorter but more highly conserved alignments, and this distinction was magnified at the more remote level of homology exhibited by SABMARK’s twilight zone benchmark. Thus, a user may also prefer MAFFT for more closely homologous alignments, and MUSCLE for more remote homologs.http://bcb.cs.tufts.edu/formatt/.Benchmark alignments produced by Formatt with each of the four sequence aligners, as well as the Formatt software (under the GNU Public License) are available at The authors declare that they have no competing interests.ND, SN and LC conceived and designed the experiments. ND and SN performed the experiments. ND analyzed the data. ND and LC wrote the manuscript. All authors read and approved the final manuscript.