A chromosome-level gapless genome assembly system and method based on a multi-layer computation graph

By constructing a multi-layer computation graph structure and an inter-layer communication mechanism, the problems of multi-source data integration and complex region processing in existing technologies were solved, achieving gapless genome assembly and improving assembly quality and efficiency.

CN122135783APending Publication Date: 2026-06-02CHINA AGRI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA AGRI UNIV
Filing Date
2026-02-02
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing genome assembly methods struggle to effectively integrate multi-source heterogeneous data, process complex regions, and achieve gapless assembly. Single graph structures cannot meet assembly requirements at different scales, and gap-filling strategies are inefficient.

Method used

A system based on multi-layer computation graphs is adopted to construct a hierarchical multi-layer computation graph structure, including sequence overlap graph, fragment connection graph, scaffold construction graph and gap filling graph. Combined with inter-layer communication mechanism, multi-source data is integrated and gap filling is classified.

Benefits of technology

It enables the handling of genome assembly problems at different scales, fully leverages the advantages of multi-source data integration, improves gap elimination rate, significantly enhances assembly quality, increases indicators such as N50 by 3-5 times, and reduces the number of gaps by more than 90%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122135783A_ABST
    Figure CN122135783A_ABST
Patent Text Reader

Abstract

This invention discloses a chromosome-level gapless genome assembly system and method based on a multi-layer computational graph, belonging to the field of bioinformatics. The system includes a data preprocessing module, a multi-layer computational graph construction module, an inter-layer communication module, a pathfinding module, a sequence generation module, and a quality assessment module. The multi-layer computational graph structure comprises four layers: a first-layer sequence overlap graph handles read-level overlap relationships; a second-layer fragment connection graph handles contig-level connection relationships; a third-layer scaffold construction graph utilizes Hi-C data for chromosome-level assembly; and a fourth-layer gap-filling graph employs differentiated filling strategies for different types of gaps. The inter-layer communication module enables bidirectional information transfer and conflict resolution. This invention achieves true chromosome-level gapless genome assembly, improving assembly continuity by 3-5 times and reducing the number of gaps by more than 90%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of bioinformatics technology, specifically relating to a chromosome-level gapless genome assembly system and method based on multi-layer computational graphs. Background Technology

[0002] Genome assembly is one of the core problems in the field of bioinformatics, with the goal of assembling the large number of short sequence fragments generated by high-throughput sequencing into a complete genome sequence. With the rapid development of sequencing technology, genome assembly has become the foundation for analyzing the genetic information of species and conducting functional genomics research.

[0003] Currently, genome assembly mainly employs the following technical approaches: The first category is the OLC (Overlap-Layout-Consensus) based assembly method, which includes three steps: calculating read overlap, determining read arrangement, and generating a consistent sequence. Representative software includes Celera Assembler, Canu, and Flye.

[0004] The second category is assembly methods based on de Bruijn graphs, which decompose reads into k-mers and construct a graph structure between the k-mers. Representative software includes SOAPdenovo, SPAdes, and MEGAHIT.

[0005] The third category is the string graph-based assembly method, which directly utilizes the overlapping relationships of reads to construct the graph structure. Representative software includes SGA and Hifiasm.

[0006] However, existing assembly methods have the following shortcomings: First, a single graph structure struggles to handle assembly problems at different scales simultaneously. Initial assembly requires dealing with read-level overlap relationships, while scaffold construction requires handling chromosome-level structural information; a single graph structure cannot meet the needs of different stages.

[0007] Secondly, integrating heterogeneous data from multiple sources is difficult. Modern genome projects typically generate various types of sequencing data, including short reads, long reads, and Hi-C, and existing tools struggle to effectively integrate the advantages of these heterogeneous data.

[0008] Secondly, there is insufficient capacity to process complex genomic regions. Complex regions such as repetitive sequences, centromeres, and telomeres in the genome remain major obstacles to assembly, resulting in numerous gaps in the assembly results.

[0009] Finally, existing gap-filling strategies are simplistic and inefficient, making it difficult to systematically eliminate all gaps and achieve truly gapless assembly.

[0010] Therefore, there is an urgent need to develop a genome assembly method that can effectively integrate multi-source data, systematically process complex regions, and efficiently eliminate gaps. Summary of the Invention

[0011] The purpose of this invention is to address the shortcomings of existing technologies by providing a chromosome-level gapless genome assembly system and method based on a multi-layer computation graph. By constructing a hierarchical multi-layer computation graph structure, the system addresses genome assembly problems at different scales, achieving gapless assembly from reads to complete chromosomes.

