A method for splitting sequencing data of fastq files

By parsing and matching the barcode sequences in the fastq file, the problem of existing tools being unable to handle data on the MobiNova platform was solved, enabling efficient data splitting and automated analysis, and generating visual reports and result files.

CN118571316BActive Publication Date: 2024-11-05MOBIDROP (ZHEJIANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411016841.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-05
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

Existing fastq file splitting tools such as STARsolo, Alevin, Alevin-fry, and Cell Ranger cannot effectively process 3' RNA and 5' RNA data from the MobiNova single-cell platform, resulting in insufficient analysis results or inability to automate the process. Furthermore, Cell Ranger is not compatible with the naming rules of different sequencers.

Method used

By receiving and parsing fastq files, the system locates sequences such as barcode 1, barcode 2, and UMI, uses a sliding window algorithm to match with a whitelist, identifies valid read data, and performs automated analysis based on the path rules of the MobiNova platform to generate visual reports and result files.

Benefits of technology

It enables automated analysis of data from the MobiNova single-cell platform, generating complete result files, improving computational efficiency and the interpretability of analysis results, and reducing redundancy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118571316B_ABST
    Figure CN118571316B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification discloses a method for splitting sequencing data of a fastq file. The method of the embodiment of the present specification includes: receiving and parsing a fastq file, obtaining read 1 data including a barcode 1 sequence, a W1 sequence, a barcode 2 sequence, a UMI sequence, and a Poly T sequence / TSO sequence in sequence; locating the position information and sequence structure of the W1 sequence, the barcode 2 sequence, the UMI sequence, and the Poly T sequence / TSO sequence in the read 1 data in sequence; obtaining the first 10bp sequence of the read 1 data as an excerpt sequence of the barcode 1 sequence, and performing whitelist matching; matching the barcode 2 sequence with the whitelist, and when both of the above two sequences are successfully matched, the read 1 data is valid read 1 data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of bioinformatics, and in particular, to a method for splitting sequencing data of a fastq file. Background Art

[0002] In the field of single-cell transcriptome sequencing technology, the fastq format is the most commonly used file format for storing gene base sequences, corresponding quality scores, and related information. The data from the sequencer will be saved as fastq format files after processing. In order to maximize the use of sequencers and on-machine kits, now basically multiple samples are mixed and sequenced on the sequencer, and then the fastq files containing the mixed gene data of multiple samples are output.

[0003] In order to carry out the next step of gene sequence analysis, it is necessary to split the original fastq file into sample-based fastq files, that is, to separate the gene data of each sample into a single fastq file (for double-end sequencing, each sample will have two independent fastq files). Since different samples have different library structures, different sequencing platforms have developed different fastq file splitting tools for different library structures.

[0004] Currently, the commonly used fastq file splitting tools include STARsolo, Alevin, Alevin-fry, Cell Ranger, etc. STARsolo is one of the modules of the RNA-Seq library alignment tool STAR, which can handle the entire process from single-cell transcriptome fastq data alignment to cell gene quantification. STARsolo itself has high requirements for the quality of the input fastq files. Different single-cell transcriptome libraries need to undergo different personalized preprocessing before they can be analyzed using STARsolo; and its analysis results are relatively simple, and the content of the output analysis report is limited to the alignment results, which cannot fully meet the current customer needs. Alevin is also used for cell gene quantification of single-cell transcriptome data, but due to the limited number of output result files, it is not conducive to single-cell downstream analysis. As the successor of Alevin, Alevin-fry has the same core calculation logic as Alevin. At the same time, its output result files not only include cell gene quantification results, but can also be used for RNA velocity analysis. However, this is still not enough for users.

[0005] The input file of Cell Ranger is a fastq format file obtained by second-generation sequencing. This technology will automatically determine whether the sequenced reads contain a valid barcode sequence, that is, whether the 16 consecutive bases at the 5' end of the sequenced read 1 are in the barcode whitelist (the barcode whitelist is provided with the 10X kit). Use the alignment tool STAR to align the reads containing valid barcodes, and retain the reads that can be reliably aligned to the reference genome (i.e., reads with MAPQ>= 255). Then, according to the different modes of gene quantification selected, extract valid reads (Exonic Reads and / or Intronic Reads), delete the reads aligned to the antisense strand, and the reads aligned to multiple genes, and obtain the final transcriptome-related reads for gene quantification. In the process of quantification, delete reads containing multiple N UMIs, delete reads containing UMIs with base quality less than 10, delete UMIs with fewer corresponding reads, and remove duplicate UMIs (retain 1). Finally, perform cell calling processing on the data set to obtain the cell gene expression matrix. Subsequent work includes dimensionality reduction of cell gene expression matrix, clustering, differential gene analysis, and generation of HTML reports and Cloupe visualization files. Cell Ranger is mainly adapted to single-cell 3'RNA and 5'RNA data from the 10X single-cell platform (see Figure 1a , Figure 1b The analysis of the RNA structure shown in the figure is not compatible with samples with other library structures or barcode whitelists that are inconsistent with 10X. In addition, since the file naming methods of different sequencers are different, when the file naming does not conform to the CellRanger naming rules, Cell Ranger cannot directly perform automated analysis and processing. Moreover, Cell Ranger analyzes a lot of content and has rich analysis result files, but at the same time, it also causes the problem of redundant and difficult to understand analysis results.

[0006] 3'RNA and 5'RNA data from the MobiNova single-cell platform (see Figure 2a , Figure 2b The RNA structure shown in Figure 2 is different from the single-cell 3'RNA and 5'RNA data from the 10X single-cell platform, both in terms of library structure and barcode whitelist. Cell Ranger and other existing tools cannot perform data analysis on the 3'RNA and 5'RNA data from the MobiNova single-cell platform. Summary of the invention

[0007] One or more embodiments of this specification describe a method for splitting sequencing data of a fastq file, which can perform data analysis on 3'RNA and 5'RNA data from the MobiNova single-cell platform.

[0008] In a first aspect, the embodiments of this specification provide a method for splitting sequencing data of a fastq file, comprising:

[0009] Receive and parse the fastq file to obtain read 1 data containing sequentially sorted barcode 1 sequence, W1 sequence, barcode 2 sequence and UMI sequence;

[0010] According to the position range of the W1 sequence, the position information and sequence structure of the W1 sequence in the read1 data are located from the read1 data;

[0011] Based on the position information of the W1 sequence in the read 1 data, the gene length of the barcode 2 sequence, the gene length of the UMI sequence, the gene length of the Poly T sequence / the gene length of the TSO sequence, the position information and sequence structure of the barcode 2 sequence, the UMI sequence, the Poly T sequence / TSO sequence in the read 1 data are determined in turn;

[0012] The first 10bp sequence of the read 1 data is obtained and used as the excerpt sequence of the barcode 1 sequence; the sequence identical to the excerpt sequence is spliced ​​after the excerpt sequence to form the first matching sequence of the barcode 1 sequence; the first sliding window sequence of a certain gene length is extracted from the first matching sequence using the sliding window algorithm, and the first sliding window sequence is matched with the first barcode whitelist; the sequence identical to the sequence is spliced ​​after the barcode 2 sequence to form the second matching sequence of the barcode 2 sequence; the second sliding window sequence of a certain gene length is extracted from the second matching sequence using the sliding window algorithm, and the second sliding window sequence is matched with the second barcode list; when the first sliding window sequence successfully matches the first barcode whitelist, and the second sliding window sequence successfully matches the second barcode whitelist, the read 1 data is determined as valid read 1 data, otherwise, a new sliding window sequence is continuously obtained to match the barcode whitelist, and if all sliding window sequences do not match the barcode whitelist, the read 1 data is determined as invalid read 1 data; wherein the first barcode whitelist and the second barcode whitelist both include a plurality of spliced ​​sequences, each of which is formed by splicing the same sequence after the original whitelist sequence.

[0013] In some implementations, the method of the embodiments of this specification further includes:

[0014] Before parsing the fastq file, obtain the path of the fastq file; the path of the fastq file includes at least a prefix, a read type, and a suffix;

[0015] Identify whether the read type in the path of the fastq file is consistent with the preset read type. If so, identify the prefix in the path of the fastq file as the sample ID, and then parse the fastq file corresponding to the sample ID; otherwise, end the process.

[0016] In some implementations, the method of the embodiments of this specification further includes: configuring a preset read type, wherein the preset read type includes R1, R2, 1, and 2.

[0017] In some embodiments, the path of the fastq file is defined by a regular expression on the machine side of the single cell platform that outputs the fastq file.

[0018] In some embodiments, the fastq file is a fastq file of 3'RNA data or 5'RNA data output from a single-cell platform, and the 3'RNA data or 5'RNA data in the fastq file includes a barcode 1 sequence, a W1 sequence, and a barcode 2 sequence connected in sequence.

[0019] In some embodiments, locating the position information and sequence structure of the W1 sequence in the read data according to the position range of the W1 sequence, includes:

[0020] From the read data, obtain all base pairs within the position range where the W1 sequence appears, and form a detection sequence containing all base pairs;

[0021] According to the gene length in the target sequence, a number of candidate sequences of the same length as the gene length of the target sequence are obtained from the detection sequence, which are composed of consecutive base pairs; the target sequence is the W1 sequence in the 3'RNA data or 5'RNA data output from the single-cell platform pre-stored in the database;

[0022] Using the Hamming distance algorithm, the distance between each candidate sequence and the target sequence is calculated, and the candidate sequence whose distance is less than the first distance threshold is determined as the W1 sequence;

[0023] According to the position of the candidate sequence in the read data, the position of the W1 sequence in the read data is determined.

[0024] In some embodiments, the determining the position information and sequence structure of the barcode 2 sequence, the UMI sequence, the Poly T sequence / TSO sequence in the read 1 data in sequence based on the position information of the W1 sequence in the read 1 data, the gene length of the barcode 2 sequence, the gene length of the UMI sequence, and the gene length of the Poly T sequence / TSO sequence includes:

[0025] Based on the position information of the W1 sequence in the read 1 data, determine the starting position of the barcode2 sequence connected to the back end of the W1 sequence in the read 1 data;

[0026] Based on the starting position of the barcode 2 sequence in the read 1 data and the gene length of the barcode 2 sequence, determine the position information and sequence structure of the barcode 2 sequence in the read 1 data;

[0027] Based on the position information of the barcode 2 sequence in the read 1 data, determine the starting position of the UMI sequence connected to the back end of the barcode 2 sequence in the read 1 data;

[0028] Based on the starting position of the UMI sequence in the read 1 data and the gene length of the UMI sequence, determine the position information and sequence structure of the UMI sequence in the read 1 data;

[0029] Based on the position information of the UMI sequence in the read 1 data, determine the starting position of the PolyT sequence / TSO sequence connected to the back end of the UMI sequence in the read 1 data;

[0030] Based on the starting position of the Poly T sequence / TSO sequence in the read 1 data and the gene length of the Poly T sequence / TSO sequence, the position information and sequence structure of the Poly T sequence / TSO sequence in the read 1 data are determined. In some embodiments, the method of the embodiment of this specification further includes:

[0031] In the process of pairing the selected sequence of barcode 1 sequence with the first barcode whitelist, when the match is successful, the original whitelist sequence in the first barcode whitelist is used as the selected sequence of barcode 1 sequence;

[0032] In the process of pairing the barcode 2 sequence with the second barcode whitelist, when the match is successful, the original whitelist sequence in the second barcode whitelist is used as the barcode 2 sequence.

[0033] In some embodiments, the gene length of the first sliding window sequence is 9 bp or 10 bp; the gene length of the second sliding window sequence is 9 bp or 10 bp.

[0034] In some implementations, the method of the embodiments of this specification further includes:

[0035] Based on the valid read 1 data, its paired read 2 data is determined as valid read 2 data;

[0036] After obtaining all valid reads data in the fastq file, the ratio of the total amount of valid reads data to the total amount of reads data in the fastq file is calculated to obtain the effective proportion of valid reads data; the total amount of valid reads data is the sum of the number of valid read 1 data and the number of valid read 2 data;

[0037] When the effective proportion is not less than the proportion threshold, sequencing data processing is performed on the effective reads data.

[0038] In some embodiments, the method of the embodiments of this specification further includes: saving the sequencing data processing results to a file with a prefix in the path of the fastq file as the sample ID.

[0039] The beneficial effects brought by the technical solutions provided by some embodiments of this specification include at least:

[0040] In one or more embodiments of the present specification, the method of the embodiment of the present specification pre-configures a barcode whitelist related to a kit for sequencing on a MobiNova single-cell platform, and based on the RNA structure in the fastq file of the 3'RNA and 5'RNA data outputted from the MobiNova single-cell platform, locates the barcode 2 sequence connected thereto by locating the W1 sequence, and locates the UMI sequence connected thereto by locating the barcode 2 sequence; then, whitelist matching is performed on the barcode 1 sequence and the barcode 2 sequence, and after the matching is successful to obtain valid read 1 data, data analysis can be performed on the 3'RNA and 5'RNA data from the MobiNova single-cell platform.

[0041] Furthermore, the path generation rules of the fastq file are defined on the machine side of the MobiNova single-cell platform. The method of the embodiment of the present specification can determine whether sequencing data analysis can be performed by identifying the read type in the path of the fastq file, which can facilitate automatic parsing of the fastq file and execution of subsequent processes without being affected by the naming rules like Cell Ranger and being unable to process the fastq file.

[0042] In addition, the method of the embodiment of this specification can perform data analysis and processing procedures such as connector sequence cutting, alignment, cell gene quantification, generation of visual HTML report, generation of visual Mobi-Browser file, etc. on the effective read data obtained by filtering, and finally organize, package and compress all result files to generate a complete result file. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of this specification, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1a The RNA structure of the single-cell 3'RNA data from the 10X single-cell platform;

[0045] Figure 1b The RNA structure of the single-cell 5' RNA data from the 10X single-cell platform;

[0046] Figure 2a RNA structure of 3' RNA data from the MobiNova single-cell platform;

[0047] Figure 2b RNA structure of 5' RNA data from the MobiNova single-cell platform;

[0048] Figure 3 A flowchart of a method for splitting sequencing data of a fastq file provided in an embodiment of this specification;

[0049] Figure 4 A flowchart of sequencing data analysis using the method of the embodiments of this specification;

[0050] Figure 5 It is a schematic diagram of the structure of the first matching sequence, in which the window is selected according to 9bp. DETAILED DESCRIPTION

[0051] The technical solutions in the embodiments of this specification will be described clearly and completely below in conjunction with the drawings in the embodiments of this specification.

[0052] The terms "first", "second", "third", etc. in the description and claims of this specification and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0053] Figure 1a The library structure of single-cell 3'RNA data from the 10X single-cell platform was constructed using a microfluidic platform. The 5' ends of read 1 are a 20bp barcode sequence, a 10bp UMI sequence, and a Poly T sequence, and read 2 is an insert sequence, and there may be some TSO sequences at its 5' end. Figure 1b The library structure of the single-cell 5'RNA data generated by the 10X single-cell platform is based on the library structure of the single-cell 3'RNA data generated by the 10X single-cell platform. The TSO sequence is introduced after the UMI sequence to eliminate the preference for constructing the 3'RNA library structure.

[0054] Figure 2a The library structure of 3'RNA data downloaded from the MobiNova single-cell platform. The 5' ends of read 1 are barcode 1 sequence (i.e. BC1 in the figure), W1 sequence, barcode 2 sequence (i.e. BC2 in the figure), UMI sequence and PolyT sequence, and read 2 is the insert sequence. Figure 2b The library structure of 5'RNA data from the MobiNova single-cell platform is shown in Figure 2a Based on the library structure of 3'RNA data from the MobiNova single-cell platform, a TSO sequence was introduced after the UMI sequence.

[0055] For the 3'RNA and 5'RNA data from the MobiNova single-cell platform, the biggest difference between them and the data from the 10X single-cell platform is the barcode and UMI sequence structure. The barcode of the 10X transcriptome is 16bp long and the UMI is 12bp long, while the barcode of MobiNova single-cell data consists of barcode 1 (10-13bp), W1 sequence (5bp) and barcode 2 (10bp), and the UMI is 10bp long. It can be seen that the Read1 sequences of the two are very different, so Cell Ranger is not directly compatible.

[0056] Based on this, the embodiments of this specification propose a method for processing sequencing data of 3'RNA and 5'RNA data from the MobiNova single-cell platform.

[0057] Figure 3 A flowchart of a fastq file sequencing data splitting method provided in an embodiment of this specification is shown. Figure 3 , methods include:

[0058] Step 102, receiving and parsing the fastq file to obtain read 1 data including barcode 1 sequence, W1 sequence, barcode 2 sequence and UMI sequence sorted in sequence;

[0059] Step 104, locating the position information and sequence structure of the W1 sequence in the read 1 data according to the position range of the W1 sequence;

[0060] Step 106, based on the position information of the W1 sequence in the read 1 data, the gene length of the barcode 2 sequence, the gene length of the UMI sequence, and the gene length of the Poly T sequence / the gene length of the TSO sequence, the position information and sequence structure of the barcode 2 sequence, the UMI sequence, and the Poly T sequence / TSO sequence in the read 1 data are determined in sequence;

[0061] Step 1081, obtaining the first 10 bp sequence in the read 1 data, and using it as the excerpt sequence of the barcode 1 sequence; splicing the sequence identical to the excerpt sequence after the excerpt sequence to form the first matching sequence of the barcode 1 sequence; using the sliding window algorithm to extract the first sliding window sequence of a certain gene length from the first matching sequence, and matching the first sliding window sequence with the first barcode whitelist;

[0062] Step 1083, after the barcode 2 sequence, a sequence identical to the sequence is spliced ​​to form a second matching sequence of the barcode 2 sequence; a second sliding window sequence of a certain gene length is extracted from the second matching sequence using a sliding window algorithm, and the second sliding window sequence is matched with the second barcode list;

[0063] Step 1085: when the first sliding window sequence successfully matches the first barcode whitelist, and the second sliding window sequence successfully matches the second barcode whitelist, the read 1 data is determined as valid read 1 data; otherwise, return to step 1081 and step 1083, continue to obtain a new sliding window sequence, and perform barcode whitelist matching. If all sliding window sequences do not match the barcode whitelist, the read 1 data is determined as invalid read 1 data; wherein the first barcode whitelist and the second barcode whitelist both include a plurality of spliced ​​sequences, and each spliced ​​sequence is formed by splicing the same sequence after the original whitelist sequence.

[0064] The method of the embodiment of this specification is executed by a computer device, which may be a terminal device or a server with computing capabilities. The terminal device may be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, desktop computers, etc.

[0065] The computer device may be configured with sequencing data analysis software. The method of the embodiment of this specification may be configured in a fastq file splitting tool or a computing module, and the above tool or computing module is integrated in the sequencing data analysis software. After obtaining the output fastq file of the single cell platform, the computer device is used to split the file and perform relevant sequencing data analysis and processing.

[0066] The method of the embodiment of this specification first locates the W1 sequence that appears according to a certain position regularity, and then locates the barcode 2 sequence, UMI sequence, PolyT sequence / TSO sequence that are sequentially connected to the back end. Since the gene length in the barcode 1 sequence and the barcode 2 sequence is longer than the gene length of the W1 sequence, and the gene length of the barcode 1 sequence is uncertain, by locating the W1 sequence with a shorter gene length and then locating the barcode 2 sequence, the amount of computational data can be reduced and the computational efficiency can be improved. Accordingly, the subsequent fixed-length UMI sequence and Poly T sequence / TSO sequence can be quickly obtained.

[0067] In step 102, the fastq file is a fastq file of 3'RNA data or 5'RNA data output from the single cell platform, and the 3'RNA data or 5'RNA data in the fastq file includes barcode 1 sequence, W1 sequence, and barcode 2 sequence connected in sequence.

[0068] In one example, the single-cell platform machine is connected to a computer device for communication, and the single-cell platform machine outputs a fastq file to the computer device; in another example, the fastq file output by the single-cell platform machine is imported into a storage medium, and after the storage medium is connected to the computer device, the computer device obtains the fastq file output by the single-cell platform machine. The storage medium can be a medium that can realize the effective storage and export of fastq files, such as a USB flash drive, a hard disk, or other computer devices that can transmit data.

[0069] The step 102 further includes:

[0070] Step 1021, before parsing the fastq file, obtaining the path of the fastq file; the path of the fastq file at least includes a prefix, a read type, and a suffix;

[0071] Step 1023, identify whether the read type in the path of the fastq file is consistent with the preset read type. If so, identify the prefix in the path of the fastq file as the sample ID, and then parse the fastq file corresponding to the sample ID; otherwise, end the process.

[0072] Before implementing the above process, the path of the output fastq file needs to be defined according to a regular expression on the machine side of the single-cell platform.

[0073] pattern = re.compile("(.+)[-_\\.](R1|R2|1|2)(_0\d+) .(fastq.gz|fq.gz|fastq|fq)$")

[0074] The above regular expression divides the fastq file name into 4 parts: prefix (.+), read type (R1|R2|1|2), others (_0\d+) ) and suffix (fastq.gz|fq.gz|fastq|fq). The separator between the four parts can be a hyphen (-), underscore (_), or period (.).

