Automatic annotation and database submission feature file generation method for coronavirus nucleic acid sequences

By establishing the positional correspondence between the target reference sequence and the coronavirus nucleic acid sequence to be annotated in metatranscriptome sequencing, mapping and verifying coding regions, the accuracy problem of annotating short coronavirus contig sequences was solved, automated database feature file generation was achieved, and processing efficiency and consistency were improved.

CN123120067APending Publication Date: 2026-11-17INST OF PATHOGEN BIOLOGY CHINESE ACADEMY OF MEDICAL SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611242979.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently process annotations of short coronavirus contig sequences obtained from metatranscriptome sequencing, particularly due to inaccurate determination of coding region boundaries and reading frames in the ORF1ab region. This results in a large workload for manual alignment and correction, and makes it difficult to generate compliant database submission feature files.

Method used

By establishing the positional correspondence between the target reference sequence and the coronavirus nucleic acid sequence to be annotated, the reference coding features are mapped to the sequence to be annotated, the coding region is constructed and translated and verified, the final coding region without internal stop codons is generated, and it is automatically written into the annotation file to generate the feature file required for database submission.

Benefits of technology

It has achieved automated annotation of coronavirus nucleic acid sequences of different lengths and generation of database feature files, which improves annotation efficiency and result consistency and reduces manual conversion steps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123120067A_ABST
    Figure CN123120067A_ABST
Patent Text Reader

Abstract

This invention relates to the field of nucleic acid sequence processing technology, and more particularly to a method for automatically annotating coronavirus nucleic acid sequences and generating feature files for database submission. This invention establishes a positional correspondence between a target reference sequence and the sequence to be annotated, and maps reference coding features to the sequence to be annotated accordingly. This allows coronavirus nucleic acid sequences of different lengths to obtain structured coding region annotations based on a reference template. By translating and verifying the constructed coding regions and adjusting the boundaries to obtain coding regions without internal stop codons, errors caused by directly copying reference coordinates are effectively avoided. Simultaneously, by automatically writing the coding region annotations into an annotation file and generating the feature files required for database submission, the manual conversion steps from annotation results to database submission files are reduced, improving annotation efficiency and result consistency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of nucleic acid sequence processing technology, and in particular to a method for automatically annotating coronavirus nucleic acid sequences and generating feature files for database submission. Background Technology

[0002] Coronaviruses are a class of enveloped, positive-sense, single-stranded RNA viruses with relatively large genomes among RNA viruses, capable of infecting a wide variety of mammals and birds. This family of viruses includes many viruses closely related to human and animal diseases, some of which have the ability to spread across host species and cause emerging infectious diseases. Due to the wide host range and active genetic variation of coronaviruses, which can form new genetic types through mutation and recombination, continuous surveillance of coronaviruses in wild animals and other hosts is a crucial foundation for discovering unknown viruses, understanding viral genetic diversity, assessing potential transmission risks, and improving pathogen databases.

[0003] Metatranscriptome sequencing, capable of simultaneously obtaining large amounts of RNA virus sequences from wild animals, environmental, or clinical samples without pre-defining the target virus, has become an important technique for discovering new viruses and investigating viral diversity. However, the viral sequences obtained through sequencing are usually not complete genomes. Influenced by factors such as viral abundance in the sample, the degree of nucleic acid degradation, sequencing depth, assembly breakpoints, and the complex structure of the viral genome, the assembly results often contain a large number of contigs with significant differences in length. A considerable portion of these only cover local regions of the viral genome, or only contain a part of a coding region, making it difficult to directly annotate according to the fixed structure of a complete viral genome.

[0004] The genomic structure of coronaviruses further complicates the annotation of such sequences. Compared to many RNA viruses with relatively simple genomes, coronaviruses have longer genomes, containing not only extensive replicase coding regions but also multiple structural protein genes and accessory genes. Gene composition, arrangement, and nomenclature can also vary between different genera or subgenera. In particular, ORF1ab is not a typical continuous open reading frame; its expression depends on programmed ribosome frameshifting, where ribosomes change the reading frame near a specific slip sequence, causing the two coding regions to combine and form the replicase polyprotein 1ab. Annotating this region requires not only identifying the slip site but also accurately expressing the connectivity between the coding regions before and after the frameshift. For short contigs obtained from metatranscriptome assembly, their start and end points may be located within any gene, or they may only cover the upstream, downstream, or just cross the slip site, making it easier to encounter problems with inaccurate determination of coding region boundaries, reading frames, partial states, and ORF1ab structure.

[0005] Existing general-purpose genome annotation tools are generally better suited for processing complete or near-complete genome sequences. For short coronavirus contigs that only cover local coding regions, they may fail to identify effective features, or require users to manually adjust coding region boundaries, reading frames, partial markers, and gene names. Regions involving programmed ribosomal frameshifts, such as ORF1ab, are particularly difficult to accurately express using only standard open reading frame prediction methods. This results in a large number of identifiable coronavirus sequences in metagenomic studies still requiring tedious manual alignment and annotation correction, limiting the efficiency of large-scale data processing.

[0006] Furthermore, nucleic acid sequence databases typically require not only the submission of the original nucleic acid sequence but also a structured annotation file with standardized coordinates, feature types, and limiting information. The five-list feature file is crucial for describing gene, CDS, product, partial status, and specific coding information during sequence submission. Current workflows usually require researchers to manually extract and transform the annotation results after sequence annotation, generating the corresponding five-list content line by line. This process is not only labor-intensive but also prone to inconsistencies between coding region coordinates, gene names, product names, partial markers, and programmed ribosome frameshift information.

[0007] Therefore, it is necessary to establish a method for processing complete and partially assembled coronavirus sequences of different lengths obtained from metatranscriptome sequencing. This method would enable batch annotation based on standardized reference sequences, normalize partial coding regions and coronavirus-specific coding structures, and automatically convert the annotation results into the five-list feature files required for database submission. This would reduce manual operations and improve the efficiency and consistency of annotating and preparing coronavirus sequences of different lengths for submission. Summary of the Invention

[0008] The technical problem to be solved by the present invention is to provide a method for automatically annotating coronavirus nucleic acid sequences and generating feature files for database submission, so as to solve the above-mentioned technical problem.

[0009] The technical solution of this invention to solve the above-mentioned technical problems is as follows: A method for automatic annotation and database submission feature file generation of coronavirus nucleic acid sequences, comprising: obtaining a coronavirus nucleic acid sequence to be annotated, and determining a target reference sequence matching the coronavirus nucleic acid sequence to be annotated from a preset reference database, wherein the preset reference database contains multiple reference sequences with encoded feature annotations; configuring the coronavirus nucleic acid sequence to be annotated to be aligned with the annotation direction of the target reference sequence, and performing sequence alignment between the coronavirus nucleic acid sequence to be annotated after the alignment and the target reference sequence to establish the nucleotide positions of the target reference sequence and the coronavirus nucleic acid sequence to be annotated after the alignment. The positional correspondence between nucleotide positions in the column is determined; for each reference coding feature in the target reference sequence, the reference coding feature is mapped to the coronavirus nucleic acid sequence to be annotated after the configuration direction based on the positional correspondence, and a coding region is constructed on the coronavirus nucleic acid sequence to be annotated after the configuration direction according to the coverage obtained after mapping and the reference coding feature; for each constructed coding region, the coding region is translated and verified, and the boundary of the coding region is adjusted according to the verification result to obtain a final coding region without internal stop codons; the annotations of each final coding region are written into an annotation file, and the feature file required for database submission is generated according to the annotation file.

