BACKGROUND
the alignment of multiple dna, rna or protein sequences is of major importance for a variety of biological modelling methods, including the estimation of the phylogenetic tree of the sequences and the prediction of their structural, functional and/or evolutionary relationships
<cit> .
in addition, the recent advances in rapid, low-cost sequencing methods, have resulted in the accumulation of large amounts of molecular data to be processed, making thus the need for fast and accurate multiple sequence aligners even more imperative
<cit> .
a widely used approach to cope with the multiple sequence alignment  problem, is the employment of a computational formulation comprised of two major components, namely an objective function
<cit>  able to quantify the degree of similarity of a given alignment and an optimization procedure that targets at identifying the optimal alignment based on the underlying objective function
<cit> .
concerning the former component, the sum-of-pairs scoring model
<cit>  remains amongst the most popular choices
.
the maximization of the sp score is usually performed using dynamic programming.
for the pairwise alignment case, an optimal  solution can be found within reasonable time.
however this does not hold for the multiple sequence alignment case, where it has already been shown
that obtaining the optimal alignment using the sp score is np-hard.
to overcome the computational intractability of the msa problem, a large number of efficient heuristic algorithms have been proposed with the most popular being the progressive alignment approach
.
in progressive alignment the sequences are initially placed on a bifurcating tree according to their degree of similarity.
then, they are progressively aligned in pairs following the formed guide tree in a bottom-up order until its root is reached.
at each step, two nodes of the tree  are aligned by a standard pairwise alignment algorithm, and the deriving subalignment is retained to be used at a subsequent step.
one important aspect of the progressive alignment strategy is the “once a gap, always a gap” rule, first introduced in
<cit> .
based on this policy, once a group of sequences is aligned, all gaps in the alignment are replaced by a neutral ‘x’ symbol ensuring that all subsequent pairwise alignments will be consistent with the pre-existing alignment of the group
<cit> .
this rule by definition implies that once a group of alignments has been built up, they will remain fixed even in the view of new sequences that could potentially improve the overall alignment.
consequently, early errors in the progressive alignment steps are accumulated and propagated to later alignment stages compromising thus the alignment quality.
this problem is often tackled by using iterative refinement techniques
<cit> .
in iterative refinement, one sequence  is iteratively subtracted and realigned against the alignment of the remaining sequences.
via this sequence-profile or profile-profile realignment, a new alignment is obtained which is then used for the next iteration of the algorithm.
the refinement terminates when a fixed number of iterations is reached or when the alignment remains unchanged between consecutive iterations
<cit> .
although these methods are very efficacious at curating early alignment errors, they only partially address the “frozen subalignments” issue, since at each iteration of the algorithm only one sequence  is realigned whereas the alignment of the remaining sequences is kept fixed.
in this article we present a variation of the aforementioned iterative refinement strategy where all sequences may be simultaneously and independently realigned against a summarization profile that encapsulates all the starting alignment information.
the process begins by constructing a standard profile that summarizes all the initial alignment information.
then, a series of individual  sequence-profile pairwise comparisons takes place, recording the way that each sequence is aligned against the profile.
the new alignment is then indirectly inferred by merging all the individual subalignments into a unified group.
the proposed approach is implemented as part of a newly introduced meta-aligner under the name reformalign  and is freely available to the public from http://evol.bio.lmu.de/_statgen/software/reformalign/ under the gnu general public license .
we call reformalign a meta-aligner, in the sense described in
<cit> , meaning that an initial alignment is required and it can be used with a variety of alignment programs.
as currently reformalign can only align dna/rna sequences, for the needs of our performance evaluations real nucleic acid datasets of variable length and average sequence identity rates were used.
our experimental results demonstrate that the suggested profile-based modification of the classic progressive alignment and iterative refinement strategies is able to overcome the challenges posed by the propagation of early pairwise alignment errors and that reformalign is an efficient, well suited approach that may improve on the performance of a vast variety of existing alignment software.
implementation
alignment strategy
reformalign aims at improving on the quality of an existing alignment by providing the sequences with an additional opportunity to be individually re-aligned against a standard profile that efficiently summarizes the starting alignment information.
the idea is that via this re-alignment step, early alignment errors caused by “frozen” subalignments may be fixed, delivering thus better results in terms of alignment accuracy.
towards this end, in reformalign the alignment of the sequences is performed in two steps.
the first step involves the construction of a non-probabilistic profile from an existing alignment, whereas during the second step all the sequences are individually realigned against the profile that derived from the first step.
the new alignment is finally indirectly reconstructed by merging all the individual sequence-profile subalignments into a unified group.
due to the nature of the latter step, all pairwise sequence-profile comparison can be performed in parallel, improving thus the aligner performance in terms of execution time.
upon completion of the latter step, a new  alignment is derived which is very often different to the starting one.
since this alignment may be also susceptible to further improvement, the whole process can be re-initiated using the reformed alignment as starting alignment.
the algorithm terminates when either the alignment between two successive runs remains unchanged or a pre-defined maximum number of iterations is reached.
a diagrammatic overview of the reformalign alignment logic flow is provided at figure
<dig> figure  <dig>
logic flow diagram of the reformalign alignment strategy.
the algorithm creates an initial profile based on a starting alignment deriving from an established aligner.
then, all the sequences are aligned against the formed profile to obtain the reformed alignment.
notice that in this step, in case a new insertion is detected, the algorithm automatically switches to a profile fine-tuning mode in order to modify the profile to also account for the new insertion.
after all sequences have been successfully aligned against the profile, the deriving alignment is indirectly inferred by merging all the estimated subalignments into a unified set and it is then freed from uninformative void columns .
the process is repeated using the reformed alignment as starting alignment until the alignment between two successive runs remains unchanged or a predefined maximum number of iterations is reached.
a. profile construction step
in the profile construction step, a popular aligner is employed to infer a starting alignment for the examined group of sequences.
then, a summarization profile is constructed upon the starting alignment, having as many position as the columns in the alignment.
each position in the profile is characterized by a series of < residue, weight > pairs sized to fit the number of distinct residues that appear in the corresponding column of the alignment.
the “residue” part in each pair corresponds to the label of a particular residue in the alignment column whereas its “weight” represents the number of times that this particular residue appears in that column.
b. sequence alignment step
in reformalign, the formation of the final alignment is performed indirectly by aligning all the sequences against the profile that derived from the first step.
all sequence-profile alignments are performed using a standard pairwise alignment algorithm and for each sequence its alignment against the profile is recorded.
by joining all deriving pairwise alignments into a unified group, it is possible to infer the final alignment of the examined sequences.
in contrast to traditional iterative refinement approaches where at each refinement only one sequence  is realigned, in the proposed approach all the sequences have a chance to align differently against the formed summarization profile.
intuitively, the majority of the pairwise alignments that will come up from this step will have at most as many columns as the number of positions of the formed profile.
nevertheless this is not always the case.
for example, it might happen that a particular residue is aligned as a mismatch in one of the columns of the starting alignment, but during the sequence alignment step the score obtained by misaligning this residue against the corresponding profile position might be smaller than the penalty for opening a new gap in the alignment.
in cases where the profile has to be updated in order to accommodate new insertion, reformalign automatically switches to a profile fine-tuning mode.
as soon as the profile has been successfully updated, reformalign restarts the sequence alignment step using the new profile.
another important aspect of the suggested meta-alignment technique is that since the alignment of the sequences may alter during the sequence alignment step, it might happen that none of the sequences aligns against one or more of the positions of the final profile, leading thus to the derivation of void  columns.
to fix for this issue, upon completion of the sequence alignment step, the program checks for uninformative void columns and completely removes them from the reported alignment.
c. iterative refinement
after the sequence alignment step has been completed, a new alignment is produced.
in case the reformed alignment is different to the starting one, reformalign may be iteratively applied to further fine-tune the produced alignment.
the iterative refinement step terminates when the pre-defined limit of iterations is reached or when the deriving alignments between two successive runs of the algorithm are identical.
dynamic programming and scoring system
the dynamic programming scheme employed by reformalign for the sequence-profile alignment task is the gotoh’s
<cit>  affine-gap penalties variation of the needleman-wunsch global alignment algorithm
<cit> , as described in
<cit> .
regarding the scoring scheme for assessing the similarity between a position in a sequence and one from the profile, in contrast to the average function encountered in various alignment models such as clustalw
<cit> , we employed an additive variant where the observed counts of the residues are used instead of their averaged frequencies, as follows:
where a is the current alphabet , ca and cb represent the observed counts  of residues a and b respectively and suba → b corresponds to the score matrix value for aligning residue a to b.
the main reason for selecting aforementioned scoring scheme is that the use of the observed counts instead of the relative frequencies allows for a better discrimination between well-conserved columns.
for example, a profile position exclusively comprised of a several cytosine residues will have exactly the same score as another profile position formed by a single cytosine, if the averaged sum of pairs scoring scheme was used, but the score for the former case would be significantly higher if the additive scoring model was employed instead.
alignment parameters
the choice of a proper values for the alignment parameters is essential for the multiple sequence alignment problem, since it has been proven
<cit>  that it may significantly affect the decision of the “optimal” alignment among the numerous alternatives.
these parameters may significantly vary among different alignment approaches and they are usually decided by cross validation testing.
in reformalign, the alignment parameters that have to be defined are the substitution scores and the gap opening and extension penalties.
however, it would be desirable in our strategy that each residue of the sequences could inexpensively skip any low-scoring profile positions in order to align itself against another higher scoring position.
furthermore, based on the fact that by definition the profile already incorporates enough positions where every residue of the sequences could possibly be aligned, opening a new gap in the profile should be more costly than opening a gap to the sequence.
consequently, in reformalign four distinct types of gap penalties are considered: a penalty for opening a gap in the profile , a penalty for extending a gap in the profile , a penalty for opening a gap in the sequence  and a penalty for extending a gap in the sequence .
as in clustalw, terminal gaps  are not penalized in our approach either.
an additional parameter constraint deriving from the inherent properties of our model is that the substitution scores should be substantially higher than the gap penalties.
in case this restriction is not met, it might happen that many sequences require a profile update during the sequence alignment phase, resulting thus in very large profiles containing a lot of poorly supported positions.
to avoid such cases it is recommended that substitution scores are always set to  positive values whereas gap opening and extension penalties are set to negative values.
regarding the substitution weights, reformalign currently uses a modified version of the hoxd substitution matrix
<cit>  where all scores are increased by a positive “bonus” value, so that the aforementioned condition is met and to further reward matches compared to gaps.
nevertheless, increasing all substitution scores by the same “bonus” value results in understating the differences between matches and mismatches.
for this reason, each score value is then increased by a re-adjustment coefficient .
the default bonus value and re-adjustment coefficient applied to the score matrix as well as the default gap opening and extension penalties were decided based on a greedy parameters search that was performed using muscle
<cit>  as the starting aligner and a separate training set with alignments from the data-set  <dig> of a previous version of bralibase
<cit> .
for each test in the training set, the percent apsi value of the initial alignment was calculated and then more than  <dig>  parameter combinations were greedily assessed by comparing each time the deriving  alignment to the expected one  in terms of alignment accuracy.
the results of this cross-validation analysis suggested that the score matrix bonus value and the gap penalties should be re-adjusted according to the apsi value of the initial alignment based on the subsequent formulas:
where apsip is the percent average pairwise sequence identity calculated over the initial alignment.
the aforementioned scheme for defining the starting parameter values was used for all the experiments outlined in the present study and is automatically employed by default in reformalign, unless more appropriate starting values are defined to the program by the user.
finally, reformalign follows clustalw’s paradigm
<cit>  by heuristically updating the gap opening and extension penalties during runtime, in an attempt to deliver superior alignment results.
in particular, the penalties are modified based on the following criteria:
dependency on the lengths of the sequences
both the gap opening and gap extension penalties are modified depending on the ratio between the length  of the sequence to be aligned and the largest sequence in the set.
intuitively, gaps should be penalized harder for shorter sequences in order to avoid having alignments with too many and/or sparse gaps.
the calculation of the starting gap penalties is performed according to the following formula:
where gp represents all types of gap penalties , m is the length of the largest sequence in the set and n is the length of the sequence to be aligned.
position-specific penalties based on the profile conservation rate
during the computation of the dynamic programming matrix, the gap opening penalties  are modified in a position-specific way depending on the conservation rate of the profile.
if a position in the profile is well conserved , then this implies that the specific position is strongly supported by many sequences  and thus the penalty for opening a new gap against this profile position should be higher compared to weakly supported positions.
consequently, the gap opening penalties per position are calculated as follows:
where gop represents the gap opening penalties , pcri is the profile conservation rate for the ith position of the profile calculated as a fraction of the maximum weight value among all < residue, weight > pairs contained in the ith position of the profile divided by the sum of all weights of the pairs in the ith position and ssij is the substitution score for aligning the ith position of the profile against the jth position of the sequence.
the idea behind the multiplication of the profile conservation rate by the substitution score is to linearly increase the gap opening penalties for conserved columns, so that gaps would be favored only if subsequent matches of the sequence against ensuing positions of the profile would score high enough to sufficiently compensate for the very costly gap that was opened.
methods
in order to assess the efficiency of reformalign in improving the quality of existing alignments, testsets from the bralibase  <dig>  rna alignment database
<cit>  and the dna smart database
<cit>  were used.
bralibase  <dig>
bralibase  is a collection of rna alignments taken from the rfam database.
it was initially introduced in
<cit> , but since then it has been further enriched with additional alignments
<cit> , leading to its current version v <dig>  which contains in total  <dig>  aligned sets of sequences  with an average pairwise sequence identity  rate ranging between 20% and 95%
<cit> .
for the needs of the present study we limited our analysis to the bralibase alignments composed of  <dig>   <dig> and  <dig> sequences per alignment.
dna smart
the dna reference alignment benchmarks database
<cit>  was proposed in  <dig> as a collection of dna reference alignments for the assessment of msa applications.
it is comprised of multiple dna sequence alignments  corresponding to protein alignments of the balibase
<cit> , oxbench
<cit> , prefab
<cit>  and smart
<cit>  benchmarking datasets.
for our experiments, we considered all alignments corresponding to the smart database containing between  <dig> and  <dig> sequences per alignment.
since however reformalign does not currently support ambiguous characters, we limited our analysis to a total of  <dig> alignments containing exclusively unambiguous dna letters.
accuracy measures
to assess the agreement between the reconstructed and the reference alignments, the following measures of accuracy were considered.
the sum of pairs  score  was initially proposed by thompson et al.
<cit>  and is defined as a fraction of the number of the correctly aligned residue pairs in the reconstructed alignment over the number of aligned residue-pairs of the reference alignment.
if the denominator of the fraction is replaced by the number of residue-pairs in the test alignment, then the reverse sum of pairs score  is obtained.
finally, the total columns  score is computed by dividing the number of correctly identified columns in the reconstructed alignment over the total number of columns in the reference alignment.
although these metrics can provide an overview of the quality of the deriving alignments, each one has its own drawbacks.
the developer’s score fails to penalize over-alignments and could give a great score to an alignment that erroneously aligns non-homologous regions, whereas the modeler’s score is not sensitive to detecting under-alignments and thus could possibly give high scores to alignments that systematically fail to align homologous regions .
finally, the tc score is very sensitive to the misalignment of even a single sequence yielding a zero-valued tc score even if all the remaining sequences in the examined group are properly aligned.
for this reason, two additional metrics were considered: a) the cline’s score
<cit> , which efficiently addresses the issues of the developer’s and modeler’s scores by penalizing over- and under- alignments while taking into account minor shifts in the reconstructed alignment compared to the reference and b) the d-pos metric proposed by blackburne and whelan
<cit>  which satisfies the conditions of symmetry and triangular inequality that are not met by the sp and tc scores, where at the same time it incorporates information from indels by recording the position where gaps occur.
all accuracy measures take their values in the  <cit>  range, with the exception of cline’s score which may also take negative values in case there exist many large shifts.
moreover, in contrast to the remaining metrics, d-pos reports the distance between the generated and the reference alignment and thus lower d-pos values correspond to better alignments.
since d-pos and cline’s score can efficiently summarize the quality of the deriving alignments while at the same time being the most immune to deficiencies, the discussion will be mostly based on the experimental results of these two metrics.
alignment programs
we assessed the effect reformalign on the deriving alignments of ten leading methods: clustalw
<cit> , clustalo
<cit> , muscle
<cit> , mafft
<cit> , kalign
<cit> , gramalign
<cit> , probconsrna
<cit> , r-coffee
<cit> , picxaa
<cit>  and dialign-tx
<cit> .
these aligners implement a variety of alignment techniques, such as progressive alignment
<cit> , iterative refinement
<cit> , segment-based alignment
<cit> , probabilistic/consistency-based alignment
<cit>  and maximum expected accuracy alignment
<cit> .
moreover, r-coffee specializes in the alignment of rna sequences and could thus provide us with an overview of the way that the proposed sequence-based method may affect initial alignments that use secondary structure information.
since our main intention was to examine the effect of reformalign on existing alignments rather than to analytically assess the efficiency of each aligner on the benchmark databases, we used the default settings for all aligners except for mafft which was executed using both the –fft-ns-i and the –l-ins-i options.
finally, the default value for the maximum number of refinement iterations in reformalign was set to  <dig> for all experiments .
RESULTS
each benchmark test was given as input to all the considered aligners in order to obtain an initial alignment which was compared against the reference.
then, this alignment was provided as input to reformalign and the newly generated alignment was also compared against the reference using all considered accuracy metrics.
via this procedure, we came up with eleven distinct alignment pairs for each benchmark test .
furthermore, in order to determine the statistical significance of the differences between the initial and the reformed alignments, wilcoxon signed rank tests were also performed for each alignment-pair.
however, since multiple test cases in the benchmark data may contain sequences of the same families, the samples independency assumption of the statistical test might not be fully met and for this reason the reported results should be interpreted with caution.
bralibase  <dig>
the results for the  <dig>  bralibase benchmark tests are visualized in figures
<dig> and
<dig>  moreover, in order to explore the effect of reformalign to testsets of increasing apsi, we grouped the benchmarks in four clusters according to the percent identity of the sequences.
the average scores for each group are shown in table
<dig> and additional file
2: table s <dig> and are graphically depicted at figure
<dig> figure  <dig>
scatterplots of the cline scores per alignment pair for the  <dig>  benchmark tests of the bralibase dataset.
a scatterplot is constructed per alignment pair for each one of the  <dig>  benchmark tests.
the diagonal line represents the expected plot if the initial and the reformed alignments were identical.
consequently, an accumulation of points above the diagonal line represents improved reformed alignments whereas points below the diagonal correspond to cases where reformalign worsened the initial alignment.
boxplots of the averaged cline scores of the considered alignment pairs for the  <dig>  alignments of the bralibase dataset.
the boxplots of the cline scores averaged over all  <dig>  test cases of the bralibase dataset are given at this figure.
the figures are organized in pairs corresponding, from left to right, to the averaged performance of , , , , , , , , , , and .
the bars at the bottom of each pair represent the percentage of times where the reformed alignments were superior , equal  or inferior  in terms of cline score compared to the initial alignments.
bralibase cline scores
aligner
initial
reformed
avg.
dif.
p-value
r > i
r = i
r < i
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
apsi
aligner
initial
reformed
avg.
dif.
p-value
r > i
r = i
r < i
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p =  <dig> ***
apsi
aligner
initial
reformed
avg.
dif.
p-value
r > i
r = i
r < i
p <  <dig> ***
p =  <dig> ***
p <  <dig> ***
p =  <dig> **
p <  <dig> ***
p <  <dig> ***
p =  <dig> *
apsi
aligner
initial
reformed
avg.
dif.
p-value
r > i
r = i
r < i
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
apsi
aligner
initial
reformed
avg.
dif.
p-value
r > i
r = i
r < i
p =  <dig> *
p <  <dig> ***
p =  <dig> **
p =  <dig> *
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
cline scores corresponding to the  <dig>  alignments of the bralibase dataset.
*significant at p< <dig> , **significant at p< <dig> , ***significant at p≤ <dig> .
the first sub-table summarizes the performance of each alignment pair averaged over all test cases whereas the remaining sub-tables report the results organized according to the average pairwise sequence identity of the sequences.
for every sub-table, the apsi value and the number of alignments  corresponding to each group are reported in the first row.
columns  <dig> and  <dig> correspond to the average cline scores of the initial  and the reformed  alignments respectively.
the average differences  per alignment pair are given in the fourth column and the corresponding p-values of these differences are given at the fifth column .
finally, columns 6– <dig> indicate the percentage of cases where the reformed alignments were superior, equal or inferior  to the initial alignment.
average cline score differences for the benchmark tests of the bralibase dataset.
effect of reformalign to testsets of increasing apsi  and increasing number of sequences per alignment .
the alignment pairs  correspond to , , , , , , , , , , and .
for each value of the horizontal axis, the difference is calculated by subtracting the average cline score of the reformed alignments to the respective score of the initial alignments that belong to each group.
statistically significant differences at the .
<dig> significance level are denoted by an asterisk  at the top-left corner of the respective points.
the number of test cases  per group is given at the bottom of each value in the x-axis.
despite the simplicity of the reformalign logic, the experimental results suggest that the proposed approach may significantly improve on the performance of almost all examined aligners.
in general, the improvement due to reformalign seems to be substantially higher for difficult examples  or for lower-scoring aligners  and becomes less noticeable when the starting alignments are already nearly optimal leaving thus less room for improvement .
the only cases where reformalign seems to degrade on average the initial alignments are for picxaa and probconsrna.
nonetheless, even for these aligners it was found that in a considerable amount of cases the reformed alignments were superior to the initial ones  whereas it may also be observed that the average decrease for both aligners is relatively small and not always statistically significant .
in addition, although the cline , sp and tc scores  seem to indicate a marginal degradation of the initial alignments due to reformalign, according to the d-pos similarity metric the reformed alignments were superior to the starting ones for all aligners participating in our experiments .
another important observation is that reformalign very often delivers alignments which are different to the starting ones , and in the majority of these cases the reformed alignments are superior to the corresponding starting ones.
this trend is much more apparent for testsets with relatively low apsi values and becomes less evident for highly similar alignment cases .
the experimental results also demonstrate that the application of reformalign to existing alignments does not affect all aligners in the same way and may result in changes in their overall ranking.
for example, as it may be seen at table
<dig>  although initially gramalign and r-coffee score on average lower than dialigntx and probconsrna respectively, the situation is reversed after reformalign has been applied to fine-tune the respective alignments.
the same holds true for the muscle, kalign and mafft  aligners with the latter scoring higher than the other two after the respective alignments have been reformed.
finally, as it may be seen at figure
4a, the effect of reformalign for the majority of aligners seems to be more substantial for harder test cases  and becomes less noticeable as the average pairwise sequence identity increases.
this does not seem to be the case for the highest scoring aligners  which deliver quite accurate alignments  even for relatively hard test cases leaving thus less room for improvement, and for gramalign where several test cases from the higher apsi groups seem to violate its grammar-based assumptions resulting thus in lower-scoring initial alignments that are then refined by reformalign .
the analysis of the cline score differences versus the number of sequences per alignment  revealed similar results.
probabilistic and consistency-based aligners, which appear to deliver more accurate starting alignments, seem to benefit less  from the application of reformalign compared to optimization-driven or iterative refinement based approaches.
the main reason for this might be in the underlying assumptions of these models.
in particular, these high-scoring aligners employ sophisticated albeit computationally expensive probabilistic assumptions resulting thus quite often in very accurate alignments.
reformalign however is based on the ad hoc sp scoring scheme and it may thus happen that accurate starting alignments that meet the probabilistic/consistency based assumptions are slightly degraded by the more arbitrary optimization scheme of reformalign, especially in alignments composed of multiple sequences.
however, as the experimental results demonstrate, there is a considerable amount of cases where the initial alignments of the probabilistic consistency transformation  approaches are improved by the proposed post-processing step , suggesting thus that reformalign could appear to be useful even for fine-tuning the starting alignments of such sophisticated alignment methods.
dna smart
a similar analysis was carried out for the benchmark tests of the dna smart database.
for these experiments r-coffee  was removed from the analysis.
since the majority of the test cases  were sharing an average sequence identity equal or lower to 55%, the differences between the reformed and the initial alignments for the higher apsi groups were not found to be statistically significant at the .
<dig> level .
the performance averaged over all  <dig> test cases per alignment pair is graphically depicted at figures
<dig> and
<dig> whereas the analytic results for the considered accuracy metrics are reported at table
<dig> and additional file
3: table s <dig> figure  <dig>
scatterplots of the cline scores per alignment pair for the  <dig> benchmark tests of the dna smart dataset.
for each alignment pair a scatterplot is constructed.
each point corresponds to an alignment test case of the dna smart dataset and depicts the cline score of the initial alignment versus the respective score of the reformed alignment.
the diagonal line represents the expected plot if the initial and the reformed alignments were identical.
boxplots of the averaged cline scores for the  <dig> alignments of the dna smart dataset.
the boxplots corresponding to the cline scores for the dna smart dataset are given in this figure.
the figures, correspond, from left to right, to the averaged performance of , , , , , , , ,  and .
the bars at the bottom of each pair represent the percentage of times where the reformed alignments were superior , equal  or inferior  in terms of cline score compared to the initial alignments.
dna smart cline scores
aligner
initial
reformed
avg.
dif.
p-value
r > i
r = i
r < i
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
p <  <dig> ***
cline scores corresponding to the  <dig> alignments of the dna smart dataset.
*significant at p< <dig> , **significant at p< <dig> , ***significant at p≤ <dig> .
the average cline scores corresponding to the initial  and the reformed  alignments are given at columns  <dig> and  <dig> respectively.
column  <dig> represents the differences of the cline scores  per alignment pair and the statistical significance of these differences is given at column  <dig> .
the last three columns correspond to the percentage of cases where the reformed alignments were superior, equal or inferior  to the initial alignment.
the experimental results suggest that reformalign was able to improve on the starting alignments for the majority of the considered aligners.
for probconsrna the effect of reformalign is dubious: although on average the reformed alignments appear to be marginally superior to the initial ones , they demonstrate a greater variability compared to the starting alignments  and the reported differences are not always found to be statistically significant.
regarding the remaining aligners of our benchmark study, only mafft  and picxaa are shown to be negatively affected by the application of reformalign whereas a noticeable improvement is observed for the rest.
the reported degradation of the pct-based aligners could be due to the sophisticated assumptions of these high performance methods compared to the ad hoc optimization scheme of reformalign.
specifically, since the dna smart database is composed of alignments which are based on biological features such as the tertiary structure of encoded proteins, the simplicity of the reformalign scheme could result more often in degradation of alignments deriving from the more accurate pct-based methods, compared to alignments generated from progressive and iterative refinement aligners.
in agreement to the results of the bralibase experiments, the dna smart analysis supports the conclusions that reformalign generates alignments that are frequently different  to the starting ones  and that the suggested approach does not affect all aligners the same way, resulting thus in changes in their overall ranking .
finally, the assessment of the effect of reformalign to testsets of increasing apsi  and increasing number of sequences per alignment  did not provide us with conclusive results, mainly due to the fact that there were only a limited number of test cases belonging to the higher order groups, often resulting in statistically insignificant differences for the considered alignment pairs.
nevertheless, the results of figure
7a indicate a trend that further supports the idea that the effect of reformalign is weaker for closely related sequences compared to alignments with lower apsi values, whereas there does not seem to be a clear pattern describing the way reformalign affects the examined aligners with an increasing number of sequences per alignment .figure  <dig>
average cline score differences for the benchmark tests of the dna smart dataset.
effect of reformalign to testsets of increasing apsi  and increasing number of sequences per alignment .
the alignment pairs  correspond to , , , , , , , ,  and .
for each value of the horizontal axis, the difference is calculated by subtracting the average cline score of the reformed alignments to the respective score of the initial alignments that belong to each group.
statistically significant differences at the .
<dig> significance level are denoted by an asterisk  at the top-left corner of the respective points.
CONCLUSIONS
in this paper we presented reformalign, a novel profile-based meta-alignment approach that aims at correcting early alignment errors by giving the sequences a second opportunity to re-align themselves against a standard profile that efficiently summarizes the initial alignment information.
reformalign is based on the gotoh’s affine-gap penalties variation of the classic needleman-wunsch algorithm and uses a refinement scheme according to which the reformed alignment is indirectly inferred by a series of individual and independent sequence-profile pairwise comparisons.
reformalign was extensively assessed on the way it affects the alignments of ten leading aligners using benchmark testsets from the bralibase and dna smart datasets.
the results suggest that the majority of aligners showed a notable improvement on the accuracy of the delivered alignments when reformalign was employed as a post-processing step.
this improvement was more substantial for harder alignment cases with low apsi or when there was still adequate room for improvement on the starting alignments, and became less evident when the initial alignment was already quite accurate or for easier alignment cases with high identity rates.
finally, it is important to mention that the proposed method does not come to replace other popular alignment techniques.
instead, users may continue to use their aligner of preference  and then complementarily employ reformalign as a post-processing step to examine if the delivered alignment is more appropriate for their analyses.
availability and requirements
reformalign is freely available to the public under the gnu general public license .
both the source code and precompiled binaries for linux and windows may be downloaded from http://evol.bio.lmu.de/_statgen/software/reformalign/.
currently reformalign can only align dna and rna sequences and it is provided as a command line program.
its source code is in c++ and it makes use of the open multi-processing  parallelization api.
for the benchmark tests, the bralibase  <dig>  rna alignment database
<cit>  and the alignments from the dna reference alignment benchmarks database
<cit>  were employed.
the evaluation of the alignments accuracy was performed using robert edgar’s qscore,  multiple alignment scoring software and blackburne and whelan’s metal
<cit>  command-line utility for calculating metric distances between alternative alignments.
finally, the alignment programs that were used in our benchmark analysis are as follows: clustalw2
<cit>  , clustalo
<cit>  , muscle
<cit>  , mafft
<cit>  , kalign
<cit>  , gramalign
<cit>  , probconsrna
<cit>  , r-coffee
<cit>  , picxaa
<cit>   and dialign-tx
<cit>  .
electronic supplementary material
additional file 1: table s1: command-line options per alignment method.
additional file 2: table s2: bralibase results.
averaged d-pos, sp and tc scores for the  <dig>  benchmark tests of the bralibase dataset.
the results are presented averaged over all benchmark tests as well as organized in four groups according to the average pairwise sequence identity of the sequences.
for each accuracy metric three figures are provided corresponding to the average scores of the initial alignments , the reformed alignments  and their respective differences .
differences that are found to be statistically significant at the .
<dig> significance level are highlighted in bold.
for the sp and tc scores, positive average differences indicate that the reformed alignments were superior to the initial ones whereas negative values indicate that reformalign  worsened the starting alignments.
for the d-pos scores the situation is reversed: negative values indicate an improvement due to reformalign, whereas positive values represent a degradation of the starting alignments.
additional file 3: table s3: dna smart results.
averaged d-pos, sp and tc scores for the  <dig> benchmark tests of the dna smart dataset.
for each accuracy metric three figures are provided corresponding to the average scores of the initial alignments , the reformed alignments  and their respective differences .
statistically significant differences at the .
<dig> significance level are highlighted in bold.
competing interests
the authors declare that they have no competing interests.
authors’ contributions
d.p.l.
developed the idea, implemented the software and drafted the manuscript.
d.m.
planned and supervised the work and contributed to the manuscript.
both authors read and approved the final manuscript.

 the alignment of multiple dna, rna or protein sequences is of major importance for a variety of biological modelling methods, including the estimation of the phylogenetic tree of the sequences and the prediction of their structural, functional and/or evolutionary relationships. in addition, the recent advances in rapid, low-cost sequencing methods, have resulted in the accumulation of large amounts of molecular data to be processed, making thus the need for fast and accurate multiple sequence aligners even more imperative. a widely used approach to cope with the multiple sequence alignment problem, is the employment of a computational formulation comprised of two major components, namely an objective function able to quantify the degree of similarity of a given alignment and an optimization procedure that targets at identifying the optimal alignment based on the underlying objective function. concerning the former component, the sum-of-pairs scoring model remains amongst the most popular choices. the maximization of the sp score is usually performed using dynamic programming. for the pairwise alignment case, an optimal solution can be found within reasonable time. however this does not hold for the multiple sequence alignment case, where it has already been shown that obtaining the optimal alignment using the sp score is np-hard. to overcome the computational intractability of the msa problem, a large number of efficient heuristic algorithms have been proposed with the most popular being the progressive alignment approach. in progressive alignment the sequences are initially placed on a bifurcating tree according to their degree of similarity. then, they are progressively aligned in pairs following the formed guide tree in a bottom-up order until its root is reached. at each step, two nodes of the tree are aligned by a standard pairwise alignment algorithm, and the deriving subalignment is retained to be used at a subsequent step. one important aspect of the progressive alignment strategy is the “once a gap, always a gap” rule, first introduced in. based on this policy, once a group of sequences is aligned, all gaps in the alignment are replaced by a neutral ‘x’ symbol ensuring that all subsequent pairwise alignments will be consistent with the pre-existing alignment of the group. this rule by definition implies that once a group of alignments has been built up, they will remain fixed even in the view of new sequences that could potentially improve the overall alignment. consequently, early errors in the progressive alignment steps are accumulated and propagated to later alignment stages compromising thus the alignment quality. this problem is often tackled by using iterative refinement techniques. in iterative refinement, one sequence is iteratively subtracted and realigned against the alignment of the remaining sequences. via this sequence-profile or profile-profile realignment, a new alignment is obtained which is then used for the next iteration of the algorithm. the refinement terminates when a fixed number of iterations is reached or when the alignment remains unchanged between consecutive iterations. although these methods are very efficacious at curating early alignment errors, they only partially address the “frozen subalignments” issue, since at each iteration of the algorithm only one sequence is realigned whereas the alignment of the remaining sequences is kept fixed. in this article we present a variation of the aforementioned iterative refinement strategy where all sequences may be simultaneously and independently realigned against a summarization profile that encapsulates all the starting alignment information. the process begins by constructing a standard profile that summarizes all the initial alignment information. then, a series of individual sequence-profile pairwise comparisons takes place, recording the way that each sequence is aligned against the profile. the new alignment is then indirectly inferred by merging all the individual subalignments into a unified group. the proposed approach is implemented as part of a newly introduced meta-aligner under the name reformalign and is freely available to the public from http://evol.bio.lmu.de/_statgen/software/reformalign/ under the gnu general public license. we call reformalign a meta-aligner, in the sense described in, meaning that an initial alignment is required and it can be used with a variety of alignment programs. as currently reformalign can only align dna/rna sequences, for the needs of our performance evaluations real nucleic acid datasets of variable length and average sequence identity rates were used. our experimental results demonstrate that the suggested profile-based modification of the classic progressive alignment and iterative refinement strategies is able to overcome the challenges posed by the propagation of early pairwise alignment errors and that reformalign is an efficient, well suited approach that may improve on the performance of a vast variety of existing alignment software. implementation alignment strategy reformalign aims at improving on the quality of an existing alignment by providing the sequences with an additional opportunity to be individually re-aligned against a standard profile that efficiently summarizes the starting alignment information. the idea is that via this re-alignment step, early alignment errors caused by “frozen” subalignments may be fixed, delivering thus better results in terms of alignment accuracy. towards this end, in reformalign the alignment of the sequences is performed in two steps. the first step involves the construction of a non-probabilistic profile from an existing alignment, whereas during the second step all the sequences are individually realigned against the profile that derived from the first step. the new alignment is finally indirectly reconstructed by merging all the individual sequence-profile subalignments into a unified group. due to the nature of the latter step, all pairwise sequence-profile comparison can be performed in parallel, improving thus the aligner performance in terms of execution time. upon completion of the latter step, a new alignment is derived which is very often different to the starting one. since this alignment may be also susceptible to further improvement, the whole process can be re-initiated using the reformed alignment as starting alignment. the algorithm terminates when either the alignment between two successive runs remains unchanged or a pre-defined maximum number of iterations is reached. a diagrammatic overview of the reformalign alignment logic flow is provided at figure  figure logic flow diagram of the reformalign alignment strategy. the algorithm creates an initial profile based on a starting alignment deriving from an established aligner. then, all the sequences are aligned against the formed profile to obtain the reformed alignment. notice that in this step, in case a new insertion is detected, the algorithm automatically switches to a profile fine-tuning mode in order to modify the profile to also account for the new insertion. after all sequences have been successfully aligned against the profile, the deriving alignment is indirectly inferred by merging all the estimated subalignments into a unified set and it is then freed from uninformative void columns. the process is repeated using the reformed alignment as starting alignment until the alignment between two successive runs remains unchanged or a predefined maximum number of iterations is reached. a. profile construction step in the profile construction step, a popular aligner is employed to infer a starting alignment for the examined group of sequences. then, a summarization profile is constructed upon the starting alignment, having as many position as the columns in the alignment. each position in the profile is characterized by a series of < residue, weight > pairs sized to fit the number of distinct residues that appear in the corresponding column of the alignment. the “residue” part in each pair corresponds to the label of a particular residue in the alignment column whereas its “weight” represents the number of times that this particular residue appears in that column. b. sequence alignment step in reformalign, the formation of the final alignment is performed indirectly by aligning all the sequences against the profile that derived from the first step. all sequence-profile alignments are performed using a standard pairwise alignment algorithm and for each sequence its alignment against the profile is recorded. by joining all deriving pairwise alignments into a unified group, it is possible to infer the final alignment of the examined sequences. in contrast to traditional iterative refinement approaches where at each refinement only one sequence is realigned, in the proposed approach all the sequences have a chance to align differently against the formed summarization profile. intuitively, the majority of the pairwise alignments that will come up from this step will have at most as many columns as the number of positions of the formed profile. nevertheless this is not always the case. for example, it might happen that a particular residue is aligned as a mismatch in one of the columns of the starting alignment, but during the sequence alignment step the score obtained by misaligning this residue against the corresponding profile position might be smaller than the penalty for opening a new gap in the alignment. in cases where the profile has to be updated in order to accommodate new insertion, reformalign automatically switches to a profile fine-tuning mode. as soon as the profile has been successfully updated, reformalign restarts the sequence alignment step using the new profile. another important aspect of the suggested meta-alignment technique is that since the alignment of the sequences may alter during the sequence alignment step, it might happen that none of the sequences aligns against one or more of the positions of the final profile, leading thus to the derivation of void columns. to fix for this issue, upon completion of the sequence alignment step, the program checks for uninformative void columns and completely removes them from the reported alignment. c. iterative refinement after the sequence alignment step has been completed, a new alignment is produced. in case the reformed alignment is different to the starting one, reformalign may be iteratively applied to further fine-tune the produced alignment. the iterative refinement step terminates when the pre-defined limit of iterations is reached or when the deriving alignments between two successive runs of the algorithm are identical. dynamic programming and scoring system the dynamic programming scheme employed by reformalign for the sequence-profile alignment task is the gotoh’s affine-gap penalties variation of the needleman-wunsch global alignment algorithm, as described in. regarding the scoring scheme for assessing the similarity between a position in a sequence and one from the profile, in contrast to the average function encountered in various alignment models such as clustalw, we employed an additive variant where the observed counts of the residues are used instead of their averaged frequencies, as follows: where a is the current alphabet, ca and cb represent the observed counts of residues a and b respectively and suba → b corresponds to the score matrix value for aligning residue a to b. the main reason for selecting aforementioned scoring scheme is that the use of the observed counts instead of the relative frequencies allows for a better discrimination between well-conserved columns. for example, a profile position exclusively comprised of a several cytosine residues will have exactly the same score as another profile position formed by a single cytosine, if the averaged sum of pairs scoring scheme was used, but the score for the former case would be significantly higher if the additive scoring model was employed instead. alignment parameters the choice of a proper values for the alignment parameters is essential for the multiple sequence alignment problem, since it has been proven that it may significantly affect the decision of the “optimal” alignment among the numerous alternatives. these parameters may significantly vary among different alignment approaches and they are usually decided by cross validation testing. in reformalign, the alignment parameters that have to be defined are the substitution scores and the gap opening and extension penalties. however, it would be desirable in our strategy that each residue of the sequences could inexpensively skip any low-scoring profile positions in order to align itself against another higher scoring position. furthermore, based on the fact that by definition the profile already incorporates enough positions where every residue of the sequences could possibly be aligned, opening a new gap in the profile should be more costly than opening a gap to the sequence. consequently, in reformalign four distinct types of gap penalties are considered: a penalty for opening a gap in the profile, a penalty for extending a gap in the profile, a penalty for opening a gap in the sequence and a penalty for extending a gap in the sequence. as in clustalw, terminal gaps are not penalized in our approach either. an additional parameter constraint deriving from the inherent properties of our model is that the substitution scores should be substantially higher than the gap penalties. in case this restriction is not met, it might happen that many sequences require a profile update during the sequence alignment phase, resulting thus in very large profiles containing a lot of poorly supported positions. to avoid such cases it is recommended that substitution scores are always set to positive values whereas gap opening and extension penalties are set to negative values. regarding the substitution weights, reformalign currently uses a modified version of the hoxd substitution matrix where all scores are increased by a positive “bonus” value, so that the aforementioned condition is met and to further reward matches compared to gaps. nevertheless, increasing all substitution scores by the same “bonus” value results in understating the differences between matches and mismatches. for this reason, each score value is then increased by a re-adjustment coefficient. the default bonus value and re-adjustment coefficient applied to the score matrix as well as the default gap opening and extension penalties were decided based on a greedy parameters search that was performed using muscle as the starting aligner and a separate training set with alignments from the data-set of a previous version of bralibase. for each test in the training set, the percent apsi value of the initial alignment was calculated and then more than parameter combinations were greedily assessed by comparing each time the deriving alignment to the expected one in terms of alignment accuracy. the results of this cross-validation analysis suggested that the score matrix bonus value and the gap penalties should be re-adjusted according to the apsi value of the initial alignment based on the subsequent formulas: where apsip is the percent average pairwise sequence identity calculated over the initial alignment. the aforementioned scheme for defining the starting parameter values was used for all the experiments outlined in the present study and is automatically employed by default in reformalign, unless more appropriate starting values are defined to the program by the user. finally, reformalign follows clustalw’s paradigm by heuristically updating the gap opening and extension penalties during runtime, in an attempt to deliver superior alignment results. in particular, the penalties are modified based on the following criteria: dependency on the lengths of the sequences both the gap opening and gap extension penalties are modified depending on the ratio between the length of the sequence to be aligned and the largest sequence in the set. intuitively, gaps should be penalized harder for shorter sequences in order to avoid having alignments with too many and/or sparse gaps. the calculation of the starting gap penalties is performed according to the following formula: where gp represents all types of gap penalties, m is the length of the largest sequence in the set and n is the length of the sequence to be aligned. position-specific penalties based on the profile conservation rate during the computation of the dynamic programming matrix, the gap opening penalties are modified in a position-specific way depending on the conservation rate of the profile. if a position in the profile is well conserved, then this implies that the specific position is strongly supported by many sequences and thus the penalty for opening a new gap against this profile position should be higher compared to weakly supported positions. consequently, the gap opening penalties per position are calculated as follows: where gop represents the gap opening penalties, pcri is the profile conservation rate for the ith position of the profile calculated as a fraction of the maximum weight value among all < residue, weight > pairs contained in the ith position of the profile divided by the sum of all weights of the pairs in the ith position and ssij is the substitution score for aligning the ith position of the profile against the jth position of the sequence. the idea behind the multiplication of the profile conservation rate by the substitution score is to linearly increase the gap opening penalties for conserved columns, so that gaps would be favored only if subsequent matches of the sequence against ensuing positions of the profile would score high enough to sufficiently compensate for the very costly gap that was opened. methods in order to assess the efficiency of reformalign in improving the quality of existing alignments, testsets from the bralibase rna alignment database and the dna smart database were used. bralibase bralibase is a collection of rna alignments taken from the rfam database. it was initially introduced in, but since then it has been further enriched with additional alignments, leading to its current version v which contains in total aligned sets of sequences with an average pairwise sequence identity rate ranging between 20% and 95%. for the needs of the present study we limited our analysis to the bralibase alignments composed of and sequences per alignment. dna smart the dna reference alignment benchmarks database was proposed in as a collection of dna reference alignments for the assessment of msa applications. it is comprised of multiple dna sequence alignments corresponding to protein alignments of the balibase, oxbench, prefab and smart benchmarking datasets. for our experiments, we considered all alignments corresponding to the smart database containing between and sequences per alignment. since however reformalign does not currently support ambiguous characters, we limited our analysis to a total of alignments containing exclusively unambiguous dna letters. accuracy measures to assess the agreement between the reconstructed and the reference alignments, the following measures of accuracy were considered. the sum of pairs score was initially proposed by thompson et al. and is defined as a fraction of the number of the correctly aligned residue pairs in the reconstructed alignment over the number of aligned residue-pairs of the reference alignment. if the denominator of the fraction is replaced by the number of residue-pairs in the test alignment, then the reverse sum of pairs score is obtained. finally, the total columns score is computed by dividing the number of correctly identified columns in the reconstructed alignment over the total number of columns in the reference alignment. although these metrics can provide an overview of the quality of the deriving alignments, each one has its own drawbacks. the developer’s score fails to penalize over-alignments and could give a great score to an alignment that erroneously aligns non-homologous regions, whereas the modeler’s score is not sensitive to detecting under-alignments and thus could possibly give high scores to alignments that systematically fail to align homologous regions. finally, the tc score is very sensitive to the misalignment of even a single sequence yielding a zero-valued tc score even if all the remaining sequences in the examined group are properly aligned. for this reason, two additional metrics were considered: a) the cline’s score, which efficiently addresses the issues of the developer’s and modeler’s scores by penalizing over- and under- alignments while taking into account minor shifts in the reconstructed alignment compared to the reference and b) the d-pos metric proposed by blackburne and whelan which satisfies the conditions of symmetry and triangular inequality that are not met by the sp and tc scores, where at the same time it incorporates information from indels by recording the position where gaps occur. all accuracy measures take their values in the range, with the exception of cline’s score which may also take negative values in case there exist many large shifts. moreover, in contrast to the remaining metrics, d-pos reports the distance between the generated and the reference alignment and thus lower d-pos values correspond to better alignments. since d-pos and cline’s score can efficiently summarize the quality of the deriving alignments while at the same time being the most immune to deficiencies, the discussion will be mostly based on the experimental results of these two metrics. alignment programs we assessed the effect reformalign on the deriving alignments of ten leading methods: clustalw, clustalo, muscle, mafft, kalign, gramalign, probconsrna, r-coffee, picxaa and dialign-tx. these aligners implement a variety of alignment techniques, such as progressive alignment, iterative refinement, segment-based alignment, probabilistic/consistency-based alignment and maximum expected accuracy alignment. moreover, r-coffee specializes in the alignment of rna sequences and could thus provide us with an overview of the way that the proposed sequence-based method may affect initial alignments that use secondary structure information. since our main intention was to examine the effect of reformalign on existing alignments rather than to analytically assess the efficiency of each aligner on the benchmark databases, we used the default settings for all aligners except for mafft which was executed using both the –fft-ns-i and the –l-ins-i options. finally, the default value for the maximum number of refinement iterations in reformalign was set to for all experiments.  each benchmark test was given as input to all the considered aligners in order to obtain an initial alignment which was compared against the reference. then, this alignment was provided as input to reformalign and the newly generated alignment was also compared against the reference using all considered accuracy metrics. via this procedure, we came up with eleven distinct alignment pairs for each benchmark test. furthermore, in order to determine the statistical significance of the differences between the initial and the reformed alignments, wilcoxon signed rank tests were also performed for each alignment-pair. however, since multiple test cases in the benchmark data may contain sequences of the same families, the samples independency assumption of the statistical test might not be fully met and for this reason the reported results should be interpreted with caution. bralibase the results for the bralibase benchmark tests are visualized in figures  and moreover, in order to explore the effect of reformalign to testsets of increasing apsi, we grouped the benchmarks in four clusters according to the percent identity of the sequences. the average scores for each group are shown in table  and additional file 2: table s and are graphically depicted at figure  figure scatterplots of the cline scores per alignment pair for the benchmark tests of the bralibase dataset. a scatterplot is constructed per alignment pair for each one of the benchmark tests. the diagonal line represents the expected plot if the initial and the reformed alignments were identical. consequently, an accumulation of points above the diagonal line represents improved reformed alignments whereas points below the diagonal correspond to cases where reformalign worsened the initial alignment. boxplots of the averaged cline scores of the considered alignment pairs for the alignments of the bralibase dataset. the boxplots of the cline scores averaged over all test cases of the bralibase dataset are given at this figure. the figures are organized in pairs corresponding, from left to right, to the averaged performance of,,,,,,,,,, and. the bars at the bottom of each pair represent the percentage of times where the reformed alignments were superior, equal or inferior in terms of cline score compared to the initial alignments. bralibase cline scores aligner initial reformed avg. dif. p-value r > i r = i r < i p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** apsi aligner initial reformed avg. dif. p-value r > i r = i r < i p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p =  *** apsi aligner initial reformed avg. dif. p-value r > i r = i r < i p <  *** p =  *** p <  *** p =  ** p <  *** p <  *** p =  * apsi aligner initial reformed avg. dif. p-value r > i r = i r < i p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** apsi aligner initial reformed avg. dif. p-value r > i r = i r < i p =  * p <  *** p =  ** p =  * p <  *** p <  *** p <  *** cline scores corresponding to the alignments of the bralibase dataset. *significant at p<, **significant at p<, ***significant at p≤. the first sub-table summarizes the performance of each alignment pair averaged over all test cases whereas the remaining sub-tables report the results organized according to the average pairwise sequence identity of the sequences. for every sub-table, the apsi value and the number of alignments corresponding to each group are reported in the first row. columns and correspond to the average cline scores of the initial and the reformed alignments respectively. the average differences per alignment pair are given in the fourth column and the corresponding p-values of these differences are given at the fifth column. finally, columns 6– indicate the percentage of cases where the reformed alignments were superior, equal or inferior to the initial alignment. average cline score differences for the benchmark tests of the bralibase dataset. effect of reformalign to testsets of increasing apsi and increasing number of sequences per alignment. the alignment pairs correspond to,,,,,,,,,, and. for each value of the horizontal axis, the difference is calculated by subtracting the average cline score of the reformed alignments to the respective score of the initial alignments that belong to each group. statistically significant differences at the. significance level are denoted by an asterisk at the top-left corner of the respective points. the number of test cases per group is given at the bottom of each value in the x-axis. despite the simplicity of the reformalign logic, the experimental results suggest that the proposed approach may significantly improve on the performance of almost all examined aligners. in general, the improvement due to reformalign seems to be substantially higher for difficult examples or for lower-scoring aligners and becomes less noticeable when the starting alignments are already nearly optimal leaving thus less room for improvement. the only cases where reformalign seems to degrade on average the initial alignments are for picxaa and probconsrna. nonetheless, even for these aligners it was found that in a considerable amount of cases the reformed alignments were superior to the initial ones whereas it may also be observed that the average decrease for both aligners is relatively small and not always statistically significant. in addition, although the cline, sp and tc scores seem to indicate a marginal degradation of the initial alignments due to reformalign, according to the d-pos similarity metric the reformed alignments were superior to the starting ones for all aligners participating in our experiments. another important observation is that reformalign very often delivers alignments which are different to the starting ones, and in the majority of these cases the reformed alignments are superior to the corresponding starting ones. this trend is much more apparent for testsets with relatively low apsi values and becomes less evident for highly similar alignment cases. the experimental results also demonstrate that the application of reformalign to existing alignments does not affect all aligners in the same way and may result in changes in their overall ranking. for example, as it may be seen at table  although initially gramalign and r-coffee score on average lower than dialigntx and probconsrna respectively, the situation is reversed after reformalign has been applied to fine-tune the respective alignments. the same holds true for the muscle, kalign and mafft aligners with the latter scoring higher than the other two after the respective alignments have been reformed. finally, as it may be seen at figure  4a, the effect of reformalign for the majority of aligners seems to be more substantial for harder test cases and becomes less noticeable as the average pairwise sequence identity increases. this does not seem to be the case for the highest scoring aligners which deliver quite accurate alignments even for relatively hard test cases leaving thus less room for improvement, and for gramalign where several test cases from the higher apsi groups seem to violate its grammar-based assumptions resulting thus in lower-scoring initial alignments that are then refined by reformalign. the analysis of the cline score differences versus the number of sequences per alignment revealed similar results. probabilistic and consistency-based aligners, which appear to deliver more accurate starting alignments, seem to benefit less from the application of reformalign compared to optimization-driven or iterative refinement based approaches. the main reason for this might be in the underlying assumptions of these models. in particular, these high-scoring aligners employ sophisticated albeit computationally expensive probabilistic assumptions resulting thus quite often in very accurate alignments. reformalign however is based on the ad hoc sp scoring scheme and it may thus happen that accurate starting alignments that meet the probabilistic/consistency based assumptions are slightly degraded by the more arbitrary optimization scheme of reformalign, especially in alignments composed of multiple sequences. however, as the experimental results demonstrate, there is a considerable amount of cases where the initial alignments of the probabilistic consistency transformation approaches are improved by the proposed post-processing step, suggesting thus that reformalign could appear to be useful even for fine-tuning the starting alignments of such sophisticated alignment methods. dna smart a similar analysis was carried out for the benchmark tests of the dna smart database. for these experiments r-coffee was removed from the analysis. since the majority of the test cases were sharing an average sequence identity equal or lower to 55%, the differences between the reformed and the initial alignments for the higher apsi groups were not found to be statistically significant at the. level. the performance averaged over all test cases per alignment pair is graphically depicted at figures  and whereas the analytic results for the considered accuracy metrics are reported at table  and additional file 3: table s figure scatterplots of the cline scores per alignment pair for the benchmark tests of the dna smart dataset. for each alignment pair a scatterplot is constructed. each point corresponds to an alignment test case of the dna smart dataset and depicts the cline score of the initial alignment versus the respective score of the reformed alignment. the diagonal line represents the expected plot if the initial and the reformed alignments were identical. boxplots of the averaged cline scores for the alignments of the dna smart dataset. the boxplots corresponding to the cline scores for the dna smart dataset are given in this figure. the figures, correspond, from left to right, to the averaged performance of,,,,,,,, and. the bars at the bottom of each pair represent the percentage of times where the reformed alignments were superior, equal or inferior in terms of cline score compared to the initial alignments. dna smart cline scores aligner initial reformed avg. dif. p-value r > i r = i r < i p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** p <  *** cline scores corresponding to the alignments of the dna smart dataset. *significant at p<, **significant at p<, ***significant at p≤. the average cline scores corresponding to the initial and the reformed alignments are given at columns and respectively. column represents the differences of the cline scores per alignment pair and the statistical significance of these differences is given at column. the last three columns correspond to the percentage of cases where the reformed alignments were superior, equal or inferior to the initial alignment. the experimental results suggest that reformalign was able to improve on the starting alignments for the majority of the considered aligners. for probconsrna the effect of reformalign is dubious: although on average the reformed alignments appear to be marginally superior to the initial ones, they demonstrate a greater variability compared to the starting alignments and the reported differences are not always found to be statistically significant. regarding the remaining aligners of our benchmark study, only mafft and picxaa are shown to be negatively affected by the application of reformalign whereas a noticeable improvement is observed for the rest. the reported degradation of the pct-based aligners could be due to the sophisticated assumptions of these high performance methods compared to the ad hoc optimization scheme of reformalign. specifically, since the dna smart database is composed of alignments which are based on biological features such as the tertiary structure of encoded proteins, the simplicity of the reformalign scheme could result more often in degradation of alignments deriving from the more accurate pct-based methods, compared to alignments generated from progressive and iterative refinement aligners. in agreement to the results of the bralibase experiments, the dna smart analysis supports the conclusions that reformalign generates alignments that are frequently different to the starting ones and that the suggested approach does not affect all aligners the same way, resulting thus in changes in their overall ranking. finally, the assessment of the effect of reformalign to testsets of increasing apsi and increasing number of sequences per alignment did not provide us with conclusive results, mainly due to the fact that there were only a limited number of test cases belonging to the higher order groups, often resulting in statistically insignificant differences for the considered alignment pairs. nevertheless, the results of figure  7a indicate a trend that further supports the idea that the effect of reformalign is weaker for closely related sequences compared to alignments with lower apsi values, whereas there does not seem to be a clear pattern describing the way reformalign affects the examined aligners with an increasing number of sequences per alignment.figure average cline score differences for the benchmark tests of the dna smart dataset. effect of reformalign to testsets of increasing apsi and increasing number of sequences per alignment. the alignment pairs correspond to,,,,,,,, and. for each value of the horizontal axis, the difference is calculated by subtracting the average cline score of the reformed alignments to the respective score of the initial alignments that belong to each group. statistically significant differences at the. significance level are denoted by an asterisk at the top-left corner of the respective points.  in this paper we presented reformalign, a novel profile-based meta-alignment approach that aims at correcting early alignment errors by giving the sequences a second opportunity to re-align themselves against a standard profile that efficiently summarizes the initial alignment information. reformalign is based on the gotoh’s affine-gap penalties variation of the classic needleman-wunsch algorithm and uses a refinement scheme according to which the reformed alignment is indirectly inferred by a series of individual and independent sequence-profile pairwise comparisons. reformalign was extensively assessed on the way it affects the alignments of ten leading aligners using benchmark testsets from the bralibase and dna smart datasets. the results suggest that the majority of aligners showed a notable improvement on the accuracy of the delivered alignments when reformalign was employed as a post-processing step. this improvement was more substantial for harder alignment cases with low apsi or when there was still adequate room for improvement on the starting alignments, and became less evident when the initial alignment was already quite accurate or for easier alignment cases with high identity rates. finally, it is important to mention that the proposed method does not come to replace other popular alignment techniques. instead, users may continue to use their aligner of preference and then complementarily employ reformalign as a post-processing step to examine if the delivered alignment is more appropriate for their analyses. availability and requirements reformalign is freely available to the public under the gnu general public license. both the source code and precompiled binaries for linux and windows may be downloaded from http://evol.bio.lmu.de/_statgen/software/reformalign/. currently reformalign can only align dna and rna sequences and it is provided as a command line program. its source code is in c++ and it makes use of the open multi-processing parallelization api. for the benchmark tests, the bralibase rna alignment database and the alignments from the dna reference alignment benchmarks database were employed. the evaluation of the alignments accuracy was performed using robert edgar’s qscore, multiple alignment scoring software and blackburne and whelan’s metal command-line utility for calculating metric distances between alternative alignments. finally, the alignment programs that were used in our benchmark analysis are as follows: clustalw2, clustalo, muscle, mafft, kalign, gramalign, probconsrna, r-coffee, picxaa and dialign-tx. electronic supplementary material additional file 1: table s1: command-line options per alignment method. additional file 2: table s2: bralibase results. averaged d-pos, sp and tc scores for the benchmark tests of the bralibase dataset. the results are presented averaged over all benchmark tests as well as organized in four groups according to the average pairwise sequence identity of the sequences. for each accuracy metric three figures are provided corresponding to the average scores of the initial alignments, the reformed alignments and their respective differences. differences that are found to be statistically significant at the. significance level are highlighted in bold. for the sp and tc scores, positive average differences indicate that the reformed alignments were superior to the initial ones whereas negative values indicate that reformalign worsened the starting alignments. for the d-pos scores the situation is reversed: negative values indicate an improvement due to reformalign, whereas positive values represent a degradation of the starting alignments. additional file 3: table s3: dna smart results. averaged d-pos, sp and tc scores for the benchmark tests of the dna smart dataset. for each accuracy metric three figures are provided corresponding to the average scores of the initial alignments, the reformed alignments and their respective differences. statistically significant differences at the. significance level are highlighted in bold. competing interests the authors declare that they have no competing interests. authors’ contributions d.p.l. developed the idea, implemented the software and drafted the manuscript. d.m. planned and supervised the work and contributed to the manuscript. both authors read and approved the final manuscript. 