[0075] The prefix can be any character except the newline character, but cannot be empty;

[0076] The read type can be R1, R2, 1, 2;

[0077] Others can be an underscore and a number followed by the read type, or they can be empty;

[0078] The suffix can be fastq.gz|fq.gz|fastq|fq.

[0079] Therefore, after being defined in the above manner, the method of the embodiment of this specification can identify the path of the fastq file. It is determined whether the read type is a preset type. If so, the prefix of the read fastq file can be used as the Sample ID of this analysis.

[0080] Table 1. Example table showing that the read types in the fastq file path are consistent with the preset types.

[0081] fastq file sample name Sample ID read type Rat_R1.fastq.gz Rat Read 1 little-Rat_2.fastq Little-Rat Read 2 R23400777-WJ-E12-W04_combined_R1.fq.gz R2340077-WJ-E12-W04_combined Read 1 240418-ABC-S-YXJ-U04_S0_L001_R2_001.fq 240418-ABC-S-YXJ-U04_S0_L001 Read 2

[0082] In Table 1, when the path of the fastq file is any of the above fastq file sample names, since the read types in the path are R1, 2, R1, R2, respectively, which match the preset read types, subsequent processing can be performed and the prefix in the path is determined as the sample ID.

[0083] When the read type in the path is inconsistent with the preset read type, the method process ends. For example, the fastq file sample name is "Rat_I1.fastq.gz". According to the path defined by the regular rule, "I1" can be identified as the read type, but it is inconsistent with the preset read type, so the process ends. For another example, the fastq file sample name is "little-Rat_3.fastq", "3" is the identified read type, but it is inconsistent with the preset read type, so the process ends.

