Such assembly-based genome graphs would encompass the wide spectrum of genetic variation accessible to long-read-basedde novo assembly, including large structural variants and divergent haplotypes.Genome graphs are emerging as an important novel approach to the analysis of high-throughput human sequencing data. By explicitly representing genetic variants and alternative haplotypes in a mappable data structure, they can enable the improved analysis of structurally variable and hyperpolymorphic regions of the genome. In most existing approaches, graphs are constructed from variant call sets derived from short-read sequencing. As long-read sequencing becomes more cost-effective and enablesde novo assemblies. NovoGraph constructs a genome-wide multiple sequence alignment of all input contigs and creates a graph by merging the input sequences at positions that are both homologous and sequence-identical. NovoGraph outputs resulting graphs in VCF format that can be loaded into third-party genome graph toolkits. To demonstrate NovoGraph, we construct a genome graph with 23,478,835 variant sites and 30,582,795 variant alleles fromde novo assemblies of seven ethnically diverse human genomes . Initial evaluations show that mapping against the constructed graph reduces the average mismatch rate of reads from sample NA12878 by approximately 0.2%, albeit at a slightly increased rate of reads that remain unmapped. Here we present NovoGraph, a method for the construction of a human genome graph directly from a set of Since the release of the first complete version of the human reference genome in 2003, large-scale genomic sequencing has been established as a key tool for both fundamental research and personalized medicine. Sequencing costs have fallen dramatically, and the whole genomes of tens of thousands of individuals have been sequenced and analyzed. Although long-read sequencing is becoming more cost-effective and popular, the sequencing technologies that currently dominate cohort sequencing produce millions of short reads between 100 and 250 base pairs in length. As the first step of data analysis, these reads are typically mapped to the human reference genome to determine their genomic locations.This approach works well for the large majority of reads; critically, however, it fails for reads that come from regions in the sequenced genome that are strongly divergent from the reference genome. Important examples include immunogenetic regions known to harbor important disease-associated variants like the major histocompatibility complex (MHC) and the killer-cell immunoglobulin-like receptor (KIR) genes , as wellInstead of mapping reads to a single reference genome, it is now possible to map reads to a reference genome graph  the sequences that correspond to structural variants and divergent haplotypes. Graphs constructed by NovoGraph will therefore be comparatively enriched in large-scale structural and complex variants. In the spirit of modularity, constructed graphs are represented in VCF format, which enables them to be used with any of the established genome-wide graph toolkits. We also utilize the standard CRAM format for representing the output of intermediate steps, in particular a multiple sequence alignment of all input sequences.Here we introduce NovoGraph, a pipeline for the direct construction of acyclic genome graphs fromde novo assemblies; they don’t directly support multi-chromosomal alignment scenarios and typically don’t scale to aligning thousands of contigs across multi-gigabase genomes. Methods and data structures for whole-genome alignment, on the other hand, are typically designed to detect homology relationships between more distantly related genomes of different species and explicitly model complex large-scale events, such as chromosomal inversions and translocations, in terms of a  sequence graph. Although these data structures describe essential aspects of genome evolution, such whole-genome alignment graphs are not supported by the alignment and/or inference modules of the existing genome-wide graph toolkits. By contrast, NovoGraph is designed to construct graphs that are universally compatible with existing downstream software for graph-based genome inference, and uses a localization approach to enable the application of existing multiple sequence alignment algorithms in the context of graph construction (described in detail below).The genome graph construction problem is related to other algorithms and approaches to establish homology relationships between sets of sequences, for example multiple sequence alignment , A-BruijWe demonstrate NovoGraph by constructing a genome graph from seven ethnically diverse human genomes and the canonical reference. In a mapping experiment with vg  between all input contigs and the reference genome. This multiple sequence alignment embodies the joint sequence homology relationships between all input sequences and the reference genome. The pairwise contig-to-reference alignments from Step 1 are used to guide this process.3. Compute a directed acyclic graph (DAG) from the global MSA, connecting contigs at positions that are both homologous and sequence-identical.The outputs from Steps 1 and 2 are represented in SAM/CRAM format  can therefore contribute to a consistent global alignment.We now give a formal definition of the algorithm. For simplicity, we assume that all identified diagonals align to the same reference contig in the same orientation; if this is not the case, the following algorithm can be executed independently for all reference contig/orientation pairs and their corresponding diagonals, and the best global alignment between the input contig and the reference genome is the best identified alignment over all considered pairs of reference contigs and orientation.P_ENTRY of “path entry” points and a setP_EXIT of “path exit” points. Each element) of these sets consists of a diagonal identifier and a pair of coordinates that specify positions along the reference and input sequences, similar to the coordinates in the classical Needleman-Wunsch dynamic programming matrix. For example, the coordinate pair  refers to a state in which 3 characters of the reference and 2 characters of the input sequence have been consumed. We also define the special pointsORIGIN as) andTERMINUS as), wheren is the length of the reference sequence,m is the length of the input contig ID, and “NA” stands for an undefined diagonal identifier.We define a setP_ENTRY andP_EXIT based on the identified diagonals. Each diagonal represents a local pairwise alignment between the reference and the input contig, and is therefore associated with two pairs of coordinates that specify the start and stop of the alignment in the reference and in the contig sequence. Specifically, let1, d2)))) the coordinatesx, dy) there is another diagonalg with1 = dxg or2 = dyg. The definition of within-diagonal path entry points follows symmetrically. The different types of entry and exit points are illustrated inWe populate the sets0,x1,x2,...,xnx that meet the following conditions:The set of valid path traversals is defined as the set of sequences(i) i such thati is even,ix is a member of {ORIGIN ∪P_EXIT}for all(ii) i such thati is odd,ix is a member of {TERMINUS ∪P_ENTRY}for all(iii) 0 = ORIGINx andn = TERMINUSx(iv) i=)x andi+1= )x,a ≤ hag andb ≤ hbgfor all(v) i=)x andi+1=)x with oddi,g = hfor all(vi) each element of the sequence is unique.score(ORIGIN) = 0. For oddi withi=)x andi-1=)x, we seti) = score(xi-1) + gap_score x [(ha - ga)+(hb - gb)]score)x andi-1=)x,g is equal toh by definition and we seti)score(x to bei-1)score.Each traversal can be scored iteratively from left to right by combining the scores of the traversed diagonals with gap-incurred penalties from the jumps between exit and entry points. We initialize by settingS := {ORIGIN ∪ P_ENTRY ∪ P_EXIT ∪ TERMINUS} by coordinates and for thei-th element of the ordered setS, compute the maximum achievable scorei)max_score 0 , .., xi-1}S’ ⊆ {x of possible predecessor elementsidentifying the subset(ii) s ϵ S’, scoring the transition froms toix by replacing‘score’ with‘max_score’ in the definitions of the preceding paragraphfor each(iii) i)max_score. We initialize two variablesRUNNING_REF andRUNNING_CONTIG as empty strings. We then iterate through the pairwise alignment in a column-by-column fashion from left to right; for each columni of the pairwise alignment, we perform the following steps:The first of these algorithms, NovoGraph-Simple, implements a one-to-one conversion of each aligned contig from the multiple sequence alignment into VCF format. Given a pairwise alignment between the canonical reference and the contig, let1. ALIGNED_REF[i] ≠ ALIGNED_CONTIG[i], continue to step 2. Otherwise, carry out the following: a) remove all gap characters fromRUNNING_REF andRUNNING_CONTIG; b) ifRUNNING_REF andRUNNING_CONTIG are then not identical, output a VCF variant with reference sequenceRUNNING_REF and variant sequenceRUNNING_CONTIG; c) resetRUNNING_REF andRUNNING_CONTIG to the empty string.If2.ALIGNED_REF[i] toRUNNING_REF, and appendALIGNED_CONTIG[i] toRUNNING_CONTIG. Then, if the end of the pairwise alignment has not been reached, return to step 1 withi = i + 1.Append the charactera,b) of MSA sequences immediately prior to positions at which botha andb align to the reference in the joint MSA with either a match or a mismatch. The generated VCF may contain overlapping variants.If necessary, the pairwise alignments are pruned so that the first and the last column are non-gap and reference-identical; no further regularization  of alignment gap structure is carried out. After having applied the conversion algorithm to all aligned contigs, identical variants from different contigs are merged and sorted by position to obtain a valid VCF. This algorithm implements a merging model that allows for transitions between pairs  between pairs of input contigs wherever input contigs start or end along the canonical reference, and (B) at positions at which all contig sequences agree with the canonical reference. The graph collapses into a uniformly homozygous state at positions whereby condition (B) applies. The resulting graph structure  lends itself directly to representation in VCF format. Also note that criterion B  is stronger than the merging condition (sequence identity across pairs of input sequences) of a related algorithm  consists of two elements: (i) the “current sequence” ofh  and (ii) the contig ID of the contig that the current haplotype is copying from (the “source haplotype”)—this can be either the reference or one of the input contigs. We initializeR such thatR has one element that has a zero-length sequence and that is set to copy its sequence from the reference.We keep a set of current haplotypes, denoted ash ∈R, we append the corresponding MSA character of the source haplotype to the current sequence ofh. This step is called “extension”  all appended characters are non-gap reference identical and (B) the length of the current sequences of the elements ofR is greater than or equal to 2 non-gap bases. This step is called “flushing” .Compile a list2. C of non-reference contig IDs that a) are the source haplotype of any current element inR and b) don’t exit at the current MSA position (i.e.C is a list of non-exhausted current contig IDs).Compile a list3.  ∈ {E xC}, we add a new element toR with a) its current sequence set to the current sequence ofe and b) its source haplotype set toc. After having processed all elements of the set {E xC} we set the source haplotypes of alle E to the reference.For each elementR increases as non-reference contigs enter and exit and, conversely, the size ofR can only decrease during the flushing step. To limit computational demands, we impose an upper limitU1 on the size ofR. If|R| ≥U1, we prohibit the entry of new contigs, and when exiting a contig, we only allow the transition to the reference as source haplotype. If the entry of a contig is prohibited, the contig is lost permanently (including the variants it contains).Clearly the size ofU2 on the maximum number of contiguous contig gaps in the input alignments. If a contiguous gap along the input contig dimension in an input contig alignment exceedsU2 in size, we break the alignment, i.e. we split the alignment in two.U1 limits the complexity of the graph in terms of the number of per-site variant haplotypes,U2 limits the maximum size of deletions represented in the graph. In the current implementation, we useU1 = U2 = 5000 bp, but both parameters can be easily modified by the user.Furthermore, due to the requirement of reference identity, gaps in the input MSA along the contig sequence dimension (i.e. corresponding to columns in the MSA in which the input contig sequence is a gap and the reference is not) prevent flushing. We therefore also place an upper limitSteps 1 and 2 are implemented in Perl 5. Step 3 is implemented in C++, with a wrapper Perl script. Our pipeline utilizes bwa (version 0.7.15 and above), SAMtools (version 1.4 and above), and MAFFT (version 7). The minimum computational requirement for NovoGraph is a workstation computer with at least 32 Gb of RAM; we recommend, however, that the MSA generation steps be executed within a multi-node cluster environment. NovoGraph natively supports SGE-compatible grid environments, although this could be easily adapted to other platforms.de novo assemblies of human genomes  against a) the genome graph constructed by us  and b) a simple non-branching reference graph constructed from the primary GRCh38 reference alone. Alleles longer than 10 kb in size were removed to ensure successful loading of the graphs into vg. Results of the mapping experiment are shown inde novo assemblies. The pipeline is available under an open source license and will scale to at least a few dozen input assemblies without major modifications. It would also be straightforward to adapt NovoGraph to non-human species, given the appropriate reference and input assemblies.NovoGraph enables the construction of a graph genome from multipleIt is instructive to contrast the MSA-based NovoGraph approach with possible alternative approaches in which one creates a separate VCF for each assembly and then builds a graph by combining the individual VCFs. First, carrying out the multiple sequence alignment prior to the VCF generation step enables the sharing of information across multiple samples during the alignment process, potentially improving overall alignment quality and providing more consistent variant definitions across samples. Secondly, the constructed multiple sequence alignment of all input assemblies can be repurposed for other applications, for example as an input to other graph construction algorithms like the Population Reference Graph (One limitation of NovoGraph (and existing approaches for downstream graph-based genome inference) is that no attempt is made to explicitly model or annotate events that break co-linearity between the input sequences, such as rearrangements, inversions, or translocations. If present, the corresponding sequences will be represented in the MSA and feature as bubbles in the generated graph, so that downstream inference on the presence or absence of these features is possible in principle. Meaningful integration of complex variant types into models for graph-based genome inference, however, will require further work in methods development. This is an important direction for future research.There are two additional directions for future work. First, in the spirit of a hackathon, we have focused our efforts on the software development process. A comprehensive empirical evaluation of the constructed human genome graph is still outstanding. This could be achieved by loading the graph into multiple graph-based inference frameworks and by measuring genome inference accuracy. Secondly, it would be important to better understand the impact on the graph construction process of various parameter settings and trade-offs. For example, in the interest of simplicity, we implemented a simple gap scoring scheme that is neither affine nor convex; we relied on the default settings of MAFFT for the generation of the multiple sequence alignments; and we implemented a naive algorithm to split the reference genome into windows for MSA generation. Exploring alternative choices in each of these cases would be straightforward and could lead to valuable insights. A convex gap scoring scheme would probably improve the alignment of large and complex structural variants ,http://identifiers.org/ncbigi/GI:929855629; GCA_001015385.3 (CHM13),http://identifiers.org/ncbigi/GI:953917559; GCA_001549605.1 (HG003),http://identifiers.org/ncbigi/GI:985741195; GCA_001549595.1 (HG004),http://identifiers.org/GI:985734877; GCA_001524155.1 (NA19240),http://identifiers.org/ncbigi/GI:1057722128; GCA_001708065.2 (HX1),http://identifiers.org/ncbigi/GI:1087879108. Full assembly data access details are given inInput assemblies are publicly available and carry the NCBI assembly accession numbers GCA_001750385.2 (AK1),https://doi.org/10.17605/OSF.IO/3VS42  andhttps://osf.io/pgq52/?view_only=fedd8437d96c4d688f6c40150903d857 (constructed with NovoGraph-Simple). The global multiple sequence of all input sequences in CRAM format can be downloaded fromhttps://osf.io/jhbwx/?view_only=fedd8437d96c4d688f6c40150903d857. OSF data are available under the terms of theCreative Commons Zero "No rights reserved" data waiver (CC0 1.0 Public domain dedication).All NovoGraph output data are available on OSF:O/3VS42 . The genhttps://github.com/NCBI-Hackathons/NovoGraph.Source code for the pipeline is available from:https://doi.org/10.5281/zenodo.1342485  which might limit its applicability. The manuscript is well and clearly written. In the title, the authors state that the method is applicable for “long-read de novo assemblies”. Are there any specific reasons that the authors decided to restrict the scope of their method?The method is geared to human genome comparison. This should be made clear in the title and abstract to avoid confusion as it might not be so straightforward to adapt it to other species if type and degree of sequence variation is different (see point 3 and 4). Otherwise, the authors could demonstrate how to adjust the tool for other genomes with higher degree of structural variation as well.If a “consistent global alignment” of a contig (step 1) can only be on one reference contig and can only consider one alignment direction, how are inversion breakpoints and cross-chromosome translocation breakpoints identified?How are large insertions (i.e. sequences not present in the ref seq) represented in step 2? How are the per-window MSA combined if different genomes have different orders of these 10kb windows ?Were there contigs that were too divergent to be aligned in the test cases? What if those exist?The authors mentioned that the graph construction is constrained by their requirement to generate VCF files, however, they don’t mention what could be the potential effects of this restriction.The authors have cited work which has not yet been published after peer review. Is this common for F1000research, if not, please mention that these citations are non-peer-reviewed preprints.In order to limit computation load, the method uses hard cut-offs for the number of haplotypes that can be analysed simultaneously. Consequently, new contigs are not added. However, the authors do not describe what happens to those contigs. Are they removed permanently? If yes, then would that lead to potential loss of alternate haplotypes that could be identified from available data? MinorWe agree with the other reviewer that the authors might want to consider the well-established definitions of “recombination” and “homologous recombination” and perhaps try to find different wording for the branching points in the graph. It is not clear what “homologous-identical recombination” (abstract) or “homologous identical positions” (methods).Similarly, it is conventional to write Directed Acyclic Graph instead of acyclic directed graph, and the authors might want to change that. “uneven” => “odd”?Figure 2 could be extended with cases where  “entry” and “exit” points are within alignments as well. Major (which the authors should consider)We have read this submission. We believe that we have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however we have significant reservations, as outlined above. The manuscript describes a method to create a graph genome from a set of input sequences, such as whole genome assembly. This is a topic of current interest to the community and I am not aware of another implementation for this problem. The paper implementation is practical and likely to be useful, but it is also clear that that there is considerable room for improvement and work in this field. The provide an algorithm and software. The algorithm has three steps: 1) Whole genome alignment 2) Local multiple sequence alignment 3) Graph construction/VCF construction from graph. There is a large body of literature on whole genome alignment which might be cited and explained to the reader what the difference is between the current method and previously described ones. Multiple sequence alignment is also a well studied problem, this literature might be cited and it is not clear why MAFFT was chosen over other implementations. I would suggest the authors find another word to replace “recombination” in their text, recombination has a well defined meaning in genetics/meiosis which to me seems to be different from the meaning the authors assign to the word. The authors say the branching points in the graph are recombination points between the input genomes, but they might as well be due to SVs. Why do the authors choose to claim that the human reference genome was completed in 2003? There have been a number of updates since then and the reference genome is still filled with gaps. The authors are using GRCh38 which was released in December 2013. Genomic sequencing can be considered to be a key tool in research since shortly after invented, certainly since long before 2003. On page 4, step 2 states that a global MSA is computed, but from figure 2 it is clear that this is in fact a series of local MSAs.  I would suggest using another term than global alignment or at least refer to it as inexact/approximate global MSA. From figure 1, step 2.1 it might be inferred that identifying windows was a more involved process than partitioning the genome into 10kb windows. I am not sure how NovoGraph-Simple is implemented, the details are not described in the manuscript. For NovoGraph-Simple to be useful, it would be very useful if the “The positions where an input sequence deviates from the reference is represented as variant alleles in a valid VCF” was better defined.  For inserted sequence, particularly microsatellites/STRs, there are multiple valid VCF records that can be created. Conventions such as left aligning would be useful for the user. If I understand correctly, NovoGraph-Universal is a BFS (breadth first search) of the graph. The authors might make a note of this. It is clear that NovoGraph-Universal is not a practical implementation for people studying a large number of genomes. Whenever a single sequence diverges from the reference all sequences are expanded. Once enough individuals have been sequenced this will lead to VCF files where each individual's’ chromosomes are the alternate allele. I have only evaluated the manuscript and not the software or the VCF files.I have read this submission. I believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.


Protein sequence alignment analyses have become a crucial step for many bioinformatics studies during the past decades. Multiple sequence alignment (MSA) and pair-wise sequence alignment (PSA) are two major approaches in sequence alignment. Former benchmark studies revealed drawbacks of MSA methods on nucleotide sequence alignments. To test whether similar drawbacks also influence protein sequence alignment analyses, we propose a new benchmark framework for protein clustering based on cluster validity. This new framework directly reflects the biological ground truth of the application scenarios that adopt sequence alignments, and evaluates the alignment quality according to the achievement of the biological goal, rather than the comparison on sequence level only, which averts the biases introduced by alignment scores or manual alignment templates. Compared with former studies, we calculate the cluster validity score based on sequence distances instead of clustering results. This strategy could avoid the influence brought by different clustering methods thus make results more dependable.Results showed that PSA methods performed better than MSA methods on most of the BAliBASE benchmark datasets. Analyses on the 80 re-sampled benchmark datasets constructed by randomly choosing 90% of each dataset 10 times showed similar results.These results validated that the drawbacks of MSA methods revealed in nucleotide level also existed in protein sequence alignment analyses and affect the accuracy of results.The online version of this article (10.1186/s12859-018-2524-4) contains supplementary material, which is available to authorized users. Protein sequence alignments, as an effective and intuitive way of identifying homologous regions among sequences, play a fundamental role in various biomedical researches such as database construction and query, prediction of protein structure and function, etc. . ProteinVarious kinds of methods have been proposed for creating an alignment, including pair-wise sequence alignment (PSA), multiple sequence alignments (MSA), profile-based methods, prediction-based methods, and structure-based methods, etc. Of which, PSA and MSA are most widely used. PSA aligns each pair of sequences once at a time. It is the simplest form of an alignment which can be performed with two approaches: global or local. The computational definition of PSA is to find the alignment that maximizes the two input protein sequences’ similarity. PSA methods are usually used to calculate the sequence similarity on function, structure and/or evolution levels , 18. ManThe reliability of alignment results is an indispensable prerequisite for most downstream analyses. Nevertheless, it has been observed that the alignment results produced by different tools can be quite diversified . EvaluatSeveral studies have focused on the performance of MSA method using these benchmark datasets –64 by anThe reasons causing these drawbacks of MSA methods may be as follows: (1) The evolutionary relationships of input sequences were often unknown thus the assumption of MSA methods were not met. (2) The design of some MSA methods’ alignment evaluation scores focused on math sense instead of biological meanings. (3) Many MSA methods adopted heuristic search in order to deal with massive sequences which made themselves easier to fall into local optimization. Compared with this, PSA methods could identify similar regions of protein sequences in a fast and flexible way when applied on nucleotide level , 70. ThuNormally, a benchmark study is based on some kind of understanding of what the correct result should be, thus a specific and significant definition of what ‘correct’ or ‘gold standard’ and measures used to reflect the results are crucial. Two commonly used scores in MSA benchmark studies are Sum-of Pairs score (SP) and Column Score (CS). SP increases with the number of correctly aligned sequences and is used to determine the extent of MSAs succeed in an alignment. CS is a binary score that shows the ability of MSA methods to align all the input sequences correctly. However, SP and CS only consider the correctly aligned residues. To overcome this limitation, an alternative approach is Position Shift Error (PSE) score, which is used to measure the average magnitude of error. This score could ensure misalignments that caused a small shift between two sequences are penalized less than large shifts. Other metrics such as fD and fM have been developed to distinguish the regions that were homologous from the unrelated regions. These metrics may reflect the ability of MSA methods through a computational perspective; however, the underlying assumption is that all the input protein sequences are globally align-able, which means that only substitutions, small insertions, and deletions are considered to be the mutational events separating those protein sequences. However, most protein benchmark datasets are grouped into different sub-datasets which contain several protein families. This indicated us that the ‘correct’ or ‘gold standard’ results should be consistent with the protein family divided on biological levels. Each benchmark dataset contain several protein families which could be considered as classes and the proteins in them can be considered as samples with known class labels. Each benchmark dataset could thus be considered as a clustering result and the ‘correct’ results given by MSA or PSA methods should be the one best fit with it. Cluster validity criteria which are quantitative measures are suitable here  to evaluIn this paper we propose a new benchmark framework for protein sequence alignment methods based on cluster validity. This new framework directly reflects the biological ground truth of the application scenarios that adopt sequence alignments, and evaluates the alignment quality according to the achievement of the biological goal, rather than the comparison on sequence level only, which averts the biases introduced by alignment scores or manual alignment templates. In contrast to former studies, we calculated the cluster validity scores based on sequence distances directly instead of clustering results, which avoids the influence brought by different clustering methods, and makes the comparison fairer for both MSA and PSA methods. Results showed that PSA methods have higher cluster validity score than MSA methods on most of the benchmark datasets. These results validated that the drawbacks of MSA methods revealed in nucleotide level also existed in protein sequence alignment analyses and affect the accuracy of results.Figure One major difficulty for comparing alignment methods against biological backgrounds is that de-novo sequence binning relies heavily on the choice of clustering methods, which is independent of the alignment itself but greatly impacts the outcome. To avert this influence, we adopt a clustering-free approach on the evaluation step. Instead of creating clusters and matching them with real taxonomy, we directly evaluate how the taxa are separated by the alignment results. An optimal alignment will be expected to maximally separate sequences of different family, while on the other hand group sequences of the same family together. In this manner the alignment quality of different algorithms are evaluated.We downloaded eight datasets from BAliBase v3.0. Two steps of analyses were performed on these datasets to generate eight groups of benchmark datasets as follows: 1) For each dataset, we combined protein sequences of different protein families into one file. All the protein families and sequences were included in the analyses except for the sequences belonged to more than one protein families since they would cause the confusion of the following steps. Each protein sequence was considered as a sample and the family it belonged to was considered as the sample’s class label. The original family labels of the sequences are considered as the ground truth of the clustering results. (2) For each dataset, we randomly chose 90% of the sequences from the file generated in the above step to construct a re-sampled benchmark dataset. This procedure was repeated 10 times for each dataset. Thus eight groups of benchmark datasets were generated and each group contained 11 datasets including one benchmark datasets downloaded from BAliBase and 10 re-sampled datasets. The details of these eight benchmark datasets groups were listed as follows and Table  For eachReference 1 (including RV11 and RV12) contained full-length equidistant sequences with two different levels of conservation: RV11 contained very divergent sequences with < 20% residue identity and any two sequences shared 20–40% residue identity were included in the dataset RV12. Sequences having large internal insertions or extensions were excluded. The average number of sequences (309) and the average sequence length (346.9332) in this dataset were both the smallest of all the datasetsReference 2 (RV20) contained full-length families aligned with a highly divergent ‘orphan’ sequence. A family was included in this dataset if all the sequences shared > 40% residue identity and for which at least one 3D structure was known. ‘Orphan’ was referred to a sequence that shared < 20% residue identity with all members in the family. The numbers of sequences in the dataset was 1706 with average sequence length 384.3581Reference 3 (RV30) contained full-length sequences with < 25% residue identity between any two sequences from different families. It was designed to demonstrate the ability of the programs to correctly align equidistant divergent families into a single alignment. The numbers of sequences in the dataset was 1723 with average sequence length 387.9745For References 1–3, the percent identity was calculated over the homologous region only, and no sequences contain large internal insertions.References 4 (RV40) and 5 (RV50) contained full-length sequences shared > 20% residue identity that contained large N/C-terminal extensions or internal insertions respectively. The two datasets were designed to evaluate a program’s ability to identify the presence of the insertions not to judge the overall quality of an alignment. The numbers of sequences in the two datasets were 1113 and 443 with average sequence length 480.0952 and 516.6546Reference 9 (including RV911 and RV912) contained full-length sequences with linear motif alignment. RV911 contained sequences with < 20% residue identity and RV912 contained sequences with 20–40% residue identity. The average number of sequences was 325.5 and the average sequence length was 577.8071 in this datasetSix MSA programs including MUSCLE (default), MUSCLE (iters = 2), MAFFT (FFT-NS-2), MAFFT (L-INS-i), Clustal Omega, and KAlign were chosen based on different algorithmic approaches beyond download availability and popularity. ESPRIT was used on behalf of PSA methods. The details of these methods were listed as follows:MUSCLE had three stages: draft progressive, improved progressive, and refinement. The first stage calculated the similarity of each pair of input sequences using k-mer counting or by constructing a global alignment of the pair to get a triangular distance matrix constructed a tree based on it. After this, a progressive alignment was built. The second stage attempted to improve the tree constructed in the first step and built a new progressive alignment according to this tree. The third stage performed iterative refinement using a variant of tree-dependent restricted partitioning. At the completion of each stage, a multiple alignment was available and the algorithm can be terminated. MUSCLE was shown to be suitable for medium alignments. In this paper, we chose two parameter settings of MUSCLE based on the consideration of accuracy and speed: MUSCLE (default) and MUSCLE (iters = 2). The default settings were designed for best accuracy rather than making any compromises for speed, and the option ‘iters = 2’ (short for maxiters two Iterations) was designed for large datasets where long execution times becomes an issue.MAFFT offered various multiple alignment strategies which were classified into three types: (1) progressive method , (2) iterative refinement method , (3) iterative refinement method using both the WSP and consistency scores . Strategies in type1 ran the fastest in speed and strategies in type3 was the most accurate. The same as MUSCLE, we chose two parameter settings of MAFFT based on the consideration of accuracy and speed: MAFFT (FFT-NS-2) and MAFFT (L-INS-i).Clustal Omega was the latest member of the ‘Clustal family’. Compared with previous versions, Clustal Omega offered a significant increase in scalability, allowing virtually any number of protein sequences to be aligned quickly with similar accuracy of other MSA methods.KAlign was a global, progressive alignment method which employed an approximate string-matching algorithm to calculate sequence distances and incorporated local matches into the global alignment. It was designed to deal with large-scale sequences with quickly speed and accuracy.ESPRIT performed global pair-wise sequence alignment using Needleman-Wunsch algorithm.To evaluate the performance of different methods we analyzed in this study, we performed evaluation calculation using three procedures: similarity calculation, distance calculation, and cluster validation calculation. The input of this step was the aligned sequence matrices generated by each alignment method and the output was a cluster validity value. The ‘distance calculation’ was calculated based on ‘similarity calculation’ while the ‘cluster validation calculation’ was calculated based on ‘distance calculation’. The detailed way of the three procedures were as follows:The percent identify (ID) score was used to calculate the similarity between two sequences in the aligned matrixes generated in the step named ‘alignment analyses’ as follows:The ID score was adopted by BLAST programs and it could reflect the percentage of identical residues in the aligned sequence pairs.Based on the similarity ID score, the distance between two protein sequences was calculated as follows:For PSA method, if two sequences were exactly the same, the ID score would be the maximum value 1.0 and the distance score dis will be 0. It should be noted that, however, for MSA methods, the ID score may not be the maximum value 1.0 even when two sequences are identical, because MSA algorithms may produce different alignment results for identical sequences within one run.Since cluster validity index were designed to evaluate the fitness degree MSA or PSA aligned results and the real protein family divisions, the index should not be too sensitive to noise such as Dunn and Dunn like indices and should not add burden to the calculation such as importing the representative point for each cluster as many index required. We chose two cluster validity indices which met the above criteria: silhouette width and RS to evaluate the performance of each MSA and PSA methods.i, the silhouette value was defined asa(i) was the average distance between sequence i and other sequences in the same cluster; b(i) was the minimum average distance between sequence i and any other clusters where i was not a member. The cluster with this minimum distance was called ‘nearest neighboring cluster’ of i because it was the next best fit cluster for sequence i.Silhouette was used to find the partitioning that best fitted the underlying data and was not easily affected by noise data. If one sequence alignment method got well-clustered results, the value will near 1.0; otherwise the value will near − 1 if it was poorly-clustered results. Higher silhouette value meant intra-distances (distances among the same class) were much smaller than inter-distances (distances among different classes) which proved the partitioning to be a good one. The Silhouette Width (SW) score for a partition was calculated asRS score was used to measure the dissimilarity of clusters. The values of RS ranged from 0 to 1. A higher RS value meant better clustering. It was calculated as:SSt referred to the total sum of squares of the whole dataset, SSw referred to the sum of squares within cluster. The sum of squares was calculated as xk stood for the distance between two sequences, n stood for the number of the combination among different sequences.Of which It should be noted that, although PSA methods are likely to produce smaller distance for a sequence pair compared with MSA methods, the above criterion is essentially fair for both type of methods. The reason is that both the SW score and the RS score are not measured by the sole sequence distances, but by the contrasts between intra-cluster and inter-cluster distances. Although PSA achieves smaller pair-wise distances, this applies to both within-cluster and between-cluster comparisons. If the intra-cluster and intra-cluster distances are shrinks by the same degree, the SW and RS scores won’t be increased.t test. A higher p-value meant the performance of the two alignment methods was of no difference while a smaller p-value meant there were significant differences between the two alignment methods.For each benchmark group, the cluster validity results of different alignment methods calculated on the 10 re-sampled datasets were compared using We performed protein sequence alignments using 6 MSA methods and 1 PSA method on the benchmark datasets. Six hundred sixteen alignment analyses were performed in total. Results showed that (1) Esprit got the highest scores on all the datasets based on SW calculation; (2) both Esprit and MUSCLE (default) got high scores based on RS calculation, Esprit performed a little better than MUSCLE (default) in total. Meanwhile, the computational time taken by Esprit was less than MUSCLE (default) as shown in Additional file p values). Taken MUSCLE (default) as a representation of MSA methods, all the p values were less than 0.1 indicating the significant differences between these alignment methods  which were used to reflect the abilities of alignment methods on dealing with short length sequences. Results showed that based on SW scores, Esprit performed better than other MSA methods used in this study in both RV11 and RV12 with SW scores 0.008933 and 0.107577, separately  were small  on benchmark groups RV20, RV30, and RV912  outperformed other MSA methods by the RS scores criteria, we chose it as the representation of MSA methods as the way we analyzed the results based on SW scores. The average RS scores of Esprit and MUSCLE (default) in re-sampled benchmark datasets were listed in Table p value for the re-sampled datasets of this benchmark group between the two methods was not significant , both MUSCLE (default) and Esprit could be considered as the best performance methods on RV12 benchmark dataset group. Same as using SW score, Esprit was the best alignment method in RV20 and RV30  and Esprit) were good choices on RV40 benchmark dataset group. For RV50, Esprit was the best performance method with RS score 0.318475  indicated that both of the top 2 alignment methods (Esprit and MUSCLE (default)) were good choices when dealing with such datasets. For reference dataset 9, MUSCLE (default) got the highest RS score 0.848139 and Esprit got the second highest score (0.840775) in RV911. Similar as the results of RV40 and RV50, the big p value (0.1271) also indicating the best performances of both MUSCLE (default) and Esprit on RV911 benchmark dataset group. For RV912, Esprit got the highest RS score 0.485991 and the statistical analyses results was also significant  and Esprit on the re-sampled datasets of RV11 group, thus both of them could be considered as best performance alignment methods in this dataset group. In RV12, the highest RS score was achieved by MUSCLE (default) with 0.735538, the second highest RS score 0.708394 was achieved by Esprit. Considering the Considering the above results, cluster validity calculation using SW and RS scores on the datasets indicated that PSA methods perform better than MSA methods under most biological conditions. Interestingly, both Esprit and MUSCLE (default) could be considered as the best methods based on RS scores under some conditions. Due to the characters of the two scores, a higher RS score reflected the big dissimilarity among different protein families without considering the topological relationship between families; on the other hand, a higher SW score reflected a small dissimilarity inside a protein family and a clear discrimination between the family and its siblings. Hence, SW score is more sensitive and rational compared with RS score due to its definition. However, the representation of PSA methods Esprit still performed equally or better than the MSA methods analyzed in this study. These indicated that PSA methods may be a better choice if researchers focus on a balance between similarity in a same protein family and dissimilarity among different protein families which is often the option of most researchers.Protein sequence alignments are essential in many bioinformatics fields including computational analysis of protein sequences, structure modeling, functional site prediction, and sequence database searching, etc. MSA methods try to minimize the sum of pair-wise scores by aligning unrelated sequences thus the biological closely related sequences are given large distances. Compared with this, PSA could identify similar regions of protein sequences in a fast and flexible way when applied on nucleotide level.To test the performance of MSA and PSA methods on protein sequence level, we presented a benchmark study of sequence alignment methods for protein clustering. Results showed that PSA methods performed much better than MSA methods on all the BAliBASE datasets. These indicated us that PSA methods were a better choice of dealing with protein sequence alignment analyses than MSA methods.Additional file 1:Table S1. Relative computational time of MSAs compared to ESPRIT. (DOCX 13 kb)