[0012] To achieve the above objectives, the present invention adopts the following technical solution: A chromosome-level gapless genome assembly system based on a multi-layer computational graph includes: The data preprocessing module is used to receive multi-source sequencing data and perform quality control and format conversion; A multi-layer computational graph construction module is used to construct a hierarchical multi-layer computational graph structure, which includes: a first-layer sequence overlap graph, with sequencing reads as nodes and overlap relationships between reads as edges; a second-layer fragment connection graph, with contig sequences as nodes and connection relationships supported by long-read data as edges; a third-layer scaffold construction graph, with scaffold fragments as nodes and intrachromosomal connection relationships supported by Hi-C data as edges; and a fourth-layer gap-filling graph, with sequences on both sides of the gap and candidate fill fragments as nodes and fill paths as edges. Inter-layer communication module, used to enable bidirectional information transfer between different layers of the computation graph; The path solving module is used to solve for the optimal assembly path in the multi-layer computation graph; A sequence generation module is used to generate a genome sequence according to the optimal assembly path; The quality assessment module is used to evaluate the continuity, integrity, and accuracy of the assembly results.

[0013] A chromosome-level gapless genome assembly method based on multi-layer computational graphs includes the following steps: S1: Receive multi-source sequencing data and perform preprocessing; S2: Construct the first-level sequence overlap graph and calculate the overlap relationship between reads; S3: Extract the initial contig sequence from the first layer sequence overlap map; S4: Construct the second-level fragment connection graph and establish contig connections using long-read data; S5: Perform contig extension and merging; S6: Construct the third-layer scaffolding construction diagram and establish long-range connections using Hi-C data; S7: Perform chromosome clustering, sorting, and orientation; S8: Identify gap regions and construct the fourth layer gap filling map; S9: Use a differentiated strategy to fill the gap; S10: Quality assessment and iterative optimization; S11: Outputs chromosome-level gapless genome sequences.

[0014] Compared with the prior art, the present invention has the following beneficial effects: 1. Multi-layer computational graph architecture breaks through the limitations of single graph structures and can handle assembly problems at different scales; 2. The inter-layer communication mechanism enables the effective integration of multi-source data, giving full play to the advantages of various types of data; 3. The classification-based gap-filling strategy improves the gap elimination rate and achieves true gapless assembly; 4. Assembly quality has been significantly improved, with continuity indicators such as N50 increasing by 3-5 times and gaps reduced by more than 90%. Attached Figure Description

[0015] Figure 1 This is a diagram of the overall system architecture of the present invention; Figure 2 This is a schematic diagram of a multi-layer computation graph structure; Figure 3 This is a flowchart of the method of the present invention; Figure 4 This is a schematic diagram of a sequence overlap graph (SOG). Figure 5 This is a schematic diagram of a fragment connection graph (CCG). Figure 6 A schematic diagram of the stent assembly (SAG); Figure 7 This is a schematic diagram of a gap-filled shape (GFG). Figure 8 This is a schematic diagram of the inter-layer communication mechanism; Figure 9 A diagram illustrating the gap classification and filling strategy. Detailed Implementation

[0016] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0017] Example 1: System Overall Architecture like Figure 1 As shown, the chromosome-level gapless genome assembly system based on multi-layer computation graph of the present invention includes a data preprocessing module, a multi-layer computation graph construction module, an inter-layer communication module, a path solving module, a sequence generation module, and a quality assessment module.

[0018] The data preprocessing module supports various types of sequencing data input, including Illumina short read data, PacBio HiFi data, Oxford Nanopore ultra-long read data, Hi-C chromatin conformation data, and optical map data. This module performs quality filtering, format conversion, and feature extraction on the input data.

[0019] The multi-layer computation graph construction module is the core of this invention, constructing a hierarchical computation graph structure containing four layers, such as... Figure 2 As shown.

[0020] Example 2: First-layer sequence overlap graph (SOG) like Figure 4 As shown, the first layer sequence overlap graph uses preprocessed sequencing reads as nodes and the overlap relationship between reads as edges.

[0021] Node attributes include: sequence ID, sequence content, sequence length, quality distribution, and data source.

[0022] Edge attributes include: overlap length, overlap direction, overlap consistency, and quality score.

[0023] Overlap detection employs a hierarchical strategy: In the first stage, the minimumr index is used to quickly filter candidate overlapping pairs, reducing the time complexity to O(n×m), where n is the number of reads and m is the average number of minimumrs.

[0024] In the second stage, precise sequence alignment is performed on candidate overlapping pairs to calculate the exact location and consistency of the overlap.