[0084] Step 102 also includes:

[0085] When the format of the path for identifying the fastq file does not conform to the defined rule, the process ends.

[0086] For example, the fastq file sample name is "test_2.fa", although the identified read type is consistent with the preset read type, the file name suffix does not contain "fa", so the process ends. For another example, the fastq file sample name is "240418YYY~240418R-S-YXJ-U04_S0_L001~R2_001.fq", although the identified read type is consistent with the preset read type, the connector between different components does not contain "~", so the process ends.

[0087] In addition to determining the sample ID by the prefix in the path of the fastq file, the sample ID can also be specified for the fastq file by entering a command line.

[0088] In step 104, the location information and sequence structure of the W1 sequence in the read data are located according to the position range of the W1 sequence, including:

[0089] Step 1041, obtaining all base pairs within the position range where the W1 sequence appears from the read data, and forming a detection sequence containing all base pairs;

[0090] Step 1043, according to the gene length in the target sequence, obtain from the detection sequence a number of candidate sequences of consecutive base pairs that are equal to the gene length of the target sequence; the target sequence is the W1 sequence in the 3'RNA data or 5'RNA data output from the single cell platform pre-stored in the database;

[0091] Step 1045, using the Hamming distance algorithm, calculate the distance between each candidate sequence and the target sequence, and determine the candidate sequence whose distance is less than the first distance threshold as the W1 sequence;

