A method, system, electronic device and storage medium for splitting a FASTQ file

By constructing Tables 1, 2, 3, and 4, and using barcode/index sequences as keys and sample IDs as values, segmentation, mismatched base replacement, and merging processes are performed, solving the universality problem of FASTQ file splitting in existing technologies and achieving efficient and flexible FASTQ file splitting and statistics.

CN116050348BActive Publication Date: 2026-03-31BGI TECH SOLUTIONS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-16
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies lack a universal splitting scheme that can handle multiple samples, multiple barcode combinations, and support any number of FASTQ files. Furthermore, they cannot handle cases where the reverse sequences of the two ends are inconsistent, and the number and length of the output files are immutable.

Method used

By constructing Tables 1, 2, 3, and 4, and using barcode/index sequences as keys and sample IDs as values, segmentation, mismatched base substitution, and merging processes are performed to generate new sequences. The sequences are then split into units of 4 rows each, supporting any number of FASTQ files and barcode combinations, and outputting any number of FASTQ files.

Benefits of technology

It achieves efficient splitting of any number of FASTQ files and barcode combinations, supports any number of output files, and generates the final result in one go without the need for merging or secondary splitting operations after splitting, providing complete statistical results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116050348B_ABST
    Figure CN116050348B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of FASTQ file splitting method, system, electronic equipment and storage medium, the splitting method includes: with barcode / index sequence as key, sample ID is value and constructs table one;With barcode / index sequence as key, barcode / index sequence belongs to the serial number of FASTQ file and its location information in belonging FASTQ file as value and constructs table two;After each group barcode / index sequence in table one is segmented, mismatch base replacement and is handled to generate new sequence, with new sequence as key, sample ID is value and constructs table three;Table four is constructed and includes: the serial number of output file, corresponding input FASTQ file serial number, the starting position and length of the sequence of this file output;With every 4 as a sequence, simultaneously traversing each FASTQ file, based on table one, table two, table three and table four, each unit sequence is split, solve the problem that there is no general splitting scheme in prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of bioinformatics technology, and in particular to a method, system, electronic device, and storage medium for splitting FASTQ files. Background Technology

[0002] FASTQ format is a text format for storing biological sequences (usually nucleic acid sequences) and their sequencing quality scores. Both the sequence and the quality score are represented by a single ASCII character.

[0003] This format was originally developed by the Wellcome Trust Sanger Institute to integrate FASTA format sequences and their quality data. Currently, the FASTQ format has become the de facto standard for preserving high-throughput sequencing results.

[0004] In a FASTQ file, a sequence typically consists of four lines:

[0005] The first line begins with @, followed by the sequence identifier and description (similar to the description line in FASTA format). The second line contains the sequence information. The third line begins with +, followed by the sequence identifier and description again (optional). The fourth line contains the quality score information, corresponding to the sequence in the second line, and must be the same length as the second line.

[0006] The following is an example of a FASTQ file containing a single sequence:

[0007]

[0008] Where ! represents the lowest quality and ~ represents the highest quality. The following characters, from left to right, represent quality scores from low to high:

[0009]

[0010] Typically, for PE (Paired-end) sequencing, FASTQ files are generated in pairs, while for SE (single-end) sequencing, a single FASTQ file is generated.

[0011] During library preparation before sequencing, multiple sample libraries may be mixed together. Barcode / index sequences are added to distinguish between different samples. A barcode / index is a unique sequence encoding several sets (>=1) of sequences linked to each raw DNA from the same sample. Each barcode set typically consists of several (>=1) segments designed as nucleotide sequences. Depending on the design, the position and orientation of the barcode in the final file vary. Figures 1(a) and 1(b) show examples of common single-index and double-index barcode / index sequences, respectively.

[0012] In the sequencing results from the same batch of library construction, the position and orientation of the barcode in the FASTQ file are consistent. After sequencing, the sequencing results of each sample are separated based on the known barcode / index sequence and its position and orientation information.