[0010] The beneficial effects of this invention are as follows: By establishing a positional correspondence between the target reference sequence and the sequence to be annotated, and mapping the reference coding features to the sequence to be annotated accordingly, this invention enables structured coding region annotations for coronavirus nucleic acid sequences of different lengths to be obtained based on a reference template. By translating and verifying the constructed coding region and adjusting its boundaries to obtain a coding region without internal stop codons, errors caused by directly copying reference coordinates are effectively avoided. Simultaneously, by automatically writing the coding region annotations into an annotation file and generating the feature file required for database submission, the manual conversion steps from annotation results to database submission files are reduced, improving annotation efficiency and result consistency.

[0011] Based on the above technical solution, the present invention can be further improved as follows.

[0012] Furthermore, determining the target reference sequence matching the coronavirus nucleic acid sequence to be annotated from the preset reference database includes: comparing the coronavirus nucleic acid sequence to be annotated with each reference sequence in the reference database using a sequence alignment tool; when the sequence alignment tool returns a resolvable alignment record, selecting the reference sequence with the highest matching degree as the target reference sequence based on the alignment record; when the sequence alignment tool does not return a resolvable alignment record, performing common short fragment statistics on the coronavirus nucleic acid sequence to be annotated and each reference sequence in the reference database, and determining the target reference sequence based on the obtained statistical results.

[0013] Further, the step of performing common short fragment statistics based on the coronavirus nucleic acid sequence to be annotated and each reference sequence in the reference database to determine the target reference sequence includes: extracting the forward sequence and the reverse complementary sequence of the coronavirus nucleic acid sequence to be annotated; splitting the forward sequence, the reverse complementary sequence, and each reference sequence into continuous nucleotide fragments of a preset length to obtain a set of forward sequence fragments, a set of reverse complementary sequence fragments, and a set of each reference sequence fragment; for each reference sequence, calculating a first intersection number based on the set of reference sequence fragments corresponding to the reference sequence and the set of forward sequence fragments, and calculating a second intersection number based on the set of reference sequence fragments corresponding to the reference sequence and the set of reverse complementary sequence fragments; for each reference sequence, taking the maximum value between the first intersection number and the second intersection number as the number of common short fragments of the reference sequence; and determining the reference sequence with the highest number of common short fragments as the target reference sequence.

[0014] Further, the step of aligning the configured-direction coronavirus nucleic acid sequence to be annotated with the target reference sequence to establish a positional correspondence between the nucleotide positions of the target reference sequence and the nucleotide positions of the configured-direction coronavirus nucleic acid sequence to be annotated includes: aligning the configured-direction coronavirus nucleic acid sequence to be annotated with the target reference sequence to obtain alignment results; reading the alignment results column by column, and for each position in the alignment column where both the target reference sequence and the configured-direction coronavirus nucleic acid sequence to be annotated are actual nucleotides and not gap characters, establishing a one-to-one correspondence between the nucleotide positions of the target reference sequence and the nucleotide positions of the configured-direction coronavirus nucleic acid sequence to be annotated; and generating a mapping from the target reference sequence position to the configured-direction coronavirus nucleic acid sequence position, and a reverse mapping from the configured-direction coronavirus nucleic acid sequence position to the target reference sequence position, based on the one-to-one correspondence, as the positional correspondence.

[0015] Further, constructing a coding region on the coronavirus nucleic acid sequence to be annotated after the configuration direction based on the coverage obtained after mapping and the reference coding feature includes: determining whether the reference coding feature meets a preset frameshift construction condition; if it does, constructing a composite coding region as the coding region; otherwise, constructing a linear coding region as the coding region based on the coverage obtained after mapping; wherein, the preset frameshift construction condition includes: the annotation form of the reference coding feature is a composite structure containing a first segment and a second segment, and a predetermined frameshift motif exists in the candidate region between the end point of the first segment and the start point of the second segment; a specified nucleotide position in the predetermined frameshift motif can be mapped to a position on the coronavirus nucleic acid sequence to be annotated after the configuration direction through the position correspondence relationship, the position being located inside the coverage area of ​​the reference coding feature mapped to the coronavirus nucleic acid sequence to be annotated after the configuration direction, and the coronavirus nucleic acid sequence to be annotated after the configuration direction still retains the predetermined frameshift motif at that position.

[0016] Furthermore, the step of constructing a linear coding region as the coding region based on the coverage obtained after mapping includes: traversing each reference nucleotide position contained in the reference coding feature, converting the reference nucleotide positions that can be mapped to the coronavirus nucleic acid sequence to be annotated after the configuration direction into corresponding mapping positions on the coronavirus nucleic acid sequence to be annotated after the configuration direction through the position correspondence; determining an initial projection interval using the minimum and maximum values ​​among all corresponding mapping positions; and constructing a linear coding region of the corresponding type within the initial projection interval based on whether the start and end points of the reference coding feature are covered by the coronavirus nucleic acid sequence to be annotated after the configuration direction.

[0017] Furthermore, within the initial projection interval, constructing a linear coding region of the corresponding type based on whether the start and end points of the reference coding feature are covered by the coronavirus nucleic acid sequence to be annotated after the configured direction includes: if both the start and end points of the reference coding feature are covered by the coronavirus nucleic acid sequence to be annotated after the configured direction, then a complete coding region is constructed; if the start point of the reference coding feature is not covered but the end point is covered, then a 5′ partial coding region is constructed; if the start point of the reference coding feature is covered but the end point is not covered, then a 3′ partial coding region is constructed; if neither the start nor the end point of the reference coding feature is covered, then a double-ended partial coding region is constructed.

[0018] Furthermore, for each constructed coding region, the translation verification of the coding region is performed, and the boundary of the coding region is adjusted according to the obtained verification result to obtain a final coding region without internal stop codons. This includes: extracting the nucleic acid sequence of the coding region and translating it to obtain a translation result; detecting whether the translation result contains an internal stop codon; if the internal stop codon is contained, comparing the translation results of different reading frames and boundary models within the range supported by the position correspondence, and selecting the model with the longest effective translation length, annotation position that conforms to the region where the genome structure is located, and which does not contain an internal stop codon as the adjusted final coding region; if the internal stop codon is not contained, the coding region is taken as the final coding region that passes the verification.

[0019] Furthermore, the step of writing the annotations of each final coding region into an annotation file includes: organizing and filtering the features of each final coding region to obtain the organized coding region; performing a consistency check on the structural integrity and translation validity of the organized coding region; and outputting the annotations of the coding regions that pass the check as an annotation file in GenBank format.

[0020] Furthermore, the step of generating the feature file required for database submission based on the annotation file includes: reading the annotation file; converting the coded area annotations in the annotation file into a feature file format to obtain the converted coded area data; and generating the feature file required for database submission based on the converted coded area data. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating the automatic annotation and database submission feature file generation method for coronavirus nucleic acid sequences according to the present invention. Detailed Implementation

[0022] The principles and features of the present invention are described below. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0023] like Figure 1 As shown, this embodiment provides a method for automatically annotating coronavirus nucleic acid sequences and generating feature files for database submission, including: S101. Obtain the coronavirus nucleic acid sequence to be annotated, and determine the target reference sequence matching the coronavirus nucleic acid sequence to be annotated from the preset reference database. The preset reference database contains multiple reference sequences annotated with encoded features. S102. Configure the coronavirus nucleic acid sequence to be annotated to be consistent with the annotation direction of the target reference sequence, and perform sequence alignment between the coronavirus nucleic acid sequence to be annotated after the configuration direction and the target reference sequence to establish the positional correspondence between the nucleotide positions of the target reference sequence and the nucleotide positions of the coronavirus nucleic acid sequence to be annotated after the configuration direction. S103. For each reference coding feature in the target reference sequence, the reference coding feature is mapped to the coronavirus nucleic acid sequence to be annotated after the configuration direction based on the position correspondence, and a coding region is constructed on the coronavirus nucleic acid sequence to be annotated after the configuration direction according to the coverage obtained after mapping and the reference coding feature. S104. For each constructed coding region, the coding region is translated and verified, and the boundary of the coding region is adjusted according to the verification result to obtain the final coding region without internal stop codons. S105. Write the annotations of each final coding region into an annotation file, and generate the feature file required for database submission based on the annotation file.