[0092] Step 1047, determining the position of the W1 sequence in the read data according to the position of the candidate sequence in the read data.

[0093] The W1 sequence is a common sequence, which generally appears in the 11th to 18th bp sequence of read 1. All base pairs within the range are obtained, and the 11th to 18th bp sequence is used as the detection sequence.

[0094] The W1 sequences of different samples pre-stored in the database are obtained and used as the target sequences. The database is the TCGAG database, which stores data sets of different tissues, such as the W1 sequences of stomach samples. According to the needs of detection and analysis, the target sequence of the corresponding tissue is obtained.

[0095] According to the gene length of the target sequence, which is generally 5bp, the continuous 5bp sequence in the test sequence is used as a candidate sequence. That is, the 11th to 15th bp sequence is a candidate sequence, the 12th to 16th bp sequence is a candidate sequence, the 13th to 17th bp sequence is a candidate sequence, and the 14th to 18th bp sequence is a candidate sequence. In this way, there are 4 candidate sequences. Each candidate sequence is matched with the target sequence, that is, the Hamming distance algorithm is used to determine whether the candidate sequence matches the target sequence.

[0096] The Hamming distance is a distance measure between two strings (or binary sequences) of equal length, which represents the number of different characters at corresponding positions in the two strings. The method of calculating the Hamming distance usually involves performing an XOR operation on the two strings and counting the number of results that are 1, which is the Hamming distance. When the result is 1, there is a character at a certain position in the two strings that is inconsistent. When the result is 0, the characters on the two strings are the same.