Sequence alignment is a way of arranging sequences  to identify the relatedness between two or more sequences and regions of similarity. For Electronic Health Records (EHR) data, sequence alignment helps to identify patients of similar disease trajectory for more relevant and precise prognosis, diagnosis and treatment of patients.We tested two cutting-edge global sequence alignment methods, namely dynamic time warping (DTW) and Needleman-Wunsch algorithm (NWA), together with their local modifications, DTW for Local alignment (DTWL) and Smith-Waterman algorithm (SWA), for aligning patient medical records. We also used 4 sets of synthetic patient medical records generated from a large real-world EHR database as gold standard data, to objectively evaluate these sequence alignment algorithms.For global sequence alignments, 47 out of 80 DTW alignments and 11 out of 80 NWA alignments had superior similarity scores than reference alignments while the rest 33 DTW alignments and 69 NWA alignments had the same similarity scores as reference alignments. Forty-six out of 80 DTW alignments had better similarity scores than NWA alignments with the rest 34 cases having the equal similarity scores from both algorithms. For local sequence alignments, 70 out of 80 DTWL alignments and 68 out of 80 SWA alignments had larger coverage and higher similarity scores than reference alignments while the rest DTWL alignments and SWA alignments received the same coverage and similarity scores as reference alignments. Six out of 80 DTWL alignments showed larger coverage and higher similarity scores than SWA alignments. Thirty DTWL alignments had the equal coverage but better similarity scores than SWA. DTWL and SWA received the equal coverage and similarity scores for the rest 44 cases.DTW, NWA, DTWL and SWA outperformed the reference alignments. DTW (or DTWL) seems to align better than NWA (or SWA) by inserting new daily events and identifying more similarities between patient medical records. The evaluation results could provide valuable information on the strengths and weakness of these sequence alignment methods for future development of sequence alignment methods and patient similarity-based studies. Patient similarity calculation has become an emerging research topic. It identifies similar patients in a large pool for healthcare insights on prognosis, diagnosis, and treatment , 2. For When calculating and comparing patient similarity from electronic health records (EHRs) data, we could not bypass the issue of aligning the temporal event sequences . MathemaDTW is a global sequence alignment method based on dynamic programming. It finds an optimal match between two sequences of feature vectors by stretching and/or compressing one or more sections of one sequence and is considered as the best alignment method for various applications including speech recognition and video streaming . SequencConsidering the significance of temporal information in medicine, we are curious to ask the question – which type of sequence alignment method works best for EHR data? Unfortunately, no objective and comprehensive evaluation and comparison between state-of-art sequence alignment methods is available. Therefore, we plan to compare the strengths and limitations of both global and local sequence alignment methods and evaluate their impact on patient similarity calculation. This is a challenging task for several reasons:Firstly, patient medical records are complex –17. We uSecondly, no gold standard data is available for evaluating sequence alignment algorithms. One solution is to ask experts, such as physicians to evaluate and rank the results from different sequence alignment methods, which can be very subjective and expensive. In this work, we propose to synthesize simulated patient medical records using seed patients carefully chosen from a large real-world EHR database. We will be able to design and control the differences between sequences of medical records for objective and comprehensive evaluation of sequence alignment algorithms.The rest of the paper is organized as the following 5 sections. In the Related Work section, we will describe three global and local sequence alignment algorithms, namely DTW, NWA and SWA. In the Methods section, we will introduce the methods for selecting seed patients from a large real-world EHR database and for synthesizing more patient medical records; the implementation of DTW, NWA, SWA and DTWL, a modified DTW for local alignment; and the metrics for evaluating sequence alignment results. In the Results section, we will share and analyze briefly the alignment results. In the Discussion section, we will evaluate these sequence alignment methods in details and illustrated various scenarios of sequence alignments using simplified cases. We also discuss the limitations of our work. In the end we will conclude our work.Dynamic Time Warping (DTW) is one of the leading matching algorithms for globally aligning two temporal sequences of different speeds and measuring similarity ) and Y , DTWL calculates an accumulated score matrix A(n + 1) x (m + 1) by updating the matrix element Ai, j according to the following equation,More specifically, given two temporal sequences of medical events X  denotes the similarity between two elements Xi and Yj in the sequence of X and Y, and is calculated using a predefined scoring system as shown in Fig. Where s  and 0 (matching). In other words, the similarity s between them is defined as,n to denote the normalized similarity score of aligned sequences.For global sequence alignments, we calculated the similarity score of aligned sequences by summing all the similarity scores s of aligned daily events. Due to the variation of daily event number in patient sequences, we further normalized the similarity score of aligned sequences by dividing the total number of daily events in the seed patient sequence. We used Sn) and coverage (C) of the longest aligned subsequences between seed patient and synthetic patient. Sn is the summation of the similarity scores s of daily events in the aligned subsequences and then is divided by the total number of daily events in the seed patient sequence. C is coverage of the seed patient sequence aligned to the synthetic patient sequence. Specifically, C is the ratio of the number of daily events in the seed patient sequence aligned to a synthetic patient sequence and the total number of daily events in the seed patient sequence.For local sequence alignments, we calculated the normalized similarity score (SWe synthesized 80 (4 × 20) patient medical records by performing the operations of deleting, updating and switching a daily event or a multi-day event block on the four seed patient records. We then performed global sequence alignment between each seed patient and each synthetic patient.Table We found that the similarity scores of DTW alignments were as good as, or even better than those of reference alignments. Particularly 47 out of 80 alignments made by DTW had even higher similarity scores than reference alignments. In addition, DTW alignments were better than NWA alignments on 46 cases out of 80, with the rest 34 cases having the equal similarity scores from both algorithms.The NWA alignments also received better similarity scores than reference alignments − 11 out of 80 NWA alignments had superior similarity scores than reference alignment while the rest 69 had the same distance scores as reference alignment.n) and coverage (C) for each pair of the longest aligned patient sequences. The results are shown in Table n from baseline references are identical, we only show one of them in Table After synthesizing 20 patient medical records for each out of 4 seed patients, we also performed local sequence alignment between medical records of each seed patient and each synthetic patient with DTWL and SWA to identify the longest aligned subsequences. We then calculated their similarity scores  out of 80 NWA alignments had superior coverage (or similarity scores) than reference alignment while the rest 11 (or 12) had the same coverage (or similarity scores) as reference alignment.We carefully examined the raw global and local alignment results from 4 × 20 sequence pairs and noticed some subtle differences. We drew some cartoons in Figs. In Fig. The reference alignment shown in Fig. In Fig. In Fig. The synthetic sequences in Fig. The reference alignments in Fig. This study for sure has several limitations, not limited to the following:We only used diagnosis codes in our experiments. Other medical events such as demographics, procedures, medications, and clinical notes were not considered. We would like to incorporate more other medical event types for more comprehensive evaluation of sequence alignment algorithms in future, once we can infer the dependency between diagnosis and the other event types when synthesizing simulated patient medical records that still reflect reality, or when we can afford more expensive evaluation by physicians.Secondly, we only used a limited number of operations to create synthetic patient records that reflect real-world situations in this study. We carefully selected 4 seed patients and created 20 synthesized patient medical records for each of them. This was driven by our goal of performing an objective and detailed 360-degree examination. This small size does not cover all the complex situations in large EHR database. After this, we could perform a much larger scale evaluation with confidence and precision.Last but not the least, we used self-defined scoring system to quantitatively evaluate sequence alignment results. This scoring system penalizes mismatching and gap equally and also penalizes elements inserted by DTW and DTWL. We plan to design and test different scoring systems for evaluating sequence alignments. For example, a scoring system treats acute and chronic diseases differently by incorporating some knowledge base.A full consideration of temporal sequence information and aligning medical event sequences properly is fundamental for precise patient similarity calculation, since medicine is about providing patients the right diagnosis and treatments at the right timing. In this study, we synthesized patient medical records using a set of synthesis operations on top of real patient medical records from a large real-world EHR database. Then we tested two cutting-edge sequence alignment methods, dynamic time warping (DTW) and Needleman-Wunsch algorithm (NWA), and their corresponding versions for local alignments, modified DTW for Local alignment (DTWL) and Smith-Waterman algorithm (SWA), for the purpose of patient medical records alignment, in order to understand their strengths and limitations. We found that sequence alignment is very necessary for fully reserving the temporal sequence information in patient medical records. In addition, DTW (or DTWL) seemed to align better and identify more similarities between patient medical records than NWA (or SWA). But DTW, NWA, DTWL, and SWA performed better than the reference alignment. Our evaluation work could provide timely and valuable information on the strengths and weakness of these sequence alignment methods for the fast-growing areas of patient similarity calculation.