[0024] This method establishes a positional correspondence between the target reference sequence and the sequence to be annotated, and maps the reference coding features to the sequence to be annotated accordingly. This allows coronavirus nucleic acid sequences of different lengths to obtain structured coding region annotations based on the reference template. By translating and verifying the constructed coding regions and adjusting the boundaries to obtain coding regions without internal stop codons, errors caused by directly copying reference coordinates are effectively avoided. Furthermore, by automatically writing the coding region annotations into an annotation file and generating the feature file required for database submission, the manual conversion steps from annotation results to database submission files are reduced, improving annotation efficiency and result consistency.

[0025] It should be noted that this method can be applied to the annotation of single coronavirus nucleic acid sequences as well as the batch annotation of multiple coronavirus nucleic acid sequences. When the input contains multiple sequences, the same annotation process is performed independently for each sequence. This method primarily applies to coronaviruses, and is particularly suitable for the automated annotation and database submission file generation of complete genomes, near-complete genomes, and partially assembled sequences of varying lengths that have been identified as belonging to the Coronaviridae family.

[0026] In this embodiment, the reference database is a pre-constructed structured sequence database, which contains multiple reference sequences annotated with coding features. Each reference sequence has standardized annotation information, which includes at least the genomic coordinates of the coding region (CDS), the gene name, the product name, and the labeling of the coding region structure type (linear or complex structure).

[0027] For viral genes with programmed ribosomal frameshift structures (such as ORF1ab of coronavirus), the corresponding coding features in the reference database are stored as a composite coding region containing a first segment and a second segment, and the linking position and frameshift motif information corresponding to the programmed ribosomal frameshift are marked in the annotation.

[0028] The reference database can be constructed based on known viral reference genomes in public sequence databases, obtained by uniformly standardizing the coding features in the reference genomes. Those skilled in the art can select appropriate reference sequences to construct a reference database suitable for the Coronaviridae family according to actual needs. This invention does not involve specific methods for constructing the reference database; the reference database, as a prerequisite input for implementing this method, is either provided by the user or pre-constructed by a third party.

[0029] Optionally, in an embodiment, determining the target reference sequence matching the coronavirus nucleic acid sequence to be annotated from a preset reference database includes: aligning the coronavirus nucleic acid sequence to be annotated with each reference sequence in the reference database using a sequence alignment tool; when the sequence alignment tool returns a resolvable alignment record, selecting the reference sequence with the highest matching degree as the target reference sequence based on the alignment record; when the sequence alignment tool does not return a resolvable alignment record, performing common short fragment statistics based on the coronavirus nucleic acid sequence to be annotated and each reference sequence in the reference database, and determining the target reference sequence based on the obtained statistical results.

[0030] For each coronavirus nucleic acid sequence to be annotated, the nucleic acid sequence alignment tool minimap2 is invoked to match the sequence with various reference sequences in the reference database. minimap2 supports rapid alignment of nucleic acid sequences with the reference database and outputs alignment records in a standard format.

[0031] Specifically, each sequence to be annotated is compared using two sets of preset parameters, asm20 and sr, and secondary alignment results are allowed to be output. That is, for each sequence to be annotated, multiple possible alignment candidates are retained, rather than just the best one.

[0032] Read the PAF (Pairwise Alignment Format) records output by minimap2. From each parsable alignment record, extract the following information: reference sequence identifier, matching direction, number of matching bases, alignment segment length, and alignment quality value. Alignment consistency is calculated by dividing the number of matching bases by the alignment segment length, i.e., alignment consistency = number of matching bases / alignment segment length.

[0033] Then, the overall score for each comparison record is calculated according to the following formula: Overall score = number of matching bases + 0.15 × alignment segment length + 100 × alignment consistency + 0.01 × alignment quality value.

[0034] Among all candidate alignment records generated by the two sets of alignments (asm20 and sr), the reference sequence corresponding to the record with the highest comprehensive score is selected as the target reference sequence.

[0035] If the overall scores are the same, the following criteria are used to compare the number of matching bases (larger ones take priority), the length of the aligned segment (longer ones take priority), and the alignment consistency (higher ones take priority) in sequence until the final result is determined.

[0036] Read the orientation field from the selected optimal alignment record. If the field indicates that the sequence to be annotated is in the same orientation as the target reference sequence, no processing is required. If the field indicates that the sequence to be annotated is in the opposite orientation to the target reference sequence, perform an inverse complementary transformation on the sequence to be annotated so that subsequent sequence alignment, coordinate mapping and feature annotation are all performed in the same positive coordinate system as the target reference sequence.

[0037] Optionally, in an embodiment, common short fragment statistics are performed based on the coronavirus nucleic acid sequence to be annotated and various reference sequences in a reference database to determine the target reference sequence, including: extracting the forward sequence and reverse complementary sequence of the coronavirus nucleic acid sequence to be annotated; splitting the forward sequence, reverse complementary sequence, and each reference sequence into continuous nucleotide fragments of a preset length to obtain a set of forward sequence fragments, a set of reverse complementary sequence fragments, and a set of reference sequence fragments; for each reference sequence, calculating a first intersection number based on the reference sequence fragment set and the forward sequence fragment set corresponding to the reference sequence, and calculating a second intersection number based on the reference sequence fragment set and the reverse complementary sequence fragment set corresponding to the reference sequence; for each reference sequence, taking the maximum value between the first intersection number and the second intersection number corresponding to the reference sequence as the number of common short fragments of the reference sequence; and determining the reference sequence with the highest number of common short fragments as the target reference sequence.

[0038] When neither of the two minimap2 alignments (asm20 and sr) returns any resolvable candidate records, a backup reference selection based on shared short nucleotide fragments is initiated.

[0039] Specifically, the forward and reverse complementary sequences of the sequence to be annotated are extracted separately, and both, as well as each reference sequence in the reference database, are split into continuous fragments of 9 nucleotides in length (i.e., 9-mer).

[0040] During the splitting process, the following two filtering rules are executed: fragments containing the uncertain base "N" are not included in the calculation; repeated identical fragments are counted as a different fragment, i.e., deduplication.

[0041] For each reference sequence, calculate the following two values: the number of intersections between the 9-mer set of the reference sequence and the forward 9-mer set of the sequence to be annotated (i.e., the number of common distinct segments); and the number of intersections between the 9-mer set of the reference sequence and the reverse complementary 9-mer set of the sequence to be annotated. Then, take the larger of these two values ​​as the backup score for the reference sequence, i.e., the number of common short segments. The reference sequence with the highest backup score is selected as the target reference sequence.

[0042] If the number of 9-mers in the forward direction is greater than or equal to the number of 9-mers in the reverse direction, the sequence to be annotated is determined to be in the forward direction; otherwise, it is determined to be in the reverse direction. For input sequences shorter than 9 nucleotides, 9-mer comparison is not performed; instead, the first reference sequence in the reference database is selected by default and determined to be in the forward direction.

[0043] Optionally, in an embodiment, the coronavirus nucleic acid sequence to be annotated after configuration is aligned with the target reference sequence to establish a positional correspondence between the nucleotide positions of the target reference sequence and the nucleotide positions of the coronavirus nucleic acid sequence to be annotated after configuration. This includes: aligning the coronavirus nucleic acid sequence to be annotated after configuration with the target reference sequence to obtain alignment results; reading the alignment results column by column; and establishing a one-to-one correspondence between the nucleotide positions of the target reference sequence and the coronavirus nucleic acid sequence to be annotated after configuration for each position in the alignment column where both the target reference sequence and the coronavirus nucleic acid sequence to be annotated after configuration are actual nucleotides and not gap characters; and generating a mapping from the target reference sequence position to the coronavirus nucleic acid sequence position to the coronavirus nucleic acid sequence position to the coronavirus nucleic acid sequence position to the coronavirus nucleic acid sequence position after configuration, and a reverse mapping from the coronavirus nucleic acid sequence position to the target reference sequence position, based on the one-to-one correspondence, as the positional correspondence.