[0097] When matching the candidate sequence with the target sequence, the match is successful when the distance between the candidate sequence and the target sequence is less than the first distance threshold. The first distance threshold can be 1 or 2. When the first distance threshold is 1, the candidate sequence and the target sequence must be completely consistent for the pairing to be successful; when the first distance threshold is 2, one base mismatch is allowed.

[0098] When the first distance threshold is met, the candidate sequence that is successfully matched is used as the W1 sequence. If the candidate sequence that is successfully matched is the 11th to 15th bp sequence, the W1 sequence is the 11th to 15th bp sequence. At this point, not only the position information of the W1 sequence in read1 is determined, but also the sequence structure of the W1 sequence is determined.

[0099] In step 106, based on the position information of the W1 sequence in the read 1 data, the gene length of the barcode 2 sequence, the gene length of the UMI sequence, and the gene length of the Poly T sequence / the gene length of the TSO sequence, the position information and sequence structure of the barcode 2 sequence, the UMI sequence, and the Poly T sequence / TSO sequence in the read 1 data are determined in sequence, including:

[0100] Step 1061, based on the position information of the W1 sequence in the read 1 data, determine the starting position of the barcode 2 sequence connected to the back end of the W1 sequence in the read 1 data;

[0101] Step 1063, based on the starting position of the barcode 2 sequence in the read 1 data and the gene length of the barcode 2 sequence, determine the position information and sequence structure of the barcode 2 sequence in the read 1 data;

[0102] Based on the position information of the barcode 2 sequence in the read 1 data, determine the starting position of the UMI sequence connected to the back end of the barcode 2 sequence in the read 1 data;

[0103] Based on the starting position of the UMI sequence in the read 1 data and the gene length of the UMI sequence, determine the position information and sequence structure of the UMI sequence in the read 1 data;

[0104] Based on the position information of the UMI sequence in the read 1 data, determine the starting position of the PolyT sequence / TSO sequence connected to the back end of the UMI sequence in the read 1 data;

[0105] Based on the starting position of the Poly T sequence / TSO sequence in the read 1 data and the gene length of the Poly T sequence / TSO sequence, the position information and sequence structure of the Poly T sequence / TSO sequence in the read 1 data are determined.

[0106] from Figure 2a , Figure 2b It can be seen that the barcode 1 sequence, W1 sequence, barcode 2 sequence, UMI sequence, Poly T sequence / TSO sequence are connected in sequence. When the position of the W1 sequence is determined to be in the Nth to (N+4)th bp sequence, the starting position of the barcode 2 sequence can be determined to be (N+5)th bp. According to the gene length of the barcode 2 sequence, which is generally 10bp, the position information of the barcode 2 sequence can be determined to be (N+5)th bp to (N+14)th bp. After that, the starting position of the UMI sequence can be determined to be (N+15)th bp. According to the gene length of the UMI sequence, which is generally 10bp, the position information of the UMI sequence can be determined to be (N+15)th bp to (N+24)th bp. Next, the starting position of the Poly T sequence / TSO sequence can be determined to be the (N+25)th bp. According to the gene length of the Poly T sequence, the PolyT sequence refers to a sequence structure of 10 or more consecutive Ts appearing at any position in the full-length sequence of read1. Assuming that the gene length is 10bp, the position information of the gene length of the Poly T sequence can be determined to be (N+25)bp to (N+34)bp. According to the gene length of the TSO sequence, which is generally 30bp, and the sequence structure is similar to the W1 sequence but longer than the W1 sequence, the position information of the TSO sequence can be determined to be (N+25)bp to (N+54)bp.

