Mining Negative Sequential Patterns to Improve Viral Genomic Feature Representation and Classification Wenxi Zhua , Wensheng Ganb,∗ and Zhenlian Qic a College of Information Science and Technology, Jinan University, Guangzhou 510632, China b College of Cyber Security, Jinan University, Guangzhou 510632, China
arXiv:2604.25968v1 [cs.DB] 28 Apr 2026
c Guangdong Eco-Engineering Polytechnic, Guangzhou 510520, China
ARTICLE INFO
ABSTRACT
Keywords: Viral Genomes Pattern mining Machine learning classifiers Negative sequential patterns Classification
Viruses represent the most abundant biological entities on Earth and play a pivotal role in microbial ecosystems, yet, as prominent human pathogens, they are closely linked to human morbidity and mortality. Accurate identification of viral sequences from viral genome sequences is therefore essential, but existing genome-based classification models that largely relying on composition- or frequencybased subsequence features often suffer from limited interpretability and reduced accuracy, particularly on complex or imbalanced datasets. To address these limitations, we propose GeneNSPCla (Genomic Negative Sequential Pattern-based Classification), a novel viral classification framework based on Negative Sequential Patterns (NSPs) that extracts discriminative absence-based features from nucleotide sequences of RNA viral genomes. By transforming these NSPs into numerical feature vectors and integrating them into multiple supervised classifiers, GeneNSPCla effectively captures both presence and absence signals in viral sequences. Furthermore, we propose a negative pattern mining algorithm adapted for processing genomic data: GONPM+, which can discover longer and more biologically meaningful negative sequential patterns. The experimental results demonstrate that the average accuracy of GONPM+ in 8 classifiers has improved by 10.03% compared to the original negative pattern mining algorithm and by 24.75% compared to the positive pattern mining algorithm. These findings highlight the effectiveness of incorporating absence-based sequential information, providing a new and complementary perspective for viral genome analysis and classification. The source code and datasets are available at https://github.com/zhuwenxi317/GeneNSPCla.
1. Introduction Viruses, as the most abundant and diverse biological entities on Earth [18], parasitize various living organisms, exerting profound impacts on ecosystem balance, biological evolution, and human health. On the one hand, some viruses participate in the material cycling of marine plankton and promote horizontal gene transfer in hosts, thereby serving as a crucial driver of ecological evolution [60]. On the other hand, virulent viruses (e.g., SARS-CoV-2, influenza viruses, and Ebola viruses) can trigger zoonotic diseases; they rapidly generate new strains through genomic mutation and recombination, posing a persistent threat to global public health security [62]. With the rapid advancement of biological sequencing technologies, massive amounts of viral genome data have been continuously emerging, such as GenBank [55], and GISAID [10], which have significantly promoted the progress of virology research. In the field of virology, virus classification [29] is a fundamental task. Accurate virus classification can provide key information for disease diagnosis, epidemic prevention and control, vaccine development, and ecosystem research. Most genomic tools employed to build taxonomies for living organisms rely on alignment-based approaches. Notable examples include BLAST [7] and FASTA [44], as well as their enhanced or expanded variants, which are widely recognized ∗ Corresponding author
[email protected] (W. Zhu); [email protected] (W. Gan); [email protected] (Z. Qi) ORCID (s):
Wenxi Zhu et al.: Preprint submitted to Elsevier
and frequently used as reference standards in genomic sequence analysis [45]. However, alignment-based approaches also have several drawbacks [30]. For instance, these methods rely on the sequence collinearity assumption, struggling to handle nonlinear chimeric genomic fragments resulting from high mutation rates, recombination, horizontal gene transfer, and other factors. Second, these models exhibit high computational complexity—algorithms like dynamic programming incur substantial time and memory costs, making them unsuitable with NGS big data [75]. While several alignment-free tools have emerged, such as Kallisto [9] and Kraken 2 [64], they can handle moderately similar sequences but often falter when applied to highly mutable viruses (e.g., HIV and influenza viruses), as they fail to account for the frequent latent patterns embedded within the sequences [63]. Against this backdrop, the integration of machine learning (ML) [73] and sequential pattern mining (SPM) techniques [13, 35] offers a promising approach to overcome traditional bottlenecks. Frequent pattern mining (FPM) [1] is a type of SPM. FPM can automatically identify highfrequency sequence patterns (such as conserved motifs and functional modules) from large-scale sequence data, while ML algorithms can further transform these patterns into classification features to construct high-accuracy prediction models [52]. For example, the GenoAnaCla method significantly improved the precision of viral classification by mining frequent sequence patterns and using machine learning classifiers, demonstrating the effectiveness of pattern mining in sequence analysis [41]. However, current Page 1 of 18
Improve Viral Genomic Feature Representation and Classification
methods based on frequent pattern mining focus on frequent patterns. For example, they predominantly utilize features such as k-mers [33], frequent sequential patterns of nucleotides/codons/amino acids [41], and high-frequency CpG islands [20]. However, this exclusive focus on frequently occurring patterns may overlook another critical dimension of discriminative information: negative patterns. In viral genome classification research, negative patterns [66] refer to sequence motifs that are unexpectedly absent or substantially underrepresented within specific viral genomic groups. These absence-based patterns often signal the loss or suppression of critical regulatory or structural elements in certain viral strains, thereby harboring phylogenetic or functional information that is not captured by positive pattern mining alone [17]. For example, Koulouras et al. [28] showed that such negative patterns (i.e., minimal absent words) in viral genomes reflect evolutionary negative selection, including the systematic avoidance of host restriction enzyme recognition sites, immune evasion via host-sequence mimicry, and constraints related to genome stability and species-specific regulation. Such patterns offer complementary biological insights into viral genome organization and evolutionary relationships, providing an additional informative dimension for distinguishing viral species and deciphering their adaptive traits. To this end, this paper attempts to present a negative pattern miningbased approach to viral genome classification (GeneNSPCla) from a new perspective. This method aims to provide a complementary dimension of analysis for virus classification by capturing discriminative signals embedded in missing features. The main contributions of this paper are as follows: • The GeneNSPCla method is proposed, which applies negative patterns—defined as patterns that are significantly absent or underrepresented in specific viral taxa—to viral genome classification. This approach offers a way to complement existing methods that primarily rely on frequent patterns. • The GONPM+ algorithm is proposed as an extension of ONP-Miner, introducing a series of decay factors to achieve a more flexible and fine-grained dynamic adjustment of the minimum support threshold. This enhancement enables adaptive control of support reduction across different pattern lengths, allowing the algorithm to capture longer negative sequential patterns from RNA viral genomes. • Unify the feature formats of positive and negative sequential patterns by standardizing them into a consistent representation to eliminate format differences. Eight machine learning models were used to construct classifiers. Combined with multiple evaluation metrics, a comprehensive analysis of the classification performance of viral data in different formats was performed. In addition, compared with existing mainstream genomic classification methods, the effectiveness and superiority of negative pattern characteristics in virus classification were verified. Wenxi Zhu et al.: Preprint submitted to Elsevier
An initial algorithm was previously introduced in a preliminary version [74]. The structure of this paper is organized as follows. Section 2 provides a summary of related work. Section 3 presents the preliminary work of the proposed method, as well as the definitions of relevant terminologies. Section 4 elaborates on the GeneNSPCla approach, encompassing data preprocessing procedures and the specific implementation details of the GONPM+ algorithm. Section 5 presents and discusses the experimental results. Section 6 concludes this study.
2. Related Work In recent years, computational methods grounded in DL and ML have found widespread application in the analysis, prediction, and classification of genome sequences.
2.1. ML-based approaches Currently, the core logic of ML-based viral classification techniques lies in mining discriminative features from viral genomic data via algorithms and constructing classification models to achieve efficient categorization. A framework that combines NLP with traditional ML was proposed [6]. In this framework, DNA sequences are converted into numerical vectors using various k-mer sizes through the CountVectorizer, with the best classification performance achieved when using 6-mer features. VirusPredictor is an open-source Python software based on XGBoost [11], which incorporates the classification of ERVs into viral prediction for the first time. Additionally, this software exhibits a key characteristic: the longer the input sequence, the higher its prediction accuracy [33]. 4CAC is a four-category metagenomic contig classification tool based on ML and assembly graphs. It enables simultaneous identification of viruses, plasmids, prokaryotes, and microeukaryotes, while addressing key limitations of existing classifiers: oversight of class imbalance and low classification accuracy for short contigs [49]. The study [3] proposed a genomic sequence analysis system for COVID-19 and similar viruses based on the SVM, providing support for viral research and prevention and control at the genomic level. An additional approach utilizes classifiers in ML to classify sublineages of PRRSV. This method addresses the limitations of traditional approaches, specifically the unstable accuracy of RFLP and the high computational cost of phylogenetic analysis [27].
2.2. DL-based approaches In recent years, with the algorithmic innovations and enhanced computing power of DL technology, DL has offered novel perspectives and efficient solutions to the challenge of viral classification, boasting end-to-end features and robust complex data processing capability. Researchers propose a CNN-based viral classification method [19]. This method directly converts the DNA sequences of six virus types into numerical form via label encoding and K-mer encoding. Besides, three deep learning models, including CNN, CNNLSTM, and CNN-bidirectional LSTM, were constructed, Page 2 of 18
Improve Viral Genomic Feature Representation and Classification Dataset and Preprocessing
Viruses with the coding region form Dengue: Hanta:
Dengue:
In this study:
GAA ……CC……
200
Hanta:
3 -1 1 -1 1 -1……2 -1 2 -1……-2
Mining negative sequential patterns
3 -1 4 -1 2 -1 ……1 -1 2 -1……-2 …… 200
Precision Recall F1-Score AUC AUPRC
Eight classifiers SVM RF LR DT
……
Multi-Class Classification Class1: ? Class2: ?
…… Class8: ?
Testing 20%
1 f1 1 f2 1
==
TT¬TAAG
TT¬TAAG
4 4 f4 1 1 3
T¬TAAAAG
4 f4 1 1 1 1 3
Total:791
Total:448
Total:448
Hanta: A¬AA
T¬TTTA
4 f4 4 4 1
AA¬CA
A¬AA¬CC
1 f1 1 f2 2
ML based Classification
CUT
==
……
Classifier training
1 f4 1 f1 1
T¬TAAAAG
……
Confusion Matrix
CUT
Training 80%
Class8: “Dabie Banda”
kNN NB MLP GBM
A¬AA¬CA
……
Evaluation ROC Curves
Multi-Class Classification Class1: “Dengue” Class2: “Hanta”
Dataset partitioning
· ·· · ··
Accuracy
A¬TA¬AA
GA¬CC
……
……
Encoding
1 -1 4 -1 3 -1 ……2 -1 1 -1……-2 …… 200
Dengue: A¬AA
……
GTC ……AC……
GONPM+ GONPM
……
……
GenBank
1 -1 4 -1 3 -1 ……2 -1 2 -1……-2
……
Dengue Hanta ATG ……CC…… Ebola MERS ATG ……CA…… HIV Hepaci 200 Rota Dabie Banda
Learning via Negative Pattern Mining
T¬TTTA
T¬AAATT
4 f1 1 1 4 4
T¬TAATTA
T¬TAATTA
4 f4 1 1 4 4 1
Total:683
Total:391
Total:391
Classification and Evaluation
Figure 1: The entire GeneNSPCla framework can be divided into three parts: (1) dataset acquisition and encoding preprocessing; (2) frequent pattern mining via negative pattern algorithms; (3) classification using eight machine learning classifiers with various evaluation metrics obtained. On the right side of the second part is the encoding processing mentioned in (1), with the ’-1’ symbols between each base and the ’-2’ symbol at the end omitted.
yielding promising classification performance. The DeepVirusClassifier model is trained based on 1D-CNN, and it combines artificial mutation testing to verify its generalization ability, thus enabling the classification of SARS-CoV2 and other subtypes of viruses within the Coronaviridae family [8]. ViraLM adopts a pretrained genomic foundation model, DNABERT-2, as its backbone. By encoding input sequences after splitting them into 2 kb segments, it enables novel virus identification in metagenomes using average prediction scores [47]. DNASimCLR processes DNA sequences using One-Hot encoding, utilizes the SimCLR framework and ResNet-50 encoder for training on unlabeled data, and achieves better classification performance than existing methods when tested on three benchmark datasets, including the virus-host dataset [71]. DeepMicroClass employs a dual-path CNN architecture, which comprises a base path (via One-Hot encoding) and a codon path (via three reading frame conversion). When tested on 20 synthetic benchmark datasets, this model achieved promising performance in classifying eukaryotic, plasmid, and viral sequences [23].
2.3. Feature mining approaches In viral classification, feature mining serves as the core link connecting raw viral data and classification models. Its objective is to extract discriminative key information from genomic sequences. Classic feature extraction methods involve extracting k-mer frequency features. For example, VirFinder, the first ML tool based on k-mer frequencies, uses k-mer signals in full sequence to identify viral prokaryotic sequences from assembled metagenomic data [53]. Previous research uses three feature encoding algorithms—amino Wenxi Zhu et al.: Preprint submitted to Elsevier
acid composition (AAC), parallel correlation pseudo-amino acid composition (PC-PseAAC), and G-gap dipeptide composition (GGAP)—to process the spike protein sequences of coronaviruses. The processed sequences generated feature values, which were used for training the random forest (RF) model [50]. Association rule mining (ARM) has been applied to extract symptom association rules, helping to identify symptom patterns in COVID-19 patients [61]. GenoAnaCla processes 15 types of viral RNA sequences, employing the CM-SPAM algorithm [14] to extract frequent sequence patterns. These outputs are ultimately fed into ML classifiers, achieving promising performance [41]. SPM4GAC employs two SPM algorithms, namely CMSPAM and TKS, to extract frequent nucleotide sequence patterns composed of the four canonical nucleotides (A, C, G, T) as features [40]. FSP4HSP [39] employs frequent pattern mining algorithms to extract Frequent Sequential Patterns of Amino Acids (FSPAAs) and mines the sequential rules between amino acids via the ERMiner algorithm. In addition, there exist related methods that leverage the DALI tool to identify similar protein structures in the Protein Data Bank (PDB) and employ these structural elements as classification features [37, 38]. For extracting biomarkers based on Digital Signal Processing (DSP) technology, the method is grounded in the tri-nucleotide periodicity of DNA and employs DSP technology to process viral sequences before inputting the processed data into ML classifiers for classification [57]. Furthermore, there is a nonlinear feature extraction method based on chaos game representation (CGR) and recurrence quantification analysis (RQA) [43].
Page 3 of 18
Improve Viral Genomic Feature Representation and Classification
2.4. Challenges in existing approaches Despite the progress achieved by ML- and DL-based approaches in viral classification, several limitations remain. For ML-based methods, performance largely depends on the quality of manually engineered features such as k-mer counts. Although larger k-mer sizes generally lead to higher classification accuracy [51], this improvement comes at the cost of exponentially increasing memory and computational requirements. Specifically, the memory complexity of traditional k-mer methods is (4𝑘 ), making it challenging for standard computing devices to handle large k values [56, 34]. Moreover, such methods exhibit limited discriminative power for closely related viral strains with high genetic similarity and may suffer from reduced classification accuracy when highly similar genomes are excluded [4]. DL-based methods, although capable of automatic feature extraction, face challenges including high computational cost, the need for large labeled datasets, and limited interpretability of the learned representations. For instance, traditional DL models exhibit significantly pronounced "black-box" characteristics and poor interpretability. They thus rely on complex and time-consuming auxiliary methods, such as DeepLIFT attribution combined with TF-MoDISco clustering, filter visualization, and filter invalidation—to deduce biological significance [42, 48]. Additionally, there are significant issues at the data level: on the one hand, data scarcity and class imbalance lead to problems such as model bias toward the majority class and poor generalization ability [54]; on the other hand, data annotation requires completion by professional medical personnel and is subject to regulatory restrictions on medical data sharing across different countries, resulting in issues of difficult verification of annotation accuracy and low annotation efficiency [25]. As for feature mining approaches, conventional techniques such as frequent k-mer [53] extraction, association rule mining [61], or chaos game representation [5] often focus only on positive or frequent patterns, thereby overlooking potentially informative absence signals and rare but discriminative motifs. In fact, studies have shown that relying solely on positive sequence patterns can lead to biased or incomplete similarity and classification results. Incorporating negative sequence patterns, which capture the absence of specific subsequences, provides complementary information that enhances discrimination power [31]. To address these limitations, our work explores a complementary perspective by leveraging NSPs to characterize absence-based information in viral genomes. Rather than replacing conventional positive pattern mining, the proposed approach extends positive pattern representations by incorporating negative sequential patterns, which retain information derived from frequent patterns while additionally encoding the absence or underrepresentation of specific elements within viral taxa. This joint representation enriches the feature space used for classification and provides complementary information beyond presence-based patterns alone. Compared with those resource-intensive algorithms that rely on large language model training [65, 72], this Wenxi Zhu et al.: Preprint submitted to Elsevier
data-mining–based framework, combined with conventional machine learning classifiers, offers a lightweight alternative under the evaluated experimental settings while maintaining competitive classification performance.
3. Preliminaries Sequential pattern mining [15], a pivotal approach in knowledge discovery, aims to identify meaningful subsequences that are referred to as patterns within individual sequences or sequence databases (SDBs). Over the years, a wide range of SPM algorithms have been proposed, such as SPM with gap constraints [68, 69] and utility-driven SPM [16, 22]. However, most of these methods primarily focus on mining events that have occurred, referred to as positive SPM [14, 36]. In contrast, negative SPM emphasizes events that were expected but did not occur. Such negative patterns can be particularly informative, with applications in diverse fields including behavior analysis, medical services, financial risk management, and fraud detection. For instance, SN-RNSP [59] has been proposed to extract frequent negative patterns from transaction sequences, while algorithms such as e-RNSP [12], NegPSpan [21] have also been developed to mine frequent negative patterns across different domains. In the present study, we focus primarily on negative SPM algorithms suitable for processing largescale biological datasets. To provide a formal explanation of our algorithm, we first introduce the fundamental concepts commonly used in negative SPM. Definition 1 (subsequences [2]). Let S = ⟨𝑠1 , 𝑠2 , … , 𝑠𝑚 ⟩ be a sequence. A sequence 𝐒𝐢 = ⟨𝑠𝑖1 , 𝑠𝑖2 , … , 𝑠𝑖𝑛 ⟩ with 1 ≤ 𝑖1 < 𝑖2 < ⋯ < 𝑖𝑛 ≤ 𝑚 and 𝑛 ≤ 𝑚 is defined as a subsequence of S. When 𝑛 = 𝑚 and 𝑖𝑗 = 𝑗 for 𝑗 = 1, …, 𝑚, 𝐒𝐢 is identical to S. We use the notation 𝐒𝐢 ⊑ S, where the symbol ⊑ represents the subsequence relationship. For example, consider the sequence ⟨{GTTCAACTG}⟩. Since the elements of ⟨{TCA}⟩ appear in the same order within ⟨{GTTCAACTG}⟩, ⟨{TCA}⟩ is a subsequence of ⟨{GTTCAACTG}⟩, which can be denoted as ⟨{TCA}⟩ ⊑ ⟨{GTTCAACTG}⟩. Definition 2 (gap constant [46]). A sequence S = ⟨𝑠1 , 𝑠2 , … , 𝑠𝑖 , … 𝑠𝑚 ⟩ over an alphabet Σ has length 𝑚, where 𝑠𝑖 ∈ Σ for 1 ≤ 𝑖 ≤ 𝑚. A pattern p with gap constraints is defined as p = 𝑝1 [𝑀, 𝑁]𝑝2 … [𝑀, 𝑁]𝑝𝑗 … [𝑀, 𝑁]𝑝𝑛 , where 𝑛 is the length of the pattern, 0 ≤ 𝑀 ≤ 𝑁, and 𝑝𝑗 ∈ Σ. The gap constants 𝑀 and 𝑁 specify the minimum and maximum number of wildcard characters allowed between consecutive pattern elements 𝑝𝑗−1 and 𝑝𝑗 . For example, in an RF sequence S = ⟨{ATTACG}⟩, the character set Σ = {A, G, C, T} and the length 𝑚 = 6. Suppose that we have a pattern with gap constraints p = A[1, 3]C, which indicates that between the ’A’ and ’C’ in the pattern, there can be at least 1 and at most 3 wildcards. Sequences like AC, ATC, ATTC could potentially match this pattern, Page 4 of 18
Improve Viral Genomic Feature Representation and Classification
depending on how the wildcards are interpreted in the search context. Definition 3 (One-off condition [67]). Suppose 𝐒𝟏 = ⟨𝑠1 , 𝑠2 , …, 𝑠𝑘 , …, 𝑠𝑚 ⟩ and 𝐒′𝟏 = ⟨𝑠′1 , 𝑠′2 , …, 𝑠′𝑗 , …, 𝑠′𝑚 ⟩ are two occurrences in sequence 𝐒. If 𝑠𝑘 = 𝑠′𝑗 (1 ≤ 𝑘 ≤ 𝑚, 1 ≤ 𝑗 ≤ 𝑚), 𝐒𝟏 and 𝐒′𝟏 violate the one-off condition. Otherwise, the two occurrences are said to satisfy the one-off condition. Suppose that we have a sequence 𝐒 = ⟨{AACACCTC}⟩ and a pattern 𝐩 = A[0, 1]C[0, 1]C. According to the gap constraint [0, 1], all occurrences of 𝐩 in 𝐒 are ⟨1,3,5⟩, ⟨2,3,5⟩, ⟨4,5,6⟩ and ⟨4,6,8⟩. The occurrences ⟨1,3,5⟩ and ⟨4,5,6⟩ do not satisfy the one-off condition since they share position 5, whereas ⟨1,3,5⟩ and ⟨4,6,8⟩ do satisfy it. Definition 4 (negative pattern [67]). Give a character 𝑒 (where 𝑒 ∈ Σ or 𝑒 is the null character), the corresponding negative character is denoted as ¬𝑒, and this symbol represents the absence of the character 𝑒. A negative pattern that incorporates gap constraints can be formulated as: 𝐩 = 𝑝1 [𝑀, 𝑁]¬𝑒1 𝑝2 ⋯ [𝑀, 𝑁]¬𝑒𝑗−1 𝑝𝑗 ⋯ [𝑀, 𝑁]¬𝑒𝑚−1 𝑝𝑚 (1) If 𝑒𝑗−1 ∈ Σ, then 𝑝𝑗−1 [𝑀, 𝑁] ¬ 𝑒𝑗−1 𝑝𝑗 is a negative subsequence, which means that 𝑒𝑗−1 does not exist between 𝑝𝑗−1 and 𝑝𝑗 . (2) If 𝑒𝑗−1 is null, then 𝑝𝑗−1 [𝑀, 𝑁]𝑝𝑗 is a classical example in Definition 2. For example, consider a pattern p = 𝑝1 [0, 1]𝑝2 [0, 2]¬𝑒1 𝑝3 = C[0, 1]A[0, 2]¬GT. Here, the negative character ¬G in the subpattern A[0, 2]¬GT indicates that between "A" and "T", there can be 0, 1, or 2 characters of any type except "G"—in other words, "G" must not appear in the interval between "A" and "T". Definition 5 (minimum support [67]). The support of a pattern p within a sequence S is defined to be the count of its occurrences subject to the one-off constraint, represented as sup(p, S). For a sequence dataset SDB, the minimum support of a pattern p is sup(p, SDB), calculated as: sup(p, SDB) = ∑𝑁 𝑘=1 sup(p, 𝑠𝑘 ) ,where N is the number of sequences in SDB. If the support of pattern p in SDB is greater than or equal to a predefined threshold minsup, that is, sup(p, SDB) ≥ minsup, then p is referred to as a frequent sequence. Note that the concept of support calculation here differs from that in traditional SPM algorithms. In conventional SPM algorithms, if a pattern p appears in a sequence S, its support is counted as 1 regardless of the number of occurrences. In contrast, in the GONPM+ algorithm, the support is determined by the total number of times p appears across all sequences. For example, given the sequence S = ⟨{AACACACCTC}⟩ and the pattern p = A[0, 1]C[0, 1]¬GC, p can match both the prefix ’AACAC’ and the suffix ’ACCTC’ of S. Therefore, the support of p in S is 2. Based on the concept of subsequence, the support Wenxi Zhu et al.: Preprint submitted to Elsevier
Table 1 Viral genome sequences were retrieved from the NCBI GenBank database in the CRF, and additional statistics on their lengths were conducted. Virus RNA type Samples in CRF minlen maxlen Dengue (+)ssRNA 200 8136 10179 Dabie (−)ssRNA 200 882 6255 Hanta (−)ssRNA 200 324 6477 Ebola (−)ssRNA 200 12486 16956 MERS (+)ssRNA 200 8568 44097 HIV (−RT)ssRNA 200 1794 11304 Hepaci (+)ssRNA 200 5967 10293 Rota dsRNA 200 453 3507 Average 200 4826 13633 (+)ssRNA: Positive-sense single-stranded RNA, (−)ssRNA: Negative-sense single-stranded RNA, dsRNA: Double-stranded RNA. (−RT)ssRNA: Negative-sense reverse transcription single-stranded RNA, CRF: Coding Region Form.
measure is defined as follows. GSC refers to the genome sequence corpus and 𝑆𝑥 is a subsequence of a certain sequence 𝑆. The support of the subsequence 𝑆𝑥 , denoted as sup(𝑆𝑥 ), is the total occurrence frequency of the subsequence 𝑆𝑥 in GSC. Count(𝑆𝑥 , 𝑆) denotes the number of occurrences of 𝑆𝑥 in 𝑆. Formally, it is defined as: ∑ sup(𝑆𝑥 ) = count(𝑆𝑥 , 𝑆). (1) 𝑆∈𝐺𝑆𝐶
4. Proposed GeneNSPCla approach In this section, we introduce the GeneNSPCla method. The GeneNSPCla method is divided into three main steps: 1) Database and processing; 2) Obtaining negative sequential patterns of data through the GONPM+ algorithm; and 3) Training classifiers using these patterns and performing performance evaluation. The GeneNSPCla method can serve as a general approach, allowing the configuration of different negative SPM algorithms or distinct classifiers.
4.1. Database and preprocessing We selected eight RNA viruses from distinct taxonomic groups that exhibit low pairwise similarity and considerable variation in sequence length, with sequencing data retrieved from GenBank [55]. For each virus, we focused on the coding region form (CRF), which represents continuous coding regions composed of codons, where each codon consists of three nucleotides. These CRF sequences were downloaded in FASTA format [44]. Notably, the GeneNSPCla framework is representation-agnostic and can be extended beyond CRF to non-coding regions or protein-level amino acid sequences in our future studies. Due to the high computational complexity of extracting negative sequential patterns, the dataset used for GONPM training was constructed by randomly selecting 200 genomic sequences from each of the eight RNA virus species. This sampling strategy ensures that each virus type contributes an equal number of sequences, thus mitigating potential data imbalance between categories and maintaining diversity within each class. However, the current version of GONPM+ is not yet optimized Page 5 of 18
Improve Viral Genomic Feature Representation and Classification
for large-scale datasets, as mining negative patterns over the entire genomic collection would result in substantial memory consumption and computational overhead. We expect that training on larger datasets would further enhance the robustness and generalizability of the discovered negative patterns, providing a more comprehensive representation of viral genomic diversity once computational efficiency is improved. Future work will therefore focus on training the model with larger datasets and evaluating its performance on closely related viral strains as well as real-world metagenomic mixtures. The detailed composition of the dataset is summarized in Table 1. Each viral genome sequence consists of four canonical nucleotides: A (adenine), C (cytosine), G (guanine), and T (thymine). In some sequences, additional symbols appear to represent ambiguous positions or mixtures of these bases; such cases are referred to as redundant nucleotides (RN). Samples containing RN are thus defined as redundant samples, and in our dataset, the proportion of redundant sequences was approximately 6.47%. To handle these, each distinct RN was mapped to a unique positive integer. In this encoding scheme, a special code −1 serves as a delimiter between codons, and −2 is appended at the end of each sequence to denote termination. This conversion enables direct processing by conventional SPM algorithms, thereby ensuring compatibility and allowing seamless comparison with GONPM. Table 2 illustrates CRF sequences in both raw and encoded formats, with examples covering positive and negative SPM. Following this encoding scheme, for each virus class, sequences were encoded as illustrated in Table 2, which served as input to the positive frequent pattern mining algorithm CM-SPAM. In contrast, the original genomic sequences were directly used as input for the negative pattern mining algorithm GONPM+ without applying additional sequence filtering or length normalization, since GONPM+ operates on complete sequence information. The discovered negative sequential patterns were subsequently encoded using the same scheme as positive patterns, thereby unifying both representations into a consistent feature format for downstream classification.
4.2. Using negative SPM for learning NSP mining has attracted attention in bioinformatics because it can capture informative absence signals that are often ignored by conventional frequent-pattern mining. The current research on negative SPM mainly focuses on multiple supports [70], progressive pattern mining [24], and so on. However, these algorithms exhibit two key limitations: overlooking pattern repeat counting (i.e., only determining whether a pattern is present, without counting its multiple occurrences within a sequence) and a lack of gap constraints. The frequency of a pattern within a single sequence is of crucial importance. For instance, the occurrence frequency of short fragments such as dinucleotides in a single genomic sequence can be applied to species classification and evolutionary research [26]. Furthermore, due to a lack of gap Wenxi Zhu et al.: Preprint submitted to Elsevier
constraints, these traditional methods incorporate irrelevant regions into patterns during the mining process, resulting in generated patterns containing non-functional fragments, which are essentially meaningless patterns [32].
4.2.1. ONP-Miner algorithm By contrast, ONP-Miner [67] introduces the concept of one-off negative sequential patterns with embedding constraints, thereby reducing redundancy and improving efficiency. Its pruning strategies make it better suited for large sequential datasets than earlier NSP algorithms. Our proposed algorithm adopts ONP-Miner as the foundation and proposes the GONPM+. Our improved algorithm not only preserves the computational efficiency of ONP-Miner but also adapts its definitions of patterns and constraints to the properties of nucleotide and coding-region sequences. This enables the discovery of negative patterns that correspond more closely to biologically meaningful motifs, while maintaining scalability for long viral genomes. The pseudocode of the ONP-Miner (Algorithm 1) is outlined as follows: Algorithm 1: ONP-Miner Input: A sequence database SDB, a minimum support threshold minsup, the gap constraint gap. Output: ONPs stored in 𝐹 . 1 initialize traverse SDB, get Σ, and store frequent positive patterns with length one in 𝐹1 ; len ← 2; 2 initialize 𝐹2 ← FindONP2 (SDB, minsup, gap, 𝐹1 , Σ); 3 while 𝐹𝑙𝑒𝑛 ≠ null do 4 cand ← PatternJoin(𝐹𝑙𝑒𝑛 , 𝑙𝑒𝑛); // Generate all candidate patterns with length 5 len + 1; 6 for each positive candidate pattern p in cand do 7 sup(p, SDB) ← MatchDB(SDB, p) ; 8 if sup(p, SDB) ≥ minsup then 9 𝐹𝑙𝑒𝑛+1 ← 𝐹𝑙𝑒𝑛+1 ∪ p; 10 Prune p; 11 end 12 else 13 prune p and its corresponding negative sequence patterns; 14 end 15 end 16 𝐹𝑙𝑒𝑛+1 ← 𝐹𝑙𝑒𝑛+1 ∪ FindFrequent(SDB, minsup, cand); 17 len ← len + 1; 18 end 19 return 𝐹
Step 1: Traverse the sequence database to identify the frequent patterns of length-1 and store them in 𝐹1 . Step 2: The FindONP2 algorithm is used to generate positive candidate patterns of length 2. It then prunes the infrequent candidate patterns. Finally, it generates negative candidate patterns based on the frequent patterns and calculates the support of each pattern to screen out frequent patterns of length 2. In the Page 6 of 18
Improve Viral Genomic Feature Representation and Classification Table 2 (CRF)-formatted genome sequences, including five examples. The original sequences are presented in Figure (a); Figure (b) presents the encoded sequences; Figure (c) displays a part of the negative sequential patterns corresponding to each example; and Figure (d) shows the encoding of the negative sequential patterns in Figure (c). (a) Positive sequences in CRF ID Sequence 1 2 3 4 5
⟨{AGC}⟩ ⟨{T[0,2]ACG}⟩ ⟨{TA[0,2]GC[0,2]TA}⟩ ⟨{T[0,2]ATGC[0,2]AT}⟩ ⟨{GC[0,2]G[0,2]TA[0,2]CG}⟩
ID
(c) Negative sequences in CRF Sequence
1 2 3 4 5
ID
(b) The transformed sequences in CRF Sequence
1 2 3 4 5
𝟏–1𝟑–1𝟐–1–2 𝟒–1𝟏–1𝟐–1𝟑–1–2 𝟒–1𝟏–1𝟑–1𝟐–1𝟒–1𝟏–1–2 𝟒–1𝟏–1𝟒–1𝟑–1𝟐–1𝟏–1𝟒–1–2 𝟑–1𝟐–1𝟑–1𝟒–1𝟏–1𝟐–1𝟑–1–2
⟨{𝐴𝑇 [0, 2]¬𝐺}⟩ ⟨{𝐴[0, 2]𝑇 𝐺[0, 2]¬𝐶}⟩ ⟨{𝐺𝐶𝑇 𝐴[0, 2]¬𝑇 [0, 2]¬𝐺}⟩ ⟨{𝑇 [0, 2]¬𝐺[0, 2]𝐴𝐶[0, 2]¬𝐴}⟩ ⟨{𝐴[0, 2]¬𝐶𝑇 [0, 2]𝑇 𝐺[0, 2]¬𝑇 }⟩
FindONP2 algorithm, the FindFrequent algorithm is invoked. The primary function of this algorithm is to filter the set of candidate input patterns and retain frequent patterns with support ≥ minsup. Step 3: The PatternJoin algorithm generates all candidate patterns of length len + 1. Based on the frequent pattern set of length 𝑙, this algorithm extracts the suffix (by removing the first element) and prefix (by removing the last element) for each pattern in the set. If the suffix of one pattern matches the prefix of another pattern exactly, a candidate pattern of length 𝑙 + 1 is generated through "pattern join (𝑝 ⊕ 𝑞)". Step 4: The MatchDB algorithm calculates the support of each positive candidate pattern. Centered on depthfirst search combined with backtracking, this algorithm relies on the DFS algorithm. It locates unused characters in the sequence that match the first element of the pattern as roots, and through the DFS algorithm, identifies complete occurrences of the pattern that satisfy the one-off, gap, and negative character constraints. After marking the used characters, it backtracks to find new occurrences and finally counts the support of the pattern. This algorithm processes the candidate patterns: if the support of a candidate pattern is no less than the preset threshold, the algorithm stores the pattern in 𝐹𝑙𝑒𝑛+1 ; otherwise, it prunes the corresponding negative candidate patterns of the candidate pattern. Step 5: The MatchDB algorithm computes the support of each negative candidate pattern. If the support of the negative candidate pattern meets or exceeds the predefined threshold, the algorithm stores this pattern in 𝐹𝑙𝑒𝑛+1 . At this point, 𝐹𝑙𝑒𝑛+1 contains both positive and negative patterns with support greater than the threshold, and then len is updated to len + 1. Wenxi Zhu et al.: Preprint submitted to Elsevier
ID 1 2 3 4 5
(d) The transformed sequences in CRF Sequence 𝟏 – 1 𝟒 – 1 𝐟𝟑 – 1 – 2 𝟏 – 1 𝟒 – 1 𝟑 – 1 𝐟𝟐 – 1 – 2 𝟑 – 1 𝟐 – 1 𝟒 – 1 𝟏 – 1 𝐟𝟒 – 1 𝐟𝟑 – 1 – 2 𝟒 – 1 𝐟𝟑 – 1 𝟏 – 1 𝟐 – 1 𝐟𝟏 – 1 – 2 𝟏 – 1 𝐟𝟐 – 1 𝟒 – 1 𝟒 – 1 𝟑 – 1 𝐟𝟒 – 1 – 2
Step 6: Repeat Steps 3 through 5 until the collection of frequent patterns becomes empty.
4.2.2. GONPM+ algorithm To extract discriminative features from RNA viral genomic sequences, we employ a negative sequential pattern mining approach that captures informative absence signals specific to RNA viruses. Building upon the ONP-Miner framework, we previously proposed the GONPM algorithm, which dynamically adjusts the minimum support threshold to enhance the extraction of biologically meaningful negative sequential patterns. This method demonstrated superior performance in identifying informative negative features and effectively improved viral classification accuracy. In this extended version, we further enhance GONPM by introducing a decay-based adaptive support mechanism, referred to as GONPM+. Unlike the original GONPM, which only adjusts the minimum support once after a specific iteration, GONPM+ introduces a set of decay factors {𝑓2 , 𝑓3 , … , 𝑓𝑛 } that progressively reduce the support threshold across multiple levels of candidate generation. This gradual adjustment allows the algorithm to relax the mining constraints in a layer-wise manner, thereby facilitating the exploration of longer and less frequent negative patterns while avoiding excessive candidate expansion. As a result, the mining process becomes more flexible and fine-grained, enabling a more detailed characterization of variations among RNA viral genomes. Consequently, we have made the following improvements: • Optimization for adaptability to genomic data: The storage format of patterns in 𝐹𝑙𝑒𝑛+1 is optimized and encoded to improve compatibility with genomic data processing (encoded in the format mentioned in Section 4.1). Additionally, the algorithm’s output results are enhanced to facilitate the direct extraction of processed negative pattern sequences. Page 7 of 18
Improve Viral Genomic Feature Representation and Classification
• Progressive decay-based adjustment of the minimum support threshold: Building upon the adaptive threshold mechanism introduced in GONPM, the improved algorithm GONPM+ incorporates a multilevel decay strategy to further optimize pattern extraction. Instead of applying a fixed reduction after a specific iteration, GONPM+ introduces a series of decay factors {𝑓2 , 𝑓3 , … , 𝑓𝑛 } to progressively decrease the minsup value across successive invocations of the PatternJoin algorithm. This progressive adjustment enables a smoother and more adaptive relaxation of the support threshold as the pattern length increases, facilitating the discovery of longer and rarer negative patterns while maintaining computational stability and efficiency. The GONPM+ algorithm is shown in Algorithm 2. The specific steps of this algorithm are as follows: Step 1: Traverse the sequence database to identify all frequent length-1 patterns and store them in 𝐹1 . For the RNA viral genomes analyzed in this study, 𝐹1 includes the four canonical nucleotides (A, C, G, and T) along with a small number of low-frequency redundant nucleotides. Subsequently, the algorithm invokes the FindONP2 algorithm to generate positive candidate patterns of length 2. Step 2: The PatternJoin algorithm is invoked to generate all candidate patterns of length len + 1. For layer-wise control, GONPM+ applies decay factors (𝑓2 , 𝑓3 , … , 𝑓𝑛 ) to the original minimum support minsup. Specifically, the patterns stored in 𝐹2 use a threshold of minsup × 𝑓2 , the patterns in 𝐹3 use minsup×𝑓3 , etc., up to 𝐹𝑛 , which uses minsup×𝑓𝑛 . For any subsequent layers beyond 𝑛, the threshold remains at minsup × 𝑓𝑛 . Step 3: The MatchDB algorithm is used to calculate the support of each positive candidate pattern. If the support of a candidate pattern meets or exceeds the preset threshold, the pattern is stored in 𝐹𝑙𝑒𝑛+1 . Otherwise, the corresponding negative candidate patterns associated with it are pruned in this step of the process. Step 4: The MatchDB algorithm is then used to compute the support of each negative candidate pattern. Negative patterns whose support values meet or exceed the predefined threshold are retained and stored in 𝐹len+1 for subsequent iterations. Specifically, 𝐹𝑙𝑒𝑛+1 stores both frequent positive and negative patterns, and len is updated to len + 1. Step 5: Repeat Steps 2 through 4 until the collection of frequent patterns becomes empty. Complexity analysis. (1) The time complexity of the GONPM+ algorithm involves several parameters: 𝑙 represents the number of candidate patterns, 𝑚 denotes the maximum length of such patterns, and 𝑛 stands for the Wenxi Zhu et al.: Preprint submitted to Elsevier
Algorithm 2: GONPM+ Input: SDB, minsup, gap constraints gap, the decay factors {𝑓2 , 𝑓3 , … , 𝑓𝑛 } 1 . Output: Negative frequent patterns stored in F. 2 initialize traverse SDB, get Σ, and store frequent positive patterns with length one in 𝐹1 ; 𝑙𝑒𝑛 ← 2; 3 initialize 𝐹2 ← FindONP2(SDB, minsup, gap, 𝐹1 , Σ); 4 while 𝐹𝑙𝑒𝑛 ≠ null do 5 cand ← PatternJoin(𝐹𝑙𝑒𝑛 , len); // Generate all positive and negative patterns patterns with length len + 1; 6 minsup𝑛𝑒𝑤 ← minsup × 𝑓𝑙𝑒𝑛+1 ; // Dynamically adjust the threshold based on len; 7 for each positive candidate pattern p in cand do 8 sup(p, SDB) ← MatchDB(SDB, p); 9 if minsup ≤ sup(p, SDB) then 10 𝐹𝑙𝑒𝑛+1 ← 𝐹𝑙𝑒𝑛+1 ∪ p; Prune p; 11 end 12 else 13 prune p and its corresponding negative sequence patterns; // Prune strategy; 14 end 15 end 16 𝐹𝑙𝑒𝑛+1 ← 𝐹𝑙𝑒𝑛+1 ∪ FindFrequent(SDB, minsup, cand); // Filter the frequent negative patterns from cand ; 17 len ← len + 1; 18 end 19 return 𝐹
length of SDB. The time complexity is mainly composed of generating candidate patterns and mining frequent patterns: the former is 𝑂(𝑙2 ), while for the latter, since the MatchDB algorithm has a time complexity of 𝑂(𝑚 × 𝑛) (a nettree contains 𝑚 levels with no more than 𝑛 nodes per level), mining frequent patterns is 𝑂(𝑙 × 𝑚 × 𝑛), leading to the overall time complexity of GONPM+ being 𝑂(𝑙 × 𝑚 × 𝑛 + 𝑙2 ). (2) The space complexity of GONPM+ comprises two key components: candidate pattern generation and support computation. The space complexity of candidate patterns is 𝑂(𝑚 × 𝑙), since the number of candidate patterns is 𝑙 and the number of frequent patterns does not exceed 𝑙. The space complexity of the MatchDB algorithm is 𝑂(𝑚 × 𝑛). Therefore, the space complexity of the GONPM+ algorithm is 𝑂(𝑚 × (𝑙 + 𝑛)). Example: Suppose that we have a sequence S = ⟨𝑠1 𝑠2 𝑠3 𝑠4 𝑠5 𝑠6 𝑠7 𝑠8 𝑠9 𝑠10 𝑠11 ⟩ = ⟨AACACCTCAAG⟩, gap = [𝑀, 𝑁] = [0, 2], minsup = 2, and Σ = {A, C, G, T}, decay factors (0.9,0.5). Step 1: Iterate through the sequence to count the occurrences of each character. We obtain 𝐹1 = {𝐴, 𝐶}, since the occurrence counts of characters A and C are greater than minsup = 2. Step 2: Generate positive candidate patterns with length two. Thus, we obtain 𝐴[0, 2]𝐴, 𝐴[0, 2]𝐶, 𝐶[0, 2]𝐴, 𝐶[0, 2]𝐶, since their support values are all greater than 1.8. Next, we generate negative candidate patterns based on these patterns, resulting in a total of 16 candidate patterns. However, only five of them (𝐴[0, 2]¬𝐺𝐶, 𝐴[0, 2]¬𝑇 𝐶, 𝐶[0, 2]¬𝐺𝐴, 𝐶[0, 2]¬𝐶𝐶, and 𝐶[0, 2]¬𝐺𝐶) Page 8 of 18
Improve Viral Genomic Feature Representation and Classification
meet the support requirement. Thus, the patterns in 𝐹2 are the set of these positive and negative frequent patterns. Step 3: Generate positive and negative candidate patterns with length three using pattern join. At this point, minsup is adjusted to 2 × 0.5 = 1. That is to say, the support of patterns in 𝐹3 is 1. There are 6 positive candidate patterns in total, including 𝐴[0, 2]𝐴[0, 2]𝐶, 𝐴[0, 2]𝐶[0, 2]𝐴, 𝐴[0, 2]𝐶[0, 2]𝐶, 𝐶[0, 2]𝐴[0, 2]𝐶, 𝐶[0, 2]𝐴[0, 2]𝐴, and 𝐶[0, 2]𝐶[0, 2]𝐴. A total of 30 negative frequent patterns are obtained, including 𝐴[0, 2]𝐶[0, 2]¬𝐶𝐶, 𝐴[0, 2]¬𝐺𝐶[0, 2]¬𝐶𝐶, etc. 𝐹3 stores these frequent and negative patterns. Step 4: Repeat the steps in Step 3, with minsup set to 1 at this point, until the set of frequent patterns is empty. Then the algorithm terminates.
4.3. Classification through discovered negative frequent patterns This step involves utilizing the extracted negative pattern features for virus classification. This step can be divided into two phases: the training phase and the testing phase. In the training phase, we construct appropriate ML-based classifiers. In the testing phase, the objective is to evaluate the constructed models to assess their performance in terms of the final classification results. Multi-class (MC) classification is conducted in this study, which assigns each genomic sequence a label corresponding to its unique virus type, requiring the discrimination of each virus. We utilized eight standard ML algorithms, specifically: (1) Logistic Regression (LR), (2) Support Vector Machine (SVM), (3) Decision Tree (DT), (4) Random Forest (RF), (5) k-Nearest Neighbors (kNN), (6) Naive Bayes (NB), (7) Multilayer Perceptron (MLP), and (8) Gradient boosting machine (GBM). The performance of these classifiers is evaluated using six metrics [58]: (1) Accuracy (ACC), (2) Precision (P), (3) Recall (R), (4) F1 score (F1), (5) Area Under the Curve (AUC) and (6) Area Under the Precision-Recall Curve(AUPRC). These six metrics are defined as follows: ACC =
𝑇𝑃 𝑇𝑃 + 𝑇𝑁 , Recall (R) = , 𝑇𝑃 + 𝑇𝑁 + 𝐹𝑃 + 𝐹𝑁 𝑇𝑃 + 𝐹𝑁 (2)
Precision (P) =
𝑇𝑃 𝑃 ×𝑅 , F-measure = 2× , (3) 𝑇𝑃 + 𝐹𝑃 𝑃 +𝑅
identified as part of a specific virus type. FN corresponds to the number of sequential patterns incorrectly classified as not belonging to the specific virus type. In Equation for AUC, dFPR refers to the derivative of the false positive rate FPR 𝑃 . 𝑃𝑖 and 𝑅𝑖 in Equation for AUPRC represent the = 𝐹 𝑃𝐹+𝑇 𝑁 precision and recall values, respectively, at the 𝑖−𝑡ℎ decision threshold. Algorithm 3 provides the general pseudocode of the proposed GeneNSPCla approach. The RNA viral genome sequences are first converted into integer-based abstractions to facilitate pattern mining. NSPs are then extracted from the abstracted sequences using the GONPM algorithm. These patterns serve as input features for multiple machine learning classifiers, which are trained and evaluated using an 80:20 train–test split. The algorithm outputs the classification metrics, including ACC, P, R, F1-score, AUC, and AUPRC. Figure 1 illustrates the workflow of the GeneNSPCla framework. Algorithm 3: GeneNSPCla Input: Genome sequence corpus (GSC) of RNA viruses in CRF. Output: Classification results including ACC, P, R, F1, AUC, and AUPRC. // Step 1: Convert sequences into the needed abstraction 1 abstraction ← Convert GSC to integer-based representation; // Step 2: Find negative sequential patterns (NSPs) 2 NSPs ← Patterns are extracted by processing the abstracted GSC using the GONPM+ algorithm; // Step 3: Train classifiers 3 for each classifier in Classifiers do 4 train classifier with NSPs as features using default hyperparameters; 5 end // Step 4: Evaluate classifiers 6 for each classifier in Classifiers do 7 evaluate the classifier using an 80:20 training: testing ratio; 8 store metrics: ACC, P, R, F1, AUC, and AUPRC; 9 end 10 return ACC, P, R, F1, AUC, and AUPRC
5. Experimental Results
In this section, we focus on the multi-class virus sequence classification task. This choice is motivated by the 𝑛 1 ∑ (𝑅𝑖 − 𝑅𝑖−1 ) × (𝑃𝑖 + 𝑃𝑖−1 ) fact that our study involves eight distinct virus types, and a AUC = 𝑅(dFPR), AUPRC = ∫0 2 binary classification formulation would inevitably introduce 𝑖=1 severe class imbalance, with the negative class comprising (4) sequences from multiple viruses and greatly outnumbering Noted that TP = true positive, TN = true negative, FP the positive class. Such an imbalance increases the risk of = false positive, and FN = false negative. In the context overfitting and can bias the learned decision boundaries, parof this study, TP denotes the number of sequential patterns ticularly when modeling heterogeneous viral populations. In that are correctly identified as belonging to a specific virus contrast, a multi-class setting treats each virus class symmettype. TN refers to the number of sequential patterns that are rically and aims to accurately determine the specific viral correctly classified as not belonging to a specific virus type. category to which each sequence belongs, thereby better FP represents the number of sequential patterns incorrectly reflecting the practical requirement of virus identification. Wenxi Zhu et al.: Preprint submitted to Elsevier
Page 9 of 18
Improve Viral Genomic Feature Representation and Classification Table 3 Parameters of the eight ML classifiers and three algorithm settings. Classifier LR RF
Parameters solver: ’lbfgs’, C: 1.0, max_iter: 1000 n_estimators: 200, criterion: ’gini’, max_depth: None, min_samples_split: 2; min_samples_leaf: 1, n_jobs: -1 kNN n_neighbors: 5, weights: ’distance’, metric: ’minkowski’ NB Default parameters SVM kernel: ’rbf’, C: 1.0, gamma: ’scale’, probability: True MLP hidden_layer_sizes: (100,), activation: ’relu’, solver: ’adam’; learning_rate_init: 0.001, max_iter: 300 DT criterion: ’gini’, max_depth: None, min_samples_split: 2, min_samples_leaf: 1 GBM n_estimators: 100, learning_rate: 0.1, max_depth: 3 Algorithm Parameters CM-SPAM Min pattern length: 6, max pattern length: 9, Required items: 1, 2, 3, 4, max gap: 1 ONP-Miner Gap constant: [0,3] GONPM Gap constant: [0,3], min length: 3, ratio: 1.3 GONPM+ Gap constant: [0,3], (𝑓2 , 𝑓3 , … , 𝑓𝑛 ) = (0.9,0.85,0.75,0.65) Regarding the parameters of the CM-SPAM algorithm, this indicates that the discovered patterns with lengths ranging from 6 to 9 are required to contain the four nucleotide bases (A, C, G, T), and the gap constraint is set to [0, 1]. Regarding the parameters of the GONPM algorithm, when len ≥ 3, the support is reduced to 1∕1.3 times its original value.
Although multi-class classification is inherently more challenging and often results in lower absolute accuracy, it offers greater room for methodological improvement and provides a more rigorous evaluation of discriminative capability. Indeed, as reported in related work [41], the best-performing classifiers under similar multi-class settings achieve accuracies of only around 50%, underscoring the difficulty and relevance of this task. All experiments were conducted to evaluate the performance of GeneNSPCla on RNA viral genome datasets in CRF. Eight representative RNA viruses were selected from distinct taxonomic groups to ensure diversity. The positive frequent patterns were discovered using the CMSPAM algorithm from the SPMF data-mining library1 . In contrast, negative sequential patterns were extracted with the GONPM+ algorithm. Data preprocessing and feature unification were performed in Python, utilizing libraries such as Pandas and NumPy for data manipulation and numerical computation. The training and evaluation of eight machine learning classifiers were carried out using the scikit-learn library2 . To reduce classifier sensitivity to hyperparameters and ensure a fair comparison, GridSearchCV was employed to optimize key hyperparameters under the same crossvalidation setting, but the resulting performance differences were marginal. All experiments were conducted on a workstation equipped with an Intel Core i7 processor, 64 GB of RAM, and the Windows 11 operating system. The parameters of the classifiers and algorithms are shown in Table 3. The source code and datasets are available at GitHub3 .
5.1. Frequent patterns To intuitively illustrate the negative sequential patterns discovered by our method, Figure 2 presents a representative
example mined from a 204-nt RNA sequence of Hanta virus. The upper nucleotide sequence and the encoded numeric sequence in the middle correspond to the same viral genome, where the encoding procedure is described in detail in Section 4.1. The green-marked bases in the sequence indicate the occurrences of a representative negative sequential pattern, A[0, 1]¬TA[0, 1]T[0, 1]T, which appears ten times in this sequence. This pattern explicitly characterizes the absence of the specific nucleotide T between the surrounding nucleotides, rather than the mere presence of frequent motifs, thereby capturing absence-based constraints in the viral genome organization. As illustrated in the lower-right panel of Figure 2, we refer to the biological interpretation of absent or underrepresented subsequence patterns reported by Koulouras et al. [28]. Their study shows that negative patterns in viral genomes are not random artifacts but reflect conserved evolutionary adaptation strategies arising from long-term virus–host interactions. In particular, many recurrent negative patterns correspond to short palindromic sequences of 4–6 nucleotides that serve as recognition sites for host restriction enzymes and are therefore selectively avoided by viruses to reduce genome cleavage. A representative example is the subsequence GCCGGC, which is the recognition site of the restriction enzyme HpaII and has been reported to be absent in 1,198 viral species, indicating a widespread and conserved avoidance mechanism across viral taxa. In addition, other absent or underrepresented sequences have been associated with immune evasion via molecular mimicry, while the systematic avoidance of long repetitive or GC-rich palindromic sequences helps prevent unfavorable secondary structure formation, thereby supporting efficient viral replication and translation.
1 https://www.philippe-fournier-viger.com/spmf 2 https://scikit-learn.org
3 https://github.com/zhuwenxi317/GeneNSPCla
Wenxi Zhu et al.: Preprint submitted to Elsevier
Page 10 of 18
Improve Viral Genomic Feature Representation and Classification
One RNA sequence of Hanta virus in CRF format
ATTTGTCCTGCCCTCAGTCACAGTGTCCTTATTGTTTTACACATTGTGAGCCTACAGAATCTGCCTTTCAGGCACATTATAAAGTGTGCC AGGCAACACACAGATTTAGGGATGATTTGAAGAAGACAATAACACCTCAGTCTACAAGCCCTGGGTGTTACCGGACATTAAATCTCTT TAGATATAAAAGTAGGTGTTACATCT 1 -1 4 -1 4 -1 4 -1 3 -1 4 -1 2 -1 2 -1 4 -1 3 -1 2 -1 2 -1 2 -1 4 -1 2 -1 1 -1 3 -1 4 -1 2 -1 1 -1 2 -1 1 -1 3 -1 4 -1 3 -1 4 -1 2 -1 2 -1 4 -1 4 -1 1 -1 4 -1 4 -1 3 -1 4 -1 4 -1 4 -1 4 -1 1 -1 2 -1 1 -1 2 -1 1 -1 4 -1 4 -1 3 -1 4 -1 3 -1 1 -1 3 -1 2 -1 2 -1 4 -1 1 -1 2 -1 1 -1 3 -1 1 -1 1 -1 4 -1 2 -1 4 -1 3 -1 2 -1 2 -1 4 -1 4 -1 4 -1 2 -1 1 -1 3 -1 3 -1 2 -1 1 -1 2 -1 1 -1 4 -1 4 -1 1 -1 4 -1 1 -1 1 -1 1 -1 3 -1 4 -1 3 -1 4 -1 3 -1 2 -1 2 -1 1 -1 3 -1 3 -1 2 -1 1 -1 1 -1 2 -1 1 -1 2 -1 1 -1 2 -1 1 -1 3 -1 1 -1 4 -1 4 -1 4 -1 1 -1 3 -1 3 -1 3 -1 1 -1 4 -1 3 -1 1 -1 4 -1 4 -1 4 -1 3 -1 1 -1 1 -1 3 -1 1 -1 1 -1 3 -1 1 -1 2 -1 1 -1 1 -1 4 -1 1 -1 1 -1 2 -1 1 -1 2 -1 2 -1 4 -1 2 -1 1 -1 3 -1 4 -1 2 -1 4 -1 1 -1 2 -1 1 -1 1 -1 3 -1 2 -1 2 -1 2 -1 4 -1 3 -1 3 -1 3 -1 4 -1 3 -1 4 -1 4 -1 1 -1 2 -1 2 -1 3 -1 3 -1 1 -1 2 -1 1 -1 4 -1 4 -1 1 -1 1 -1 1 -1 4 -1 2 -1 4 -1 2 -1 4 -1 4 -1 4 -1 1 -1 3 -1 1 -1 4 -1 1 -1 4 -1 1 -1 1 -1 1 -1 1 -1 3 -1 4 -1 1 -1 3 -1 3 -1 4 -1 3 -1 4 -1 4 -1 1 -1 2 -1 1 -1 4 -1 2 -1 4 -2
Nucleotides transformation (after preprocessing) Negative sequential patterns A[0,1] ¬ TA [0,1]T [0,1]T A[0,1] ¬ TA [0,1]T A[0,1]T[0,1]¬A [0,1]T A[0,1]¬C[0,1]T[0,1]T A=60 C=44 G=39 T=61
A -> 1 C -> 2 G -> 3 T -> 4
Frequency 10 12 11 11
Viral genome high-frequency negative pattern of Negative sequential patterns Number distinct species Biological implication biological implication Recognition site of the ·····¬ GCCGGC ····· 1198 restriction enzyme HpaII
Nucleotide occurrence frequency
·····¬ GGCGCC ·····
1186
·····¬ GATC ····· ··
720
·····¬ CTGCAG ·····
938
·····¬ GGATCC ·····
953
Recognition site of the restriction enzyme MspI
Recognition sites of the restriction enzymes MboI and Sau3AI Recognition site of the restriction enzyme Pstl Recognition site of the restriction enzyme BamHI
Figure 2: Example of a CRF-encoded Hanta virus sequence and the corresponding negative sequential patterns. The upper part shows the original RNA sequence and its numerical encoding. The lower-left panel displays frequent negative sequential patterns identified by GONPM+, and the lower-right panel provides illustrative biological interpretations of such negative patterns reported in the literature.