[0013] In the sequencing results from the same batch of library construction, the position and orientation of the barcode in the FASTQ file are consistent. After sequencing, the sequencing results of each sample are separated based on the known barcode / index sequence and its position and orientation information.

[0014] Existing software commonly used to split FASTQ based on barcode, such as seqtk_demultiplex and FASTQ-multx, has the following shortcomings:

[0015] 1. Some (such as seqtk_demultiplex) only support single index (each index contains only one barcode fragment) splitting; others only support single index or dual index (each index contains only two barcode fragments).

[0016] 2. If the reversed sequences of the paired ends are inconsistent during sequencing, a second split is required;

[0017] 3. Only supports one-to-one correspondence between samples and barcodes; if a sample has multiple (groups) of barcodes, they need to be split separately and then merged separately.

[0018] 4. Only single or paired FASTQ files are supported for input;

[0019] 5. The number of output files is immutable (usually a pair of FASTQ files); the length and position of the output sequence are immutable. Summary of the Invention

[0020] This invention addresses the technical problems existing in the prior art by providing a method, system, electronic device, and storage medium for splitting FASTQ files, thus solving the problem of the lack of a universal splitting scheme in the prior art.

[0021] According to a first aspect of the present invention, a method for splitting FASTQ files is provided, comprising: constructing Table 1 using barcode / index sequences as keys and sample IDs as values;

[0022] Table 2 is constructed using the barcode / index sequence as the key, the sequence number of the FASTQ file to which the barcode / index sequence belongs, and its position information in the FASTQ file as the value;

[0023] After segmenting, mismatching base replacement, and merging the barcode / index sequences in Table 1, new sequences are generated. Table 3 is constructed using the new sequences as keys and sample IDs as values. The string representing the connection order is generated based on the mismatch order and the connector in Table 1.

[0024] The construction of Table 4 includes: the output file number, the corresponding input FASTQ file number, the starting position and length of the output sequence of that file;

[0025] Each sequence consists of 4 lines, and each FASTQ file is traversed simultaneously. Each unit sequence is split based on Table 1, Table 2, Table 3, and Table 4.

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

[0027] Optionally, Table 1, Table 2, Table 3 and Table 4 are hash tables.

[0028] Optionally, during the construction of Tables 2 and 4, the position information of the barcode / index sequence in its respective FASTQ file includes:

[0029] The starting position, length, and direction, wherein the direction is either positive or negative and complementary.

[0030] Optionally, the processing of any set of barcode / index sequences during the construction of Table 3 includes:

[0031] Step 1: Based on the connector in Table 1, split the barcode / index sequence into several segments in sequence and denote them as Sequence 1;

[0032] Step 2, the process of processing each segment of sequence one separately, includes:

[0033] Step 201: Obtain the position information of the FASTQ sequence in the FASTQ file according to the sequence number of the first sequence and the table. The position information includes the direction, which is either positive or negative complementary.

[0034] Step 202, performing mismatch base substitution on sequence one, including:

[0035] When the direction of Sequence 1 is reverse complementary, Sequence 1 is reversed and each character of Sequence 1 is replaced to generate Sequence 2. The replacement method is: A becomes T, T becomes A, C becomes G, and G becomes C. When the direction of Sequence 1 is forward, Sequence 2 is the same as Sequence 1.

[0036] Step 203: Generate a sequence that has n inconsistent characters with the second sequence and denote it as the third sequence; n is the mismatch number in step 202;

[0037] Step 3: Take one sequence from each of the three sequences in each group in turn, and concatenate the extracted sequences into a string according to the connector defined in Table 1. Use the string as the key and the sample ID as the value to generate Table 3.

[0038] Optionally, the process of splitting the data for each unit includes:

[0039] Traverse the number of each barcode / index sequence in Table 2, obtain the sequence number of the FASTQ file to which the unit sequence belongs and its position information in the FASTQ file according to the key-value correspondence in Table 2, obtain the sequence corresponding to the position information in the FASTQ file and record it as sequence four;