[0107] In step 1081 and step 1083, the first and second barcode white lists are pre-configured on the computer device according to the corresponding reagent kit.

[0108] In step 1081, it is known that the length of the barcode 1 sequence is uncertain, ranging from 10bp to 13bp. The barcode 1 sequence generally starts from the 1bp of the read 1 data, and may be located at the 1bp to 13bp of the read 1 data. The first 10bp sequence, that is, the sequence from the 1bp to the 10bp, is obtained from the starting end of the read 1 data, and is used as the excerpt sequence of the barcode 1 sequence. At this time, the excerpt sequence may be the full sequence of the barcode 1 sequence (when the gene length of the barcode 1 sequence is 10bp), or it may be a partial sequence of the barcode 1 sequence (when the gene length of the barcode 1 sequence is 11bp to 13bp). Using the possible minimum length of the barcode 1 sequence, 10bp, and starting to intercept the sequence from the starting end of the read 1 data can improve the efficiency of subsequent alignment.

[0109] After the excerpt sequence, the sequence identical to the excerpt sequence is spliced ​​to form the first matching sequence of the barcode 1 sequence. Figure 5 , the sequence in the solid-line frame is the actual sequence obtained in the read 1 data, and the sequence in the dotted-line frame is the spliced ​​sequence, and the spliced ​​sequence has the same sequence structure as the excerpt sequence. After splicing, the entire sequence is used as the first matching sequence.

[0110] A first sliding window sequence of a certain gene length is extracted from the first matching sequence using a sliding window algorithm, and the first sliding window sequence is matched with the first barcode whitelist, that is, whether the first sliding window sequence exists in the first barcode whitelist is queried. The above-mentioned certain gene length can be selected from 8bp to 10bp, that is, the first sliding window sequence contains 8bp to 10bp base pairs.

[0111] The first barcode whitelist contains several whitelist sequences related to the barcode 1 sequence. The whitelist stores several spliced ​​sequences, each of which is formed by splicing the same sequence after the original whitelist sequence. Each spliced ​​sequence in the whitelist is formed according to the length of the excerpt sequence × 2, 20bp. If the length of the original sequence is 10bp, the original sequence of the spliced ​​sequence in the whitelist is a complete original sequence structure. If the length of the original sequence is greater than 10bp, the original sequence of the spliced ​​sequence in the whitelist is a partial original sequence structure.

[0112] When the first matching sequence is a 20bp sequence, if the gene length is 10bp, the first sliding window sequence can be the 1bp to 10bp sequence in the first matching sequence. When it fails to match the first barcode whitelist, it slides forward 1bp. At this time, the first sliding window sequence can be the 2bp to 11bp sequence. When it fails to match the first barcode whitelist, it continues to slide forward 1bp until the first sliding window sequence matches the sequence in the first barcode whitelist, and then ends. According to the length of the first matching sequence, there can be up to 10 first sliding window sequences. If all first sliding window sequences cannot match the sequences in the first barcode whitelist, the match fails. In the above matching process, base mismatches are not allowed.

[0113] When the first matching sequence is a 20 bp sequence (see Figure 5 ), if the gene length is 9bp, the first sliding window sequence can be the 1bp to 9bp sequence in the first matching sequence. When it fails to match the first barcode whitelist, it slides forward 1bp. At this time, the first sliding window sequence can be the 2bp to 10bp sequence. When it fails to match the first barcode whitelist, it continues to slide forward 1bp until the first sliding window sequence matches the sequence in the first barcode whitelist, and then ends. According to the length of the first matching sequence, there can be up to 10 different first sliding window sequences. If all first sliding window sequences cannot match the sequences in the first barcode whitelist, the match fails. The above matching process allows 1 base mismatch.

[0114] If the gene length is 8 bp, different sliding window sequences are obtained for whitelist matching in the above manner. Depending on the length of the first matching sequence, there can be up to 10 different second sliding window sequences. In the above matching process, 2 base mismatches are allowed.

[0115] In step 1083, the barcode 2 sequence has been located and determined in step 106. Before it is matched with the second barcode whitelist, it needs to be spliced. Specifically, a sequence identical to the barcode 2 sequence is spliced ​​after the barcode 2 sequence to form a second matching sequence of the barcode 2 sequence (refer to Figure 5 splicing method in ).

[0116] A second sliding window sequence of a certain gene length is extracted from the second matching sequence using a sliding window algorithm, and the second sliding window sequence is matched with the second barcode list, that is, whether the second sliding window sequence exists in the second barcode whitelist is queried. The above-mentioned certain gene length can be selected from 8bp to 10bp, that is, the second sliding window sequence contains 8bp to 10bp base pairs.

[0117] The second barcode whitelist contains several whitelist sequences related to the barcode 2 sequence, and the whitelist stores several spliced ​​sequences, each of which is formed by splicing the same sequence after the original whitelist sequence. Each spliced ​​sequence in the whitelist is formed according to the length of the barcode 2 sequence × 2, 20bp.