[0025] The third stage verifies the reliability of the overlap and filters out false overlaps caused by interlocking reads.

[0026] Graph simplification processes include: transitivity simplification, removing edges that can be derived through other paths; low-quality edge filtering, removing edges with quality scores below a threshold; and duplicate node labeling, identifying nodes that may originate from repeating sequences.

[0027] Example 3: Second-layer fragment connection graph (CCG) like Figure 5 As shown, the second-layer fragment connection graph uses the contig sequences extracted from the first layer as nodes and the connection relationships supported by long-read data as edges.

[0028] The steps to extract contigs from SOG include: (1) Identify the unique path (unitig) in the graph, defined as a sequence of consecutive nodes whose in-degree and out-degree are both less than or equal to 1; (2) Process the branch structure, evaluate the support of each branch, and select the optimal path based on coverage and quality; (3) Detect and process the bubble structure generated by the heterozygous site, and record the heterozygous information; (4) Use the longest path strategy for sequence extension.

[0029] The method for establishing contig connections is as follows: For each long read sequence R, R is aligned to all contigs, the list of contigs covered by R is extracted, the connection direction and interval distance are calculated for adjacent contig pairs, and the edge weights are updated.

[0030] The mathematical formal definition of SOG is a directed graph structure SOG = (V sog E sog ), where the set of nodes V sog = {v i |v i Let E be the preprocessed sequence of read segments, i = 1, 2, ..., n}, and let E be the edge set. sog = {e ij | overlap (v i , v j )≥θmin_overlap and identity(v i , v j )≥θmin_identity}. Each node v i It includes attributes such as sequence ID, sequence content, length distribution, quality score distribution, and data source type; each edge e ij It records connection attributes such as overlap length, overlap direction, overlap quality score, and overlap type.

[0031] Example 4: Third-layer scaffold construction diagram (SAG) like Figure 6 As shown, the third-layer scaffold construction diagram uses scaffold fragments as nodes and Hi-C data-supported connection relationships as edges.

[0032] Hi-C data processing workflow: (1) Align Hi-C reads to scaffold sequences; (2) Filtering out low-quality alignments and PCR replicates; (3) Statistical analysis of the contact frequency between scaffolds; (4) Apply normalization methods such as ICE to eliminate bias.

[0033] Normalized contact frequency calculation formula: Normalized contact frequency = Original contact number / (scaffold_i length × scaffold_j length × Sequencing depth factor).