[0044] After unifying the sequence orientation, the MAFFT software is used to align the annotated coronavirus nucleic acid sequence with the selected target reference sequence. Specifically, the length ratio of the annotated coronavirus nucleic acid sequence to the target reference sequence is first obtained, i.e., the length of the annotated coronavirus nucleic acid sequence divided by the length of the target reference sequence. Different alignment modes are selected based on this ratio. When the length of the coronavirus nucleic acid sequence to be annotated is less than 75% of the target reference sequence length, the addfragments mode is used. This mode is specifically designed to add one or more short sequence fragments to an existing reference sequence without forcing a global end-to-end alignment between the short sequence and the reference sequence. For short contigs that only cover a local region of the genome, this mode can accurately locate the short sequence to the corresponding region of the reference sequence without causing erroneous global alignments due to deletions at both ends.

[0045] When the length of the coronavirus nucleic acid sequence to be annotated reaches more than 75% of the length of the reference sequence, the auto mode is used. This mode allows MAFFT to automatically select the optimal alignment strategy based on the length and number of sequences. For longer coronavirus nucleic acid sequences to be annotated, it can make full use of the overall homology and generate a more accurate global alignment.

[0046] If the process fails to complete normally, such as due to abnormal program exit or failure to generate valid comparison results, the auto mode will be used again for backup comparison to ensure that the process can continue.

[0047] The aforementioned 75% length ratio is used to distinguish between clearly partially assembled sequences and nearly complete sequences. It is an adjustable implementation parameter, rather than an absolute biological limit for viral sequences.

[0048] After obtaining the alignment results, the alignment status of the target reference sequence and the coronavirus nucleic acid sequence to be annotated is read column by column. The following filtering rules are used to establish coordinate mapping: a one-to-one correspondence between the reference nucleotide position and the query nucleotide position is established only when both the target reference sequence and the coronavirus nucleic acid sequence to be annotated are actual nucleotides and neither contains gap characters in the same alignment column. For alignment columns containing gaps (insertions or deletions), no coordinate correspondence is established to avoid misinterpreting alignment gaps as true homologous positions.

[0049] Based on the above rules, two mapping tables are established simultaneously: a mapping table from the target reference sequence position to the coronavirus nucleic acid sequence position to be annotated (forward mapping), used to project the reference CDS coordinates onto the coronavirus nucleic acid sequence to be annotated; and a reverse mapping table from the coronavirus nucleic acid sequence position to the target reference sequence position (reverse mapping), used to determine the coverage, feature boundaries, and adjacent upstream and downstream structures of the reference genome corresponding to a certain position on the coronavirus nucleic acid sequence to be annotated.

[0050] Optionally, in an embodiment, constructing a coding region on the coronavirus nucleic acid sequence to be annotated after the configuration direction based on the coverage obtained after mapping and the reference coding feature includes: determining whether the reference coding feature meets the preset frameshift construction conditions; if it does, constructing a composite coding region as the coding region; otherwise, constructing a linear coding region as the coding region based on the coverage obtained after mapping; wherein, the preset frameshift construction conditions include: the annotation form of the reference coding feature is a composite structure containing a first segment and a second segment, and a predetermined frameshift motif exists in the candidate region between the end point of the first segment and the start point of the second segment; a specified nucleotide position in the predetermined frameshift motif can be mapped to a position on the coronavirus nucleic acid sequence to be annotated after the configuration direction through a positional correspondence, the position being located inside the coverage area of ​​the reference coding feature mapped to the coronavirus nucleic acid sequence to be annotated after the configuration direction, and the coronavirus nucleic acid sequence to be annotated after the configuration direction still retains the predetermined frameshift motif at that position.

[0051] This method reads the CDS features from the best reference record sequentially. For each CDS feature, the coding region type is first determined based on its annotation form in the reference database: for reference coding features with a linear annotation structure, the linear coding region construction process is followed; for reference coding features with a composite annotation structure containing a first segment and a second segment (i.e., a procedural ribosomal shift coding region), the composite coding region construction process is followed first, and the process reverts to the linear coding region construction process only when the composite coding region construction conditions are not met.

[0052] Optionally, in an embodiment, constructing a linear coding region as a coding region based on the coverage obtained after mapping includes: traversing each reference nucleotide position contained in the reference coding feature, converting the reference nucleotide positions that can be mapped to the coronavirus nucleic acid sequence to be annotated after the configuration direction into corresponding mapped positions on the coronavirus nucleic acid sequence to be annotated after the configuration direction through position correspondence; determining an initial projection interval using the minimum and maximum values ​​among all corresponding mapped positions; and constructing a linear coding region of the corresponding type within the initial projection interval based on whether the start and end points of the reference coding feature are covered by the coronavirus nucleic acid sequence to be annotated after the configuration direction.

[0053] For each CDS, the reference nucleotide positions within each segment are processed one by one, and each reference position is converted into the corresponding position on the sequence to be annotated using a forward mapping table.

[0054] The number of successfully mapped nucleotides on the sequence to be annotated for each reference CDS is counted. Only when a reference CDS has at least 6 mapped nucleotides does it proceed to subsequent candidate feature construction. This excludes noisy projections resulting from only a few accidental base matches, while retaining coding evidence in short contigs that may only cover small local fragments. This threshold alone is insufficient to guarantee the reliability of the annotation; ultimately, it still requires subsequent boundary checks, length verification, and translation validation to ensure its reliability.

[0055] The minimum and maximum values ​​among all successfully mapped positions are used as the initial start and end points of the candidate CDS on the sequence to be annotated, respectively, to determine the initial projection interval. Simultaneously, based on the query positions mapped upstream and downstream of this reference CDS, the left and right boundaries of the allowed extension of the candidate CDS are determined to prevent the candidate CDS boundary search from crossing into the coding regions of adjacent genes.

[0056] For the start and end points of the reference CDS, a valid mapping is checked within a 12-nucleotide window near the boundary. This 12-nucleotide window is set to accommodate local insertions, deletions, or slight shifts during alignment, such as misalignments of one or more bases in the alignment result. If a valid mapping exists within the 12-nucleotide window near the boundary, the boundary is considered to be covered by the sequence to be annotated; if no valid mapping exists at all, the boundary is considered not to be covered by the sequence to be annotated.

[0057] Optionally, in an embodiment, within the initial projection interval, a linear coding region of the corresponding type is constructed based on whether the start and end points of the reference coding feature are covered by the coronavirus nucleic acid sequence to be annotated after the configured direction. This includes: if both the start and end points of the reference coding feature are covered by the coronavirus nucleic acid sequence to be annotated after the configured direction, a complete coding region is constructed; if the start point of the reference coding feature is not covered but the end point is covered, a 5′ partial coding region is constructed; if the start point of the reference coding feature is covered but the end point is not covered, a 3′ partial coding region is constructed; if neither the start nor the end point of the reference coding feature is covered, a double-ended partial coding region is constructed.

[0058] When both the start and end points of the reference CDS are covered by the sequence to be annotated, an attempt is made to construct a complete coding region model. First, the ATG start codon is searched near the projection boundary. For each candidate ATG start point, the stop codon is searched backward along the same reading frame from that position.

[0059] Candidate CDS must meet the following three conditions simultaneously: the coding length is 0.55 to 1.50 times the length of the reference CDS. This range is set relatively loosely to accommodate differences in gene length between different viruses and local alignment errors, while excluding open reading frames that are significantly disproportionate to the reference coding length; there are no internal stop codons in the translation result; and a stop codon is formed at the end.