[0040] Based on the barcode / index sequence numbering order in Table 2, the fourth sequence is concatenated into a string according to the specified concatenation operator in Table 1 and recorded as the fifth sequence; using the fifth sequence as the key, the sample ID is obtained based on Table 3;

[0041] Based on the sequence number of the FASTQ file to which it belongs in Table 4 and its position information in the FASTQ file, obtain the sequence corresponding to the position information of the unit sequence in the FASTQ file and record it as sequence six. Output sequence six and the corresponding sample ID based on the sequence number of the output file in Table 4.

[0042] Optionally, the process of outputting sequence six and the corresponding sample ID includes:

[0043] If an output file already exists that contains an ID prefixed with the sample ID, then the sequence number six is ​​appended to that output file.

[0044] Otherwise, generate an output file prefixed with the sample ID and the corresponding output file number, and output sequence six to the output file.

[0045] Optionally, during the process of traversing each FASTQ file, the number of times each sequence five appears is recorded and output as the final statistical result.

[0046] According to a second aspect of the present invention, a splitting system for FASTQ files is provided, comprising: a table one construction unit, a table two construction unit, a table three construction unit, a table four construction unit, and a splitting unit;

[0047] The Table 1 construction unit is used to construct Table 1 with the barcode / index sequence as the key and the sample ID as the value.

[0048] The Table 2 construction unit is used to construct Table 2 with the barcode / index sequence as the key, the serial number of the FASTQ file to which the barcode / index sequence belongs, and its position information in the FASTQ file as the value.

[0049] The Table 3 construction unit is used to segment, mismatch, and merge the barcode / index sequences in Table 1 to generate new sequences, and construct Table 3 with the new sequences as keys and sample IDs as values; the string representing the connection order is generated according to the mismatch order and the connector in Table 1.

[0050] The Table 4 construction unit is used to construct Table 4, which includes: the sequence number of the output file and Table 2;

[0051] The splitting unit is used to split each unit sequence into four-line units, while traversing each FASTQ file and splitting each unit sequence based on Table 1, Table 2, Table 3 and Table 4.

[0052] According to a third aspect of the present invention, an electronic device is provided, including a memory and a processor, wherein the processor is configured to implement a FASTQ file splitting method when executing a computer management program stored in the memory.

[0053] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer management class program stored thereon, which, when executed by a processor, implements the steps of a method for splitting FASTQ files.

[0054] This invention provides a method, system, electronic device, and storage medium for splitting FASTQ files. Table 1 defines the barcode corresponding to each sample, supporting the mapping relationship between each sample and any number of barcodes.

[0055] Table 2 defines the data source number, location information, and direction information needed for the splitting process, supporting:

[0056] Input any number of FASTQ files, including rare scenarios with more than 3 FASTQ files;

[0057] Each barcode group contains any number of sequences, including combinations of 3 or more barcode segments;

[0058] Specify the position and direction information for each barcode segment;

[0059] Output any number of FASTQ files;

[0060] Each output file can specify the length and position of the output sequence as required;

[0061] It generates the final result in one go, without the need for merging or secondary splitting after splitting; and it provides complete statistical results. Attached Figure Description

[0062] Figure 1(a) is a structural example of a common single-index barcode / index sequence;

[0063] Figure 1(b) is a structural example of a common dual-index barcode / index sequence;

[0064] Figure 2 A flowchart of a method for splitting FASTQ files provided by the present invention;

[0065] Figure 3 A structural block diagram of a FASTQ file splitting system provided by the present invention;

[0066] Figure 4 A schematic diagram of the hardware structure of a possible electronic device provided by the present invention;

[0067] Figure 5 This is a schematic diagram of the hardware structure of a possible computer-readable storage medium provided by the present invention. Detailed Implementation

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

[0069] Figure 1 is a flowchart of a FASTQ file splitting method provided by the present invention. As shown in Figure 1, the splitting method includes:

[0070] Table 1 is constructed using the barcode / index sequence as the key and the sample ID as the value.

