As the COVID-19 outbreak spreads, there is a growing need for a compilation of conserved RNA genome regions in the SARS-CoV-2 virus along with their structural propensities to guide development of antivirals and diagnostics. Using sequence alignments spanning a range of betacoronaviruses, we rank genomic regions by RNA sequence conservation, identifying 79 regions of length at least 15 nucleotides as exactly conserved over SARS-related complete genome sequences available near the beginning of the COVID-19 outbreak. We then confirm the conservation of the majority of these genome regions across 739 SARS-CoV-2 sequences reported to date from the current COVID-19 outbreak, and we present a curated list of 30 ‘SARS-related-conserved’ regions. We find that known RNA structured elements curated as Rfam families and in prior literature are enriched in these conserved genome regions, and we predict additional conserved, stable secondary structures across the viral genome. We provide 106 ‘SARS-CoV-2-conserved-structured’ regions as potential targets for antivirals that bind to structured RNA. We further provide detailed secondary structure models for the 5´ UTR, frame-shifting element, and 3´ UTR. Last, we predict regions of the SARS-CoV-2 viral genome have low propensity for RNA secondary structure and are conserved within SARS-CoV-2 strains. These 59 ‘SARS-CoV-2-conserved-unstructured’ genomic regions may be most easily targeted in primer-based diagnostic and oligonucleotide-based therapeutic strategies. In addition, such RNA elements may be useful targets for antivirals, a concept supported by the recent development of antisense oligonucleotide therapeutics and small-molecule RNA-targeting drugs for a variety of targets across infectious and chronic diseases.4Severe Acute Respiratory Syndrome Coronavirus 2 (SARS-CoV-2) has caused a rapidly expanding global pandemic, with the COVID-19 outbreak responsible at this time for over 600,000 cases and 25,000 deaths. The emergence of this pandemic has revealed an urgent need for diagnostic and antiviral strategies targeting SARS-CoV-2. Like other coronaviruses, SARS-CoV-2 is a positive sense RNA virus, with a large RNA genome approaching nearly 30 kilobases in length. Its RNA genome contains protein-coding open reading frames (ORFs) for the viral replication machinery, structural proteins, and accessory proteins. The genome additionally harbors various 5 Furthermore, RNA secondary structure in the 5´ UTR exposes a critical sequence motif, the transcriptional regulatory sequence (TRS), that forms long-range RNA interactions necessary for facilitating the discontinuous transcription characteristic to coronaviruses.6 Beyond the 5´ UTR, the frame-shifting element (FSE) in the first protein-coding ORF (ORF1ab) includes a pseudoknot structure that is necessary for the production of ORF1a and ORF1b from two overlapping reading frames via programmed ribosomal −1 frame-shifting.7 In the 3´ UTR, mutually exclusive RNA structures including the 3´ UTR pseudoknot control various stages of the RNA synthesis pathway.8Conserved structured RNA regions have already been shown to play critical functional roles in the life cycles of coronaviruses. Most coronavirus 5´ UTR’s harbor at least four stem loops, with many showing heightened sequence conservation across betacoronaviruses, and various stems demonstrating functional roles in viral replication.cis-acting RNA elements. Here, we analyze RNA sequence conservation across SARS-related betacoronaviruses and currently available SARS-CoV-2 sequences, and we identify structured and unstructured regions that are conserved in each sequence set; these intervals can provide starting points for a variety of diagnostic and antiviral development strategies  was computed by aligning sequences curated by Ceraolo and Giorgi,10 filtered by including only the reference genome sequence NC_0405512.211 from the SARS-CoV-2 sequence set, removing the two MERS sequences, and leaving in all remaining betacoronavirus whole genome sequences. This alignment captures a range of SARS-related bat coronavirus and SARS sequences with only 11 sequences. These sequences correspond well to the SARS-related group defined in Gorbalenya, Baker, et al.12The first multiple sequence alignment (SARSr-MSA-2) was obtained from BLAST by searching for the 100 complete genome sequences closest to the SARS-CoV-2 reference genome. This alignment captures a larger set of SARS-CoV-2, SARS, and bat coronavirus sequences than SARSr-MSA-1 but includes many sequences with high pairwise similarity.The second MSA (SARSr-MSA-3) was obtained by locating all complete genome betacoronavirus sequences from the NCBI database, and removing mutually similar sequences with a 99% sequence conservation cutoff. With 180 sequences with at most 99% pairwise sequence similarity, this MSA captures a broader set of betacoronaviruses than SARSr-MSA-1 and SARSr-MSA-2 but is more challenging to align due to higher sequence diversity.The final MSA , 98% conserved (cutoff for SARSr-MSA-2), or 54% conserved (cutoff for SARSr-MSA-3). Searching for conserved regions of 15 nucleotides or more enables the design of antisense oligonucleotides that fall within these stretches. The sequence conservation cutoffs chosen ensured that at least 75 candidate conserved stretches were used for further structure analysis for each MSA. When calculating sequence conservation at the 5´ and 3´ sequence ends of the sequence, we did not include sequences that included only leading or trailing sequence deletions up to that point to avoid sequencing artefacts.13 but we also noted stretches of RNA sequence conservation within some viral ORFs.In 14 families for Coronaviridae RNA secondary structures: the frameshifting stimulation element (Rfam family RF00507), the 3´ UTR pseudoknot (Rfam family RF00165), and the 3´ stem-loop II-like motif (Rfam family RF00164)  and stem loop 5 (SL5).16 These five known RNA structures overlap with conserved regions more than expected; in 10,000 random trials, the chance that five randomly chosen intervals of these lengths all overlap with the conserved regions from SARSr-MSA-1 or SARSr-MSA-2 is less than 0.0003. The enrichment of known RNA structures in these conserved regions suggests that other conserved regions may also harbor RNA structures.Interestingly, in SARSr-MSA-1 and SARSr-MSA-2 we found that conserved stretches overlapped with previously curated RfamRF00164) . LocatioSARS-CoV-2-MSA-1), and the second includes 739 sequences deposited to GISAID17 (SARS-CoV-2-MSA-2). We noted conserved regions in the betacoronavirus alignment SARSr-MSA-1 were more likely to be at least 99% conserved in both SARS-CoV-2-MSA-1 and SARS-CoV-2-MSA-2 than random intervals of the same size . SARS-related-conserved regions. These genome regions are conserved across the betacoronavirus sequences in SARSr-MSA-1 and have at least 99% sequence conservation across whole-genome sequences from the SARS-CoV-2 outbreak as of March 18, 2020 (SARS-CoV-2-MSA-2).To further tighten this list of conserved sequences to ones most relevant to the current COVID-19 outbreak, we analyzed whether sequence regions conserved across SARS and bat coronaviruses remain conserved in the SARS-Cov-2 strains, most of which emerged after our analysis above . We deteConservation percentages for SARSr-MSA-1, SARSr-MSA-2, SARS-CoV-2-MSA-1, and SARS-CoV-2-MSA-2 are included in The intrinsic RNA structure of a conserved genome region is of interest in current medical research . On one 18 We then sought to rank sequences based on the predicted probability that the RNA folds into the MEA structure and not other structures. For this ranking, we used the estimated Matthews correlation coefficient (MCC) from each construct’s base-pairing probability matrix.19 We note here that while MCC is often used in the RNA structure modeling literature to assess agreement of a prediction with a reference structure, we here use the metric to assess how tightly concentrated the ensemble of predicted secondary structures is to a single predicted secondary structure, the MEA structure. An MEA structure with a higher estimated MCC is expected to have unpaired and paired bases that better align with the construct’s predicted ensemble base-pairing probabilities, lending support to the single-structure MEA prediction. In 20We used two approaches to make predictions for conserved structured regions in SARS-CoV-2. First, we predicted RNA structures centered on the most sequence-conserved regions of SARS-related betacoronavirus genomes . For each conserved stretch  along with 20 nucleotide flanking windows, we predicted maximum expected accuracy (MEA) secondary structures using Contrafold 2.0.21, beginning with the betacoronavirus alignment SARSr-MSA-1. RNAz predicts structured regions that are more thermodynamically stable than expected by comparison to random sequences of the same length and sequence composition (z-score), and additionally assesses regions by the support of compensatory and consistent mutations in the sequence alignment (SCI score). These two criteria are combined into a single P-score, which when tested empirically on a set of ncRNAs produced a false-positive rate of 4% at a P>0.5 cutoff and 1% at a P>0.9 cutoff. To predict structured regions across the full viral genome, we scanned the SARSr-MSA-1 alignment in windows of length 120 nucleotides sliding by 40 nucleotides, predicted all RNAz hits in the plus strand at a P>0.5 cutoff, clustered the resulting hits to generate maximally contiguous loci of the genome with predicted structure, and filtered results to only include loci with at least one window with a P>0.9 structure prediction.We also sought independent methods to identify thermodynamically stable and conserved RNA structures, without initially guiding the search to focus on extremely sequence-conserved genome regions. We made predictions for structured regions using RNAzSARS-CoV-2-conserved-structured regions. Overlapping intervals between the RNAz predictions and conserved sequence regions in SARSr-MSA-1 are included in The RNAz approach led to the prediction of 44 structured genome loci comprising 117 windows with predicted structure (P>0.9), with these loci covering 46% of the SARS-CoV-2 genome . We foun22 Second, we validated structured window predictions with alifoldz, a program that calculates a z-score for an alignment window by comparing the window’s consensus minimum free energy structure to that of random shuffled alignments. To mirror the RNAz analysis above, we scanned through windows of length 120 nucleotides sliding by 40 nucleotides. We chose a z-score cutoff of - 2.69, which kept only 1% of windows when running alifoldz on all shuffled windows across the genome. This approach led to predicting 228 alifoldz structured windows, overlapping with 104 of the 117 RNAz structured windows (P>0.9 cutoff). This overlap is statistically significant . RNAz structured windows supported by alifoldz analysis are highlighted in We sought to further check structured windows reported by RNAz using orthogonal approaches. First, we explored using R-scape to make structure predictions with covariation signal in the sequence alignments. However, we found that the SARSr-MSA-1 alignment had insufficient variation to detect conserved base pairs with covariation, lacking alignment power for all genomic windows.lack structure, as such regions may be desired targets for some diagnostic and therapeutic approaches  that base pairs with one of several complementary sequences in nascent negative-sense strands in a ‘copy-choice mechanism’ that gives rise to discontinuous transcription of subgenomic mRNAs.6 SL4 contains a short upstream ORF, here labeled uORF, which precedes the first longer ORF1ab of the genome. The uORF leads to attenuated transcription of ORF1ab that appears helpful but is not essential for viral replication.13 SL5 has been implicated in a potential role in viral packaging, and contains the AUG start codon for long ORF1ab which encodes the viral replicase/transcriptase polyprotein. The SARS-CoV-2 SL5 domain has common features with the domain in other group IIb betacoronaviruses, for instance including UUCGU pentaloops on SL5a and SL5b, and a GNRA tetraloop on SL5c.9 Prior DMS-probing data for Stem 5 in SARS-CoV aligned with the proposed SL5a,b,c structures.9 Two additional stems (SL6 and SL7) are predicted from computer modeling here, but prior literature has not established whether such stems embedded in the coding region are functionally important across betacoronaviruses.The 5´ UTR includes five confident stem-loop structures (SL1-SL5), with structures verified by chemical mapping experiments in related coronaviruses.7 This domain is nearly exactly conserved between SARS-CoV and SARS-CoV-2, suggesting a similar mechanism for ribosomal pausing and slippage between the two viruses.25The frameshifting element (FSE) is located in ORF1ab and is involved in regulating a (−1) ribosomal frameshift event that is necessary for producing ORF1b. The FSE consists of a conserved pseudoknot structure that regulates the rate of ribosomal frameshifting at an upstream slippery site.26 The hyper-variable region (HVR) is not essential for viral RNA synthesis, as this can be removed while allowing for viral replication in tissue culture; however, viruses without this domain have lower pathogenicity in mice.27 This domain contains a completely conserved octonucleotide sequence with unconfirmed functional significance. The stem-loop II-like motif (s2m) is another subregion of the HVR that is conserved in SARS-CoV-2 and other coronaviruses. A crystal structure of the SARS s2m domain has been shown to be homologous to an rRNA loop that binds translation initiation proteins, leading this domain to have a proposed role in recruiting host translational machinery.28 The domain has been proposed to be a selfish element due to its recurrence in numerous virus families outside the Coronaviridae, but its function is not well understood.29The 3´ UTR contains various domains critical for regulating viral RNA synthesis and potentially translation. The most 5´ region of the 3´ UTR includes a switch-like domain involving mutually exclusive formation of a pseudoknot and stem-loop, both of which are essential for viral replication with putative roles in establishing the kinetics of RNA synthesis.Understanding the RNA structure of the SARS-CoV-2 genome can guide RNA-targeting interventions and diagnostics. Here we have presented an initial analysis of RNA sequence conservation across betacoronaviruses and current SARS-CoV-2 sequences, predictions for structured and unstructured domains of the viral RNA genome, and homology-derived secondary structure models for classic structured elements of the SARS-CoV-2 genome: the 5´ UTR, the frame-shifting element, and the 3´ UTR. By filtering for sequences that have more than one of these properties, we have curated three sets of RNA genomic regions of potential interest for further structural analysis, which we have termed the SARS-related-conserved, SARS-CoV-2-conserved-structured, and SARS-CoV-2-conserved-unstructured sets. 25 Additional biochemical and genetic verification, particularly through compensatory mutagenesis, will be needed to further assess these structures.The abundant RNA structures involved in the replication cycle of betacoronaviruses present ample opportunities for therapeutic development, but our analysis is not complete. First, while homology to prior structures annotated in betacoronaviruses lends some confidence to the 5´ UTR, frame-shifting element, and 3´ UTR secondary structures presented here, there may still be some inaccuracies. For instance, SL6 and SL7 in the 5´ UTR are built based on computer modeling. As another example, the frame-shifting element structure presented here differs in two base pairs compared to that presented by Kelly and Dinman.30 Such long-range RNA-RNA interactions would be missed in our analyses above which have focused on shorter windows. In related coronaviruses, RNA structures that act as packaging signals have been identified in genomic ORFs.13 Such packaging signals may reside in regions identified here from our RNAz computational analysis or may have been missed.Beyond the secondary structures highlighted here, prior work has pinpointed a variety of RNA-RNA interactions important to the betacoronavirus life cycle. Long-range interactions between the 5´ UTR and 3´ UTR have been implicated in RNA synthesis, for instance with mutations in the 5´ UTR SL1 only supporting viral replication when co-evolving with specific mutations in the 3´ UTR.32 New candidates for structured RNA elements in SARS-CoV-2 could play various functional roles, perhaps regulating viral packaging, replication, RNA synthesis, or translation initiation. To further improve these structure predictions, information about protein-binding events should be integrated, and biochemical assays can be conducted with these proteins present or even in cells. Accounting for protein-binding events will be critical to completing a picture of accessible and structured RNA sites.We believe a more thorough structure/function analysis of the virus should be obtainable with recent experimental technologies that integrate multidimensional chemical mapping, electron microscopy, and computer modeling.The secondary structures predicted here present a reasonable starting point for 3D modeling of RNA-only structures in various regions, including the 5´ UTR stem loop 5, the frame-shifting element, the 3´ UTR pseudoknot, and the 3´ stem-loop II-like motif. Furthermore, these regions and novel predicted structures can serve as candidates for RNA-only structure determination. Such 3D structures have the potential to reveal well-defined 3D folds with conserved binding domains for small-molecule drugs, potentially presenting alternative approaches for targeting SARS-CoV-2.10 with MUSCLE33 using default alignment settings, excluding all non-reference genome copies of the SARS-CoV-2 sequence and excluding MERS sequences JX869059.2 and KT368829.1.SARSr-MSA-1 was generated by re-aligning the sequences curated by Ceraolo and GiorgiSARSr-MSA-2 was generated by downloading the MSA provided by BLAST for the top 100 complete genome sequences closest to the SARS-CoV-2 reference genome.34, and computing an MSA with Clustal Omega35 using default settings.SARSr-MSA-3 was generated by obtaining all complete betacoronavirus genome sequences available from the NCBI database, removing mutually similar sequences using a 99% cutoff with CD-HIT-ESTThree alignments for SARS-related viruses were prepared:SARS-CoV-2-MSA-1 was generated by downloading the MSA provided by NCBI for the 103 whole-genome SARS-CoV-2 sequences deposited as of 03–18-20.17 sequences, including all sequences described in the Nextstrain project metadata file as of 03–18-20 (https://github.com/nextstrain/ncov). Sequences were aligned using MAFFT36 with the –add flag to add GISAID sequences to seed alignment SARS-CoV-2-MSA-1, and the sequences in SARS-CoV-2-MSA-1 were subsequently removed to avoid duplicates.SARS-CoV-2-MSA-2 was generated from 739 GISAIDTwo alignments for SARS-CoV-2 sequences were prepared:https://github.com/DasLab/SARSCoV2_Secstruct_Cons.All alignments are included in the associated GitHub repository: 11 that were matches to Rfam14 families, we used Infernal15 to build covariance models from Rfam families RR0164, RR0165, and RR0507 with cmbuild, and we ran cmscan to find hits with an E<1e-04 threshold. MEA structures were computed using Contrafold 2.018 for 20 nucleotide flanking windows around conserved intervals in SARS-CoV-2. To estimate the Matthews correlation coefficient of these single-structure predictions, we computed the pseudo-expected Matthews correlation coefficient as described in Hamada, et al.19 Base-pairing probability matrices were computed Contrafold 2.0, and these were then used to calculated the expected number of true positive, true negative, false positive, and false negative base pairs. These computations were carried out using the Arnie package (https://github.com/DasLab/arnie).To identify regions in the SARS-CoV-2 reference genome NC_0405512.221 structures were predicted in windows of the SARS-CoV-2 genome using the SARSr-MSA-1 alignment. We used rnazWindow.pl to compile alignment windows across SARSr-MSA-1 with at least 4 sequences in each window, using a window size of 120 nucleotides sliding by 40 nucleotides, and using default settings otherwise. RNAz hits were computed at the P>0.5 threshold for the forward strand with z-scores computed without a shuffled sequence background for efficiency, using the --no-shuffle flag. The resulting RNAz structured windows were then clustered with rnazCluster.pl, filtered with rnazFilter.pl at a P>0.9 threshold, and sorted with rnazSort.pl.RNAz37 on the same genome windows used with RNAz above, again using SARSr-MSA-1. The alifoldz z-score computations were calculated for the forward strand only with alifoldz.pl. We additionally calculated alifoldz z-scores for alignment windows that were shuffled with shuffle-aln.pl to assess background z-scores, determining that 1% of shuffled alignment z-scores were less than −2.69.We ran alifoldz38 to assess the potential for using SARSr-MSA-1 for covariation analysis. We generated Stockholm alignment files with biopython39 for windows of 120 nucleotides each sliding by 40 nucleotides. For each window, we ran R-scape with the –fold flag to predict new structures, obtaining estimates for the power of each base pair in the predicted structure . We then averaged across base pairs in each structure to obtain the alignment power as described in Rivas, et al.,22 noting that all windows’ alignment powers fell below the 0.10 threshold used by Rivas, et al.22 to distinguish low-power from high-power alignments.We computed alignment powers with R-scape18 in windows of 120 nucleotides sliding by 40 nucleotides, and for each genome position, we summed the probabilities of pairing with all potential partners. We then averaged these nucleotide pairing probabilities across all windows that nucleotide was present in. Additionally, RNAplfold40 was run with window size 120 nucleotides, producing another set of unpaired probabilities for each position in the genome.To obtain probabilities that each genome position in SARS-CoV-2 was unpaired, we computed base-pairing probability matrices with Contrafold 2.0https://github.com/DasLab/SARSCoV2_Secstruct_Cons. The repository additionally includes alignment files, Rfam families and covariance models, and output from the RNAz, R-scape, alifoldz and RNAplfold analyses.Code used for the conservation, structured, and unstructured analyses above can be found at the GitHub repository: 1


Here, we explore the possibility to use Topic Modeling for organism whole-genome comparisons. We analyzed 30 complete genomes from three bacterial families by topic modeling. For this, each genome was considered as a document and 13-mer nucleotide representations as words. Latent Dirichlet allocation was used as the probabilistic modeling of the corpus. We where able to identify the topic distribution among analyzed genomes, which is highly consistent with traditional hierarchical classification. It is possible that topic modeling may be applied to establish relationships between genome’s composition and biological phenomena.Alignment-free  Such segments are symbolic representations of a four-letter alphabet called words or k-mers. K-mer frequency content comparisons have proven high-accuracy [k-mer lengths are not random, which suggests that genome k-mer distribution differs between families. And while Zhang et al. [k-mer alignment-free comparisons for whole-genome sequence analysis still remains a challenge.Alignment-free sequence algorithms have been widely explored for sequence analyses due to their ability to render relatively accurate results while lowering algorithm complexity . Among taccuracy ,3. Moreoaccuracy  describeg et al.  demonstrk-mer frequency can be summarized into: (i) composition vectors, where genomic content is represented in matched/mismatched occurrence-vector motifs to classify studied sequences either by pairwise-distance measures or machine-learning approaches [(ii) information theory, which include a set of methodologies that evaluate the shared Shannon-view informational content  among the sequences studied [(iii) motif composition, where probabilistic methods model genomic sequences and compare the motifs’ expected frequencies rendered by their respective models [2 statistics(iv) D, that describe the compared sequences as the D2 model based on the shared words’ statistics [Methods based on word count or proaches ,7; (ii)  studied ,8; (iii)e models ; and  [A general practice in these methods is to perform pairwise comparisons, which renders a version of a distance matrix that is typically solved by maximum parsimony, neighbor joining or other tree-building methods. Alternate solutions for a distance matrix include clustering algorithms, (such as k-means) ,12,13 ank-means) .Altogether, these methods have been implemented into different biological applications, from small viral sequences analysis  to complk-mer sequence analysis [Topic modeling is a suite of algorithms aimed to discover certain lexicon-themed structures in a corpus of several documents  based onanalysis .Most of the topic modeling sequence analysis have consisted in single gene-based non-overlapping word analysis and lexicon clustering of such genes ,26. To ohttps://www.ncbi.nlm.nih.gov/, June 2019), and treated each genome as a document. Ten genomes were downloaded for three pathogenic bacterial families: Chlamydiales, Vibrionaceae, and Yersiniaceae respectively  is equal to k-mer size selection was determined by the Cumulative Relative Entropy metric [k. As the value approaches zero, the accuracy to estimate longer features trades-off with computer-time geometric increase.Given that the corpus is the full collection of words that are putatively present in a group of documents and, that the subcorpus is a collection of unique words that composes a particular document, we studied both the corpus and subcorpus of the genomes through the presence or absence of particular words on each genome. We considered the word –or y metric , which iN words can represent a document d: T is the number of topics [M documents denoted by Probabilistic topic modeling refers to a suite of algorithms that are assembled in order to discover, classify and annotate thematic information in large documents . The prif topics ,29. In t,w2,…,wM .w in a corpus D [Choose Choose N words Choose a topic Choose a word For each of the The probabilistic topic model used in this work is the Latent Dirichlet Allocation (LDA). The main idea is that documents are represented as random mixtures over latent topics, where each topic is characterized by a distribution over words. LDA assumes the following generative process for each document corpus D :Choose topicmodels R package [In this work, we used the  package .k was determined as 13-mer by Cumulative Relative Entropy metric, since it rendered values under the suggested threshold  by considering that word samples do not necessarily mean a corpus and biological significance interpretation can be compromised.Topic modeling techniques have been previously used in bioinformatics to classify sequences ether according to their coding genes , 16S rDNHerein we establish that the Topic model can be applied to complete genome comparison with results that are consistent with the current bacterial taxonomy. The topic modeling has the advantage of not needing a selection of characteristics to differentiate genomes according to their taxonomy. It is possible that future exploration will help to establish relationships between genome’s composition and other significant biological phenomena.


Pairwise sequence covariations are a signal of conserved RNA secondary structure. We describe a method for distinguishing when lack of covariation signal can be taken as evidence against a conserved RNA structure, as opposed to when a sequence alignment merely has insufficient variation to detect covariations. We find that alignments for several long non-coding RNAs previously shown to lack covariation support do have adequate covariation detection power, providing additional evidence against their proposed conserved structures.The R-scape web server is at eddylab.org/R-scape, with a link to download the source code.Bioinformatics online. The E-value of a given score is the expected number of pairs amongst the total set of tested pairs that are expected to get this score or better, under the null hypothesis of no covariation. Neither the number nor the diversity of sequences in the alignment alone suffices to estimate detection power  on a dataset of alignments of 87 RNA families in Rfam v14.0 with known 3D structures, consisting of 7012 annotated basepairs (s), the expected sensitivity for detecting any proposed basepair with s total substitutions. For an alignment with B total proposed basepairs, the expected fraction of basepairs with significant covariation support is alignment power, to compare covariation support across different alignments with different numbers of proposed conserved basepairs. We define an arbitrary threshold of 10% alignment power to distinguish low-power from high-power alignments.We empirically fit the relationship between substitutions and detection power  is calculated as the sum of substitutions for each position, and the basepair power(s) is estimated using the empirical power curve given in Only low-power alignments of conserved structural RNAs should lack significant covariation support. We analyzed all 3016 seed alignments for known conserved structural RNAs in Rfam v14.1 and compared the fraction of basepairs with significant covariation support versus estimated alignment power Fig. 2a;. Many RfFig. 2a;Previous analysis of several lncRNAs including HOTAIR Fig. 2b;. AlthougXist RNA is perhaps the best studied lncRNA, but it remains unclear whether Xist’s role in X dosage compensation depends on any conserved RNA structure, as opposed to its sequence alone. Several different conserved structures have been proposed for the conserved 5′ RepA region of Xist Fig. 2b;.E-value of 0.005, out of 334 proposed pairs. Our method judges this alignment to be high-power, estimated to be sufficient to detect about 110/334 basepairs.A conserved structure for the ∼1.3 kb Xist RepA lncRNA (including the conserved repeat A and F regions) has been proposed recently  (lgorithm . For phyis (summed over branches) at each individual column i. For a proposed basepair involving two columns i, j, we use In the new method for statistical power estimation, the same tree and inferred maximum parsimony substitutions are used to obtain the total substitutions i, j to obtain ijs, rather than assuming column independence, which gave similar results (data not shown).We also tested a more expensive variation where we parsimoniously infer pairwise substitutions jointly at all column pairs Simulated alignments were produced with the program R-scape-sim. Given an input sequence alignment with a consensus RNA secondary structure, R-scape-sim calculates a maximum likelihood phylogenetic tree with branch lengths. It sub-samples the original phylogenetic tree to a desired number of taxa, and linearly scales branch lengths to achieve a desired average percentage identity amongst the aligned sequences. One sequence is selected at random as a root and its evolution is simulated down the tree branches using a probabilistic evolutionary model. The evolutionary model consists of rate matrices for single (unpaired) residue substitution, pairwise (basepair) substitution, insertion, and deletion events  and estimate ijs for each proposed pair in Rfam ‘seed’ alignments. We binned proposed pairs with identical ijs and calculated the frequency of pairs with significant support E < 0.05 in each bin. For 1, 653 such points for bins s = 0 to 1, 652, we fitted a polynomial of degree 10 by minimizing least square error. The choice of degree 10 was arbitrary, and simpler functions such as For each of 7012 annotated consensus basepairs in 87 RNA families Rfam v14.0 with known 3D structures, we use R-scape to calculate the statistical significance , leading to noisy data and possibly to a bad quality alignment, which is why we fit all point for s > 150. For E-values, dividing them into 70 equal bins, and calculating the means s and power(s) in each bin. This plot is less noisy at high s. We did not re-estimate the fitted curve when we replotted. Fitted power(s) values starting from s = 0.012 are hardcoded in the R-scape source code; for s > 226 we set power(s) = 1.In binning the data by integer s) as a function solely of s. This approximates away an important additional dependency on alignment length. R-scape E-values are multiple-test-corrected; the number of potential basepairs depends on the input alignment length. Detecting significant support for a basepair in a longer alignment requires more signal because the background of non-pairs is higher. We considered fitting power to a range of different P-value thresholds p  but decided this was impractical. Instead, the fitted power curve treats all alignments as approximately the same length. The actual lengths of the Rfam seed alignments used in Our approach treats power(b with bs substitutions is power(bs), from the empirical fitted curve shown in E-value, R-scape now also reports for each pair the inferred number of substitutions bs and the estimated power(bs).The expected sensitivity for detecting a basepair alignment power, defined as the fraction of basepairs expected to have significant support,As an overall summary statistic for an alignment with a proposed structure, R-scape reports the total number of basepairs expected to have significant covariation support,In this work, alignments with L) are significantly covarying. This is R-scape’s default one-set test. Alternatively, if a consensus secondary structure is provided, R-scape allows an optional two-set test consisting of two independent tests on two different sets. One test is on the proposed structure (the set of basepairs); the other parallel test is on all other possible pairs in the alignment (the set of non basepairs). On the set of basepairs, R-scape extracts the alignment’s support for the annotated structure. On the set of non basepairs, R-scape identifies other possible covarying basepairs not present in the given structure.R-scape has two statistical modes to test the presence of a conserved RNA structure. By default, R-scape considers all pairs as equivalent and performs an statistical test as to which of the all possible two-set mode. Under the one-set mode, R-scape still reports the power for each of the significantly covarying basepairs, assuming that those could be part of a structure. The covariation and covariation power analyses provided in this manuscript for all lncRNAs have been obtained with R-scape’s two-set mode on the proposed secondary structures.Estimating the alignment power requires a proposed structure, thus the use of R-scape’s HOTAIR domain 1–4 alignments (D1–D4) and proposed consensus structure used in http://genome.ucsc.edu). This alignment includes 76 mammalian species.The SRA alignment and proposed consensus structure used in The Xist repeat A region alignment used in The Xist repeat A region alignment and proposed consensus structure in The RepA lncRNA alignment (spanning repeat A and repeat F regions) with a proposed consensus structure in We produced our own RepA lncRNA alignment of 65 sequences and got similar results: a high-power alignment sufficient to detect about 254 basepairs, but no significantly supported covarying pairs. The proposed structures for all ten XIST conserved regions were produced using R-scape.E As described in the main text, we used nhmmer  to identArabidopsis thaliana COOLAIR lncRNA sequence and the consensus structure proposed in We used the All alignments  are included in btaa080_Supplementary_DataClick here for additional data file.


Graph-based representation of genome assemblies has been recently used in different contexts — from improved reconstruction of plasmid sequences and refined analysis of metagenomic data to read error correction and reference-free haplotype reconstruction. While many of these applications heavily utilize the alignment of long nucleotide sequences to assembly graphs, first general-purpose software tools for finding such alignments have been released only recently and their deficiencies and limitations are yet to be discovered. Moreover, existing tools can not perform alignment of amino acid sequences, which could prove useful in various contexts — in particular the analysis of metagenomic sequencing data.In this work we present a novel SPAligner (Saint-Petersburg Aligner) tool for aligning long diverged nucleotide and amino acid sequences to assembly graphs. We demonstrate that SPAligner is an efficient solution for mapping third generation sequencing reads onto assembly graphs of various complexity and also show how it can facilitate the identification of known genes in complex metagenomic datasets.Our work will facilitate accelerating the development of graph-based approaches in solving sequence to genome assembly alignment problem. SPAligner is implemented as a part of SPAdes tools library and is available on Github. Many popular short read assemblers –3 providHere we present the SPAligner (Saint Petersburg Aligner) tool for aligning long diverged molecular (both nucleotide and amino acid) sequences against assembly graphs produced by the popular short-read assemblers. The project stemmed from our previous efforts on the long-read alignment within the hybridSPAdes assembler . Our ben“G be a (directed) compacted de Bruijn graph with edges labeled by nucleotide sequences that we further refer to as assembly graphS is denoted by |S| and length of edge e, |e|, is defined as a length of its label. S[x] denotes x-th symbol of S (starting from 0). Position x on string S belongs to a range [0…|S|] and corresponds to location before S[x], if x<|S|, and after S[|S|−1] otherwise. S[a:b] is a substring of S between positions a and b. By the size of graph G, |G|, we denote the sum of the number of its vertices, edges and total length of all labels.Let e and position in the sequence of e: p=, where 0<=i<=|e|. Note that with such notation there are multiple positions in graph that corresponds to a vertex of G — it is located at the end of each incoming edge and at the beginning of each outgoing edge. G[p] denotes a symbol on position i within edge e. A path P in G is defined by a sequence of consecutive edges e1,…,en and a pair of positions e1 and en respectively. We denote the nucleotide sequence obtained by concatenation of edge labels in a path P (trimmed according to Label(P).Position in the graph is naturally defined by a pair of an edge K bp, where K is the kmer size parameter of de Bruijn graph). Additional file For the sake of clarity throughout the paper we are going to neglect the fact that adjacent edges produced by popular assembly tools typically overlap (in particular adjacent edges produced by majority of the de Bruijn graph based assemblers overlap by S (query) to an assembly graph G is defined as a path P in G, such that Label(P) has minimal alignment cost against S across all paths in G. As well as other practical tools for searching alignments in large sequence graphs (including vg and GraphAligner) SPAligner first identifies regions of high nucleotide identity between the query and the graph sequences that we refer to as anchor alignments (or anchors) and then attempts to extend them to desired semi-global alignments.The semi-global alignment of a sequence S to an assembly graph G ,ends(a)) and a range on a specific edge e(a) —  matches G[p′], and μ otherwise,<pend,posSub>→<pstart,posSub> of weight zero if pend and pstart both corresponds to the same vertex in G ,pstart= and the end of edge e1 is same vertex as the start of e2),<The weighted p iterates through all positions in G, while p′ iterates through all graph positions extending p  and p′= for some edge e and index i<|e|), and posSub — through all (permissible) positions in Sub.where ai: (. ED denotes alignment cost  between strings S1 and S2. Our goal is to find a path P, connecting positions p1=(e(ai),ende(ai)) and p2=(e(ai+1),starte(ai+1)) in the graph G minimizing ED(Label(P),Sub). It is easy to see , moreover, its weight is equal to ED(Label(P),Sub). Note that SG only has non-negative weights, so minimal-weighted paths search can be efficiently performed by Dijkstra algorithm [Consider a pair of consecutive anchors in the skeleton chain, mma 5 in ) that palgorithm , 15.Suf beyond ends, fixing its starting position in the graph G as ps=,ende). The sought answer can be recovered from the minimal weight path in SG across all paths connecting <ps,0> with any of the vertices {<pt,|Suf|>}, where pt iterates through all positions in G, which can also be found by Dijkstra algorithm.In addition to reconstruction of paths between the consecutive anchors of the alignment skeleton, SPAligner also attempts to extend the alignment beyond the leftmost/rightmost anchors. Without loss of generality, we consider finding optimal alignment of the query fragment G in the description above, a much smaller subgraph surrounding anchor alignments is considered by the SPAligner implementation. The implementation also benefits from available highly optimized solutions for sequence-to-sequence alignment . Additional file O(|G|·|Sub|).More efficient algorithms in terms of worst case time complexity have been earlier suggested in , 19 for It worth to note that recently Jain et al. suggesteG with edges labeled by nucleotide sequences and an amino acid query sequence Sp. We will refer to a path P in G as an AA-path, if its label translates into a valid (i.e.without any stop codon) protein sequence (denoted by Translated(Label(P))). We define semi-global alignment of a sequence Sp to graph G as an AA-path P in G, such that the alignment cost between Sp and Translated(Label(P)) is minimal across all AA-paths in GConsider an assembly graph While considering fixed mismatch penalties is usually sufficient for aligning nucleotide sequences, most practical scoring schemes for amino acid sequence alignment use specialized substitution matrices (e.g. BLOSUM or PAM matrices) , which tM assumes better alignments to have higher cumulative scores, we will consider elements of matrix M′=−M as match/mismatch score (by default M=BLOSUM90).To reconcile our cost-minimization formulation with the fact that typical substitution matrix σ (in our experiments we used σ=5) here, affine gap penalties can also be implemented without significant increase of running time or memory footprint [Again, though we only consider linear gap penalties with coefficient ootprint .σ), we introduce alignment graph, SGp. Each vertex corresponds to a triplet p is position in the graph G, fs is a frame state string (of length 0−2), encoding a partial codon sequence (empty string is denoted by ε). We further define the graph by the iterative procedure, initialized by introducing the vertices , where p iterates through all positions in G. Then, until no more edge can be added, we introduce edges and required vertices following one of the rules below:fs|<2,σ if |fs|=2,fs|=2,σ,pend and pstart correspond to the same position in graph on consecutive edges of G ,pstart= and end of edge e1 is same vertex as the start of e2),For the given query sequence, assembly graph, substitution matrix and gap penalty coefficient  and p′= for some edge e and index i<|e|), Subp.where Subp  by searching for minimal weight paths in SGp.As before, one can find the semi-global alignment path of the sequence Subp starting from position ps in the graph G corresponds to the minimal weight path in SGp connecting vertex <ps,0,ε> to any of the vertices {<pt,|Subp|,0> }, where pt iterates through all positions in G.In particular, it is easy to show that the semi-global alignment of the amino acid sequence M′ contains negative elements, the graph SGp will have edges of negative weight, preventing direct application of Dijkstra algorithm and its variations to the search of such minimal weight paths.Note that since any reasonable matrix While Algorithm 2 from   and we additionally check that the aligned ranges are consistently located with respect to the reading frame.Anchor filtering. Unreliable and ambiguous anchors are discarded based on their size and query range. Anchors shorter than K are filtered out. Smaller lengths of typical protein sequences as compared to long read sequences allow us to omit the anchor chaining step in order to increase the accuracy of the resulting amino acid sequence alignments. It also eliminates the need to coordinate the reading frames of the chained anchors.Alignment extension. SPAligher then uses the adjusted alignment graph approach  and filters perfectly duplicating paths. Resulting paths are then translated and re-scored against the query sequence with Parasail library [ library .v1.17 and GraphAligner v1.0.4.We benchmarked SPAligner against the two sequence-to-graph aligners supporting long reads – vg The vg alignment pipeline  starts fv1.0.4 uses MUMmer4 [GraphAligner  is a nov MUMmer4  to identBesides the default configuration of GraphAligner we have also benchmarked its “try-all-seeds” mode , recommended by the developers for bacterial datasets.E. coli strain K12, S. cerevisiae strain S288C and C. elegans strain Bristol N2 . Assembly graphs were generated with SPAdes v3.12 [For benchmarking we considered PacBio and ONT reads  for three different organisms: Results of benchmarking on real sequencing data are summarized in Table Number of mapped reads (MR): Read is considered mapped if 80% of its length is covered by a single alignment path.Alignment identity (%)(AI): Mean nucleotide identity Wall-clock time (h:m)(T): Wall-clock time with 16 threads.Memory (Gb)(M): Peak RAM usage with 16 threads.Table columns present the following metrics:Vg showed highest average alignment identity for all considered datasets, but at the same time resulted in very low fraction of mapped reads. The same tendency can be seen on simulated datasets  mapping identity is nearly the same for both tools.For C. elegans ONT dataset with similar mapping identity, and on C. elegans PacBio dataset both tools show similar results.SPAligner shows a 2% advantage in the number of mapped reads on Overall, our benchmarking suggests that SPAligner and GraphAligner produce similar alignments of long error-prone reads with SPAligner being faster and more memory-efficient than GraphAligner in “try-all-seeds” mode and slower and less memory-efficient than GraphAligner in default mode.In contrast to other sequence-to-graph aligners available at the moment, SPAligner supports alignment of protein sequences onto assembly graphs. In this section we demonstrate how SPAligner can be efficiently used to identify regions of the assembly graph exhibiting high similarity to known prokaryotic protein sequences.Contigs originating from metagenomic assemblies can be excessively fragmented due to various reasons, including inter-species repeats  and within-species microdiversity . Contig coding sequences from entire UniProt  database onto an assembly graph of a well-defined synthetic metagenomic community;a comprehensive set of known antibiotic resistance genes onto an assembly graph for a wastewater metagenomic dataset.The capacity of applying SPAligner in this context is demonstrated below in two experiments, considering alignments of:While alignment of a protein sequence with SPAligner might result in several alignment paths (initiated by different anchors), in this work we will only consider single best scoring alignment for each query.Shakya et al.  performev3.12 [We model the situation in which we aim to identify potential close homologs of known protein sequences within the metagenomic assembly graph. In particular, we searched for semi-global alignments of 350 thousand sequences comprising “reviewed” UniProt database of bacterial proteins . In ordev3.12  with defIn this section we demonstrate how SPAligner can be applied to identify genes of particular interest within real metagenomic dataset.v3.12 with default settings.Spread of antimicrobial resistance is an escalating problem and a threat to public health. Metagenomic sequencing provides an efficient methodology for detection and tracking of the antibiotic resistance genes (ARGs) in the environment samples. Ng et al.  exploredFirst, we used state-of-the-art AMRFinder tool  to identWe then used SPAligner to identify best alignments (with at least 90% amino-acid identity threshold) for all 4810 ARG sequences from the same database onto the graph.% of the query length, while AMRFinder prediction spans 90.7%. At the same time, 4 clusters contained only SPAligner’s alignments. tBLASTx [%).To check whether our sequence-to-graph alignments were able to capture additional AMR protein families as compared to the baseline contig analysis approach, protein sequences identified by AMRFinder and SPAligner were clustered by single-linkage clustering with a 90% similarity cut-off. Clusters where only SPAligner alignments are presented tend to be really far by identity from alignments found by AMRFinder and vice versa. Out of the resulting 89 clusters a single cluster consisted of only AMRFinder prediction. Further analysis showed that SPAligner also successfully identified corresponding protein sequence which spanned 89.7 tBLASTx  alignmen% identity.Figure blaKPC,blaCTX−M,blaSHV,blaTEM,blaIMP,blaVIM and blaOXA). While SPAligner was not able to produce alignments for two remaining gene families (blaNDM and blaCMY), in the original study their instances were estimated to be poorly covered compared to other familiesWe further relate our analysis to the original study  with resNote that in  authors In particular, our results suggest that SPAligner is an efficient solution for mapping third generation sequencing data and can also facilitate the identification of known genes in complex metagenomic datasets.Besides general improvements of the codebase, we are planning to migrate to more efficient libraries for searching anchor alignments , 24 and An important direction with respect to the nucleotide sequence alignment is improving the alignment of reads structurally different from the genome, represented by the assembly graph . This inWith respect to the amino acid sequence alignment our future goals include improving the sensitivity of the anchor alignment to allow for searching of the more diverged protein sequences, as well as development of strategies for identification of multiple closely-related gene sequences within the custom metagenomic assembly graphs with preserved variation.In this work we present SPAligner tool for aligning long diverged molecular sequences to assembly graphs and demonstrated its effectiveness for aligning both reads produced by third-generation sequencing technologies and protein sequences.SPAligner was benchmarked against the two sequence-to-graph aligners supporting long reads – vg and GraphAligner, and showed highly competitive results on various Pacbio and Oxford Nanopore datasets. At the same time being the only tool that produce alignment of amino acid sequences, SPAligner was successfully used to identify gene sequences, which were not fully recovered by metagenomic assembly.Project name: SPAlignerProject home page: http://cab.spbu.ru/software/spalignerOperating system(s): Platform independentProgramming language: C++Other requirements: g++ (version 5.3.1 or higher), cmake (version 2.8.12 or higher), zlib, libbz2License: GNU GPLv2Any restrictions to use by non-academics: NoneAdditional file 1 Supplementary file contains additional algorithms and datasets description (bmc_supplement.pdf).


The quantity of genomic data is expanding at an increasing rate. Tools for phylogenetic analysis which scale to the quantity of available data are required. To address this need, we present cognac, a user-friendly software package to rapidly generate concatenated gene alignments for phylogenetic analysis.Escherichia producing an alignment with 1353 genes, which was constructed in less than 17 h.We illustrate that cognac is able to rapidly identify phylogenetic marker genes using a data driven approach and efficiently generate concatenated gene alignments for very large genomic datasets. To benchmark our tool, we generated core gene alignments for eight unique genera of bacteria, including a dataset of over 11,000 genomes from the genus https://github.com/rdcrawford/cognac) with customizable parameters for adaptation to diverse applications.We demonstrate that cognac presents an efficient method for generating concatenated gene alignments for phylogenetic analysis. We have released cognac as an R package ( Phylogenetic analysis is becoming an increasingly integral aspect of biological research with applications in population genetics, molecular biology, structural biology, and epidemiology . GeneratDrosophila melanogaster Adh alleles in 1983 .–19.17–19The CD-HIT output file is then parsed and marker genes within the dataset are selected for inclusion in the alignment . By defaOnce the marker genes are identified, the individual gene alignments of the amino acid sequences for each gene are generated with MAFFT . Prior tFinally, the individual genes are concatenated into a single alignment to be used in downstream analysis. The alignment can then be input to commonly used programs for generating phylogenetic trees, such as RaXML or FastTree to create a maximiumium likelihood (ML) tree or approximate ML tree respectively. We have included the ability to directly generate a neighbor joining tree within the R package, to allow users to easily create a tree. cognac is well suited to generating alignments for extremely large datasets, and in these instances the computational workload for ML based methods may be prohibitive, and therefore creating a neighbor joining tree may present a good option. Neighbor joining trees are a distance based method which require a much less computational overhead relative to ML based methods. While ML methods are likely to produce better results, the increased speed may be desirable for situations where a high degree of precision is not required.Additionally, several optional outputs may be generated. We provide the functionality to generate a nucleotide alignment by mapping the corresponding codons to the amino acid alignment. We use gap placement in the amino acid alignment to position the corresponding codons from the nucleotide sequence of each gene, generating a codon aware nucleotide alignment. This has the added benefit of increasing the number of variant positions in the alignment, which are a product of synonymous substitutions. This is potentially useful for applications where maximizing variation is key. We also provide functionality for parsing the alignments including: eliminating gap positions, removing non-variant positions, partitioning the alignment into the individual gene alignments, removing low quality alignment positions, and creating distance matrices.Cognac was developed for R version 4.0.2. C +  + code was integrated via the Rcpp package (version 1.0.3) and was written using the C +  + 11 standard . MultithPluralibacter to 11,639 for Escherichia. Cognac was run requiring that at least 1000 genes which qualify as core genes included in the alignment and genomes missing greater than 1% of core genes were removed. This was a large data set with the potential for inaccurate species assignment or assemblies to be of poor quality, ensuring that these genomes do not limit the number of core genes included. Additionally, for our test runs we included the optional steps to generate the nucleotide alignment, create a pairwise single nucleotide variant distance matrix from the nucleotide alignment, and generate a neighbor joining tree.To demonstrate the utility of our tool, we created genus-level core gene alignments for 27,529 genomes from eight clinically relevant species of bacteria  to 6.07% (n = 600), with a median of 1.13% (n = 112). Pluralibacter had the fewest genomes and had the highest proportion of unique alleles, with a maximum value of 79.9% unique alleles (n = 19). This is a substantial decrease in the quantity of sequences that need to be aligned, enabling cognac to scale to very large datasets. Because organisms are related genealogically, sequences in the genome are not independent, sharing a common ancestor. Therefore adding additional genomes does not necessarily expand the number of unique alleles for any genes, and all of the sequences may be represented by a substantially reduced subset of the number of samples.To assess the magnitude of the reduction in the quantity of sequences that were aligned by selecting only the unique alleles of each gene, which is related to increased computational efficiency, we calculated the number of unique alleles per core gene as a fraction of the number of genomes Table , Fig. 3aPseudomonas. The published mutation rate for E. coli is 2.5 times higher than that of P. aeruginosa, suggesting that the differences in diversity may be a function of the mutation rate in these organisms [We then wanted to analyze the effect of converting the amino acid alignments to nucleotide alignments with respect to amplifying the sequence diversity. The raw number of pairwise substitutions was calculated between all genomes from both the amino acid alignment and nucleotide normalized to the alignment length Fig. . This grrganisms .Fig. 4MaBacteroidetes, illustrating the utility of this tool to create gene trees over large phylogenetic distances [We present a method to rapidly identify over 1000 marker genes and generate concatenated gene alignments that is capable of handling diverse bacterial genomes. Recently, we used this method to generate a core genome alignment and maximum likelihood tree for 52 genomes in the family istances . ImportaOur approach relies fundamentally on amino acid sequence comparisons. Translation provides a natural compression algorithm, which has several advantages. First, the amino acid sequences have a third of the length of the corresponding nucleotide sequence. Because the length of the input sequences is a major contributor to the computational complexity of MSA, this reduction in length significantly improves performance and scalability , 29. AddWhen performing computationally intensive procedures, amino acid sequences have many advantages; however, nucleotide alignments may be preferable for some applications. To address this, we provide the optional functionality to map the corresponding codons back to the amino acid alignment to return the nucleotide alignment. This can substantially increase the sequence variation contained in the alignment, which may be useful for applications where it is important to distinguish between closely related isolates. Additionally, we leverage the information contained in the amino acid sequences to produce a codon aware alignment. This allows for greater accuracy in placement of functional residues within the gene sequence and reduces the potential for misalignment of codons that may occur when aligning nucleotide sequences.An important feature of our algorithm is that it relies only on annotated whole genome assemblies, which provides several advantages over commonly used techniques of aligning raw sequencing reads to a reference genome. First, with respect to the size of the files, assemblies are a small fraction of the files containing the raw sequencing data. Second, cognac does not require selection of a reference genome. Different choices of reference genome have been shown to have large influences on the quality of the output alignment, potentially amplifying the frequency of mapping errors . AdditioOther assembly based methods for estimating the genomic distance between genomes use dimensionality reduction techniques such as k-mers or the MinHash algorithm to estimate the distance between genomes , 33. TheOur algorithm was able to scale to extremely large datasets. For a data set of 11,639 Escherichia genomes we were able to generate a neighbor joining tree from a nucleotide concatenated gene alignment in less than 17 h. This is accomplished by reducing the computational overhead of MSA in two ways: (1) translating the sequences, effectively reducing their length; and (2) reducing the number of sequences by only aligning unique alleles. For extremely large datasets, this results in an approximately 99% reduction in the number of sequences that need to be aligned, allowing for great improvements in scalability, and allows for application to extremely large datasets.In summary, cognac is a robust, rapid method for generating concatenated gene alignments that scales to extremely large datasets. Our method uses a data driven approach for identification of phylogenetic markers, which are efficiently aligned and concatenated into a single alignment for downstream phylogenetic analysis. The pipeline is open source and freely available as an R package. We expect our tool will be generally useful for many different types of analysis and will enable evolutionary insights in a broad range of applications.Project Name: cognachttps://github.com/rdcrawford/cognacProject Home page: Operating system: Tested on LinuxProgramming languages: R, C +  + Other requirements: R 3.6 or higher, CD-HIT (version 4.7), and MAFFT (v7.310).License: GNU General Public License, version 2Any restrictions to use by non-academics: noneAdditional file 1: Genomes used in this study. Associated meta-data of the genome sequences that were used in this manuscript.


In Overlap-Layout-Consensus (OLC) based de novo assembly, all reads must be compared with every other read to find overlaps. This makes the process rather slow and limits the practicality of using de novo assembly methods at a large scale in the field. Darwin is a fast and accurate read overlapper that can be used for de novo assembly of state-of-the-art third generation long DNA reads. Darwin is designed to be hardware-friendly and can be accelerated on specialized computer system hardware to achieve higher performance.This work accelerates Darwin on GPUs. Using real Pacbio data, our GPU implementation on Tesla K40 has shown a speedup of 109x vs 8 CPU threads of an Intel Xeon machine and 24x vs 64 threads of IBM Power8 machine. The GPU implementation supports both linear and affine gap, scoring model. The results show that the GPU implementation can achieve the same high speedup for different scoring schemes.https://github.com/Tongdongq/darwin-gpu.The GPU implementation proposed in this work shows significant improvement in performance compared to the CPU version, thereby making it accessible for utilization as a practical read overlapper in a DNA assembly pipeline. Furthermore, our GPU acceleration can also be used for performing fast Smith-Waterman alignment between long DNA reads. GPU hardware has become commonly available in the field today, making the proposed acceleration accessible to a larger public. The implementation is available at  DNA sequencing techniques used today produce short pieces of data  that represent parts of the sampled DNA, possibly containing some errors. The length and error rate of these reads depends on the sequencing technique used. DNA assembly tries to combine the reads into larger, more accurate DNA segments. For these DNA reads, graph-based assemblers are used for the assembly process, which comes in two flavors: Overlap-Layout-Consensus (OLC) and de Bruijn Graph (dBG).The OLC assemblers  first fiK-mers. A K-mer is a substring of a read having a length K. Each K-mer represents a directed edge between two vertices, where the source vertex represents the first K−1 bases of the K-mer, and the destination vertex the last K−1 bases of the K-mer. When a particular K−1 vertex does not exist, it is created, otherwise, the existing one is reused. The weights of the edges indicate how many times a particular K-mer is encountered. The next step is to find an Eulerian Path, which is a path that includes all edges of a graph exactly once. Examples of dBG assemblers are Velvet [In dBG based assemblers , each ree Velvet , ABySS [e Velvet  and SOAPe Velvet .K incorrect K-mers. Pair this with an often-used values of K above 50 and third generation sequencing error rate of about 15%, it is clear that the graph will contain a lot of incorrect edges. Therefore, OLC based assemblers are more suitable for state-of-the-art third generation long DNA reads produced by Pacbio and Oxford Nanopore sequencers.So called Next Generation Sequencing (NGS) techniques produce reads with lengths anywhere from 50 to 500 base pairs. They can be produced at high throughput but at the expense of a smaller read length. However, DNA can contain repeat regions, where a certain piece of DNA is repeated many times back-to-back, or a repeat could appear in many different places in the genome. Since these repeats can be longer than the produced short reads, this means the reads cannot be used to resolve these repeat regions. Third generation sequencing produces much longer reads, of up to 60K base pairs. Due to their length, these reads are more likely to contain a whole repeat region, which makes them suitable for accurately reconstructing the repeat regions. A major drawback of longer DNA reads is their higher error rate, ranging from 15-30%, depending on the exact sequencing technology. dBG based assembly is the more preferred approach for NGS reads, which are much shorter and have much lower error rates. However, de Bruijn Graphs are quite susceptible to sequencing errors, since one substituted base pair causes Darwin  is a reaThe paper shows the GPU implementation of the Darwin read overlapper used in the de novo assembly of long DNA reads.The paper shows that the GPU acceleration of Darwin is orders of magnitude faster than the multithreaded software version on both IBM Power8 and Intel Xeon machines using a real Pacbio dataset.The results in the paper show that the GPU implementation of Darwin can also be applied for accelerating Smith-Waterman alignment of long DNA reads.Heterogeneous systems with GPU accelerators have become easily accessible due to their widespread use. They have shown convincing speedups in many high performance computing applications. Therefore, GPU acceleration of various genome analysis algorithms has been the topic of many research works, like in , 10 and S. Let V and W be the two sequences to be aligned. Let V and W, respectively. |V| and |W| are the lengths of V and W. S=S=0 for Smith-Waterman (SW)  algorithS and D are the score and traceback matrices, respectively. match, mismatch and gap are numeric parameters. subt is equal to match if Vi=Wj, and is equal to mismatch otherwise. gap is the penalty for inserting a gap. m is the alignment score, which is initialized to zero, and mi,j is the corresponding position on V and W. The traceback matrix is required to compute the actual alignment. Traceback starts from the highest scoring cell and follows the arrows in D until a zero or a boundary of the matrix is encountered. Equations m there is no need to store the whole S matrix as all cells of the S matrix are computed using only the values of three other cells S, S and S. Hence, to compute the alignment score, storing only the values in the previous row and column are sufficient to compute m. The above equations are for calculating the alignment with a linear-gap scoring model. However, Darwin and our GPU implementation also support the more commonly used affine gap penalty model in which there are separate penalties for opening a gap (gapo) and extending a gap (gape).Here, K-mer made up of K consecutive bases of a read. Instead of performing Smith-Waterman on each read pair, only read pairs that have one or more common K-mers are aligned. A common K-mer between two or more reads is known as a “seed hit”. Darwin also uses the seed-and-extend approach, which reduces the amount of computation needed, without compromising the output by much. Other algorithms, like BLAST [A straightforward way of finding all overlaps is performing an alignment algorithm, such as Smith-Waterman, on every pair of reads. The number of alignments is quadratic with the number of reads, and the runtime of one alignment is quadratic with the lengths of the involved reads, making this method not feasible. Many heuristic algorithms have been developed to perform this alignment, for different lengths and error rates. Seed-and-extend is one heuristic, which dramatically reduces the amount of computation needed . A seed ke BLAST , also uske BLAST  show thaRead A and Read B. To compute the overlap, a seed hit is extended on both sides by aligning R_left with Q_left and R_right with Q_right. This speedups the computation by avoiding the computation of a large number of dynamic programming matrix cells , which finds seed hits, and GACT (Genome Alignment using Constant memory Traceback), which extends the seed hit by performing sequence alignment between the sequences on the left and right of the seed hit. Figure filtering stage. Darwin uses minimizers [K-mers extracted from all the reads to be overlapped. The position of a seed is stored in a minimizer table which records the location of the seed in a read along with the identifier of the read. The window size w is the most important parameter for building a minimizer table and must be smaller than the seed length (K). To obtain seed hits, ‘N’ K-mers of a read are used as seeds that are located in other reads using the minimizer table. Two reads are considered for alignment in the extension phase if they have at least h unique bases in common. The pair of reads passing this filter are aligned using a modified Smith-Waterman algorithm described below.D-SOFT is the seeding stage of Darwin, also known as the nimizers  as seedsThe seed-and-extend approach to find overlap between two reads is much faster than performing the complete Smith-Waterman alignment algorithm. However, the reduced dynamic programming matrices could still be quite large. State-of-the-art third generation sequencers produce reads having lengths in megabases and the dynamic programming matrix in the seed extension may have around 1 Tera cells to compute. For example, if the seed hit lies at the beginning of the two reads, i.e. near the top left corner in Fig. D is still an issue. One can apply the Hirschberg’s algorithm described in [tiles of size TxT. After computing a tile it computes the next tile, which overlaps the previous tile with at least O cells on both axes. For reasonable values for T and O, GACT has shown to produce the same result as normal Smith-Waterman [T=8 and O=3. The tiles are computed in the order T1,T2,T3 and T4. The example in Fig. R_right and Q_right sequences, respectively. Listing 1, shows the algorithm for left extension. Positions i_curr and j_curr are produced by D-SOFT. The start and end position of the current tile are stored in  and , respectively. The traceback path of the whole left extension is kept in tb_left. The function Align uses Smith-Waterman to compute traceback matrix D between subsequences R_tile and Q_tile. Once the traceback matrix is filled, traceback is performed starting from the bottom-right cell, except for the first tile, where traceback starts from the highest-scoring cell. The starting cells of the traceback are coloured yellow in Fig. Align returns the number of bases in R and Q aligned by this tile , the traceback arrows/pointers (tb) and the position of the highest-scoring cell . Align also limits i_off and j_off to at most T−O bases, to ensure the next tile overlaps by at least O bases on both R and Q. The green arrows shows the path taken by the traceback in a tile if there is no limit and the traceback is allowed to complete. The left extension finishes when it hits the end of R or Q, or when traceback cannot add any bases to the existing alignment. The memory needed for the traceback is T is chosen upfront. The whole alignment of the extension is contained in tb_left and is equivalent to the path traced by the red arrows in Fig. tb_left The right extension operates on the reverse of R and Q.Numerous efforts to accelerate Smith-Waterman have been made, both by using hardware like  and softribed in  to reducWaterman . Figure O) where |ReadA| and |ReadB| are the lengths of Read A and Read B, respectively. It is more suited for long reads than banded alignment [The performance of GACT is linear . Each SM contains several cores, or Streaming Processors (SP), these are the basic building blocks and perform the actual calculations. Each block is assigned to at most one SM. This block’s threads are then executed as warps, with 32 threads per warp. Each SM has multiple warp schedulers, so multiple warps can run in parallel on an SM. All threads in a warp must execute the same instruction, if a thread is the only to take a branch, the other threads must wait until the branch is completed, this is called global memory and a cache shared by all SM’s. Accesses to the global memory are also executed in parallel, this means that all threads try to read/write to the memory in parallel. If the addresses are next to each other, only one memory transaction is needed, since a transaction processes a whole memory line. This is known as coalescing. Non-coalesced memory accesses cause multiple memory transactions.GPUs have several different memory types and levels. It has its own DRAM known as the Data is copied from the main memory to the GPU global memory.The CPU launches the GPU kernel.The GPU executes the kernel.Results are copied from the GPU to the CPU memory.A general workflow using a GPU is:Multiple efforts to accelerate the DNA alignment algorithm on GPU have been made. MUMmerGPU  is one oAlign function in GACT (Listing 1) takes the most time, namely 99.9% for Pacbio reads. Therefore, we accelerated the Align function on GPU. We selected a tile size T of 320 as it gives optimal Smith-Waterman alignment scores [R-Q matrix  and aligning using GACT. Of those two, the t scores . With thTxT aligned per GPU-thread per GPU-invocation as shown in Fig. Align function for many different R,Q pairs are executed in parallel on the GPU. Figure R_left,Q_left) and . One tile  from each extension matrix is assigned to a GPU thread for alignment. All the tile alignments are computed in parallel on the GPU. There are enough seed hits, and hence sufficient extension matrices in the set of reads to fully utilize all the GPU resources. In the post-processing step, full alignment of the extension using tb_left (and tb_right for right extension) is constructed on the CPU. As described in the “R_tile and Q_tile takes a negligible amount of time on the CPU.It is possible to run the whole GACT kernel on the GPU, for both left and right extension. However, since it is not known how long the resulting alignment will be, and all GPU threads have to wait until all threads are done, this will cause lots of idle time. Instead, it is chosen to only have a single tile of size R_tile with Q_tile, we extended the local alignment kernel of GASAL (GPU Accelerated Sequence Alignment Library) library [Q_tile sequence is read multiple times. Hence, packing the sequence with 4 bits per base helps to keep it in the cache for faster access. It is clear from Eqs. m and D. Algorithm 1 shows the GPU implementation of the Align function. The pseudocode above Line 4 is for computing the position of maximum alignment score  and the traceback matrix D. Observe that the all the writes in D are coalesced to optimize the memory bandwidth and reduce the number of memory transactions. The pesudocode below Line 4 is for computing the traceback path tb. The GPU accelerated Darwin supports both linear as well as affine gap penalties. Algorithm 1 shows the alignment using the linear gap penalties. The algorithm with affine gap penalties has a similar layout and omitted here for brevity.To reduce the GPU memory accesses, the alignment is preceded by a packing step as indicated in the flow graph of Fig.  library . The tilT and O. Hence, the Darwin algorithm can also be applied for Smith-Waterman alignment between two long DNA sequences and our GPU implementation of Darwin can be used to accelerate Smith-Waterman alignment (with traceback) for long DNA sequences.Sequence alignment of long DNA sequence is a performance bottleneck in genome analysis algorithms. The results of Darwin alignment are same as for normal Smith-Waterman for reasonable values of We compared our GPU acceleration with the hand-optimized CPU version of Darwin  , N=800, T=320, O=120, K=14, h=21, w=1.We use Pacbio 54x Human sequencing data . The datAlign function on the GPU, everything else is executed on the CPU with multiple threads. Each CPU thread launches a batch of R_tile and Q_tile sequences to be aligned on the GPU. Since all these CPU threads share a single GPU, it is necessary to investigate how the choice of numbers of CPU threads, number of GPU blocks and the number of threads in a block affect the performance. Figure Since our GPU implementation accelerates only the y-axis of the figure represents a logarithmic scale due to the high speedup achieved by the GPU implementation. The CPU implementation is running with 64 threads, which gives nearly the fastest execution time. Two GPU times are reported: “GPU” and “GPU-coalesced”. “GPU” is the time without coalescing the accesses to the traceback matrix D. The figure shows that the GPU acceleration without coalescing is 2.4x faster than the CPU implementation. Coalescing further accelerates the GPU implementation by 10x to achieve an overall speedup of 24x.Figure y-axis. The CPU implementation is running with 8 threads, which gives nearly the fastest execution time. The non-coalesced GPU implementation achieves a speedup of 11.8x over the CPU. With coalesced memory accesses the speedup becomes 109x. Figures Figure match, mismatch, gapo and gape on the IBM machine. The CPU implementation is running with 64 threads. The table shows that the speedup nearly remains constant (20x-25x) regardless of the scoring scheme. Hence our GPU acceleration is equally effective for both linear and affine gap penalty scoring models.The above results were obtained with the linear-gap penalty model which is also the default setting in Darwin. However, Darwin and hence our GPU acceleration also support the affine gap model. Table https://github.com/Tongdongq/darwin-gpu.Read overlapping is an important step in OLC based de novo assemblers. Darwin is a fast and accurate read overlapper for assembly of long DNA reads. It is based on the seed-and-extend paradigm. It has two stages: 1) D-SOFT, to compute the seeds and 2) GACT, to extend the seed hits on both sides to compute the overlap between two reads. The ASIC implementation of Darwin is shown to be hundreds of times faster than software based read overlappers. GPUs are cost-effective and easily accessible processing units that are used to accelerate many high performance applications. In this paper, we have shown a GPU implementation of Darwin which accelerates the Smith-Waterman alignment with traceback computation used in the GACT stage. We pack the sequences on the GPU and compute the Smith-Waterman alignment matrix by dividing the matrix into 8x8 submatrices. This helps to reduce the GPU memory accesses. To further reduce the memory transactions, writing to the traceback matrix is coalesced. We tested our implementation against the hand-optimized CPU implementation of Darwin. The results show that using the real Pacbio dataset, our GPU implementation is 24x faster than 64 IBM Power8 threads and 109x faster than 8 Intel Xeon threads, regardless of the scoring scheme (linear or affine gap). The GPU implementation can also be used to accelerate generic Smith-Waterman alignment of long DNA sequences. The implementation is available at Project name: darwin-gpuProject home page:https://github.com/Tongdongq/darwin-gpuOperating system(s): LinuxProgramming language: C++, CUDAOther requirements: CUDA toolkit version 8 or higher.License: Apache 2.0Any restrictions to use by non-academics: Not applicable


As a key algorithm in bioinformatics, sequence alignment algorithm is widely used in sequence similarity analysis and genome sequence database search. Existing research focuses mainly on the specific steps of the algorithm or is for specific problems, lack of high-level abstract domain algorithm framework. Multiple sequence alignment algorithms are more complex, redundant, and difficult to understand, and it is not easy for users to select the appropriate algorithm; some computing errors may occur. Based on our constructed pairwise sequence alignment algorithm component library and the convenient software platform PAR, a few expansion domain components are developed for multiple sequence alignment application domain, and specific multiple sequence alignment algorithm can be designed, and its corresponding program, i.e., C++/Java/Python program, can be generated efficiently and thus enables the improvement of the development efficiency of complex algorithms, as well as accuracy of sequence alignment calculation. A star alignment algorithm is designed and generated to demonstrate the development process. Alignment is a common and important approach in biology study. In the research of bioinformatics , biologiSequence alignment is a technique for identifying regions of sequence similarity by arranging genome sequences to obtain the function, structure, or evolutionary relationship between the sequences to be aligned. With the implementation of the Human Genome Project, the development of sequencing technology has produced a large amount of raw sequence data about biological molecules. For example, Illumina HiSeqX Ten can generate approximately 3 billion 2 × 150 bp paired-end sequencing data within 3 days . ChallenAt present, most of the research on alignment algorithms focus on specific problems  or speciSequence alignment algorithms can be divided into pairwise alignment algorithms and multiplesequence alignment algorithms , 2020. Avia component assembly. The multilevel different models in the algorithm development process are unified under the PAR framework to effectively ensure the reliability of the resulting algorithm and improve the efficiency of algorithm development.Based on the previous work, this article adopts the formal method PAR  to descrThrough in-depth analysis of the field of multiple sequence alignment algorithms, based on the component library of the DPPSAA domain, some algorithm components have been improved and added, and a component library of multiple sequence alignment algorithms on top of the component library of the DPPSAA domain was established. Finally, an example, the successful assembly of the star alignment algorithm and the automatic generation of the C++ program, is shown.On the basis of the component library in the DPPSAA domain, this article has carried out the research on the algorithm design and program generation of multiple sequence alignment algorithms under the PAR framework.The PAR framework includes two parts: software formal method and convenient software development platform. The PAR method is composed of a generic algorithm design language Radl, a generic abstract programming language Apla, systematic methodology for algorithms and programming. It combines two high-efficiency techniques, i.e., partition and recursion used in special problems, covering a variety of known algorithm design techniques such as dynamic programming, greedy, divide and conquer, and so on. It can be used as a unified method of algorithm generation to avoid the difficulty of making choices among the existing algorithm design methods. The PAR platform is composed of Apla to C++/C#/Java/Python program generation systems and realizes the automatic generation of algorithmic programs such as sequential programs, parallel/concurrent programs, and database applications.Practice has proven that the productivity of complex algorithm program and database application software can be greatly improved by using the language, method, series algorithm, and program automatic generation tool provided by PAR. Many military departments, such as the National General Equipment Department, Beijing Military Region, and armored academy, have taken the lead in applying these achievements to the construction of China’s important military projects and have achieved remarkable military and economic benefits. The PAR framework has been appraised by the expert group of the Ministry of Science and Technology of China as “having the international advanced level, among which the theoretical framework of the correctness of the complex algorithm program has the international leading level.”In The experimental results show that the DPPSAA algorithm component library has a certain degree of practicability and has good expected results. It can be seen from the domain realization process that the domain feature model is a formal description at a higher level of abstraction, which not only makes the specific composition characteristics and dependencies of the algorithm clearly displayed, but also is very helpful for understanding the overall architecture of the algorithm. Moreover, the establishment of the feature interaction model makes it easier to specify the specific configuration knowledge required by the algorithm in the domain implementation process and then automatically assemble the components in the DPPSAA algorithm component library to design the desired algorithm, without paying too much attention to the details of algorithm implementation.Based on a large amount of practical work carried out in the early stage, combined with related methodologies such as PAR and domain engineering, the development of multisequence alignment algorithms can be divided into two parts: reuse-oriented development and application reuse development.For reuse-oriented development, it can be divided into the following steps:Analyze the algorithm family in the field of multiple sequence alignment, and establish the domain model.Formally describe the component function specifications.Use the PAR method to design abstract Apla algorithm components, use the PAR platform to obtain highly reliable executable language-level components, and expand the PAR platform component library in a self-expanding manner.The process of designing a specific problem-solving algorithm and generating a program is a development process of application reuse:Analyze and  characterize the specific problem to be solved.Determine the algorithm components required for assembly.The Apla abstract language is used to describe the assembly process, and the executable program corresponding to the specific algorithm is automatically generated through the PAR platform.The introduction of the PAR framework reduces the operational difficulty of algorithm component assembly and improves the automation of algorithm component assembly.The star alignment algorithm , 2015 isFor example, for the sequence s1 = CGCT, s2 = GCGT, s3 = CCTG, the pairwise alignment results of the sequences s1, s2, and s3 are shown in The star alignment algorithm adds the alignment scores of each sequence to other sequences and selects the sequence with the largest score as the central sequence. Therefore, in this case, s1 is selected as the center sequence, and the best alignment result and the final merge result with S2 and S3 are shown in Using feature modeling knowledge and performing process analysis on star alignment algorithms, we will know that multisequence alignment is mainly used as the core service of star alignment algorithms in the star alignment process. The multiple sequence alignment service is mainly based on the pairwise sequence alignment, by selecting the optimal pairwise sequence alignment result as the central sequence, and then continuously adding the suboptimal sequence to the alignment until the final multisequence alignment result is obtained. After analyzing the execution process of the star alignment algorithm, the multisequence alignment operation service mainly consists of the following features (the component name of the corresponding feature in parentheses): sequence legality check (msa_check), distance matrix (dist_Matrix), pairwise alignment manipulation , center sequence selection (msa_center), remember alignment space (rmb_space), multisequence alignment result output (msa_op_result), and so on. Among them, sequence legality check, pairwise alignment manipulation, distance matrix, and center sequence selection are mandatory features in the star alignment algorithm, and the multisequence alignment result output feature mainly depends on the remember alignment space feature; that is, when the assembly algorithm contains a multisequence alignment result output component, it will include and implement the remember alignment space component by default.Taking DPPSAA as the basis of sequence alignment, generic programming language Apla is used to abstractly represent the star alignment algorithm, which can realize star alignment algorithm by standardized assembly. Here, we expand on the basis of the component library in the DPPSAA domain, so that the component library in this domain can be used to assemble and implement the star alignment algorithm. We perform Apla representation of the extended component as follows:Sequence legality checkmsa_check is an extension based on the check component in the DPPSAA field that can be used to detect multiple sequences. The Apla process statement is:procedure msa_check(String str);where str represents the base string array for multiple sequence alignment.Distance matrixdist_Matrix means that all pairwise alignment scores participating in multisequence alignments are returned as distance matrix elements, and the component uses pairwise sequence alignment operations as its generic parameters. The prototype of the Apla function is as follows:function dist_Matrix ; op_mode ); result:boolean; eM: elemMatrix; s:String; t:String))):integer.Center sequence selectionThe msa_center component is an important part of the components library of multiple sequence alignment algorithm. This component can be used to select the best alignment in all pairwise alignments; take the best alignment sequence in the alignment as the center sequence, and then iteratively add the remaining sequences to obtain the best multiple sequence alignment results. The function prototype is as follows:function msa_center(dist: integer):integer;The array dist represents the array returned by the distance matrix, and the component returns the index value of the center sequence.Remember alignment spaceIn the star alignment algorithm, the algorithm follows the rule of “leave blank once, leave blank everywhere” when adding subsequent sequences to the alignment process. Therefore, the role of the rmb_space component is to remember the space inserted during each sequence alignment. The function prototype is as follows:function rmb_space: integer;Multisequence alignment result outputThis component inserts the space index value obtained in (4) into the sequence to output the final multisequence alignment result. This component can be implemented with the following Apla process:procedure msa_op_result(space:integer);Using the Apla-C++ conversion system, the aforementioned component library is converted into the corresponding C++ component through the combination of automatic conversion and manual conversion, which can be used to generate the star alignment algorithm program and conduct test analysis to obtain experimental results. This section shows only the three main components: dist_Matrix component, msa_center component, and rmb_space component.As the star alignment algorithm requires the pairwise sequence alignment manipulation, and the alignment score result value is used as the element of the distance matrix, the dist_ matrix component needs to use the sequence alignment manipulation in DPPSAA as its generic parameter to obtain the score value of the pairwise alignment of all sequences. In the process of converting the Apla program to the C++ program, it is first necessary to assemble the components in DPPSAA to form a pairwise sequence alignment algorithm and design the pairwise sequence alignment algorithm as an independent function as the function pointer parameter of the distance matrix component, which reduces the dependency between the pairwise sequence alignment algorithm and the distance matrix. Here, we set the pairwise sequence alignment algorithm to NW algorithm and return the pairwise sequence alignment scores. The C++ code is as follows:class MsaNW{//NW algorithm assemblypublic:int Msa_NW{matrix.apply_memory;matrix.Memory_Score_of_Matrix;dp_mode dp_NW;dp_NW.align_and_score;return matrix.the_Last_element_score;}}The C++ program obtained by transforming the dis_matrix component is as follows:class dist_Matrix{int** dist; //distance matrixint* row_sum;//sum of rowint seqs_num;//number of sequencespublic:void Dist_Matrix(int(MsaNW::*Msa_NW),std:string* seqs, Score_matrix_mani** matrix)//final score {...}void sum_row{...}}Among them, the class dist_Matrix contains three attributes; dist represents the distance matrix, for example, the element dist[0][1] = 1, which represents the pairwise sequence alignment score value of the first sequence, and the second sequence is 1; row_sum represents the sum of the scores of each sequence after pairwise alignment with other sequences, that is, the row sum of dist; seqs_num represents the number of sequences participating in the alignment. In the method Dist_Matrix, seqs represents a string pointer to all sequences participating in the alignment, matrix represents a two-dimensional matrix composed of score matrix objects obtained after pairwise alignment of all sequences, and the method sum_row is used for calculation row_sum value.At the same time, msa_center component is transformed into a class msa_center. The attribute center_index of this class records the index of the center sequence. The method Msa_center is used to calculate the center_index, and the distance matrix object is used as its parameter. The C++ representation of this component is as follows:class msa_center{private:int center_index; //record center sequence indexpublic:int Msa_center(dist_Matrix distM){...}}rmb_space component is also converted to the class rmb_space in C++, where the attribute Msa_space_loc represents the gap position inserted when the center sequence is aligned with other sequences, and the attribute msa_ret_str means the sequence alignment result after inserting gaps in all sequences according to the “leave blank once, leave blank this time” rule. The C++ representation is as follows:class rmb_space{int** Msa_space_loc;//the position of the space when each sequence is aligned with the center sequencestd::string* msa_ret_str;//MAS alignment resultpublic:void Msa_add_space{..}}Through the above conversion, we can obtain the complete component library to assemble and generate the star alignment algorithm. The process of assembling and generating the star alignment algorithm is listed below, where Star represents the parameter matrix of the method Dist_Matrix used to construct the distance matrix in the star alignment algorithm, that is, the score matrix operation object in the NW algorithm.int main{std::string s[3]={"CGCT", "CCTG","GCGT"};int seq_num = sizeof(s)/sizeof(s[0]);Msa_check.check_dna;Star star;dist_Matrix distM(seq_num);distM.Dist_Matrix;distM.sum_row;msa_center mc;mc.Msa_center_seq(distM);RmbSpace rs;rs.Msa_add_space;Msa_print_align.msa_print_align;}Escherichia coli DNA data with a length of approximately 200 characters from NCBI’s Genbank gene database website for experimental testing. The basic configuration of the machine is 3.40 GHz, Intel Core i7 processor, 8 GB RAM, and Windows 7 operating system. The result of the experiment is shown in We downloaded four The running kr alignment algorithm generated by the assembly can perform multisequence alignment better and has obtained results similar to the original star alignment algorithm, which verifies the practicability of the star alignment algorithm generated by the assembly.Sequence alignment algorithms are widely used. Because of the complexity of multiple sequence alignment problems and the diversity of algorithm design strategies, it is difficult to guarantee the development efficiency and reliability of multiple sequence alignment algorithm programs.This article takes the problem of multiple sequence alignment as a special field and works on the algorithm development and program generation under PAR framework. Through the analysis of problem characteristics, the generality of the domain algorithm family is extracted, the features are described, and abstract algorithm components are designed. Based on the research of the pairwise sequence alignment algorithm family, the method and platform under the PAR framework are used to assemble the specific multisequence alignment algorithms and generate programs automatically. As a case study, assembly of the star alignment algorithm is given to demonstrate the generation process of the specific algorithm program, which further proves the practicability of the component library in the related field and the reliability and efficiency of the algorithm generation under the PAR framework.https://www.ncbi.nlm.nih.gov/genbank/.The datasets presented in this study can be found in online repositories. The names of the repository/repositories and accession number(s) can be found at: HpS did the codes work and the experiments. HhS instructed the whole research work and revised the paper. SX proofread the full text. All authors read and approved the final manuscript and are agree to be accountable for all aspects of the work.The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.