[0060] For candidate models that meet the above conditions, scores are calculated according to the following scoring formula: Score = Starting point deviation × 4 + Ending point deviation × 4 + Length ratio deviation × 600; The starting point deviation is the distance between the candidate starting point and the reference projection starting point; the ending point deviation is the distance between the candidate ending point and the reference projection ending point; and the length ratio deviation is the degree of deviation between the candidate length and the reference length ratio (ranging from 0.55 to 1.50, with smaller deviations closer to 1.0). The model with the lowest score is selected as the final result. The scoring prioritizes candidates whose boundaries are close to the reference projection and whose lengths are close to the reference CDS.

[0061] When a complete model meeting the requirements cannot be formed, i.e., at least one end of the reference CDS is not covered by the sequence to be annotated, this method does not presuppose missing segments outside the input sequence, nor does it perform any presupposed annotation for genomic regions not covered by the input sequence. Instead, it constructs a partial coding region (partial CDS) based on the actual situation. This method is applicable to complete, near-complete, and partially assembled viral sequences of different lengths. For incomplete sequences, only the coding regions that are actually covered and supported by reference alignment are annotated, and the corresponding partial status is marked according to the coverage of the coding region boundaries. This method does not undertake the assembly and completion of missing sequences.

[0062] If the reference start or end point is covered, the nearest start or stop codon is searched within 120 nucleotides before and after the projection boundary. If the corresponding boundary is not covered, for example, if the start point of the sequence to be annotated is after the reference CDS start point, the boundary supported by the actual alignment is used directly, and no inferences are made about missing segments outside the input sequence.

[0063] Based on the translation results of the three reading phases, it is determined in which phase the region actually covered by the sequence to be annotated can form the most reasonable translation product, thereby determining the precise boundary and reading frame of the partial CDS, and establishing partial CDS with 5′ incomplete, 3′ incomplete, or double-ended incomplete ends.

[0064] In existing technologies, short contigs often fail to provide effective structural annotation, or only yield complete gene models that do not match the actual coverage. The main reason is that general annotation workflows typically use a complete or near-complete genome as the default, relying on complete start and stop codons and fixed gene sequences. When short contigs lack one or both ends of the genome, the conditions for a complete model are difficult to meet. To address this, our method first determines the best-matching reference and sequence orientation, then establishes a coordinate mapping between the reference position and the query position. Based on the actual mapping coverage, it constructs complete coding regions, 5′ partial coding regions, 3′ partial coding regions, or paired-end partial coding regions to overcome the shortcomings of existing technologies.

[0065] For cases where the annotation form in the reference coding feature is a complex structure (i.e., containing a first segment and a second segment), the process of identifying and constructing the complex coding region is executed first. In this embodiment, the frameshift structure is only identified when the ORF1ab (or other viral genes with programmed ribosomal frameshift structures) in the reference record has been annotated as a complex CDS consisting of two segments.

[0066] Specifically, the two reference regions are first sorted according to genomic coordinates, and the locations near the end of the first region and the beginning of the second region are selected as candidate connection regions. A search is then conducted within a 4-nucleotide range before and after each candidate location for the local nucleotide marker AAAC used to locate the frameshift connection position. This narrow search accommodates potential differences in coordinate representation of GenBank region boundaries before and after the shared nucleotide (e.g., the coordinate representation of the frameshift site may differ by 1 nucleotide in different GenBank records), while avoiding the arbitrary selection of irrelevant identical short motifs throughout the entire ORF1ab coding region. Since the AAAC tetranucleotide sequence may appear multiple times in the genome, an excessively large search range may result in the selection of incorrect motif positions.

[0067] When AAAC is detected, the last cytosine in it is used as the linking nucleotide shared by the two segments of the reference complex CDS, and the position is converted into the coordinates of the sequence to be annotated by a reference-to-query coordinate mapping.

[0068] A composite coding region, i.e., a composite ORF1ab CDS, is established only when the following three conditions are met simultaneously: The reference coding feature is a composite CDS containing a first segment and a second segment, and the first segment and the second segment share a nucleotide relationship at the frameshift position, that is, the end point of the first segment coincides with or overlaps with the start point of the second segment. The reference position of the shared linker nucleotide can be successfully converted into a valid position on the sequence to be annotated through coordinate mapping, and the mapped position is located inside the coding region of the sequence to be annotated, that is, within the start and end coordinate range of the constructed candidate coding region; The sequence to be annotated, from the three nucleotides before the mapping position to that position (i.e., backtracking three nucleotides, a total of four nucleotide windows), still accurately forms the AAAC tetranucleotide sequence, indicating that the sequence to be annotated retains the complete frameshift motif in this region.

[0069] When all three conditions are met, a compound coding region is established: its first segment terminates after the shared cytosine, and the second segment begins from the same cytosine, with the two segments overlapping by 1 nucleotide, i.e. sharing the same cytosine. The comment is written as exception=ribosomal_slippage to indicate that there is a programmed ribosomal frameshift in the coding region.

[0070] In existing technologies, conventional continuous CDS models cannot accurately represent the programmed ribosomal frameshift structure of coronavirus ORF1ab. Because ORF1ab translation depends on a specific frameshift position and a combination of adjacent coding regions, treating it as a conventional continuous coding region may result in reading frames and protein products that do not conform to the actual coding mechanism of coronaviruses. To address this, this method uses the frameshift position in a reference ORF1ab complex CDS to locate the corresponding position in the sequence to be annotated via reference-query coordinate mapping, and combines this with the frameshift motif in the sequence to be annotated to construct a complex CDS with shared nucleotides, thus overcoming the aforementioned drawbacks.

[0071] This triple constraint mechanism—reference composite structure, precise coordinate mapping, and querying local motifs—is more effective at reducing erroneous composite annotations caused by accidental matches than relying solely on the presence of short motifs in the sequence to be annotated. For example, AAACs may appear accidentally at other positions in the sequence to be annotated, but these positions are not actual shift points. If any condition is not met (e.g., the reference structure is not a composite CDS, the reference connection position cannot be mapped, the mapped position is not within the candidate interval, or the corresponding position in the sequence to be annotated does not retain AAACs), then a shifted composite structure is not constructed, and a linear complete or partial CDS is generated according to the actual coverage.

[0072] For sequences that do not cover the frameshift region or lack sufficient structural support, a standard linear partial CDS is generated based on the actual coverage area, without forcing the construction of a composite structure. This branching process allows the same workflow to be compatible with different sequences that cover only the upstream region of the frameshift site, only the downstream region of the frameshift site, span the frameshift site, and do not involve the frameshift region at all.

[0073] In existing technologies, candidate CDS may contain internal stop codons or unreasonable coding start phases during translation. The main reason is that the projected coordinates can be affected by assembly boundaries, insertions / deletions, and reading frame offsets; directly copying the reference boundary cannot guarantee that the sequence to be annotated is in the correct reading frame. To address this, our method performs translation quality checks on each candidate coding region, compares different reading frames and boundary models within the reference support range, and retains only protein translation results that form non-empty sequences without internal stop codons, while standardizing the coding start phase without altering the protein sequence.

[0074] Optionally, in an embodiment, for each constructed coding region, translation verification is performed on the coding region, and the boundary of the coding region is adjusted according to the obtained verification result to obtain a final coding region without internal stop codons. This includes: extracting the nucleic acid sequence of the coding region and translating it to obtain a translation result; detecting whether the translation result contains internal stop codons; if internal stop codons are present, determining the candidate adjustment range of the coding region based on the positional correspondence and in combination with the genome structure of the corresponding virus; within the candidate adjustment range, comparing the translation results of different reading frames and boundary models, and selecting the model whose coding region position and boundary match the genome structure, has the longest effective translation length, and does not contain internal stop codons as the adjusted final coding region; if no internal stop codons are present, the coding region is taken as the final coding region that passes the verification.