[0118] When the second matching sequence is a 20bp sequence, if the gene length is 10bp, the second sliding window sequence can be the 1bp to 10bp sequence in the second matching sequence. When it fails to match the second barcode whitelist, it slides forward 1bp. At this time, the second sliding window sequence can be the 2bp to 11bp sequence. When it fails to match the second barcode whitelist, it continues to slide forward 1bp until the second sliding window sequence matches the sequence in the second barcode whitelist, and then ends. According to the length of the second matching sequence, there can be up to 10 first sliding window sequences. If all second sliding window sequences cannot match the sequences in the second barcode whitelist, the match fails. In the above matching process, base mismatches are not allowed.

[0119] When the second matching sequence is a 20bp sequence, if the gene length is 9bp, the second sliding window sequence can be the 1bp to 9bp sequence in the second matching sequence. When it fails to match the second barcode whitelist, it slides forward 1bp. At this time, the second sliding window sequence can be the 2bp to 10bp sequence. When it fails to match the second barcode whitelist, it continues to slide forward 1bp until the second sliding window sequence matches the sequence in the second barcode whitelist, and then ends. Depending on the length of the second matching sequence, there can be up to 10 different second sliding window sequences. If all second sliding window sequences cannot match the sequences in the second barcode whitelist, the match fails. The above matching process allows 1 base mismatch.

[0120] If the gene length is 8 bp, different sliding window sequences are obtained for whitelist matching in the above manner. Depending on the length of the second matching sequence, there can be up to 10 different second sliding window sequences. In the above matching process, 2 base mismatches are allowed.

[0121] In step 1085, it is determined whether the read 1 data is valid read 1 data. When the barcode 1 sequence and the barcode 2 sequence each successfully match the corresponding barcode whitelist, the read 1 data is determined to be valid read 1 data. If any one of the matches is unsuccessful, or both of the matches are unsuccessful, the read 1 data is determined to be invalid read 1 data.

[0122] The above steps 1081 to 1085 are for whitelist matching of barcode 1 sequence and barcode 2 sequence. The above steps can be performed after obtaining the barcode 2 sequence in step 106. It can also be performed after all sequences in the read 1 data are split according to step 106.

[0123] Step 1081 and step 1083 perform whitelist matching on the barcode 1 sequence and the barcode 2 sequence respectively, and the above processes can be processed in parallel.

[0124] Steps 102 to 1085 of the embodiment of this specification can be understood as a process of performing sequence splitting on each read 1 data, and matching the barcode 1 sequence and the barcode 2 sequence in each read 1 data with the whitelist.

[0125] Usually, the fastq file output from the single-cell platform includes multiple read data, each of which contains read 1 data and read 2 data, and the two appear in pairs (see Figure 2a , Figure 2b ). The method of the embodiment of this specification also includes, according to the process of the above steps 102 to 1085, performing sequence splitting on all read data in the fastq file, filtering out invalid data to obtain valid read 1 data. In steps 1081 to 1083, the method of the embodiment of this specification also includes:

[0126] In the process of pairing the selected sequence of barcode 1 sequence with the first barcode whitelist, when the match is successful, the original whitelist sequence in the first barcode whitelist is used as the selected sequence of barcode 1 sequence;

[0127] In the process of pairing the barcode 2 sequence with the second barcode whitelist, when the match is successful, the original whitelist sequence in the second barcode whitelist is used as the barcode 2 sequence.

[0128] This process can be performed when a 9bp sliding window sequence is selected. In this way, even if there is one base mismatch, when the match is successful, the sequence with the base mismatch can be replaced with the original sequence in the barcode whitelist, so that sequence correction can be achieved.

[0129] The method of the embodiment of this specification also includes:

[0130] Step 110: Based on the valid read 1 data, its paired read 2 data is determined as valid read 2 data.

[0131] In this process, effective read 2 data can be quickly screened without complex validity analysis and judgment of the read 2 data.

[0132] The method of the embodiment of this specification also includes:

[0133] Step 112, after obtaining all valid reads data in the fastq file, calculate the ratio of the total amount of valid reads data to the total amount of reads data in the fastq file to obtain the effective proportion of valid reads data; the total amount of valid reads data is the sum of the number of valid read 1 data and the number of valid read 2 data;

[0134] Step 114: when the effective proportion is not less than the proportion threshold, sequencing data processing is performed on the effective reads data.

[0135] Steps 112 and 114 determine the effectiveness (i.e., effective proportion), thereby filtering out effective read data below a proportion threshold, and retaining effective read data greater than or equal to the proportion threshold. The proportion threshold can be set based on experience, such as 10%.

[0136] The sequencing data processing includes: adapter sequence cutting, alignment, cell gene quantification, generation of visual html report, generation of visual Mobi-Browser file, etc. (see Figure 4 ). Finally, all the results are saved in a file with the prefix in the fastq file path as the sample ID, and all the result files are organized, packaged and compressed.

[0137] The method of the embodiment of this specification is configured in the fastq file splitting tool. In addition to the bam comparison file, filtered_cell_gene_matrix, raw_cell_gene_matrix cell gene expression matrix, html result report and other files required for general single-cell transcriptome analysis, the tool excludes the analysis folder for downstream clustering, and the content of this file is already included in the Mobi-Browser visualization file. The tool also configures the result_mito_percentage.csv file, which can directly view the mitochondrial gene expression level of the captured cell; configures the cell_metrics.csv file (such as Figure 4 ), the number of genes, number of UMIs, proportion of mitochondrial UMIs, species origin, etc. contained in each cell are recorded. The above functions can be realized by using other functional modules configured in the tool.

[0138] The embodiments described above are merely preferred embodiments of this specification and are not intended to limit the scope of this specification. Without departing from the design spirit of this specification, various modifications and improvements made to the technical solutions of this specification by ordinary technicians in this field should fall within the scope of protection determined by the claims of this specification.

Claims