[0071] Table 2 is constructed using the barcode / index sequence as the key and the sequence number of the FASTQ file to which the barcode / index sequence belongs and its position information in the FASTQ file as the value.

[0072] After segmenting, mismatching base substitution, and merging the barcode / index sequences in Table 1, new sequences are generated. Table 3 is constructed using the new sequences as keys and sample IDs as values.

[0073] The construction of Table 4 includes: the output file number, the corresponding input FASTQ file number, the starting position and length of the output sequence of that file.

[0074] Each unit sequence is divided into four lines, and each FASTQ file is traversed simultaneously. Each unit sequence is split based on Table 1, Table 2, Table 3, and Table 4.

[0075] This invention provides a method for splitting FASTQ files, which solves the problem of the lack of a universal splitting scheme in the prior art.

[0076] Example 1

[0077] Embodiment 1 provided by this invention is an embodiment of a method for splitting FASTQ files provided by this invention. As shown in Figure 1, this embodiment of the splitting method includes:

[0078] Table 1 is constructed using the barcode / index sequence as the key and the sample ID as the value.

[0079] In practice, the mapping relationship between the barcode / index sequence and the sample is read to generate Table 1.

[0080] The barcode / index sequence is a sequence composed of letters representing bases: "A", "T", "C", and "G". Its mapping to the sample is recorded in a text file. Each barcode / index uniquely corresponds to one sample, but the reverse is not always true. A barcode set consists of several barcode segments, which are concatenated into a string according to a specified order and a specified connector.

[0081] Table 2 is constructed using the barcode / index sequence as the key and the sequence number of the FASTQ file to which the barcode / index sequence belongs and its position information in the FASTQ file as the value.

[0082] In practice, the position and direction information of the barcode / index is read to generate Table 2.

[0083] The position and orientation information of the barcode / index sequence in the FASTQ file of the sequencing results are recorded in tabular form, including: barcode / index number, FASTQ file number (indicating which FASTQ file it belongs to), start position in the sequence, length, orientation (positive / negative complementary), and number of mismatches. The barcode numbering order corresponds to the sequence order of each barcode segment in Table 1.

[0084] After segmenting, mismatching base substitution, and merging the barcode / index sequences in Table 1, new sequences are generated. Table 3 is constructed using the new sequences as keys and sample IDs as values.

[0085] In one possible implementation, the processing of any set of barcode / index sequences during the construction of Table 3 includes:

[0086] Step 1: Based on the connector in Table 1, split the barcode / index sequence into several segments in sequence and denote them as Sequence 1.

[0087] Step 2, the process of processing each segment of sequence one separately, includes:

[0088] Step 201: Obtain the position information of the FASTQ sequence in its respective FASTQ file according to the sequence number of sequence one and table two. The position information includes the direction, which is either positive or negative complementary.

[0089] Step 202, performing mismatch base substitution on sequence one, including:

[0090] When the direction of Sequence 1 is reversed and complementary, Sequence 1 is reversed and each character of Sequence 1 is replaced to generate Sequence 2. The replacement method is: A becomes T, T becomes A, C becomes G, and G becomes C. When the direction of Sequence 1 is forward, Sequence 2 is the same as Sequence 1.

[0091] Step 203: Generate a sequence that has n inconsistent characters with sequence two and denote it as sequence three; n is the mismatch number in step 202.

[0092] Step 3: Take one sequence (permutation and combination) from each of the three groups of sequences in turn, and concatenate the selected sequences into a string according to the connector defined in Table 1. Use the string as the key and the sample ID as the value to generate Table 3.

[0093] The construction of Table 4 includes: the output file number, the corresponding input FASTQ file number, the starting position and length of the output sequence of that file.

[0094] In practice, Table 4 records the output file number, the FASTQ file number to which it belongs (representing which FASTQ file the barcode / index sequence is located in), the starting position, and the length information.

[0095] Each sequence consists of 4 lines. Simultaneously, each FASTQ file is traversed, and each unit sequence is split based on Table 1, Table 2, Table 3, and Table 4.

