# Melodic Similarity and Applications Using Biologically-Inspired Techniques
## 4 Multiple Sequence Alignment Quality for Melodic Sequences
### Results  
For each clique of sequences we generated a reference motif alignment manually, and computed its motif-SOP score (called \(S_{ref}\)). At the same time, for each motif-agnostic configuration (MSA algorithm, gap settings), we aligned the melodic sequences. Each resulting alignment was also assigned a motif-SOP score (called \(S_{auto}\)). In order to identify the best MSA configuration with respect to motif alignment, we compute its normalized motif-SOP score \(S_{ref}/S_{auto}\).  
Before proceeding into the quantitative results, it is worth visually examining the alignments created by the MSA algorithms. Figure 2 presents different alignments of the tune family \"Daar_ging_een_heer_1\" for a number of configurations. Regarding quantitative results, Figure 3 and Table 3 present the normalized motif-SOP score for different configurations. There are a number of observations that become immediately apparent: first, the normalized motif-SOP score can be less than zero, since the original unaligned sequences, that act as the lower bound, may include correctly aligned motifs by random chance (see Figure 1). Secondly as expected, star alignment is the worst performing algorithm across all gap settings. Regarding the relative performance of the configurations themselves (excluding star alignment), a Friedman significance test showed that there was a statistically significant difference in motif-SOP depending on the configuration with \(p=0.041\). However, post hoc analysis with Wilcoxon signed-rank tests and Bonferroni correction, revealed that there were no significant differences among any pair of configurations.  
Regarding the overall performance of the algorithms themselves, a Friedman significance test showed that there was a statistically significant difference in normalized motif-SOP depending on the algorithm with \(p<10^{-6}\). Post hoc analysis with Wilcoxon signed-rank tests and a Bonferroni correction resulted in a significance level set at \(p<0.003\). \(p\) values for all possible pairs are presented in Table 4. It is clear that Mafft, run with the globalpair strategy, outperforms T-Coffee and that of the three Mafft strategies, globalpair performs the best. A Wilcoxon signed-rank test between all the Mafft algorithms using and not using the allowshift option, revealed that the allowshift option does not have a significant impact on the results, \(p=0.11\).  
Finally, regarding the gap settings, significance tests showed that for Mafft and T-Coffee in general, there is a significant difference depending on the gap penalties used. For T-Coffee in particular, large gap settings such as \((-60,-3)\) or \((-40,-2)\) are not recommended. For MAFFT on the other hand, small gap penalties, such as \((-0.8,-0.5)\) should be avoided. However it should be noted that for each particular Mafft strategy, gap settings have no significant effect.  
Figure 2: Automatically aligned melodic sequences of the tune family “Daar ging een heer” using the following configurations (**top–bottom**): MAfft-genafpair-4-.2, MAfft-globalpair-allowshift-4-.2, MAfft-loacalpair-2-1.5, MAfft-localpair-allowshift-3-.1.5 and T-Coffee-8-0.5. Colours correspond to motif labels. White colour indicates no motif label.