Quantum pattern recognition techniques have recently raised attention as potential candidates in analyzing vast amount of data. The necessity to obtain faster ways to process data is imperative where data generation is rapid. The ever-growing size of sequence databases caused by the development of high throughput sequencing is unprecedented. Current alignment methods have blossomed overnight but there is still the need for more efficient methods that preserve accuracy in high levels. In this work, a complex method is proposed to treat the alignment problem better than its classical counterparts by means of quantum computation. The basic principal of the standard dot-plot method is combined with a quantum algorithm, giving insight into the effect of quantum pattern recognition on pairwise alignment. The central feature of quantum algorithmic -quantum parallelism- and the diffraction patterns of x-rays are synthesized to provide a clever array indexing structure on the growing sequence databases. A completely different approach is considered in contrast to contemporary conventional aligners and a variety of competitive classical counterparts are classified and organized in order to compare with the quantum setting. The proposed method seems to exhibit high alignment quality and prevail among the others in terms of time and space complexity. Figuring out similar portions among two or more strings of symbols is a complicated computing task as different degrees of similarity may be considered. Determining the correspondences between a target subsequence and a reference sequence consists a hard but also a qualifiedly tractable problem known as sequence alignment (SA) or mapping. The alignment of sequences remains an active research area of great importance for natural language processing, business and marketing research, forensics, ecology, epidemiology, medicine, and especially in biological studies. Mapping and studding segments of various genomes has become indispensable for basic research in the interdisciplinary field of genomics. The alignment process rearranges sequences introducing spaces, or gaps, making insertions or deletions (indels), translocation and inversion operations, in order to achieve the optimal matching. Mutation or other evolutionary natural mechanisms are usually the reasons for all these random modifications on the original biological sequences.1, a.k.a. parallel or deep sequencing. These technologies achieve ultra-high throughput sequencing allowing billions of bases being sequenced within a single day, and more specifically they produce the reads which are smaller portions of a genome sequence of a living organism. Genome databases are continuously loaded with experimentally generated raw sequence data resulting in huge amounts of unprocessed clusters of reads.Modern sequencing technologies are described by the term ¨Next Generation Sequencing¨ (NGS)Separately from the remarkable progress of sequencing technologies, current computational methods of structural and functional determination of biological sequences create an increasing gap, due to their slower and costly implementation. The alignment of sequences can generally be performed in two ways: (a) the pairwise sequence alignment and (b) the multiple sequence alignment. The first way considers only two sequences at a time whereas the second considers more than two related sequences at a time. Obviously, multiple alignment is more advantageous than pairwise since it provides more information. However, the implementation of multiple alignments is a difficult task as it seeks solutions to more complex methods such as heuristics or repetitive optimization strategies. In any case, multiple alignment approaches are highly based on pairwise alignment methods.2 introduced the similarity matrix, also known as dot-plot. Due to its limited capacity to encompass and analyze large sequences, other methods were inquired in ¨dynamic programming¨ (D.P.). In particular, the inventions of Smith-Waterman4 (S.W.) and Needleman-Wunsch5 (N.W.) algorithms were the greatest examples in D.P. These algorithms are based on a scoring framework providing optimal alignment solutions. The performance of both S.M. and N.W. algorithms depends on the lengths of the reference SR and the query SQ sequences, LR and LQ respectively, achieving O(LRLQ) runtime and memory resources. Then, the word methods (a.k.a. k-mer or k-tuple) were introduced to speed-up the alignment process. In the last two decades, combinatorial strategies were invented like seed-and-extend and q-gram filter to optimize the speed and the accuracy of the alignment result.The first approach to align the similarity between two sequences is traced back to 1970, when Gibbs and McIntyre6. Trugenberger proposed the quantum analogue of the classical associative memory8 confronting the problem of capacity shortages but probabilistically retrieving incomplete or noisy inputs. R. Zhou and Q. Ding mention in 2008 an alternative way9 of QPR with 100% probability to retrieve the query pattern which is highly based on an improved version of Grover’s search algorithm. Using quantum multi-pattern search algorithm10 may be possible to achieve pairwise SA but such a technique demands a relatively complex way in producing quantum original states if a high number of patterns exist. In 2009, R. Neigovzen et al. describe a notable QPR scheme11 which according to its authors combines the idea of a classical Hopfield neural network with adiabatic quantum computation and E. A. Fard et al. present a quantum neural network12.On the parallel, the field of pattern recognition has been extended over the quantum information and computing settings. In 2001, both R. Schützhold and C.A.Trugenberger set the concept of quantum pattern recognition (QPR). R. Schützhold mentions a quantum algorithm which runs on a probe structure line those in diffraction experiments and detects easily patterns13 which seems to outperform its classical counterparts at least in terms of time and computing resources. The reported method explains how it is possible to turn R. Schützhold’s pattern recognition schema into a novel alignment approximation by utilizing the central concept of the old but infallible technique of dot-matrix plots. In fact, the crossing points of the dots on the matrix are simulated onto an array structure lattice plane like those in diffraction experiments offering a different approach to the alignment process.In this study, we expand our previously reported method14, or BB, and the quantum Fourier transform (QFT)15. The classical computing subunit is needed to run calculations of Laue’s equations in order to localize and specify candidate line-patterns.It is assumed that our aligner is a complex device which can handle large sequences on a lattice plane surface made by non-linear Kerr media and run R. Schützhold’s QPR algorithm in a quantum computing system. The physical realization of such a device may be an apparatus consisting of a Laue diffraction system with a probing light beam (e.g. X-rays or electrons) and two computational subunits: one with a classical processor and one with a quantum processor. The R. Schützhold’s QPR algorithm is analytically described in the Methods section splitting it into five steps. The most complex parts are the quantum black boxregX register for the horizontal and the regY register for the vertical indexing. A third one-qubit register is entangled with the other two registers and a single measurement of it let in superposition only the dot cells (reflective cells). Then the QFT enhances the amplitude of the superposition at the proper index coordinates on the plane revealing the existence of prominent line patterns. A few more runs of the algorithms may be needed to secure the detection result and some further classical calculations will locate the pattern. The circuit model of the quantum part of this algorithm is depicted in Fig. According to R. Schützhold’s QPR algorithm two registers are used as an index structure for the formation of a dot-plot like diffraction pattern. The Hadamard transform (gate H) on |0〉 in Fig. n and m qubits respectively, the expression H gate is defined in Eq.  that evaluates for many different values of x simultaneously, as f(x): {0, 1}L → {0, 1}. Starting from the state |ψ0〉 = |x〉|0〉 then we see that BB|ψ0〉 = |x〉|f(x)⊕0〉 = |x〉|f(x)〉. Since the domain is a binary w-bit string and the range a one-bit, it is possible to consider x as the address of a cell in the rectangular array and the one-bit result f(x) as a flag identifier on whether the cell is a reflective one or not. The unitary operation of the BB may be constructed by phase shift gates Ru of QFT. The Ru unitary transformation, a.k.a. phase-Shift, is defined in Eq.  = 0 or f(x) = 1.Right after the measurement, the system |s in Eq.  and entaQFT . It is the well-known linear transformation that affects the amplitudes and phases of the base states of a qubit-system. Τhe first set of the input qubit states |q1〉..|qm〉, where m < u, represents the qubits of the regY input register and the rest |qm+1〉..|qu〉 the qubits of the regX input register. Typically, the number of gates that are required to build QFT circuit grows only as a quadratic function of the number of the input qubits. From bottom up, QFT circuit has 1 + 2 + … + u = u(u + 1)/2 elementary Hadamard and controlled rotation gates. Such an implementation has an exponential speed up over the classical fast Fourier transform. Moreover, the approximate version of QFT known as AQFT can improve further the performance but this study is out of our scope.The next sub-circuit is the SQ and the reference SR sequences and investigate the plane for diagonal line patterns. Reference’s length LR may be a relatively small number when a local alignment is conducted or a large one when a global alignment or database searching takes place. If the size of SR is large enough, a fragmentation process splits it into smaller segments for a more efficient management. These segments are also known as window spaces. Then the routineQPR quantum routine runs Ω times per window to find and secure the largest line pattern in the region under comparison and then routineLaue classical routine locates the position of this pattern within this window space. routineLaue also estimates the length of the line pattern LD and the deviation angle -π/2 ≤ ϑ ≤ π/2 from a vertical one. A record with all the relevant information about the detected line is saved and the procedure continues till all the windows are exhausted. Given a line pattern starting at x0 and y0 on the panel should keep the following information: record . Finally, a list of records is formed for each segment and algorithms like S.W., N.W., FOGSAA, or modified versions of them undertake for the optimal alignment.The protocol of our method is described in Fig. Dot matrix analysis provides a great way to compare every position in the matrix. Its usefulness is seen in alignment of proteins, nucleic acid sequences, finding amino acid repeats within a protein (comparing it by itself), database searching or sequence assembly.BB’s application may not be of the same importance since most of them may emerge from the small alphabet of the sequences which causes a lot of noise . Diagonals may not be perfectly shaped up to the degree that the density of dots ρ within a line-width (e.g. LD/2) deviates by an acceptable quantity Δρ from the mean ρ. A threshold value  for the minimum acceptable length L0 of detected diagonals should be defined in the beginning of the protocol in order to trim redundant or insignificant matches. But as it is the case in most situations, more than one diagonal line will occur in a typical window space with a small alphabet. Multiple occurring lines in a confined region may be a confusing problem for our probabilistic QPR algorithm in two directions:QFT, as they form coherently amplitudes of the same measuring probability. The longer the length of a diagonal line in contrast to the other diagonals, the easier the way to detect it. However, this case is usually limited in microsatellite repeats or patterns.When line patterns of nearby lengths exist in the same window, it will be difficult to distinguish them in their superposition by L0, exist in the same window, then the lengthiest of them will always shade the others rendering difficult their detection.When two, or more, line patterns of accepted lengths, >The formed diagonals in the dot matrix plane, illustrate the degree of similarity. All the occurring diagonal lines that are formed right after LW of the window. L0 should always be a few orders of magnitude smaller than LW. Reducing LW the probability to allow more than one acceptable diagonal in it shrinks. Another way to consider is to include classical heuristic methods, but increasing the computational load.One way to combat the first problem is to adjust properly the size BB to direct properly the quantum Fourier transformation. Another easier and cost-effective option would be to remove the region of the previously detected diagonal in SR, but this solution would omit to take into consideration smaller and acceptable diagonals that occur within the range of the previously detected diagonal. However, for small LW this option may be an effective solution. A third option would be to include again classical methods.An option to treat the second problematic area is to invent a way to destroy the amplitudes of the first detected diagonal within a single window space. It can be possible by adding some extra phase gates in the L0 and LW are two critical parameters which have to be carefully chosen with the aid of statistics. The goal of analysis usually determines the window size LW and the threshold length L0 of diagonal. The size of the average exon or the average protein structural element, of gene promoter or enzyme active site, are typical factors that affect window’s size. The level of noise in a dot matrix for a small α may cause the occurrence of irrelevant diagonals but since the significant diagonals have a good similarity and aggregate many dots then the detection effectiveness is independent of noise. Thus, a densely dot matrix with a high ρ will demand a higher threshold length at the risk to encompass irrelevant diagonals. A small window size would increase dramatically the number of the windows and therefore the application times of routineQPR. An interesting improvement would be to examine first the diagonal windows for a large-scale alignment.6 to secure the result. If the size of a line pattern is a small portion β of the array size LQLR, the probability to locate a line pattern is given by Eq. . Quantum entanglement fragility and decoherence render unstable quantum computation. The performance of our method is tested and some pairwise alignment examples are presented to demonstrate the precision of our method as a benchmark test with known aligners. For the following results, the supportive data will be found in the Supplementary Material.The aim of this work is to examine whether the QPR method can be used efficiently as an alternative to the conventional sequence alignment methods. The performance of our QPR protocol is tested in terms of computational resources and run time. In order to evaluate its contribution to the alignment procedure, a simple program was implemented to simulate the behavior of the novel QPR algorithm (see Methods section). Though the adopted algorithm isn’t far from reality, quantum computing technology isn’t yet mature enough to carry out efficiently the subroutines regX and regY and a set of single-qubit quantum gates including: Hadamard, cNot and phase-Shift operations, are the fundamental components for the implementation of the proposed routineQPR routine.The circuit in Fig. routineQPR ’s hardware is assumed which is based on two realistic implementations on different technology platforms. The first one is the superconducting transmon IBM-QE device with limited qubit connectivity, and the other is a fully connected trapped-ion system16. Both are limited to 5-qubits, but we do the assumption that we can reach the size of 20 in each register as it is enough to index sequences of more than one million base pairs (bp). According to their specifications the execution of an X, Hadamard and cNOT gate takes 130 ns, 130 ns, and 650 ns for the superconductor and approximately 20000 ns, 20000 ns, and 250000 ns for the ion-trap system, assuming the aforementioned memory size. For a more thorough estimation, the encoded versions of the circuit are compared with the unencoded. The well-studied distance-3 ] and ] error correcting codes are included in the estimation chart in Fig. In order to conduct a theoretical analysis with numerical treatments, an optimistic specification of the An increment in the qubits of the registers, has a sublinear augmentation on gate operations. Quantum recovery protocols usually add an expensive computing overhead. Error correction takes place after one or two logical gates. Generally, gate operations of the encoding and recovery system occupy more than 90% of the overall system. In this circuit the approximated version of QFT is considered with a degree of 2.From the aspect of memory allocation, our proposed method needs only a few qubits. Quantum registers can host sequences of size that increases exponentially in the number of qubits. Only a little classical memory will be needed to keep records of the matching points.Hadamards, the BB application and the QFT subroutine. The run time escalation for 6, 10, 15 and 20 totally indexing qubits is described in Table Hadamard and phase-Shift gates are supposed that act concurrently and parallel. Noise recovery delay is not included.Given the hardware specification and the QPR algorithm, the expected run time of the routineQPR routine is estimated by dividing the algorithm mainly into three computing steps: the initial superposition by Ω secures pattern recognition and detection, its behavior for more memory qubits is studied. This parameter is critical for the performance of our method, as it may be time consuming for many repetitions of routineQPR(Ω). In the following chart time consumption is calculated for 6, 10, 15 and 20 qubit memory in the range 5 ≤ Ω ≤ 20. The results in Fig. Ω significantly, thus a good management of this parameter will save much time. However, run times still remain at relatively low levels.As parameter Escherichia sp. are used in this section to compare the SNP-calling performance of our simulation with that in a recent research17 by four well-established alignment tools CUSHAW (v.1.0), SOAP2 (v.2.2.1), Bowtie (v.0.12.7) and BWA (v.0.7.0). In particular, a pair of alignment is used between the E. coli K12 MG1655 (accession number SRR001665 in NCBI SRA) and the E. coli 536 (accession number NC_008253 in GenBank) using the paired-end alignment for each aligner. According to this work, 20.8 million 200-bp-insert-size paired-end reads of the SRR001665 are aligned onto the reference genome NC_008253. The first three columns in Table Some model species of the bacteria SRR001665 in order to treat mapping as it would be in a single read sequencing way and not as in paired-end. A sample of ½ million reads covers almost more than ¼ of the initial sample which is a secure amount to approximate and consider our comparison. Then, the reduced reference genome is divided into segments of size 1000 bp and the window size is defined at read’s length. Each read is tested over the reference genome and when an acceptable line occurs, the threshold L0 criterion is fulfilled and the window is recorded as “positive” in order to keep track of the alignment. The threshold value L0 has an elasticity of 15–20% mismatches in each window. Each time that a positive window occurs, it is recorded as a positive hit by the simulator. Due to some shifted diagonals the width of the examination of the neighboring windows was increased in order to cover more thoroughly problematic regions with highly distorted diagonals. The output results are finally compared with the peer reviewed alignments as they are reported in the relative study17.Due to the large size of the sequences our classical simulator took many hours to approximate the alignment quality levels of the classical aligners. Real reads of medium size 200 bp were extracted from the query sequence The SNP calling is evaluated by using the precision and recall measures. Precision is defined as TP/(TP + FP) and recall as TP/(TP + FN). TP stands for true positive and FP stands for false positive, representing a match and mismatch, respectively, with a SNP (Single Nucleotide Polymorphism). FN is a false negative and represents a “correct” SNP that was not identified.17 to demonstrate the superiority of our method. The parameter Ω has a sufficient number of times to detect more than one diagonal lines in a single window.The final comparison results between the four popular aligners and our own method is presented in Table To investigate in a uniform way all the established known short read alignment methods, five stages were considered to cover every stage of these strategies. In the first stage all the preliminary operations take place regarding the reference system. In the second and the third stage the generation and the mapping process are examined, respectively. The fourth and the fifth stages deal with the mapping validity of the candidate matching list. Twelve popular aligners plus our own method and its classical counterpart are analyzed to demonstrate the pros and cons of each strategy in Table 18, most of the other aligners are some prominent variations20 of the seed-and-extend strategy: (1) the k-mer exact match seed (BLAST21 and GNUMap22), (2) the k-mer inexactly match seed , (3) the k-mer spaced seed , (4) the maximum extend match30 (MEM) seed  and (5) the adaptive seed . For the q-gram filter strategy, the SHRiMP34 and Hobbes35 are examples with improved sensitivity.In order to allow for a vivid comparison between our method and the various alignment tools, Table 36, the Burrows-Wheeler Transform with FM-index38, the FMD-index39, the bidirectional BWT40 or the Directed Acyclic Word Graph41. Further information about them can be found in the Supplementary Material.The fundamental tools that manage the sequences in all these aligners are: the hash map, the prefix/suffix trieΘ (1) and O(LSeed) where LSeed the length of the query seed. The QPR approach is evolved in a dynamic way binding only a few memory qubits. The quantum index structure can host exponentially larger data segments of genome sequences in the increase of the number of qubits.The comparison table shows that the quantum approach outperforms the other classical strategies in terms of computational complexity as at every stage the quantum setting has lower complexity than its classical counterparts. The usage of hash tables or suffix trees impose the preparation of indexing structure which may take time and space. Moreover, their manipulation may not be affordable enough in certain cases. Hash tables turn out to be more efficient than search trees or any other lookup table structure, but hash collisions are practically unavoidable when hashing a random subset of a large set of possible keys. A data structure based on Burrows-Wheeler Transform can search stored items in constant time which is the best possible complexity, but in reality, the complexity may range between QFT can detect the line-patterns in a logarithmic time. The repetitive seed generation stages, the various calculations for seed or mapping scoring and filtering and the final alignment processes based on D.P. imply a poorer performance, even if stage 2 provides an advantage with the constant time complexity by the searching methods. However, the S.W. or N.W. or alternative of dynamic programming should be incorporated in our method in order to achieve precision similar to the other classical aligners.As the goal of Table Ω surely will increase sensitivity at a cost of time reaching a level that will limit the need for dynamic programming. Long reads are the future tendency in NGS techniques and longer inexact or spaced seeds can guarantee an accurate matching detection. In this regime, the quantum algorithm may have a great advantage as it supports the detection of arbitrary long imperfect line-patterns.For weak similarities or particular patterns, the QPR approach may fail to detect or interpret correctly positive windows and further study may improve the situation. Obviously, reducing window’s size or increasing A sophisticated method is presented which combines dot-matrix plotting and quantum pattern recognition to improve sequence alignment in biology research and all the relevant fields. The results of our experiments lead to the conclusion that there is a great advantage with a method which should be explored further in the future. The implementation of such a method is not far from the reality, since it does not demand a coherent quantum system of many qubits.O(3log2LRLQ). The first term concerns the application of the Hadamard gates, the second the application of the BB and the third the QFT. The final aligning step is common for all the strategies, but it may be limited in dot-matrix approaches. Current aligners seem that they cannot run faster than O(LRLQ) in the worst case. Moreover, the quantum registers can save much space due to the exponential indexing coverage of the sequences.The overall time complexity of our method is Since, the QPR approach isn’t directly an alignment algorithm, the combination with classical tools may seem unavoidable but better treatments can be employed to make perfect alignments. Using scoring methods will also improve the alignment result. More benchmarking tests are needed under specific circumstances to illustrate the power of this method. Database searching and sequence assembly may be benefited. Another area to be consider with the QPR method is the multiple sequence alignment.6. The considered linear pattern in this study is the line pattern. The first part of this method uses quantum computation while the second part uses classical computation.The primary task of this method is to detect, identify and localize certain linear patterns in an unstructured data set as it is argued by R. Schützhold in his seminal papern × m array. This array is assumed to consist of unit cells (e.g. controlled refractors or any non-linear Kerr cells) which are, either completely absorptive, or completely reflective. The reflective cells are also assumed to be uniformly distributed in the rectangular array with a density ρ < 1. The position of the reflective points on the plane may be located by shining appropriately focused light beams on the Kerr media and doing calculations in close analogy to diffraction experiments studying crystal structures via Laue diagrams. Symmetrical pattern transformations are assumed to be resilient for an ideal number of times into different directions.A full unstructured data set has to be loaded into a lattice plane which can be considered as a rectangular BB) of the form in Eq.  can be viewed as an s-digit binary number which indicates a point in the array in the form of a string made by the coordinates n + m = s. The current superposition is given by the quantum state |Ψ〉 with 0 ≤ S − 1.After a successful measurement, Eq.  will obtt in Eq.  is reducz〉 superposition state. The final result is described in Eq. . When there isn’t a prominent pattern then the measurement of the quantum state k yield just noise.At this stage, some useful information about the pattern can be extracted by measuring |This is the only classical part of this method since it makes use of classical computation. By using the equations of Laue diagrams used in diffraction experiments it is possible to find the location of the detected patterns and extract further information about their length and their direction. This step demands a second execution of the algorithm.A few more repetitions of the algorithm may be needed to ensure the detection of our findings.LD and ϑ can be inferred from the measurements in routineQPR, in order to locate the center points z of a particular diagonal which is described byN is an integer. The Ω measurements  of routineQPR running for a single window are stored and used in this routine. Some peaks are generated in each row of the patternIn a continuation of the QPR algorithm, the key parameters k is fine-tuned according towhile the summation of the peaks of all rows interferes constructively only if fLaue = sin2(πξκ)/sin2(πκ), with k = κcos ϑS/LD and ξ = O(Nκ = k(N + tanϑ)/S and ξ = O(M The second term in Eqs  and 13)13) denotmentclasspt{minimak occur for values which satisfy both conditions in Eqs k occur fNM→)MN. The weave-numbers of the peaks are nowHowever, Eq.  cannot gπ/2.since transposing changes the array orientation per LD and ϑ can be approximated. Using the candidate values for LD/cos ϑ from Eq. LD and ϑ k and k΄ and their width is enough to find fraction β. So, with the aid of L, ϑ and β, the pattern can be localized efficiently by splitting up symmetrically the window into smaller orthogonal windows and running routineQPR again in these smaller windows. A richer analysis of this method can be found in the seminal paper6.For the size of the pattern, the frequency of measuring the peaks at A simple program is implemented by using the bioinformatics toolbox application of Mathworks in the Matlab suite.seqdotplot allows the creation of a large dot matrix and its manipulation. seqdotplot can load large sequences, take control of the size of the window on the reference genome and set the number of mismatches in it. The functions nwalign and swalign are good simulations of the well-known dynamic alignment algorithms N.W. and S.W., respectively. Whatever is the aim, the main program splits the dot matrix into smaller windows and windows that are directly connected with the main diagonal of the plot are examined. All our results are conducted with this setting ignoring windows of second priority. The majority of the diagonals, a fraction ~50%, in a sub-matrix, or window, are scanned for “1” (dot) values and the summation is kept for each one. When the sum is higher than a threshold, this window is recorded as positive. Finally, a matrix keeps the positive windows to index the regions of similarity. The threshold for the summation is analogous to the size of the window. Due to the limited performance and memory allocation of our program, reasonable sizes of sequences were tested.The readily available function of Supplementary Info