[0096] In one possible implementation, the process of splitting the data for each unit includes:

[0097] Iterate through the barcode / index sequence numbers in Table 2, obtain the sequence number of the FASTQ file to which the unit sequence belongs and its position information in the FASTQ file according to the key-value correspondence in Table 2, obtain the sequence corresponding to the position information in the FASTQ file and record it as sequence four.

[0098] Based on the barcode / index sequence numbering order in Table 2, concatenate sequence four into a string according to the specified concatenation operator in Table 1 and record it as sequence five. Using sequence five as the key, obtain the sample ID based on Table 3.

[0099] Based on the sequence number of the FASTQ file in Table 4 and its position information in the FASTQ file, obtain the sequence corresponding to the position information of the unit sequence in the FASTQ file and record it as sequence six. Output sequence six and the corresponding sample ID based on the sequence number of the output file in Table 4.

[0100] In one possible embodiment, the process of outputting sequence six and the corresponding sample ID includes:

[0101] If an output file already exists that contains a sample ID prefix, then append sequence six to that output file.

[0102] Otherwise, generate an output file prefixed with the sample ID and the corresponding output file number, and output sequence six to the output file.

[0103] In one possible implementation, during the traversal of each FASTQ file, the number of occurrences of each sequence five is recorded and output as the final statistical result.

[0104] Example 2

[0105] Embodiment 2 provided by this invention is an embodiment of a FASTQ file splitting system provided by this invention. Figure 3 This is a structural diagram of a FASTQ file splitting system provided in an embodiment of the present invention, combined with... Figure 3It can be seen that the implementation of the splitting system includes: Table 1 construction unit, Table 2 construction unit, Table 3 construction unit, Table 4 construction unit and splitting unit.

[0106] Table 1 is a construction unit used to build Table 1 with the barcode / index sequence as the key and the sample ID as the value.

[0107] Table 2 is a construction unit used to construct Table 2 with the barcode / index sequence as the key and the sequence number of the FASTQ file to which the barcode / index sequence belongs and its position information in the FASTQ file as the value.

[0108] Table 3 is a construction unit used to segment, replace mismatched bases, and merge the barcode / index sequences in Table 1 to generate new sequences. The new sequences are used as keys and sample IDs as values ​​to construct Table 3.

[0109] The Table 4 building unit is used to construct Table 4, which includes: the output file number, the corresponding input FASTQ file number, the starting position and length of the output sequence of that file.

[0110] The splitting unit is used to split each unit sequence into four-line sequences, while traversing each FASTQ file and splitting each unit sequence based on Table 1, Table 2, Table 3, and Table 4.

[0111] It is understood that the FASTQ file splitting system provided by the present invention corresponds to the FASTQ file splitting method provided in the foregoing embodiments. The relevant technical features of the FASTQ file splitting system can be referred to the relevant technical features of the FASTQ file splitting method, and will not be repeated here.

[0112] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating an embodiment of the electronic device provided in this invention. For example... Figure 4As shown, this embodiment of the invention provides an electronic device, including a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320. When the processor 1320 executes the computer program 1311, it performs the following steps: constructing Table 1 with the barcode / index sequence as the key and the sample ID as the value; constructing Table 2 with the barcode / index sequence as the key, the serial number of the FASTQ file to which the barcode / index sequence belongs, and its position information in the FASTQ file as the value; performing segmentation, mismatch base substitution, and merging processing on each group of barcode / index sequences in Table 1 to generate a new sequence, and constructing Table 3 with the new sequence as the key and the sample ID as the value; constructing Table 4, which includes: the serial number of the output file, the serial number of the corresponding input FASTQ file, the starting position and length of the output sequence of that file; dividing each unit sequence into four lines, traversing each FASTQ file simultaneously, and splitting each unit sequence based on Table 1, Table 2, Table 3, and Table 4.

