A k-tuple common substring (abbr. k-CSS) is a common subsequence of two or more strings including at most k common substrings. In this paper, we present an algorithm for finding a longest k-CSS of two strings of lengths m and n in O(kmn) time and O(m + kn) space. Using this algorithm as a subroutine, a longest k-CSS of two circular strings is retrieved in O(kmn2) time and O(m + kn) space. Extending the idea in this algorithm, a longest common subsequence with the minimum number of common substrings of two strings is retrieved in O(mn) time and O(m + n) space.
Reciprocal translocation is an important genome rearrangement operation that involves swapping non-empty terminal segments between two chromosomes. Given two multi-chromosomal genomes, A and B, the problem of sorting by reciprocal translocations aims to find the shortest sequence of reciprocal translocations that can transform A into B. This problem can be solved in polynomial time, and, as far as we know, the best time complexity is O(n^3/2√(log n)) . In this paper, by leveraging the results on the fully dynamic graph connectivity problem, we improve the time complexity to O(n(N^2log n+log ^2n)/loglog n) , where n represents the number of genes and N represents the number of chromosomes. In real evolutionary scenarios, the number of chromosomes involved in rearrangement events is typically small. Consequently, when N is treated as a constant or a polynomial function of log n , our algorithm achieves a time complexity better than O(n^3/2√(log n)) .
A (k]-tuple common substring is a sequence of at most k common substrings of two or more strings. Motivated by computational biology applications, we propose to find between two strings a longest (k]-CSS(l1, l2), that is a longest (k]-tuple common substring in which each substring is of length in [l1, l2]. We present a sliding window based dynamic programming algorithm to find a longest (k]- CSS(l1, l2) of two strings whose lengths are n1 and n2 in O(kn1n2) time and space, the same complexity as without the length bounds l1 and l2. We present a divide-and-conquer algorithm to find a longest (k]-CSS(l1, l2) in O(kn1n2) time and O(n1 + kl2n2) space, allowing much longer strings to be input for solution retrieval. We also present an algorithm to find a longest (2]-CSS(l1, l2) of two strings of total length n in O(nlog2 n) time.
Double cut and join (abbreviated as DCJ) is a popular rearrangement operation, and the problem of sorting permutations by DCJs can be used to approximately estimate the evolutionary distance between two genomes. Although this problem has been widely studied, most of the existing work on sorting permutations by DCJs didn't consider repeats around the breakpoints. Recent studies revealed that the breakpoints of rearrangement events are closely related to repetitive segments. To better mimic the rearrangement operations between genomes in reality, here we present a new rearrangement model called flanked DCJ, which requires the two breakpoints of a DCJ to be cut at the same relative side of a pair of repeats. We first investigate the decision problem of sorting signed permutations by flanked DCJs, which asks to check if a genome can be transformed into another by a series of flanked DCJs, and give an O(n(2)) time decision algorithm. Then, for the optimization version of sorting signed permutations by the minimum flanked DCJs, we show that it can be solved in O(n(2)) when each repeat appears at most three times, and prove the NP-hardness of the general case.
A (k]-tuple common substring (abbr. (k]-CSS) is a common subsequence of multiple given strings including at most k common substrings. This pattern of two strings is retrievable in quadratic time and linear space and even more, in subquadratic time and space if k is a constant. Motivated by computational biology applications in need of a (k]-CSS with substantially many consecutive matches, we propose to find a longest (k]-CSS of two strings whose substrings are of length at least l, of which the complexity is indefinite. We present a dynamic programming algorithm to find such a longest (k]CSS of two strings whose lengths are n(1) and n(2) in O(kn(1)n(2)) time and space, the same complexity as without the length bound l. Through rolling array based dynamic programming to get the longest (k]-CSS length in advance, we present a divide-and-conquer algorithm to find such a longest (k]-CSS in O(kn(1)n(2)) time and O(n(1) + kln(2)) space, which is intended to work for two much longer given strings. We also present an algorithm to find such a longest (2]-CSS in O(nlog(2)n) time where n is the total length of input strings.
In this paper, we propose two string problems, and study algorithms and complexity of various versions for those problems. Let S={s_1, s_2, … , s_m} be a set of m strings. A common substring of S is a substring appearing in every string in S. Given a set of m strings S={s_1, s_2, … , s_m} and a positive integer k, we want to find a set C of k common substrings of S such that the k common substrings in C appear in the same order and have no overlap among the m input strings in S, and the total length of the k common substring in C is maximized. This problem is referred to as the longest total length of k common substrings from m input strings (LCSS(k, m) for short). The other problem we study here is called the longest total length of a set of common substrings with length more than l from m input string (LSCSS(l, m) for short). Given a set of m strings S={s_1, s_2, … , s_m} and a positive integer l, for LSCSS(l, m), we want to find a set of common substrings of S, each is of length more than l, such that the total length of all the common substrings is maximized. We show that both problems are NP-hard when k and m are variables. We propose dynamic programming algorithms with time complexity O(k n_1n_2) and O(n_1n_2) to solve LCSS(k, 2) and LSCSS(l, 2), respectively, where n_1 and n_2 are the lengths of the two input strings. We then design an algorithm for LSCSS(l, m) when every length >l common substring appears once in each of the m-1 input strings. The running time is O(n^2_1m) , where n_1 is the length of the input string with no restriction on length >l common substrings. Finally, we propose a fixed parameter algorithm for LSCSS(l, m), where each length > l common substring appears m -1 + c times among the m- 1 input strings (other than s_1 ). In other words, each length > l common substring may repeatedly appear at most c times among the m-1 input strings {s_2, s_3, … , s_m} . The running time of the proposed algorithm is O((n_12^c)^2m) , where n_1 is the input string with no restriction on repeats. The LSCSS(l, m) is proposed to handle whole chromosome sequence alignment for different strains of the same species, where more than 98% of letters in core regions are identical.
The analysis of genomes evolving by inversions has led to a famous problem of sorting a permutation by reversals. On the other hand, during the evolution of many genomes, the involvement of repeated segments is unavoidable, which has inspired new interests on the model of sorting by signed/unsigned symmetric reversals. Recently, the signed version of this problem has been investigated. In this paper, we focus on the problem of Sorting by Unsigned Symmetric Reversals, which requires a series of unsigned symmetric reversals to transform a chromosome.A into chromosome.B, where chromosomes are represented by a sequence of unsigned symbols (possibly with repetitions). Our main result is on the special case where each symbol appears at most twice in a chromosome. We give a sufficient and necessary condition to answer the decision problem, and design an algorithm with approximation factor 1.5 for the corresponding optimization problem, which runs in O(n(4)) time.
Computing the genome rearrangement distances between two genomes has been classical combinatorial optimization problems since the 1990s, where reversals, translocations and double cut and joins (dcjs for short) are the most popular genome rearrangement operations. All the three distances can be computed in polynomial time for signed genomes but are NP-hard when the genomes are unsigned. Over the past three decades, people devoted to approximation algorithms for the three problems. So far as we know, the best approximation ratio is 1.375 for both reversal and translocation, and 1.408 for dcj. In this paper, we first design a proper approximation algorithm for the maximum independent set problem on graphs with a maximum degree of 3, by use of which, we devise an approximation algorithm for the unsigned dcj problem, improving the approximation ratio to 4173/3035 (≈ 1.37496 ) + ε , and running in O(n^3+4log4+5log5/ε) , where n represents the length of the genomes and ε is an arbitrary small constant. Joined with the pre-processing method for the unsigned reversal problem and unsigned translocation problem respectively in [5, 16], our algorithm can also be extended to solve the unsigned reversal problem and the unsigned translocation problem, also guaranteeing the same approximation ratio of 4173/3035 , beating the long-lasting best ratio of 1.375 since 2002.
A (k]-tuple common substring (abbr. (k]-CSS) is a sequence of at most k common substrings of two or more strings. A longest (k]-CSS of two strings is known retrievable in quadratic time and linear space and even more, in subquadratic time and space if k is a constant. Motivated by computational biology applications in need of a (k]-CSS with designated number of consecutively matching letters, we propose to find a longest (k]-CSS of two strings whose substrings are of length within [l(1), l(2)]. We present a sliding window based dynamic programming algorithm to find such a longest (k]-CSS of two strings whose lengths are n(1) and n(2) in O(kn(1)n(2)) time and space, the same complexity as without the length bounds l(1) and l(2). Through rolling array based dynamic programming to get the longest (k]-CSS length in advance, we present a divide-and-conquer algorithm to find such a longest (k]-CSS in O(kn(1)n(2)) time and O(n(1) + kl(2)n(2)) space, which is intended to work for two much longer given strings. We also present an algorithm to find such a longest (2]-CSS in O(n log(2) n) time where n is the total length of input strings.
It is widely recognized that structural variation represents a significant source of genetic variation. As a well-known type of structural variation, reversion is studied drastically by both biologists and computer scientists. Recently, scientists have found that repetitive sequences always appear at the ends of the segment where the reversal occurred on the chromosome, which has inspired new interests in models for sorting unsigned chromosomes by symmetric reversals (abbreviated MUSR). The problem of MUSR asks for a minimum number of unsigned symmetric reversals to transform a chromosome S into another chromosome T, and requires symmetric reversals to be performed on the segment flanked by the same letter. In this paper, we show that MUSR is NP-hard through an intricate reduction from the MAX-(3,B2)-SAT problem. Moreover, we provide an innovative depiction of the optimal solution and then develop an improved approximation algorithm that ensures the approximation factor of 2 ln3+7/8 (approximately 1.15) and a time complexity of O(n(2)).
Comparing genomes based on gene order is a classical combinatorial optimization problem in computational biology, which seeks the minimum number of genome rearrangement operations required to transform one genome into another. The problem of sorting genomes by translocations has been extensively studied over the past few decades. Computing the translocation distance is NP-hard when the input genomes are unsigned, posing significant computational challenges. A widely adopted approach to approximating this problem involves decomposing the breakpoint graph into proper alternating cycles. However, this decomposition step becomes a bottleneck in calculating the corresponding rearrangement distances, hindering the ability to achieve approximation factors better than 1.375 in polynomial time. In this paper, we propose a novel FPT (fixed-parameter tractable) approximation algorithm for the problem of sorting genomes by translocations, improving the approximation factor to 4/3 + ε , thereby surpassing the long-standing best ratio of 1.375, which has held since 2016 [12]. Our algorithm employs a new randomized method for decomposing the breakpoint graph, which succeeds with high probability, 1 - 1/e^O(n) , as guaranteed by the Chernoff Bound. The time complexity of the algorithm is O(2^d^*· n^O(1/ϵ)) , where n represents the length of each genome and d^* denotes the optimal translocation distance.
Viruses are of great diversity and variability and impact human society deeply and broadly. Advances in sequencing technologies enable easier detection and analysis of environmental samples, aiding clinical and virology research. Efficient viral classification remains a key challenge, with ongoing methodological improvements pursuing more reliable outputs. Time-consuming alignment-based methods are becoming obsolete with the explosion of data, while alignment-free especially machine learning methods take the lead. Along this line, we introduce VirB, a hierarchical classification method based on the latest BERT model ModernBERT, to classify the viral contigs or genomes at the order and family level. Integration of BPE and Transformer architecture with optimized embedding and attention strategies enables our model to process ultra-long sequences effectively, demonstrating superior performance over all compared methods in test cases. Experiments conducted with diverse real-world datasets confirmed the generalization power of the proposed model by presenting remarkable performance in predicting unseen sequences and sequences with noises.
Transposition is a well-known genome rearrangement event that switches two consecutive sub-strings on a string. Since a transposition makes changes to a string, the genome here is just a string. The problem of transforming one string into the other by a sequence of transposition operations has attracted a lot of attention. However, it has been reported that genome rearrangement events are often associated with repeated sub-strings. In particular, a transposition operation is most likely associated with three identical repeated sub-strings. A transposition operation on two consecutive sub-strings $x$ and $y$ switches the two sub-strings and transforms the whole string $zxyw$ into the other string $zyxw$, where $z$ and $w$ represents the two sub-strings on the left and right of $xy$, respectively. When repeated sub-strings are considered, the two consecutive sub-strings $x$ and $y$ are flanked with three identical repeated sub-strings $R$ and the flanked transposition transforms the whole string $zRxRyRw$ into $zRyRxRw$. For a flanked transposition operation, the neighbors of $x$ and $y$ remain the same before and after the transposition. In this paper, we investigate the problem of transforming one string into the other by a number of flanked transpositions. First, we present a necessary and sufficient condition to determine if a string can be transformed into the other by a sequence of flanked transpositions. We then design a decision algorithm with running time $\mathcal {O}(n)$ to test if such a condition holds. We also show that transforming one string into the other by using minimum number of flanked transpositions is NP-hard. A string $\pi$ of $n$ letters is simple if the $n-1$ consecutive pairs of letters are distinct. We present an $\mathcal {O}(n^{2})$ approximation algorithm with ratio 2 for the optimization version of the special case, where both input strings are simple.
Rearrangement sorting problems impact profoundly in measuring genome similarities and tracing historic scenarios of species. However, recent studies on genome rearrangement mechanisms disclosed a statistically significant evidence, repeats are situated at the ends of rearrangement relevant segments and stay unchanged before and after rearrangements.To reflect the principle behind this evidence, we propose flanked block-interchange, an operation on strings that exchanges two substrings flanked by identical left and right symbols in a string. The flanked block-interchange distance problem is formulated as finding a shortest sequence of flanked block-interchanges to transform a string into the other. We propose a sufficient and necessary condition for deciding whether two strings can be transformed into each other by flanked block-interchanges. This condition is linear time verifiable. Under this condition for two strings, we present a $\text{4}\,k$4k-approximation algorithm for the flanked block-interchange distance problem where each symbol occurs at most $k$k times in a string and a polynomial algorithm for this problem where each symbol occurs at most twice in a string. We show that the problem of flanked block-interchange distance is NP-hard at last.
This paper investigates two combinatorial problems from RNA secondary structure prediction with arbitrary pseudoknots. Given a RNA sequence and a set of base pairs, two parallel and adjacent base pairs constitute a stacking. The Maximum Stacking Base Pairs problem (MSBP) aims at finding a maximum number of based pairs, all of which form stackings, while the Maximum Base Pair Stackings problem (MBPS) is to find a maximum number of stackings. Both problems are NP-hard. We present two new approximation algorithms for the two problems by local search methods. For MSBP, the approximation factor is improved from 52 to 73; as for the MBPS, the approximation factor is improved from 83 to 52.
We focus on a new problem that is formulated to find a longest k-tuple of common sub-strings (abbr. k-CSSs) of two or more strings. We present a suffix tree based algorithm for this problem, which can find a longest k-CSS of m strings in $O(kmn^{k})$ time and $O(kmn)$ space where n is the length sum of the m strings. This algorithm can be used to approximate the longest k-CSS problem to a performance ratio $\frac{1}{\epsilon}$ in $O(kmn^{\lceil\epsilon k\rceil})$ time for $\epsilon\in(0,1]$. Since the algorithm has the space complexity in linear order of n, it will show advantage in comparing particularly long strings. This algorithm proves that the problem that asks to find a longest gapped pattern of non-constant number of strings is polynomial time solvable if the gap number is restricted constant, although the problem without any restriction on the gap number was proved NP-Hard. Using a C++ tool that is reliant on the algorithm, we performed experiments of finding longest 2-CSSs, 3-CSSs and 5-CSSs of 2 ~ 14 COVID-19 S-proteins. Under the help of longest 2-CSSs and 3-CSSs of COVID-19 S-proteins, we identified the mutation sites in the S-proteins of two COVID-19 variants Delta and Omicron. The algorithm based tool is available for downloading at https://github.com/lytt0/k-CSS.
Order-consistent and number-limited common substrings of multiple strings are in strong demand for conserved region recognition and structural similarity identification in bio-sequences. To characterize order-consistent and number-limited common substrings, we propose (k]-tuple common substring (abbr. (k]-CSS), a sequence of no more than k non-overlapping common substrings of two or more strings. This paper is devoted to designing algorithms to solve a problem called LCSS(m,k) that asks to find a longest (k]-CSS of m ≥ 2 strings. For LCSS(m,k), we present a suffix tree based algorithm to find a longest (k]-CSS of m strings in O(mn^k) time and O(kmn) space where n is the length sum of m given strings. This algorithm can be used to approximate LCSS(m,k) to achieve a performance 1/ε for ε∈(0,1] in O(mn^⌈εk⌉ ) time. For LCSS(2,k), we present a dynamic programming algorithm to find a longest (k]-CSS of two strings in O(kn_1 n_2) time and space where n_1 and n_2 are the lengths of the given strings. To break through the quadratic space limitation, we present to improve the algorithm for LCSS(2,k) to run in O(kn_1 n_2) time and O(n_1+kn_2) space.
The collision cross section (CCS) is a crucial parameter that reflects a molecule’s size and shape, offering valuable insights into its structural conformation. Accurate CCS predictions can significantly enhance the identification and separation of compounds in mass spectrometry, proving particularly useful in fields such as proteomics and drug discovery. The CCS of a peptide is a reproducible physicochemical property influenced by its mass, charge, and gas-phase structure. Despite its importance, predicting CCS using both sequence data and physical attributes remains challenging. To address this, we introduce PEP2CCS, a deep learning model designed to predict CCS. This model integrates enhanced physical features of peptides, thereby improving the accuracy of CCS predictions. The analysis revealed that PEP2CCS had a Median Absolute Percent Error of 1.139% in predicting the synthetic proteomic peptide cross-section, which is 18.6% lower than state-of-the-art method. Furthermore, the results suggest that the integration of the charge state into the model is a significant contributor to the accurate prediction of CCS values. Code and pre-trained model are released at https://github.com/xfcui/PEP2CCS.
Repetitive sequences are prevalent across all domains of life and play intricate roles in genetic regulation, stability, and evolution. To better understand the functions of these repetitive sequences, various methods have been developed for assembling short tandem repeats such as microsatellites, minisatellites, and satellites. However, existing assembly methods overlook a special case of ultra-long tandem repeat, where the length of a single repeat unit exceeds tens of thousands of base pairs. It is challenging for existing assembly methods to accurately reconstruct these repeatsHere we present ULTR-asm, an assembler specifically designed to tackle ultra-long tandem repeats. ULTR-asm builds on the overlap-layout-consensus (OLC) paradigm, with an additional polishing optimization step. Evaluations on simulated data demonstrated that ULTR-asm outperforms state-of-the-art assemblers, enhancing genome integrity and accuracy, and contributing to the assembly of more complete genomes.
The significance of viruses in various ecosystems necessitates a comprehensive examination of viral genomes across diverse datasets, underscoring the growing importance of automated and reliable identification of viruses in metagenomic data. However, the complex composition and large data volumes pose a crucial challenge to taxonomic analysis, particularly in deep hierarchies. In this paper, we propose a new hierarchical classification model, FOKHic, which allows hierarchical classification of viruses from kingdom to family. By combining k-mer frequency-based coding, principal component analysis, and attention fusion, FOKHic is capable of accomplishing rapid classification of metagenomic viral sequences. Benchmarked on the ICTV virus database, FOKHic exhibits overwhelming performance in terms of accuracy, recall, precision, and F1-score compared to currently popular virus-oriented tools. FOKHic is available at https://github.com/xiaozhangzhang123/FOKHic.
Jiong Guo (郭炅)合作论文数School of Computer Science and Technology, Shandong University6