[0075] The extraction of candidate CDS nucleic acid sequences and codon translation were performed using Biopython's sequence processing function, employing a standard genetic code table. Nucleic acid sequences of linear or complex regions were extracted sequentially based on the coordinates of candidate features. The translation start point was determined according to the 0, 1, or 2 nucleotide offset corresponding to codon_start, and nucleotides with a terminal length less than one complete codon were temporarily omitted from translation.

[0076] Codon translation is a conventional technique, but this method does not directly accept the initial translation result. Instead, it uses it as a constraint for candidate boundaries and reading phase selection. After translation, this method calculates the effective coding nucleotide length, whether the protein sequence is empty, the total number of stop codons, the number of internal stop codons, whether the end is a stop codon, and the position of the first stop codon in the coding sequence.

[0077] For a complete CDS, this method prioritizes models that do not contain internal stop codons, have reasonable start and end boundaries, and highly overlap with the reference projection. If internal stop codons exist in the initial candidate translation results, the translation results of different reading frames and boundary models are compared within the range supported by the positional correspondence (i.e., without crossing into adjacent gene regions), and the model with the longest effective translation length and no internal stop codons is selected as the adjusted coding region.

[0078] For partial CDS, this method sequentially compares the reference phase and the remaining reading phases, searching for continuous translation fragments without stop codons within candidate regions. Boundary adjustments are initially limited to within 600 nucleotides to avoid annotation boundaries deviating from the original reference projection; the search range is only broadened when an effective model cannot be obtained locally. Candidate partial models are preferentially selected from longest to shortest effective translation length. When lengths are similar, the retention of the reference estimated phase, the retention of longer nucleic acid regions, and the minimization of boundary movement are considered sequentially. If a coding region without an internal stop codon cannot be obtained after boundary adjustments, the longest translation fragment without an internal stop codon corresponding to that coding region is used, and its integrity status is adjusted accordingly.

[0079] Before final writing, this method requires each CDS to have a non-empty translation result and to be free of internal stop codons. For CDS with incomplete 5′ ends and where the original candidate model requires codon_start=2 or 3, the corresponding 1 or 2 nucleotide phase shift is absorbed into the biological 5′ end coordinates, i.e., the 5′ end boundary is shifted downstream by 1 or 2 nucleotides along the coding direction, and codon_start is normalized to 1. This conversion is only accepted when the protein sequence before and after adjustment is completely identical, thus ensuring that format normalization does not change the actual coding meaning.

[0080] The aforementioned 600 nucleotide values ​​are engineering parameters that control the search range. Their rationale is to prioritize preserving the local structure near the reference projection and avoid unconstrained movement of the boundary in order to obtain translations without internal termination.

[0081] In existing technologies, conventional open reading frame (OPG) searches often select reading frames or boundaries that are inconsistent with the coronavirus gene structure. This is mainly because short sequences may contain multiple incidental OPGs, and relying solely on the longest OPG cannot determine whether it corresponds to the actual viral gene, nor can it prevent it from crossing adjacent gene regions. To address this, our method utilizes standardized reference features to define the gene identity and allowed range of candidate coding regions, and combines reference mapping coverage, adjacent feature positions, coding length, and translation quality to jointly select boundaries, thus resolving the aforementioned drawbacks.

[0082] Optionally, in an embodiment, the annotations of each final coding region are written into an annotation file, including: sorting and filtering the features of each final coding region to obtain sorted coding regions; performing a consistency check on the structural integrity and translation validity of the sorted coding regions; and outputting the annotations of the coding regions that pass the check as an annotation file in GenBank format.

[0083] After completing the candidate coding region construction, boundary optimization, and translation quality verification, the generated annotation features are uniformly organized to avoid duplicate annotations for the same coding region due to different projection methods or boundary adjustments.

[0084] For multiple candidate CDS with the same gene name, the candidates are compared based on the coverage of the candidate region, the effective coding length, and the translation quality. Candidates that can cover the reference coding region more completely, have a longer effective translation interval, and do not have internal stop codons are given priority. When multiple candidate results meet the translation quality requirements, the result with the smaller deviation from the projection boundary of the reference sequence is further selected.

[0085] For potential local overlaps between different genes, instead of simply deleting the overlapping regions, we determine whether to retain the corresponding features based on the gene structural relationships in the reference sequence, the reference support of the candidate CDS, and the translation effectiveness, thereby avoiding the erroneous deletion of the true coding region due to local sequence overlap.

[0086] Finally, the processed features are written into a GenBank format file, and the output includes the nucleic acid sequence after unification, CDS coordinates, gene, product, codon_start, transl_table, translation, and exception information corresponding to programmed ribosome frameshift.

[0087] Before GenBank files are generated, a consistency check is performed on all CDS to ensure that each coding region has a valid translation result and no internal stop codons. The partial state, composite CDS structure, and special coding information are verified to conform to preset rules. At the same time, quality check information is generated for subsequent manual review.

[0088] Optionally, in an embodiment, generating the feature file required for database submission based on the annotation file includes: reading the annotation file; converting the coded area annotations in the annotation file into a feature file format to obtain the converted coded area data; and generating the feature file required for database submission based on the converted coded area data.

[0089] Using annotated and quality-verified GenBank files as input, BioPython reads sequence records and their feature information one by one. Instead of performing reference selection, sequence alignment, or coding region prediction, it converts the already determined feature coordinates, chain orientation, partial status, and constraint information in GenBank into NCBI five-list feature files.

[0090] First, the input file is checked to ensure it contains valid records and that record identifiers are not duplicated. Record identifiers used for the five list headers must be non-empty, contain no whitespace characters, and be representable using ASCII characters. For each feature to be output, its coordinates are also checked to ensure they exist, that each interval is within the corresponding sequence length, and that the start of the interval is less than the end point.

[0091] During coordinate transformation, the zero-starting point and right-end open coordinates used by BioPython are converted to the starting point and closed interval coordinates used by the five-list system. Positive chain features are output in the order of "starting point plus 1, ending point unchanged"; negative chain features are output in the reverse order of "ending point, starting point plus 1". When GenBank coordinates use BeforePosition or AfterPosition to indicate that the 5′ end or 3′ end is incomplete, the corresponding "<" or ">" mark is retained before the five-list coordinates.

[0092] For a composite CDS consisting of multiple intervals, the intervals are sorted according to the chain direction, the first row is written with the feature type, and the subsequent intervals are output as continuous coordinate rows. Therefore, the programmatic ribosomal shifter composite structure can be preserved as is.

[0093] Instead of directly copying existing gene features from GenBank, the features are grouped according to their / gene values ​​in both non-source and non-gene features. For each distinct gene name, the minimum start and maximum end points of all relevant feature intervals in that group are calculated, and the partial marker of the outermost interval is inherited to generate a single, continuous gene interval aligned with the direction of the relevant feature chain. Thus, the CDS of the composite coding region can maintain its composite structure composed of multiple intervals, while the corresponding gene features cover the entire range of the CDS and are represented as continuous intervals.

[0094] When outputting restricted information, retain the restricted fields and their original values ​​in the input features, excluding preset exclusions, including gene, product, codon_start, transl_table, and necessary exceptions. Note, inference, translation, and individual ribosomal_slippage restrictions are not written into the five-list to ensure the final five-list is clean and meets submission requirements. If the input features indicate the presence of procedural ribosomal frameshifts through ribosomal_slippage or exception restrictions, standardize different writing methods into a single exception ribosomal_slippage to avoid duplicate output of the same frameshift information.

[0095] All feature types, qualified names, and qualified values ​​are cleaned of tabs, newlines, and consecutive whitespace before being written, and are checked to ensure they can be represented by ASCII characters, reducing submission errors caused by illegal characters or formatting issues. An audit table is also generated simultaneously, recording the sequence identifier, feature type, GenBank location, number of constituent intervals, number of output qualified items, and specific qualified information for each item. This is used to verify whether the five lists fully inherit the structured comments in the final GenBank.