[0113] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. (See diagram below.) Figure 5 As shown, this embodiment provides a computer-readable storage medium 1400, on which a computer program 1411 is stored. When the computer program 1411 is executed by a processor, it performs the following steps: constructing Table 1 with the barcode / index sequence as the key and the sample ID as the value; constructing Table 2 with the barcode / index sequence as the key, the serial number of the FASTQ file to which the barcode / index sequence belongs, and its position information in the FASTQ file as the value; performing segmentation, mismatch base substitution, and merging processing on each group of barcode / index sequences in Table 1 to generate a new sequence, and constructing Table 3 with the new sequence as the key and the sample ID as the value; constructing Table 4, which includes: the serial number of the output file, the serial number of the corresponding input FASTQ file, the starting position and length of the output sequence of that file; dividing each unit sequence into units of 4 lines, and simultaneously traversing each FASTQ file, splitting each unit sequence based on Table 1, Table 2, Table 3, and Table 4.

[0114] The present invention provides a method, system, electronic device and storage medium for splitting FASTQ files, which defines the barcode for each sample through Table 1 and supports the mapping relationship between each sample and any number of barcodes.

[0115] Table 2 defines the data source number, location information, and direction information needed for the splitting process, supporting:

[0116] Input any number of FASTQ files, including rare scenarios with more than 3 FASTQ files;

[0117] Each barcode group contains any number of sequences, including combinations of 3 or more barcode segments;

[0118] Specify the position and direction information for each barcode segment;

[0119] Output any number of FASTQ files;

[0120] Each output file can specify the length and position of the output sequence as required;

[0121] It generates the final result in one go, without the need for merging or secondary splitting after splitting; and it provides complete statistical results.

[0122] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0123] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0124] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.

[0125] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.

[0126] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.

[0127] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0128] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for splitting FASTQ files, characterized in that, The splitting method comprises: Table 1 is constructed by taking barcode / index sequence as key and sample ID as value; Table 2 is constructed by taking barcode / index sequence as key, sequence number of the FASTQ file to which the barcode / index sequence belongs and position information of the barcode / index sequence in the FASTQ file as value; After segmenting, mismatch base replacing and merging processing of each group of barcode / index sequences in Table 1, new sequences are generated, and Table 3 is constructed by taking new sequence as key and sample ID as value; Table 4 is constructed and comprises sequence number of output file, corresponding input FASTQ file sequence number, starting position and length of output sequence of the FASTQ file; Each 4 lines of sequence are taken as one sequence, and each FASTQ file is traversed, and each unit sequence is split based on Table 1, Table 2, Table 3 and Table 4; The process of splitting each unit sequence based on Table 1, Table 2, Table 3 and Table 4 comprises: The sequence number of each barcode / index sequence in Table 2 is traversed, the sequence number of the FASTQ file to which the unit sequence belongs and the position information of the unit sequence in the FASTQ file are obtained according to the key-value correspondence of Table 2, the sequence corresponding to the position information in the FASTQ file is obtained and recorded as sequence four; According to the sequence number order of barcode / index sequence in Table 2, the sequence four is connected into a string according to the specified connector in Table 1 and recorded as sequence five, and the sample ID is obtained based on Table 3 by taking the sequence five as key; According to the sequence number of the FASTQ file to which the unit sequence belongs and the position information of the unit sequence in the FASTQ file in Table 4, the sequence corresponding to the position information of the unit sequence in the FASTQ file is obtained and recorded as sequence six, and the sequence six and the corresponding sample ID are output based on the sequence number of the output file in Table 4.

2. The resolution method according to claim 1, characterized in that, Table 1, Table 2, Table 3 and Table 4 are hash tables.

3. The resolution method according to claim 1, characterized in that, In the process of constructing Table 2 and Table 4, the position information of the barcode / index sequence in the FASTQ file to which it belongs comprises starting position, length and direction, and the direction is forward or reverse complement.