the main idea behind reformalign is quite straightforward: at first, an existing alignment is used to construct a standard profile which summarizes the initial alignment and then all sequences are individually re-aligned against the formed profile. we call reformalign a meta-aligner as it requires an initial alignment, for which a variety of alignment programs can be used. the experimental results suggest that the proposed meta-aligner approach may often lead to statistically significant more accurate alignments. furthermore, we show that reformalign results in more substantial improvement in cases where the starting alignment is of relatively inferior quality or when the input sequences are harder to align. although this problem may be efficiently solved when only two sequences are considered, the exact inference of the optimal alignment easily gets computationally intractable for the multiple sequence alignment case. from each sequence-profile comparison, the alignment of each sequence against the profile is recorded and the final alignment is indirectly inferred by merging all the individual sub-alignments into a unified set. in this paper we present reformalign, a novel meta-alignment approach that may significantly improve on the quality of the deriving alignments from popular aligners. the proposed profile-based meta-alignment approach seems to be a promising and computationally efficient method that can be combined with practically all popular alignment methods and may lead to significant improvements in the generated alignments.
 obtaining an accurate sequence alignment is fundamental for consistently analyzing biological data. although this problem may be efficiently solved when only two sequences are considered, the exact inference of the optimal alignment easily gets computationally intractable for the multiple sequence alignment case. to cope with the high computational expenses, approximate heuristic methods have been proposed that address the problem indirectly by progressively aligning the sequences in pairs according to their relatedness. these methods however are not flexible to change the alignment of an already aligned group of sequences in the view of new data, resulting thus in compromises on the quality of the deriving alignment. in this paper we present reformalign, a novel meta-alignment approach that may significantly improve on the quality of the deriving alignments from popular aligners. we call reformalign a meta-aligner as it requires an initial alignment, for which a variety of alignment programs can be used. the main idea behind reformalign is quite straightforward: at first, an existing alignment is used to construct a standard profile which summarizes the initial alignment and then all sequences are individually re-aligned against the formed profile. from each sequence-profile comparison, the alignment of each sequence against the profile is recorded and the final alignment is indirectly inferred by merging all the individual sub-alignments into a unified set. the employment of reformalign may often result in alignments which are significantly more accurate than the starting alignments.  we evaluated the effect of reformalign on the generated alignments from ten leading alignment methods using real data of variable size and sequence identity. the experimental results suggest that the proposed meta-aligner approach may often lead to statistically significant more accurate alignments. furthermore, we show that reformalign results in more substantial improvement in cases where the starting alignment is of relatively inferior quality or when the input sequences are harder to align.  the proposed profile-based meta-alignment approach seems to be a promising and computationally efficient method that can be combined with practically all popular alignment methods and may lead to significant improvements in the generated alignments. electronic supplementary material the online version of this article contains supplementary material, which is available to authorized users. keywords multiple sequence alignmentiterative refinementdynamic programmingissue-copyright-statement© the author 2014 