[0034] SAG is formally described using a weighted undirected graph model, defined as SAG = (V sag E sag ), where the set of nodes V sag = {s i | s i Let E be a Scaffold object instance, with edge set E = {i = 1, 2, ..., k}. sag = {e ij | HiC_contact(s i , s j ) ≥θcontact}. Each node records attributes such as the scaffold sequence, the number of contigs it contains, and their length distribution; each edge e ij Store spatial constraint information such as normalized contact frequency, connection confidence, and distance attenuation factor.

[0035] Chromosome assembly involves three steps: (1) Clustering and grouping: Hierarchical clustering is used to assign scaffolds to different chromosome groups; (2) Intra-group sorting: Sort the scaffolds within each chromosome group; (3) Direction determination: Determine the direction (forward / backward) of each scaffold.

[0036] The optimization objective is to maximize the ratio of Hi-C contact strength to distance between adjacent scaffolds.

[0037] Example 5: Fourth Layer Gap Filling Map (GFG) like Figure 7 As shown, the fourth layer gap fill map is specifically designed to fill the gap area.

[0038] Gap classification criteria (such as) Figure 9 (as shown) (1) Small gap: The length is less than 1 kb, and reads can directly cross it; (2) Middle gap: length 1-10kb, partially covered by reads; (3) Large gap: length greater than 10 kb, no reads covering it; (4) Complex gap: located in the region of repeating sequence.

[0039] Differentiated filling strategy: For small gaps, a direct cross-filling strategy is adopted: identify reads that cross the gap, extract the sequence corresponding to the gap region, and generate a filling sequence through multi-sequence consistency correction.

[0040] For the middle gap, a local reassembly strategy is adopted: collect relevant reads in the gap region and on both sides, construct a local overlap graph, and solve the path under the constraint of connecting the known sequences on both sides.

[0041] For large gaps, a guided assembly strategy is adopted: analyze the sequence features on both sides of the gap, search for possible anchor sequences, use ultra-long reads for guidance, and iterate for extension and verification.

[0042] For complex gaps, a multi-strategy combination approach can be adopted, which can combine optical spectral information and reference sequences of closely related species.

[0043] Example 6: Inter-layer communication mechanism like Figure 8 As shown, the inter-layer communication module enables bidirectional information transfer between different layers of the computation graph.

[0044] Bottom-up propagation: The processing results of the lower-level graph are passed to the upper level. The passed content includes node sequences, connection relationships and confidence information.

[0045] Top-down propagation: Constraints from the upper-level graph are fed back to the lower-level graph, including expected structure, exclusion paths, and priority adjustments.

[0046] Conflict resolution mechanism: When conflicting information is provided by different levels or different data sources, the following strategies are adopted: (1) Weighting of evidence: Assign weights based on data type, quality, and support; (2) Majority voting: A proposal supported by multiple independent pieces of evidence receives higher confidence. (3) Consistency check: Check the consistency between the plan and the determined structure.

[0047] Example 7: Method Flow like Figure 3 As shown, the method flow of the present invention includes the following steps: Step S1: Receive multi-source sequencing data, including HiFi, ONT, and Hi-C data. Perform quality filtering on the data, setting minimum read length thresholds (HiFi ≥ 5 kb, ONT ≥ 10 kb) and quality score thresholds (Q ≥ 20).

[0048] Step S2: Construct the first-layer sequence overlap map. Use a minimizer index for fast filtering, followed by precise alignment and overlap verification.

[0049] Step S3: Extract the initial contig from the first-level graph. Identify unique paths and handle branching and bubble structures.

[0050] Step S4: Construct the second-level fragment connection graph. Establish connections between contigs using long-read data.

[0051] Step S5: Perform contig extension and merging. Merge adjacent contigs based on connectivity evidence.

[0052] Step S6: Construct the third-layer scaffold construction diagram. Process the Hi-C data, and statistically normalize the contact frequency.

[0053] Step S7: Perform chromosome-level assembly. Cluster, sort, and orient to generate chromosome-level scaffolds.

[0054] Step S8: Identify the gap regions in the assembly results, count the number, location, and length of the gaps, and construct the fourth layer gap filling map.

[0055] Step S9: Adopt a differentiated filling strategy based on gap classification.

[0056] Step S10, Quality Assessment. Evaluate metrics such as N50, number of gaps, and BUSCO integrity. If the metrics are not met, return to step S8 for iterative optimization.

[0057] Step S11: Output the chromosome-level gapless genome sequence.

[0058] Example 8: System Software Implementation Example The following is a software implementation example of the chromosome-level gapless genome assembly system based on a multilayer computational graph, described using the Python programming language. This implementation includes a core class, MultiLayerGenomeAssembler, which coordinates the functions of modules such as data preprocessing, multilayer computational graph construction, inter-layer communication, path solving, sequence generation, and quality assessment. The example code demonstrates the complete assembly process of the system (corresponding to steps S1-S11 in claim 2) and defines configuration parameters, data structures, and intermediate result storage. Custom modules referenced in the code (such as data_structures, graph_layers, and layer_communication) correspond to specific data types and layer implementation logic described in this specification; for example, the Read class represents sequencing reads, and the SequenceOverlapGraph class implements the construction and simplification of the first-layer sequence overlap graph.

[0059] This software implementation can serve as a reference, enabling those skilled in the art to reproduce the invention based on existing programming environments (such as Python 3.12 or later, combined with bioinformatics libraries such as biopython). The specific code is as follows: import time from typing import List, Dict, Optional from dataclasses import dataclass from data_structures import ( Read, Contig, Scaffold, Gap, HiCContact, AssemblyResult, DataSource ) from graph_layers import ( SequenceOverlapGraph ContigConnectionGraph, ScaffoldAssemblyGraph GapFillingGraph ) from layer_communication import ( LayerCommunicationHub BottomUpPropagator TopDownConstrainer ConflictResolver ) @dataclass class AssemblyConfig: Assembly configuration parameters # Data filtering parameters min_read_length_hifi: int = 5000 min_read_length_ont: int = 10000 min_quality_score: int = 20 # First layer parameters min_overlap_length: int = 500 min_overlap_identity: float = 0.9 # Second layer parameters min_connection_support: int = 2 # Third layer parameters n_chromosomes: int = 5 # Fourth layer parameters max_gap_iterations: int = 3 # Quality threshold target_n50: int = 10000000# 10Mb max_gaps: int = 10 class MultiLayerGenomeAssembler: """ Genome assembler based on multi-level computational graphs The core class coordinates the construction and processing of the four-layer diagram. """ def __init__(self, config: Optional[AssemblyConfig] = None): self.config = config or AssemblyConfig() # Initialize the four-layer graph self.layer1_sog = SequenceOverlapGraph() self.layer2_ccg = ContigConnectionGraph() self.layer3_sag = ScaffoldAssemblyGraph() self.layer4_gfg = GapFillingGraph() # Initialize the communication center self.comm_hub = LayerCommunicationHub() self.propagator = BottomUpPropagator(self.comm_hub) self.constrainer = TopDownConstrainer(self.comm_hub) self.resolver = ConflictResolver(self.comm_hub) # Store intermediate results self.reads: List[Read] = self.contigs: List[Contig] = self.scaffolds: List[Scaffold] = self.chromosomes: Dict[str, str] = {} self.result: Optional[AssemblyResult] = None def preprocess_data(self, reads: List[Read]) ->List[Read]: """ Step 1: Data Preprocessing Quality filtering and format standardization """ print("\n" + "="*60) print("Step 1: Data Preprocessing") print("="*60") filtered_reads = stats = {'total': len(reads), 'passed': 0, 'filtered': 0} for read in reads: # Apply different length thresholds based on the data source if read.source == DataSource.HIFI: min_len = self.config.min_read_length_hifi elif read.source == DataSource.ONT: min_len = self.config.min_read_length_ont else: min_len = 100 # Length filtering if read.length>= min_len: filtered_reads.append(read) stats['passed'] += 1 else: stats['filtered'] += 1 print(f"Entry reads: {stats['total']}") print(f"Passed by filter: {stats['passed']}") print(f"Filtered: {stats['filtered']}") self.reads = filtered_reads return filtered_reads def build_layer1(self): """ Step 2-3: Construct the first-layer sequence overlap map and extract contigs """ print("\n" + "="*60) print("Steps 2-3: Constructing the first-level sequence overlap graph (SOG)") print("="*60") # Add reads to the graph For read in self.reads: self.layer1_sog.add_read(read) print(f"{len(self.reads)} reads have been added") # Detect overlap self.layer1_sog.find_overlaps( min_overlap=self.config.min_overlap_length, min_identity=self.config.min_overlap_identity ) # Simplified Diagram self.layer1_sog.simplify_graph() # Extract contigs self.contigs = self.layer1_sog.extract_unitigs() # Uppropagation results self.propagator.propagate_contigs(1, self.contigs) self.comm_hub.report_progress(1, 1.0, "First-level processing completed") return self.contigs def build_layer2(self, long_reads: Optional[List[Read]] = None): """ Steps 4-5: Construct the second-level fragment connectivity graph and extend contigs """ print("\n" + "="*60) print("Steps 4-5: Constructing the second-level fragment connectivity graph (CCG)") print("="*60") # Add contigs to the graph For contig in self.contigs: self.layer2_ccg.add_contig(contig) # Use long read length to establish a connection if long_reads is None: long_reads = [r for r in self.reads if r.source in [DataSource.HIFI,DataSource.ONT]] if long_reads: self.layer2_ccg.build_from_long_reads( long_reads, min_support=self.config.min_connection_support ) # Extended contigs self.contigs = self.layer2_ccg.extend_contigs() # Spread Upwards self.propagator.propagate_contigs(2, self.contigs) self.comm_hub.report_progress(2, 1.0, "Second-level processing completed") return self.contigs def build_layer3(self, hic_contacts: Optional[List[HiCContact]] =None): """ Steps 6-7: Construct the third-layer scaffold diagram and assemble chromosomes. """ print("\n" + "="*60) print("Steps 6-7: Construct the third-layer scaffolding (SAG) diagram") print("="*60") # Create scaffolds from contigs self.layer3_sag.build_from_contigs(self.contigs) # Add Hi-C contact data if hic_contacts: self.layer3_sag.add_hic_contacts(hic_contacts) # Constructing Chromosomes self.chromosomes = self.layer3_sag.build_chromosomes( n_chromosomes=self.config.n_chromosomes ) # Spread Upwards self.propagator.propagate_chromosomes(3, self.chromosomes) self.comm_hub.report_progress(3, 1.0, "Third-level processing completed") return self.chromosomes def build_layer4(self, long_reads: Optional[List[Read]] = None): """ Steps 8-9: Construct the fourth layer gap fill map and fill the gaps. """ print("\n" + "="*60) print("Steps 8-9: Construct the fourth layer gap fill map (GFG)") print("="*60") if long_reads is None: long_reads = [r for r in self.reads if r.source in [DataSource.HIFI,DataSource.ONT]] # Iterative Fill for iteration in range(self.config.max_gap_iterations): print(f"\nIteration{iteration + 1} / {self.config.max_gap_iterations}") # Identify gaps gaps = self.layer4_gfg.identify_gaps(self.chromosomes) If there are no gaps: print("No gaps found, ending prematurely") break # Filling Gaps fills = self.layer4_gfg.fill_gaps(long_reads) If not filled: print("Unable to populate more gaps, iteration ends") break # Apply fill self.chromosomes = self.layer4_gfg.apply_fills(self.chromosomes,fills) self.comm_hub.report_progress(4, 1.0, "Fourth-level processing completed") return self.chromosomes def evaluate_quality(self) ->AssemblyResult: """ Step 10: Quality Assessment """ print("\n" + "="*60) print("Step 10: Quality Assessment") print("="*60") result = AssemblyResult( chromosomes = self.chromosomes, contig_count=len(self.contigs), scaffold_count=len(self.layer3_sag.scaffolds) ) result.calculate_stats() print(f"\nAssembly Statistics:") print(f"───────────────────────────") print(f"Chromosome count: {len(result.chromosomes)}") print(f"Total length: {result.total_length:,} bp") print(f"N50: {result.n50:,} bp") print(f"Gap count: {result.gap_count}") print(f"Gap total length: {result.gap_total_length:,} bp") print(f"Contig count: {result.contig_count}") # Check if it meets the standard meets_n50 = result.n50>= self.config.target_n50 meets_gaps = result.gap_count<= self.config.max_gaps print(f"\nQuality Inspection:") print(f"N50>= {self.config.target_n50:,}: {' 'if meets_n50 else ' '}") print(f"Gaps<= {self.config.max_gaps}: {' 'if meets_gaps else ' '}") self.result = result return result def assemble(self, reads: List[Read], long_reads: Optional[List[Read]] = None, hic_contacts: Optional[List[HiCContact]] = None) ->AssemblyResult: """ Complete assembly process """ print("\n" + "="*60) print("A genome assembly system based on a multi-level computational graph") print("="*60") start_time = time.time() # Step 1: Preprocessing self.preprocess_data(reads) # Steps 2-3: First Layer self.build_layer1() # Steps 4-5: Second Layer self.build_layer2(long_reads) # Steps 6-7: Third Layer self.build_layer3(hic_contacts) # Steps 8-9: Fourth Floor self.build_layer4(long_reads) # Step 10: Assessment result = self.evaluate_quality() elapsed = time.time() - start_time print(f"\nTotal time elapsed: {elapsed:.2f} seconds") return result def export_fasta(self, output_path: str): Exporting results in FASTA format. with open(output_path, 'w') as f: for chr_id, sequence in sorted(self.chromosomes.items()): f.write(f">{chr_id}\n") # 80 characters per line for i in range(0, len(sequence), 80): f.write(sequence[i:i++ "\n") print(f"\nResult exported to: {output_path}") def get_summary(self) ->str: """Get Assembly Summary""" if self.result is None: The message "Assembly is not yet complete" returned. summary = f""" Assembly Summary ════════════════════════════════════ Chromosome count: {len(self.result.chromosomes)} Total length: {self.result.total_length:,} bp N50: {self.result.n50:,} bp Gap count: {self.result.gap_count} Total gap length: {self.result.gap_total_length:,} bp Processing statistics at each level: - First layer (SOG): {len(self.layer1_sog.reads)} reads, {len(self.layer1_sog.overlaps)} overlaps - Second layer (CCG): {len(self.layer2_ccg.contigs)} contigs, {len(self.layer2_ccg.connections)} connections - Third layer (SAG): {len(self.layer3_sag.scaffolds)} scaffolds - The fourth layer (GFG): {len(self.layer4_gfg.gaps)} gaps identified ════════════════════════════════════ """ return summary # Convenience Functions def create_assembler(n_chromosomes: int = 5, min_overlap: int = 500, target_n50: int = 10000000) ->MultiLayerGenomeAssembler: """Convenience functions for creating assemblers""" config = AssemblyConfig( n_chromosomes=n_chromosomes, min_overlap_length=min_overlap, target_n50=target_n50 ) return MultiLayerGenomeAssembler(config) In this implementation, the `preprocess_data` method corresponds to the data preprocessing in step S1, including applying different length thresholds and quality filters based on the data source (such as HiFi or ONT). The `build_layer1` method implements the first-layer sequence overlap graph construction and contig extraction in steps S2-S3, including adding reads, detecting overlaps, graph simplification, and bottom-up result propagation. Similarly, other methods correspond to subsequent steps. The `assemble` method serves as the main entry point, calling all steps to implement the complete assembly process. The `export_fasta` and `get_summary` methods are used to output results and summaries, supporting FASTA format export and statistical reports. This sample code can be extended into a complete software system and further optimized by integrating external libraries (such as biopython for sequence processing).

[0060] Example 9: Effect Verification The Arabidopsis thaliana genome, approximately 135 Mb in size, was used as the test subject. Simulated datasets were used for testing, including 30×HiFi, 20×ONT ultra-long reads, and Hi-C data.

[0061] The results compared with existing methods are as follows: N50 index: The method of this invention achieves 120Mb, while method A is 45Mb, method B is 58Mb, and method C is 65Mb, representing an improvement of 1.8-2.7 times.

[0062] Number of gaps: The method of this invention has only 5 gaps, while method A has 320, method B has 250, and method C has 180, which is a reduction of 96-98%.

[0063] BUSCO completeness: The method of this invention achieves 98.5%, while method A achieves 92.0%, method B achieves 93.5%, and method C achieves 95.0%, representing an improvement of 3.5-6.5 percentage points.

[0064] Assembly time: The method of this invention reduces assembly time by about 40% compared to the traditional process, mainly due to the reduction of single-layer complexity by layered processing.

[0065] Memory consumption: The method of this invention reduces memory consumption by about 30% compared to traditional methods, thanks to the hierarchical structure that avoids the construction of a global graph.

[0066] Example 10: Big Genome Applications The method of this invention was applied to the assembly of the wheat genome (approximately 16 Gb). Because wheat is an allohexaploid, exhibiting high repetition and high heterozygosity, assembly was extremely difficult.

[0067] Using 100×HiFi, 50×ONT ultra-long reads and Hi-C data, the method of this invention successfully constructed 21 chromosome-level scaffolds.

[0068] Assembly results: N50 reached 750 Mb, with only 42 gaps, and BUSCO integrity reached 96.2%. Compared with the current best method, N50 is improved by 2.1 times, and the number of gaps is reduced by 85%.

[0069] This demonstrates that the method of the present invention also has significant advantages in the assembly of large and complex genomes.

Claims

1. A chromosome-level gapless genome assembly system based on a multi-layer computational graph, characterized in that, The system includes a data preprocessing module for receiving multi-source sequencing data and performing quality control and format conversion. Supported sequencing data types include Illumina short read data, PacBio HiFi data, and Oxford sequencing data. The system includes Nanopore ultra-long read data, Hi-C chromatin conformation data, and optical map data; a multi-layer computational graph construction module for constructing a hierarchical multi-layer computational graph structure, comprising: a first-layer sequence overlap graph with sequencing reads as nodes and overlap relationships between reads as edges; a second-layer fragment connection graph with contig sequences as nodes and connections supported by long-read data as edges; a third-layer scaffold construction graph with scaffold fragments as nodes and intrachromosomal connections supported by Hi-C data as edges; and a fourth-layer gap-filling graph with sequences flanking the gap and candidate filler fragments as nodes and filling paths as edges; an inter-layer communication module for bidirectional information transfer between computational graphs, including bottom-up result transfer and top-down constraint transfer; a path solving module for solving the optimal assembly path from the chromosome start point to the end point in the multi-layer computational graph; a sequence generation module for generating chromosome-level genome sequences based on the optimal assembly path; and a quality assessment module for evaluating the continuity, completeness, and accuracy of the assembly results.

2. The system according to claim 1, characterized in that, The construction of the first-layer sequence overlap graph adopts a hierarchical overlap detection strategy, including a fast screening stage based on the minimizer index, a precise detection stage based on sequence alignment, and an overlap verification stage based on quality score; the first-layer sequence overlap graph includes graph simplification processing, specifically including transitivity simplification, low-quality edge filtering, and duplicate node marking.

3. The system according to claim 1, characterized in that, In the second-layer fragment connection graph, the edge attributes include the number of long reads supporting the connection, connection direction, interval distance estimation, and confidence score; the construction of the third-layer scaffolding graph includes Hi-C data alignment and filtering, contact frequency statistics and normalization, and signal correction based on a distance attenuation model; the chromosome assembly in the third-layer scaffolding graph includes chromosome grouping based on hierarchical clustering, intra-group scaffold sorting, and scaffold direction determination.

4. The system according to claim 1, characterized in that, The fourth-layer gap-filling map employs differentiated processing strategies for different types of gaps, including a direct cross-filling strategy for small gaps (length less than 1kb), a local reassembly strategy for medium gaps (length between 1kb and 10kb), a guided assembly strategy for large gaps (length greater than 10kb), and a multi-strategy combination approach for complex gaps (gap located in repeating sequence regions).

5. The system according to claim 1, characterized in that, The inter-layer communication module includes a conflict resolution mechanism for handling conflicting information from different layers or data sources. The conflict resolution mechanism includes evidence weight assessment, majority voting, and consistency testing. The quality assessment module's evaluation metrics include N50, L50, number of gaps, total gap length, BUSCO integrity, and base accuracy.

6. A chromosome-level gapless genome assembly method based on multi-layer computational graphs, characterized in that, The method includes the following steps: S1: Receiving multi-source sequencing data and preprocessing the sequencing data, including quality filtering and format conversion, wherein the multi-source sequencing data includes at least two of high-accuracy long-read data, ultra-long-read data, and Hi-C data; S2: Constructing a first-layer sequence overlap graph, using the preprocessed sequencing reads as nodes, calculating the overlap relationship between reads and establishing edge connections; S3: Extracting initial contig sequences from the first-layer sequence overlap graph; S4: Constructing a second-layer fragment connection graph, using the initial contig sequences as nodes, and establishing connection edges between contigs using long-read sequencing data; S5: Based on the first-layer sequence overlap graph... S6: Contract extension and merging of the second-layer fragment connection graph; S7: Construct the third-layer scaffold construction graph, using the extended scaffold fragments as nodes, and establish long-range connections within the chromosome using Hi-C data; S8: Based on the third-layer scaffold construction graph, perform chromosome clustering, sorting, and orientation to generate chromosome-level scaffolds; S9: Identify gap regions in the assembly results and construct the fourth-layer gap-filling graph; S0: Perform gap-filling using a differentiated filling strategy according to the gap type; S11: Evaluate the quality of the assembly results, and if they do not meet the standards, return to step S8 for iterative optimization; S12: Output the chromosome-level gapless genome sequence.

7. The method according to claim 6, characterized in that, In step S2, the calculation of the overlap relationship includes using the minimizer index to quickly screen candidate overlapping pairs, performing accurate sequence alignment on candidate overlapping pairs, calculating the length, direction, and consistency of the overlap, and filtering low-quality overlaps based on a quality threshold. In step S3, the method for extracting the initial contig sequence from the first-layer sequence overlap map includes identifying the unique path in the map, processing branch structures and selecting paths based on coverage and quality, detecting and processing bubble structures generated by heterozygous sites, and using the longest path strategy for sequence extension.

8. The method according to claim 6, characterized in that, In step S4, the method for establishing connection edges between contigs using long-read sequencing data includes aligning long-read sequences to all contigs, extracting the list of contigs covered by each long read, calculating the connection direction and spacing distance for adjacent contig pairs, and counting the number of reads supporting each connection as edge weights. In step S6, the method for establishing long-range connection edges within chromosomes using Hi-C data includes aligning Hi-C reads to scaffold sequences, filtering low-quality alignments and PCR repeats, counting the original contact frequency between scaffolds, applying a normalization method to eliminate length and sequencing depth biases, and establishing connection edges with a normalized contact frequency greater than a threshold.

9. The method according to claim 6, characterized in that, In step S7, the chromosome clustering, sorting, and orientation include constructing a Hi-C contact matrix between scaffolds, using hierarchical clustering to assign scaffolds to different chromosome groups, sorting the scaffolds within each chromosome group, determining the orientation of each scaffold, and optimizing to maximize the Hi-C contact strength between adjacent scaffolds. In step S9, the differentiated filling strategy includes: Directly skip the padding, identify long reads that cross the gap, extract the corresponding sequence in the gap region, and generate the padding sequence through consistency correction; Local reassembly is performed, the gap region and related reads on both sides are collected, a local overlap graph is constructed, and the path is solved under the constraint of connecting the known sequences on both sides; Guided assembly, analysis of sequence features on both sides of the gap, use of ultra-long reads for guidance, iterative extension and verification to generate candidate filling sequences.

10. The method according to claim 6, characterized in that, The method also includes an inter-layer information transfer step, specifically including bottom-up transfer: passing the processing results of the lower-level graph to the upper level, including node sequences, connection relationships and confidence information; top-down transfer: feeding back the constraints of the upper-level graph to the lower level, including expected structure, exclusion paths and priority adjustments; when different levels or different data sources provide contradictory information, evidence weight assessment, majority voting and consistency testing are used to resolve conflicts.