4. The resolution method according to claim 1, characterized by, In the process of constructing Table 3, the processing process of any group of barcode / index sequences comprises: Step 1, according to the connector of Table 1, the barcode / index sequences are split into several sequence segments in order and recorded as sequence one; Step 2, the process of processing each sequence segment one comprises: Step 201, according to the sequence number of the sequence one and Table 2, the position information of the sequence one in the FASTQ file to which it belongs is obtained, and the position information comprises direction, and the direction is forward or reverse complement; Step 202, the sequence one is processed by mismatch base replacing, which comprises: When the direction of the sequence one is reverse complement, the sequence one is reversed and each character of the sequence one is replaced to generate a sequence two, the replacement mode is: A is changed into T, T is changed into A, C is changed into G, and G is changed into C; when the direction of the sequence one is forward, the sequence two is the same as the sequence one; In step 203, a group of sequences with n inconsistent characters with the sequence two are generated and recorded as sequence three; n is the number of mismatches in step 202; In step 3, one sequence is taken from each group of the sequence three in turn, the taken sequences are connected into a string according to the connector defined in the table one, and the table three is generated with the string as the key and the sample ID as the value.

5. The resolution method according to claim 1, characterized in that, The process of outputting the sequence six and the corresponding sample ID includes: If an output file containing the sample ID as a prefix already exists, the sequence six is appended to the output file; Otherwise, an output file with the sample ID and the sequence number of the corresponding output file as a prefix is generated, and the sequence six is output to the output file.

6. The resolution method according to claim 1, wherein, During the process of traversing each FASTQ file, the number of occurrences of each sequence five is recorded and output as the final statistical result.

7. A system for splitting of FASTQ files, characterized in that, The splitting system includes a table one construction unit, a table two construction unit, a table three construction unit, a table four construction unit and a splitting unit; The table one construction unit is configured to construct the table one with the barcode / index sequence as the key and the sample ID as the value; the table two construction unit is configured to construct the table two with the barcode / index sequence as the key and the sequence number of the FASTQ file to which the barcode / index sequence belongs and the position information of the barcode / index sequence in the FASTQ file as the value; The table three construction unit is configured to generate a new sequence by segmenting, replacing mismatched bases and merging each group of barcode / index sequences in the table one, and construct the table three with the new sequence as the key and the sample ID as the value; The table four construction unit is configured to construct the table four, and the table four includes the sequence number of the output file, the sequence number of the corresponding input FASTQ file, the starting position and length of the output sequence of the FASTQ file; The splitting unit is configured to traverse each FASTQ file with each 4 lines as a sequence, and split each unit sequence based on the table one, the table two, the table three and the table four; The process of splitting each unit sequence based on the table one, the table two, the table three and the table four includes: Traverse the number of each barcode / index sequence in the table two, obtain the sequence number of the FASTQ file to which the unit sequence belongs and the position information of the unit sequence in the FASTQ file according to the key-value correspondence of the table two, and obtain the sequence corresponding to the position information in the FASTQ file and record it as sequence four; According to the number order of the barcode / index sequence in the table two, the sequence four is connected into a string according to the specified connector in the table one and recorded as sequence five; the sample ID is obtained based on the table three with the sequence five as the key. According to the sequence number of the table four FASTQ file and the location information thereof in the table four FASTQ file, the sequence corresponding to the location information of the unit sequence in the table four FASTQ file is obtained and recorded as sequence six, and the sequence six and the corresponding sample ID are output based on the sequence number of the output file in the table four.

8. An electronic device, comprising: A computer program product comprising a memory, a processor for executing a computer management program stored in the memory to implement the method of claim 1 6. The step of the method of splitting a FASTQ file of any one of the preceding claims.

9. A computer-readable storage medium, characterized in that, a computer management program stored thereon, which, when executed by the processor, implements the method of claim 1 6. The step of the method of splitting a FASTQ file of any one of the preceding claims.

Citation Information

Patent Citations

  • The invention discloses a data classification method for single cell sequencing

    CN109658981A

  • Storage, transfer and compresson of next generation sequencing data

    US20180152535A1