[0096] In existing technologies, annotation results cannot be directly submitted to databases; a five-list feature file still needs to be manually created, and it is difficult to maintain consistent naming and annotation rules when processing a large number of sequences manually. The main reason is that the output format of common annotation tools differs from the five-list format of nucleic acid sequence databases, requiring each gene, CDS, partial marker, and special qualifier to be copied and organized individually. Furthermore, manual operation is affected by the experience and processing order of different personnel, easily leading to different names for the same type of gene and different boundary handling methods for the same type of partial sequence. To address this, this method uses the final GenBank annotation result as the sole input, automatically reads coordinates and constraint information, reconstructs continuous gene features, retains the composite CDS, and outputs necessary qualifiers according to the five-list format. The reference feature standardization rules and quality verification logic are embedded in the program, applying the same judgment process and output rules to all sequences to be annotated in the same batch.

[0097] For processing coronavirus nucleic acid sequences, users need to provide complete or partially assembled coronavirus sequences in FASTA format. After processing using the above method, a GenBank annotation file is generated, containing structured CDS, gene, product, coding initiation phase, translation results, and necessary anomaly descriptions, as well as a five-list feature file automatically generated from the final GenBank annotation file. Furthermore, a quality check report on coding region translation and feature structure, and an optional audit log of the five-list generation process can be generated as supplementary outputs.

[0098] The following describes this method using specific scenarios: Scenario 1: A short contig that covers only a single coding region.

[0099] The user inputs a short contig belonging to the Coronaviridae family, but only covering a local region of a reference CDS. The core annotation script, Annotation.py, first selects the best-matching reference and determines the sequence orientation, then positions the contig to the reference genome through paired alignment. Since the sequence to be annotated does not cover one or both ends of the reference CDS, the program does not force a full gene search; instead, it generates a corresponding partial CDS based on the actual coverage area and compares the translation results of the three reading frames, selecting a reasonable model that does not contain an internal stop codon within the reference support range. Finally, the gene, product, partial coordinates, codon_start, and translation are written to GenBank.

[0100] It should be noted that Annotation.py is the core script for implementing the above annotation methods. Its main functions include: reading the coronavirus assembly sequence and standardized reference library provided by the user, completing reference selection, orientation determination, sequence alignment, feature coordinate projection, construction of complete or partial coding regions, translation quality verification, ORF1ab special structure processing, and generating GenBank results with structure annotations.

[0101] Scenario 2: Contig spanning the ORF1ab ribosomal frameshift region.

[0102] The user inputs a sequence that spans the ORF1ab programmed ribosomal frameshift region. The program determines the frameshift position from the composite ORF1ab CDS of the best reference record and maps this position to the sequence to be annotated; simultaneously, it checks whether the corresponding region of the sequence to be annotated has a frameshift motif consistent with coronavirus characteristics. If the condition is met, the program constructs a composite CDS of the two coding regions sharing nucleotides and performs a translation quality check on the composite nucleic acid sequence. If the sequence to be annotated does not cover a sufficient frameshift region, a composite structure is not constructed, and a linear partial CDS is generated based on the actual coverage.

[0103] Scenario 3: Automatically generate five-list feature files from GenBank.

[0104] The final GenBank file output from Annotation.py is input into the feature file generation script genbank_to_ncbi_five_column.py. The script reads the CDS and constraint information from each record, outputting coordinates and feature names in a five-column format; it generates continuous gene features by taking the outermost boundary of features associated with the same gene; it retains the composite CDS interval for ORF1ab and outputs the exception corresponding to the ribosome frameshift. This process does not re-predict genes, ensuring that the five-column is generated based on the final annotation results that have already undergone quality verification.

[0105] It should be noted that genbank_to_ncbi_five_column.py is the core script for generating the aforementioned feature files. Its main functions are: to read the GenBank file output by Annotation.py, automatically generate the five-column feature file used for submission to the nucleic acid sequence database, and organize information such as gene, CDS, product, codon_start, and exception according to the submission format requirements.

[0106] Compared with existing technologies, this method has the following main advantages: This invention constructs a standardized reference database, pre-unifying coronavirus gene names, product names, coding region structures, and ORF1ab-specific annotations. Before annotating each sequence, the most matching reference sequence is selected first, followed by subsequent feature projection. This approach allows contigs of different sources and lengths to be annotated based on the closest coronavirus structural template, effectively reducing gene identity and boundary biases caused by inappropriate reference selection.

[0107] This invention determines the relative orientation of the sequence to be annotated and the reference sequence before feature projection and establishes a bidirectional coordinate relationship through comparative alignment. This ensures that the reference coding region accurately falls in the correct position and orientation of the sequence to be annotated, providing a consistent coordinate basis for subsequent reading frame determination, partial labeling, and protein translation.

[0108] This invention does not require complete start and stop codons as mandatory conditions for all sequences. Instead, it determines the integrity of coding regions based on whether the reference boundary is covered by the sequence to be annotated. This allows short contigs that cannot be completed into a full-length genome to still obtain structured and interpretable coding region annotations, while reducing the possibility of misclassifying partial sequences as complete genes.

[0109] This invention performs actual translation of candidate boundaries and uses internal stop codons, effective coding length, reference support range, and partial states to jointly screen models. This avoids erroneous reading frames caused by directly copying reference coordinates based solely on nucleic acid similarity, improves the rationality of the final coding region at the protein level, and reduces the workload of subsequent manual line-by-line correction.

[0110] This invention generates a shared nucleotide complex coding region only when the frameshift position of the reference complex coding region can be mapped to the sequence to be annotated and the query region satisfies the frameshift structure condition. This allows the program to distinguish between ordinary linear coding regions and coding region structures that truly span programmed ribosome frameshift regions, avoiding the simplification of the coronavirus's unique coding mechanism into ordinary continuous coding regions.

[0111] The five-list generation script of this invention directly reads the quality-verified coordinates and constraint information, and reconstructs the gene and coding region structures according to uniform rules. This reduces the workload of manually copying coordinates, determining chain direction, and filling in partial markers and special qualifiers, while maintaining the consistency between the annotation results and the five-list content.

[0112] This invention applies the same reference selection, feature projection, translation checking, and format output process to all sequences in the input file using the same procedure. Compared to manual processing line by line, this significantly reduces repetitive operations and lowers the risk of inconsistent annotation rules used by different operators or in different batches.

[0113] In summary, the core of this invention is not simply calling existing sequence alignment tools, nor is it an isolated conversion of one text format to another. Instead, it addresses the large number of coronavirus sequences of varying lengths generated by metatranscriptomics by forming a continuous technical workflow encompassing standardized reference feature projection, complete / partial coding region determination, protein translation quality verification, ORF1ab procedural ribosome frameshifting, and automatic generation of five-list feature files. This method can transform partial sequences that cannot be processed according to the full-length genome into structured, verifiable annotation results suitable for database submission, demonstrating clear practical applications and technical effectiveness.

[0114] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.

[0115] It should be noted that the terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and do not imply a specific order or sequence. Where appropriate, the order of use for similar objects can be interchanged so that the embodiments of this application described herein can be implemented in an order other than that shown or described.

[0116] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this invention can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.