1. A method for splitting sequencing data of a fastq file, characterized in that: include: Receive and parse the fastq file to obtain read 1 data containing sequentially sorted barcode 1 sequence, W1 sequence, barcode 2 sequence and UMI sequence; According to the position range of the W1 sequence, the position information and sequence structure of the W1 sequence in the read 1 data are located from the read 1 data; Based on the position information of the W1 sequence in the read 1 data, the gene length of the barcode 2 sequence, the gene length of the UMI sequence, the gene length of the Poly T sequence / the gene length of the TSO sequence, the position information and sequence structure of the barcode 2 sequence, the UMI sequence, the Poly T sequence / TSO sequence in the read 1 data are determined in turn; The first 10bp sequence of the read 1 data is obtained and used as the excerpt sequence of the barcode 1 sequence; the sequence identical to the excerpt sequence is spliced ​​after the excerpt sequence to form the first matching sequence of the barcode 1 sequence; the first sliding window sequence of a certain gene length is extracted from the first matching sequence using the sliding window algorithm, and the first sliding window sequence is matched with the first barcode whitelist; the sequence identical to the sequence is spliced ​​after the barcode 2 sequence to form the second matching sequence of the barcode 2 sequence; the second sliding window sequence of a certain gene length is extracted from the second matching sequence using the sliding window algorithm, and the second sliding window sequence is matched with the second barcode list; when the first sliding window sequence successfully matches the first barcode whitelist, and the second sliding window sequence successfully matches the second barcode whitelist, the read 1 data is determined as valid read 1 data, otherwise, a new sliding window sequence is continuously obtained to match the barcode whitelist, and if all sliding window sequences do not match the barcode whitelist, the read 1 data is determined as invalid read 1 data; wherein the first barcode whitelist and the second barcode whitelist each include a plurality of spliced ​​sequences, each of which is formed by splicing the same sequence after the original whitelist sequence; The fastq file is a fastq file of 3'RNA data or 5'RNA data output from the single-cell platform. The 3'RNA data or 5'RNA data in the fastq file includes a barcode 1 sequence, a W1 sequence, and a barcode 2 sequence connected in sequence.

2. The method according to claim 1, characterized in that Also includes: Before parsing the fastq file, obtain the path of the fastq file; the path of the fastq file includes at least a prefix, a read type, and a suffix; Identify whether the read type in the path of the fastq file is consistent with the preset read type. If so, identify the prefix in the path of the fastq file as the sample ID, and then parse the fastq file corresponding to the sample ID; otherwise, end the process.

3. The method according to claim 2, characterized in that Also includes: Configure a preset read type, where the preset read types include R1, R2, 1, and 2.

4. The method according to claim 2, characterized in that: The path of the fastq file is defined by a regular expression on the machine side of the single cell platform that outputs the fastq file.

5. The method according to claim 1, characterized in that The method of locating the position information and sequence structure of the W1 sequence in the read 1 data according to the position range of the W1 sequence, comprises: From the read 1 data, obtain all base pairs within the position range where the W1 sequence appears, and form a detection sequence containing all base pairs; According to the gene length in the target sequence, a number of candidate sequences of the same length as the gene length of the target sequence are obtained from the detection sequence, which are composed of consecutive base pairs; the target sequence is the W1 sequence in the 3'RNA data or 5'RNA data output from the single-cell platform pre-stored in the database; Using the Hamming distance algorithm, the distance between each candidate sequence and the target sequence is calculated, and the candidate sequence whose distance is less than the first distance threshold is determined as the W1 sequence; According to the position of the candidate sequence in the read 1 data, the position of the W1 sequence in the read 1 data is determined.

6. The method according to claim 1, characterized in that The method sequentially determines the position information and sequence structure of the barcode 2 sequence, the UMI sequence, the Poly T sequence / TSO sequence in the read 1 data based on the position information of the W1 sequence in the read 1 data, the gene length of the barcode 2 sequence, the gene length of the UMI sequence, and the gene length of the Poly T sequence / TSO sequence, including: Based on the position information of the W1 sequence in the read 1 data, determine the starting position of the barcode 2 sequence connected to the back end of the W1 sequence in the read 1 data; Based on the starting position of the barcode 2 sequence in the read 1 data and the gene length of the barcode 2 sequence, determine the position information and sequence structure of the barcode 2 sequence in the read 1 data; Based on the position information of the barcode 2 sequence in the read 1 data, determine the starting position of the UMI sequence connected to the back end of the barcode 2 sequence in the read 1 data; Based on the starting position of the UMI sequence in the read 1 data and the gene length of the UMI sequence, determine the position information and sequence structure of the UMI sequence in the read 1 data; Based on the position information of the UMI sequence in the read 1 data, determine the starting position of the Poly T sequence / TSO sequence connected to the back end of the UMI sequence in the read 1 data; Based on the starting position of the Poly T sequence / TSO sequence in the read 1 data and the gene length of the Poly T sequence / TSO sequence, the position information and sequence structure of the Poly T sequence / TSO sequence in the read 1 data are determined.

7. The method according to claim 1, characterized in that Also includes: In the process of pairing the selected sequence of barcode 1 sequence with the first barcode whitelist, when the match is successful, the original whitelist sequence in the first barcode whitelist is used as the selected sequence of barcode 1 sequence; In the process of pairing the barcode 2 sequence with the second barcode whitelist, when the match is successful, the original whitelist sequence in the second barcode whitelist is used as the barcode 2 sequence.

8. The method according to claim 1, characterized in that: The gene length of the first sliding window sequence is 9 bp or 10 bp; the gene length of the second sliding window sequence is 9 bp or 10 bp.

9. The method according to claim 1, characterized in that: Also includes: Based on the valid read 1 data, its paired read 2 data is determined as valid read 2 data; After obtaining all valid reads data in the fastq file, the ratio of the total amount of valid reads data to the total amount of reads data in the fastq file is calculated to obtain the effective proportion of valid reads data; the total amount of valid reads data is the sum of the number of valid read 1 data and the number of valid read 2 data; When the effective proportion is not less than the proportion threshold, sequencing data processing is performed on the effective reads data.