[0117] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for automatically annotating coronavirus nucleic acid sequences and generating feature files for database submission, characterized in that, include: Obtain the coronavirus nucleic acid sequence to be annotated, and determine the target reference sequence matching the coronavirus nucleic acid sequence to be annotated from a preset reference database, wherein the preset reference database contains multiple reference sequences annotated with encoded features; The coronavirus nucleic acid sequence to be annotated is configured to be aligned with the annotation direction of the target reference sequence, and the coronavirus nucleic acid sequence to be annotated after the configuration direction is compared with the target reference sequence to establish the positional correspondence between the nucleotide positions of the target reference sequence and the nucleotide positions of the coronavirus nucleic acid sequence to be annotated after the configuration direction. For each reference coding feature in the target reference sequence, the reference coding feature is mapped to the coronavirus nucleic acid sequence to be annotated after the configuration direction based on the position correspondence, and a coding region is constructed on the coronavirus nucleic acid sequence to be annotated after the configuration direction according to the coverage obtained after mapping and the reference coding feature; For each constructed coding region, the coding region is translated and verified, and the boundary of the coding region is adjusted according to the verification result to obtain a final coding region without internal stop codons; The annotations for each final encoded region are written into an annotation file, and the feature file required for database submission is generated based on the annotation file.

2. The method for automatic annotation and database submission feature file generation of coronavirus nucleic acid sequences according to claim 1, characterized in that, The step of determining the target reference sequence matching the coronavirus nucleic acid sequence to be annotated from a preset reference database includes: The coronavirus nucleic acid sequence to be annotated is compared with various reference sequences in the reference database using a sequence alignment tool; When the sequence alignment tool returns a parsable alignment record, the reference sequence with the highest matching degree is selected as the target reference sequence based on the alignment record; When the sequence alignment tool does not return a resolvable alignment record, common short fragment statistics are performed based on the coronavirus nucleic acid sequence to be annotated and each reference sequence in the reference database, so as to determine the target reference sequence based on the obtained statistical results.

3. The method for automatic annotation and database submission feature file generation of coronavirus nucleic acid sequences according to claim 2, characterized in that, The step of performing common short fragment statistics based on the coronavirus nucleic acid sequence to be annotated and various reference sequences in the reference database, and determining the target reference sequence based on the obtained statistical results, includes: The forward and reverse complementary sequences of the coronavirus nucleic acid sequence to be annotated were extracted respectively; The forward sequence, the reverse complementary sequence, and each reference sequence are each split into continuous nucleotide fragments of a predetermined length to obtain a set of forward sequence fragments, a set of reverse complementary sequence fragments, and a set of reference sequence fragments. For each reference sequence, the first intersection number is calculated based on the reference sequence fragment set corresponding to the reference sequence and the forward sequence fragment set, and the second intersection number is calculated based on the reference sequence fragment set corresponding to the reference sequence and the reverse complementary sequence fragment set; For each reference sequence, the maximum value between the first intersection number and the second intersection number corresponding to the reference sequence is taken as the number of common short segments of the reference sequence; The reference sequence with the highest number of common short segments is determined as the target reference sequence.

4. The method for automatic annotation and database submission feature file generation of coronavirus nucleic acid sequences according to claim 1, characterized in that, The step of performing sequence alignment between the coronavirus nucleic acid sequence to be annotated after configuration and the target reference sequence to establish the positional correspondence between the nucleotide positions of the target reference sequence and the nucleotide positions of the coronavirus nucleic acid sequence to be annotated after configuration includes: The coronavirus nucleic acid sequence to be annotated after configuration direction is compared with the target reference sequence to obtain the alignment results; The alignment results are read column by column. For each position in the alignment column where both the target reference sequence and the coronavirus nucleic acid sequence to be annotated after the configuration direction are actual nucleotides and not gap characters, a one-to-one correspondence is established between the nucleotide positions of the target reference sequence and the nucleotide positions of the coronavirus nucleic acid sequence to be annotated after the configuration direction. Based on the one-to-one correspondence, a mapping from the target reference sequence position to the position of the coronavirus nucleic acid sequence to be annotated after the configuration direction is generated, and a reverse mapping from the position of the coronavirus nucleic acid sequence to be annotated after the configuration direction to the target reference sequence position is generated, which serves as the position correspondence.

5. The method for automatic annotation and database submission feature file generation of coronavirus nucleic acid sequences according to claim 1, characterized in that, Based on the mapping coverage and the reference coding features, a coding region is constructed on the coronavirus nucleic acid sequence to be annotated in the configured direction, including: Determine whether the reference coding feature meets the preset code shift construction conditions. If it does, construct a composite coding region as the coding region; otherwise, construct a linear coding region as the coding region based on the coverage obtained after mapping. The preset code shift construction conditions include: The annotation form of the reference coding feature is a composite structure containing a first segment and a second segment, and a predetermined shifted code base sequence exists in the candidate region between the end point of the first segment and the start point of the second segment. The specified nucleotide position in the predetermined frameshift motif can be mapped to a position on the coronavirus nucleic acid sequence to be annotated after the configuration direction through the position correspondence. This position is located within the coverage area of ​​the reference coding feature mapped to the coronavirus nucleic acid sequence to be annotated after the configuration direction, and the coronavirus nucleic acid sequence to be annotated after the configuration direction still retains the predetermined frameshift motif at this position.

6. The method for automatic annotation and database submission feature file generation of coronavirus nucleic acid sequences according to claim 5, characterized in that, The step of constructing a linear coding region as the coding region based on the coverage obtained after mapping includes: Traverse each reference nucleotide position contained in the reference coding feature, and convert the reference nucleotide positions that can be mapped to the coronavirus nucleic acid sequence to be annotated after the configuration direction into corresponding mapping positions on the coronavirus nucleic acid sequence to be annotated after the configuration direction through the position correspondence; The initial projection interval is determined by the minimum and maximum values ​​among all corresponding mapping positions; Within the initial projection interval, a linear coding region of the corresponding type is constructed based on whether the start and end points of the reference coding feature are covered by the coronavirus nucleic acid sequence to be annotated after the configuration direction.

7. The method for automatic annotation and database submission feature file generation of coronavirus nucleic acid sequences according to claim 6, characterized in that, Within the initial projection interval, a corresponding type of linear coding region is constructed based on whether the start and end points of the reference coding features are covered by the coronavirus nucleic acid sequence to be annotated after the configured direction, including: If both the start and end points of the reference coding feature are covered by the coronavirus nucleic acid sequence to be annotated following the configured direction, then a complete coding region is constructed; If the starting point of the reference coding feature is not covered but the ending point is covered, then a 5′ end partial coding region is constructed; If the starting point of the reference coding feature is covered but the ending point is not covered, then a 3′ end partial coding region is constructed. If neither the start nor the end point of the reference coding feature is covered, then a dual-ended partial coding region is constructed.

8. The method for automatic annotation and database submission feature file generation of coronavirus nucleic acid sequences according to claim 1, characterized in that, For each constructed coding region, the coding region is translated and verified, and the boundaries of the coding region are adjusted according to the verification results to obtain a final coding region without internal stop codons, including: Extract the nucleic acid sequence of the coding region and translate it to obtain the translation result; Detect whether the translation result contains an internal stop codon; If the internal stop codon is present, then within the range supported by the position correspondence, the translation results of different reading frames and boundary models are compared, and the model with the longest effective translation length, annotation position that matches the region where the genome structure is located and does not contain the internal stop codon is selected as the adjusted final coding region. If the internal stop codon is not present, the encoded region is taken as the final encoded region that passes the verification.

9. The method for automatic annotation and database submission feature file generation of coronavirus nucleic acid sequences according to claim 1, characterized in that, The step of writing the comments for each final encoded region into a comment file includes: Each final coding region is processed and filtered to obtain the processed coding region; The reorganized encoding area is then checked for structural integrity and translation validity. The checked coded area annotations are output as annotation files in GenBank format.

10. The method for automatic annotation and database submission feature file generation of coronavirus nucleic acid sequences according to claim 1, characterized in that, The step of generating the feature file required for database submission based on the annotation file includes: Read the annotation file; The coded area annotations in the annotation file are converted into feature file format to obtain the converted coded area data. Based on the converted encoded area data, a feature file required for database submission is generated.