A liquid phase-mass spectrometry co-control coupling method, system and application
Through the combined use method and system of liquid phase-mass spectrometry co-control, the compatibility problem between different brands of equipment is solved, efficient and accurate experimental operations are achieved, and cost and operation complexity are reduced.
Patent Information
- Application Number
- CN202510012018.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-01-06
AI Technical Summary
Different brands of liquid chromatographs and mass spectrometers have caused communication compatibility and software compatibility issues due to differences in communication protocols and interface standards, which increases operational complexity and error risks, affecting the accuracy and reliability of experimental data.
Provide a liquid phase-mass spectrometry co-control method and system, which starts the device operation by importing the dependency library, loading sample test configuration information, generating configuration files suitable for liquid phase and mass spectrometry equipment, calling control scripts, and generating and saving analysis results.
It significantly reduces manual operation time, improves work efficiency, reduces operational errors and coordination difficulties, reduces costs, realizes the combination of different models or brands of equipment, and broadens application scenarios.
Smart Images

Figure CN119415185B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of biochemical detection co-control, and relates to a liquid phase-mass spectrometry co-control coupling method, system and application. Background Art
[0002] At present, in the proteomics and metabolomics production practices of enterprises, liquid chromatography-mass spectrometry has become the most commonly used analytical method. The core of this technology is that the sample is first fractionated by liquid chromatography and then enters the mass spectrometer for component detection and information collection. The combination of liquid chromatography and mass spectrometry provides reliable technical support for the separation of complex components and high-sensitivity detection of samples, and is particularly suitable for high-precision proteomics and metabolomics research.
[0003] However, the technical barriers between instruments of different brands pose considerable challenges to actual production applications. At present, each instrument manufacturer usually provides supporting software systems for its own products to control and manage liquid chromatography and mass spectrometers. For companies that choose products from the same instrument company, the professional software provided by the manufacturer can achieve synchronous control of liquid chromatographs and mass spectrometers, and the operation is relatively convenient. However, when companies choose liquid chromatography and mass spectrometers from different companies, they will encounter the following problems:
[0004] Communication issues: Since instruments of different brands use different communication protocols and interface standards, the communication compatibility between the liquid chromatography instrument and the mass spectrometer must first be resolved. This usually involves interface adjustments for hardware and software, and may require the development of a custom communication module, which increases technical difficulty and cost.
[0005] Software compatibility issues: Each company only provides control software for its corresponding instruments. When the liquid chromatography instrument and mass spectrometer are controlled by different software, the operator needs to start, configure and run two independent software systems respectively, which greatly increases the complexity of operation. Even experienced operators are bound to make mistakes when handling such multi-tasking operations, especially in scenarios where information needs to be kept consistent, such as sample numbers, run sequences, and analysis parameters. These inconsistencies will lead to confusion in experimental data and may even affect the accuracy and reliability of experimental results.
[0006] Therefore, the market urgently needs a method or system that can simultaneously control mass spectrometers and liquid chromatographs of different brands, manage the workflow of liquid chromatographs and mass spectrometers at the same time, automatically synchronize sample information and operating parameters, eliminate the inconvenience of multiple software operations and the risk of human errors, improve analysis efficiency and data quality, and ensure the efficiency and accuracy of experiments. Summary of the invention
[0007] In order to solve the deficiencies in the prior art, the purpose of the present invention is to provide a liquid chromatography-mass spectrometry co-control coupling method, system and application.
[0008] The present invention provides a liquid phase-mass spectrometry co-control coupling method, the method comprising the following steps:
[0009] Step 1: Import the dependent library and set the path of the liquid phase control script, mass spectrometry control script and method configuration file;
[0010] Step 2: Load the last sample test configuration information or initialize the sample test configuration information, modify and save the sample test configuration information according to the requirements;
[0011] Step 3: Convert sample information and test configuration to generate configuration files suitable for liquid phase equipment and mass spectrometry equipment;
[0012] Step 4: sequentially call the liquid phase control script to load the liquid phase configuration file, call the mass spectrometry control script to load the mass spectrometry configuration file, and start the operation of the liquid phase device and the mass spectrometry device;
[0013] Step 5: The liquid phase device and the mass spectrometry device respectively generate and save the analysis results of each sample.
[0014] In step 1, the dependent libraries include streamlit library, pandas library, numpy library, os library, glob library, pickle library, functools library, re library, etc.;
[0015] The streamlit library is used to create and display a web interface that provides visual operations;
[0016] The pandas library is used to read and process the template files of liquid phase and mass spectrometry equipment, and generate the configuration files required by the liquid phase or mass spectrometry equipment;
[0017] The numpy library is used to generate and manipulate array data, helping to process sample-related numerical data;
[0018] The os library is used to set and manage file paths and execute external scripts;
[0019] The glob library is used for file path pattern matching to search for liquid phase or mass spectrometry method files;
[0020] The pickle library is used to serialize objects including sample configuration information and save them to files, and to deserialize and read objects from files;
[0021] The functools library is used to generate new functions with some fixed parameters to simplify code calls;
[0022] The re library is used to match and verify string content and check sample information content.
[0023] In one specific embodiment, in step 1, relative paths of the liquid phase control script and the mass spectrometry control script are first generated and then converted into absolute paths for easy transplantation and compatibility; and / or,
[0024] Defining and setting the path of the liquid phase and mass spectrometry method configuration files for reading the configuration files; and / or,
[0025] The corresponding method profile, run status and sample selection status can be selected through the drop-down menu in the visual operation web interface.
[0026] In step 2, try to find, open and read the last sample test configuration information, which includes sample name (samples), sample position (positions), liquid phase method (lcmethods), mass spectrometry method (msmethods), injection volume (invols), whether it is selected (checks), sample result path (dirs), running status (status), etc.;
[0027] When the last sample test configuration information cannot be found, use the initialization default configuration information; and / or,
[0028] Modify and update the initial default configuration information according to test requirements and save it for subsequent test runs.
[0029] In a specific implementation, the configuration information modification includes deleting the selected sample row, retaining the unselected sample row, modifying the sequence of the sample rows to be tested, copying the selected sample row, etc.
[0030] In a specific implementation, the page layout, sidebar, buttons and other page contents can also be adjusted and modified through the UI component of the web interface; each column of the configuration information modification position in the web interface corresponds to one of the sample test configuration information;
[0031] In step 3, the field data containing sample information in the template file of the liquid phase device is read and updated, the data in the updated template file is converted into a table, and saved in a CSV format file as a local configuration file for the liquid phase test; and,
[0032] Read and update the field data containing sample information in the template file of the mass spectrometer device, convert the data in the updated template file into a table, and save it in an XLS format file as a local configuration file for the mass spectrometer test;
[0033] and / or,
[0034] During the specific implementation process, the previously existing configuration file may be deleted.
[0035] In step 4, the control scripts of the liquid phase device and the mass spectrometer device are called in sequence, and the generated configuration files are loaded into the respective devices; after the configuration is completed, the control script of the device is called to start the actual operation process and start processing samples; and / or,
[0036] When the configuration and / or operation of the liquid phase device and / or mass spectrometry device fails, an exception is prompted and the execution is stopped.
[0037] In the specific implementation process, before step 1, it also includes: accessing the browser through a script, opening and running the UI control interface written by the streamlit package; and / or,
[0038] Remote access to the UI control interface can be achieved by setting the LAN IP and / or intranet penetration service and domain name.
[0039] In a specific implementation process, during the mass spectrometry setting process, it is necessary to delete the unrun samples. The unrun samples are deleted by identifying the color blocks and corresponding text information on the mass spectrometry control interface: the sample area is obtained by scrolling the interface and taking screenshots, and then opencv-python is used to identify the color blocks of the run samples, and easyocr is used to identify whether there is text under the color blocks. If there is and the text length is greater than the preset threshold, it is determined to be a unrun sample; click and delete the unrun sample until all unrun samples are deleted.
[0040] The present invention provides a liquid phase-mass spectrometry co-control coupling system, the system comprising a system initialization module, a data processing module, a device control module, an abnormality processing module, a state management and storage module;
[0041] The system initialization module is used to set the system basic environment including file path, method file loading and recovery of the last running state;
[0042] The data processing module is used to parse and process the input sample data and generate the configuration files required by the liquid chromatography and mass spectrometry equipment;
[0043] The device control module is used to control the liquid chromatography and mass spectrometry equipment through system commands to complete the configuration and operation of the sample;
[0044] The exception handling module is used to monitor the operating status of the equipment in real time, detect and handle abnormal situations that occur during operation;
[0045] The state management and storage module is used to save and update the system state, including the current state and configuration information of the sample, and provide management functions for the sample.
[0046] In the specific implementation process, the liquid chromatography-mass spectrometry co-control coupling system may also include a UI auxiliary module, which facilitates the implementation of functions including file uploading, control operations, information display, etc. through the design of the front-end UI interface.
[0047] The present invention also provides the above-mentioned liquid chromatography-mass spectrometry co-control coupling method, or the above-mentioned liquid chromatography-mass spectrometry co-control coupling system in the process of biochemical testing, the application of liquid chromatography-mass spectrometry efficient co-control coupling, and the use of mass spectrometry control system to improve processing efficiency, reduce workload, etc.
[0048] The beneficial effects of the present invention include: the co-control coupling method of the present invention can significantly reduce the time of manual operation in the coupling system. It only takes 5 minutes to configure 30 samples using the method of the present invention, while the traditional method takes 20 minutes, which greatly improves work efficiency; the method of the present invention effectively reduces manpower occupation and solves the problems of arbitrariness and lack of standardization caused by manual operation, thereby reducing communication costs, reducing operational errors and coordination difficulties within the enterprise, and optimizing manual intervention, so that the method of the present invention can be promoted and applied at a lower cost, reducing costs and increasing efficiency; the method of the present invention provides feasible ideas and methods for other models or brands of liquid chromatography-mass spectrometry coupling technology, and supports the coupling of different models or different companies' equipment by simply modifying the script, even including gas chromatography-mass spectrometry coupling, broadening the application scenarios; at the same time, the method of the present invention can also realize remote connection and control on different computers by configuring a local area network or the like. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 It is a flow chart of the co-control combination method in a specific implementation manner of the present invention.
[0051] Figure 2 It is a schematic diagram of the sample information editing area interface on hystar in Example 3 of the present invention.
[0052] Figure 3 Schematic diagram of the liquid phase-mass spectrometry co-control interface in an embodiment of the present invention.
[0053] Figure 4It is a schematic diagram of the interface of the Xcalibur software in Example 4 of the present invention.
[0054] Figure 5 It is a schematic diagram of the interface of the Hystar software in Example 4 of the present invention.
[0055] Figure 6 This is a schematic diagram of a demand table file in Example 5 of the present invention.
[0056] Figure 7 It is a schematic diagram of the interface of the mass spectrometry production system in Example 6 of the present invention. DETAILED DESCRIPTION
[0057] The present invention is further described in detail with reference to the following specific examples and drawings. The process, conditions, experimental methods, etc. for implementing the present invention, except for the contents specifically mentioned below, are all common knowledge and common common sense in the art and are not particularly limited by the present invention.
[0058] The present invention provides a liquid phase-mass spectrometry co-control coupling method, the method comprising the following steps:
[0059] Step 1: Import the dependent library and set the path of the liquid phase control script, mass spectrometry control script and method configuration file;
[0060] Step 2: Load the last sample test configuration information or initialize the sample test configuration information, modify and save the sample test configuration information according to the requirements;
[0061] Step 3: Convert sample information and test configuration to generate configuration files suitable for liquid phase equipment and mass spectrometry equipment;
[0062] Step 4: sequentially call the liquid phase control script to load the liquid phase configuration file, call the mass spectrometry control script to load the mass spectrometry configuration file, and start the operation of the liquid phase device and the mass spectrometry device;
[0063] Step 5: The liquid phase device and the mass spectrometry device respectively generate and save the analysis results of each sample.
[0064] In step 1, the dependent libraries include streamlit library, pandas library, numpy library, os library, glob library, pickle library, functools library, re library, etc.;
[0065] The streamlit library is used to create and display a web interface that provides visual operations;
[0066] The pandas library is used to read and process the template files of liquid phase and mass spectrometry equipment, and generate the configuration files required by the liquid phase or mass spectrometry equipment;
[0067] The numpy library is used to generate and manipulate array data, helping to process sample-related numerical data;
[0068] The os library is used to set and manage file paths and execute external scripts;
[0069] The glob library is used for file path pattern matching to search for liquid phase or mass spectrometry method files;
[0070] The pickle library is used to serialize objects including sample configuration information and save them to files, and to deserialize and read objects from files;
[0071] The functools library is used to generate new functions with some fixed parameters to simplify code calls;
[0072] The re library is used to match and verify string content and check sample information content;
[0073] and / or,
[0074] In step 1, the relative paths of the liquid phase control script and the mass spectrometry control script are first generated and then converted into absolute paths for easy porting and compatibility; and / or,
[0075] Defining and setting the path of the liquid phase and mass spectrometry method configuration files for reading the configuration files; and / or,
[0076] Select the corresponding method profile, run status, and sample selection status through the drop-down menu in the visual operation web interface.
[0077] In step 2, try to find, open and read the last sample test configuration information, wherein the sample test configuration information includes sample name, sample location, liquid phase method, mass spectrometry method, injection volume, whether selected, sample result path, and running status;
[0078] When the last sample test configuration information cannot be found, use the initialization default configuration information; and / or,
[0079] Modify and update the initial default configuration information according to test requirements and save it for subsequent test runs;
[0080] The configuration information modification includes deleting the selected sample row, retaining the unselected sample row, modifying the sequence of the sample rows that need to be tested, copying the selected sample row, etc.
[0081] In step 3, the field data containing sample information in the template file of the liquid phase equipment is read and updated, the data in the updated template file is converted into a table, and saved in a CSV format file as a local configuration file for the liquid phase test;
[0082] Read and update the field data containing sample information in the template file of the mass spectrometer device, convert the data in the updated template file into a table, and save it in an XLS format file as a local configuration file for the mass spectrometer test;
[0083] and / or,
[0084] Delete the previously existing configuration file.
[0085] In step 4, the control scripts of the liquid phase device and the mass spectrometer device are called in sequence, and the generated configuration files are loaded into the respective devices; after the configuration is completed, the control script of the device is called to start the actual operation process and start processing samples; and / or,
[0086] When the configuration and / or operation of the liquid phase device and / or mass spectrometry device fails, an exception is prompted and the execution is stopped.
[0087] Example 1
[0088] In a specific embodiment, the liquid phase control process specifically includes the following steps:
[0089] Step I. Library import and initialization
[0090] The Liquid Phase Control Module automates the operation of the Xcalibur software by importing several necessary libraries:
[0091] os, time, re, etc. are used for file operations, time control, and regular expression processing.
[0092] uiautomation is used to operate the controls of the Xcalibur software interface.
[0093] psutil is used to monitor processes and file open status.
[0094] win32gui and win32con are used for window management, such as pinning and minimizing windows.
[0095] Step II. Start Xcalibur software and control the window
[0096] First, Lc_controller needs to ensure that the Xcalibur software is started and available:
[0097] The system will match the Xcalibur software window name through regular expressions. If the software is not started, the system will open the software through system commands.
[0098] After opening the software, the system will wait for 20 seconds (or longer, depending on the situation) to ensure that the software is fully loaded.
[0099] If the window cannot be found automatically, the system will retry several times until it successfully locates and brings the Xcalibur software window to the top.
[0100] Step III. Locate and control the sample editing interface
[0101] The system automatically switches to the Xcalibur sample sequence editing interface (Sequence Setup View). If the interface is not displayed, the system will enter this view through the menu.
[0102] Confirm that the window in the sample editing area is available by setting the focus several times to ensure that the following operations can proceed normally.
[0103] Step IV. Importing sample sequence files
[0104] The system uses the shortcut key Ctrl+I to open the "Import Sequence" interface of Xcalibur.
[0105] Automatically locate the file selection window and use the "Browse" button to find the CSV format sample sequence file to be imported.
[0106] Enter the path to the sample sequence file and select the file, then confirm and import it into Xcalibur.
[0107] When the import is complete, the system confirms that the file was successfully imported.
[0108] Step V. Saving the sample sequence
[0109] After the sample sequence editing is completed, the system will perform the "Save As" operation through the menu operation.
[0110] The sequence file will be automatically named with the current timestamp and saved in the specified directory to ensure that the file name is unique, which is convenient for subsequent tracing and inspection.
[0111] If the system encounters a freeze or the interface becomes unresponsive, it will repeatedly confirm the save operation to ensure that the file is saved successfully.
[0112] Step VI. Triggering the Liquid Phase Equipment Operation
[0113] The system starts the sample sequence by operating the "Actions" menu of the Xcalibur software and selecting the "Run Sequence..." option.
[0114] After entering the operation interface, the system will select the default operation mode (such as On mode) and start the liquid phase equipment to start running sample analysis.
[0115] After the run starts, the system will record the current time and take a screenshot of the run interface for subsequent debugging and troubleshooting.
[0116] Step VII. Sample running status monitoring
[0117] The system will continuously monitor the generation and update status of sample files. By checking the generated .raw files, it can be determined whether the liquid phase equipment has completed the analysis of the sample.
[0118] If the .raw file of a sample is not generated within the set time, the system will consider that the sample is not running normally and throw an exception prompt.
[0119] The system determines that the run for this sample is complete after detecting that the file is not open by the Xcalibur program.
[0120] Step VIII. Clean up unrun samples
[0121] If the option to delete unrun samples is set in the configuration, the system will purge those samples that have not completed the run before the device is run.
[0122] The system will scroll to the bottom of the sample edit table, select the samples that were not run and remove them using the delete key to ensure that only usable samples remain.
[0123] Step IX. End the run and save the results
[0124] When all sample analyses are completed, the system will minimize the Xcalibur software window to ensure that the interface does not affect other operations.
[0125] The system will save and organize all generated sample analysis result files.
[0126] Example 2
[0127] In a specific embodiment, the mass spectrometry control process specifically includes the following steps:
[0128] Step A. Software startup and window control
[0129] Open HyStar software: First, ms_controller checks whether Bruker's HyStar software has been started. It matches the name of the HyStar software window through a regular expression. If the software is not started, the system will use the system command to open the software and wait for the software to be fully loaded (up to 60 seconds).
[0130] Window control: After successfully opening the software, the system will put the HyStar window on top and set it to maximize to ensure that subsequent operations can proceed smoothly. In order to ensure that the window has the focus, the system will call the window on top function several times.
[0131] Step B. Sample sequence import and configuration
[0132] Delete unrun samples: If the option to delete unrun samples is set in the configuration, the system will scroll to the bottom of the sample table, identify unrun samples through image recognition technology, and automatically delete them. This is achieved by taking a screenshot of the table and using image processing libraries (such as opencv and easyocr) to detect the areas in the table that have not been run.
[0133] In this embodiment, first enter the configuration page and click the "Acquisition" button: the uiautomation command cannot directly obtain the handle of the "Acquisition" button in the mass spectrometry software interface, but can identify the component in which it is located, and the component is located in the operation button area at the top of the software interface; by locating the upper left corner of the blue operation button area and simulating the click operation according to the relative position, the purpose of entering the "Acquisition" page is achieved;
[0134] Next, it is necessary to delete the samples in the queue: Since the uiautomation command cannot directly obtain the content of the table and can only identify the table itself, the method of the present invention adopts an auxiliary method to identify the content in the table. Specifically, use the CapturePicture command of uiautomation to take a screenshot of the table, and then analyze the bottom position of the colored area in the screenshot through the OpenCV-Python library. Then, extract the image below the area, and perform text recognition through Python's machine learning library EasyOCR. If the recognition result returns text, it means that there are still unprocessed samples. At this time, control the mouse to click the corresponding position through the uiautomation command, and simulate pressing the Delete key to perform the deletion operation. This step will be repeated until the text recognition fails, proving that all unfinished samples have been deleted.
[0135] Finally, after the deletion operation is completed, the system needs to import the data. Similar to the processing method of Xcalibur software, the system uses Python's Pandas library to organize the information on the UI interface into Hystar format, which facilitates subsequent data processing and analysis.
[0136] Import sample sequence: After completing the table cleanup, the system enters the sample sequence import stage. The system will operate the HyStar sample editing interface, click the "Import" button through automatic operation, and select the sample sequence file in CSV format to be imported.
[0137] Save sample information: After importing the sequence file, the system will save the sample information and set a name for the sample run this time, usually the current timestamp, to ensure that the file name is unique and facilitate subsequent tracing.
[0138] Step C. Start mass spectrometry analysis
[0139] Start sample analysis: After importing and saving the sample information, the system will click the "Start Sequence" button in the HyStar software to start the mass spectrometer's analysis of the sample. The system will also automatically record the start time of the run.
[0140] Interface control: After starting mass spectrometry analysis, the system will take a screenshot of the HyStar interface and save it for later debugging or checking the results of mass spectrometry analysis. If an abnormality occurs, these screenshots can be used to locate the problem.
[0141] Step D. Operation status monitoring
[0142] The system will continuously monitor the operating status of the mass spectrometer and ensure the correct operation of the mass spectrometer by observing the HyStar interface. If a problem is found during operation (for example, some samples are not analyzed), the system will throw an exception to remind the operator to intervene.
[0143] Step E. Save the result and minimize the window
[0144] Results preservation: After the mass spectrometry analysis is completed, the system will ensure that the analysis results of all samples are properly saved. The HyStar interface will be minimized so as not to affect other operations, ensuring that the entire mass spectrometer operation process is smooth and error-free.
[0145] Example 3
[0146] Regarding the process of deleting unrun samples in mass spectrometry control, the method of the present invention needs to solve the problem of deleting samples that have not been run. The processed samples on the interface are represented by colored blocks as the background color. If sample information with text is identified in the area below the color block, it means that there are still samples to be run, which need to be selected and deleted.
[0147] Here the program will use the uiautomation package to find the sample information editing area on the hystar interface, such as Figure 2As shown, then control the mouse wheel (uiautomation.WheelDown) to slide the sample editing area scroll bar to the bottom to reveal the last sample. First, call uiautomation.CaptureToImage to capture the entire table area as a picture. The following is divided into two steps to determine the location of the sample to be run:
[0148] 1. Use the opencv-python package to read the image and create a matrix in the computer memory. x, y represent the coordinates of each pixel, and the corresponding value is the RGB color value of the image at the corresponding position. Use the find_unchanged_regions function to find the position of the corresponding color block of the sample that has been run. Its logic is to traverse each pixel. If the values of multiple pixels before and after it are the same, it proves that it is a pure color area. In this way, the position of the pure color area is confirmed. In a specific implementation process, numpy's apply_along_axis function is also used to process all pixels in parallel, which greatly saves running time; 2. The next step is to determine whether there are samples to be run under the pure color area. If there are samples to be run, there will be text under the pure color area. Easyocr returns the text and text coordinates. When the length of the recognized text is greater than 3, it is determined to be a sample.
[0149] Then cut out the image below the solid color area in the first step and pass it in to get the area coordinates of the text, then control the mouse and keyboard to click the line on hystar and press the delete key to delete it. Considering the situation where there are too many unrun samples, this step will be called multiple times until no text is recognized.
[0150] Example 4
[0151] In a specific embodiment, the process of realizing the co-control coupling of liquid chromatography-mass spectrometry by the method or system of the present invention is as follows:
[0152] The present invention creates a means for controlling a liquid phase analyzer and a mass spectrometer together through a simple configuration, and the specific operation steps are as follows:
[0153] Step 1: Start the service with a simple command and open the browser to see the UI interface.
[0154] The UI is written using Python's streamlit package, which is used to display the web interface and control the liquid phase and mass spectrometry.
[0155] In a specific implementation, the relevant control code is saved in the UI_WEB.py file. By entering python -m streamlit run .\UI_WEB.py in the command line, the software will automatically open the browser and access the UI interface, such as Figure 3 As shown;
[0156] In a specific implementation, the address can also be accessed by directly entering it in the browser address bar;
[0157] Step 2: The operator needs to configure all the information required to run the project in the UI interface. Each project has several samples, each sample occupies a row, and the key information required for the operation includes sample name, location of the liquid phase sample tray, liquid phase method, mass spectrometry method, injection volume, and result file storage location.
[0158] You can also click the Browse files button in the web interface to import Excel files. By default, the previous content will be deleted before importing the file. After importing, it will be displayed in the list of the UI, and you can also make further adjustments in the list.
[0159] Each position in the list can be edited, and the buttons below have corresponding functions. Click the Add Row button to add a blank row. The Up and Down buttons can move one or more selected samples to facilitate the adjustment of the running order. The Delete Selected Row button can delete the selected sample. The Copy Selected Row button can only select one sample to copy, which is suitable for the situation where the next sample only needs to slightly adjust the next sample information. After the information is filled in, click the Start Run button and wait for the program to run.
[0160] Step 3: Control the liquid phase through Xcalibur 4.7 software. Xcalibur is the mainstream software used by Thermo Fisher to control its liquid phase and mass spectrometry. This software is used to control its liquid phase instrument. The entire operation is based on the python uiautomation package. This package can find each button on the software interface for clicks, inputs, and other operations. First, call the open_xca function to open the Xcalibur software. If it is already open, it will automatically identify and confirm and put it in the front of the screen. The interface of the Xcalibur software is as follows: Figure 4 shown.
[0161] After opening, call del_norun_seq to delete the samples that have not been run, or you can choose not to delete them. There are control parameters on the UI interface (checkbox to delete the samples that have not been run before running). Then call the convert_lc function to convert the information on the UI interface into a file format that can be read by the Xcalibur software, call the import_squence function to import this file into the software, and then the software will display the configured information. Finally, call save_sequence to save the configuration information on the Xcalibur software.
[0162] Step 4: Control the mass spectrometer through Bruker Compass HyStar 6.2 software. Hystar software is Bruker's software for controlling its mass spectrometers and liquid phases. This software is used to control its mass spectrometers. The underlying control also uses the python uiautomaition package. In addition, some functions use opencv and easyocr to identify the locations that need to be operated through machine learning. First, call the open_hystar function to open the HyStar software. If it is already open, it will automatically identify and confirm that it is at the top of the screen. The interface of the Hystar software is as follows: Figure 5 As shown;
[0163] Then call the delete_norun function to delete the samples that have not been run (you can also choose not to delete them, there are parameters on the UI page to control this), call the convert_ms function to convert the information configured on the UI interface into a format that can be read by the Hystar software, then call the run_Sequence_ms function to import the configuration file into Hystar, and then save the sequence information.
[0164] The mass spectrometer and liquid chromatography were configured separately.
[0165] Step 5: Call the run function in the liquid chromatography and mass spectrometry run script to run the liquid chromatography instrument and mass spectrometer, and take a screenshot of the current interface for subsequent verification.
[0166] The present invention facilitates the operator to fill in the necessary sample information through a simple and clear UI design. After filling in the information, the operator only needs to click a button, and the program will control the liquid phase to grade the sample, and the effluent will be given to the mass spectrometer for further analysis, achieving the combined effect of liquid phase mass spectrometry, and there is no need to manually control the liquid phase and mass spectrometry separately during the process, which reduces the workload and reduces the complexity of operations caused by human control, which is very easy to make mistakes, avoids the generation of problem projects, and each operation will have a screenshot preserved, which is convenient for troubleshooting if there is a problem. In general, it not only integrates the most advantageous machines of the two companies, but also facilitates the operators, and reduces the generation of project problems, which is of great significance to enterprise production.
[0167] Example 5
[0168] In a specific implementation, the specific usage examples are as follows:
[0169] 1. Organize a table file according to your needs. The file is in Excel format, such as Figure 6 As shown, there are six columns in total, and the order cannot be changed. The sample name column is the name of the sample required by the user, and one line is the information of one sample; the position column is the position of the sample bottle containing the sample extract on the sample tray (instructing the liquid phase to extract the sample at which position); the liquid phase method column is the method called when the liquid phase analyzes the sample (the temperature gradient and other information will be saved in a certain file in advance to control the operation rules of the liquid phase, and it will be directly called when needed, which is the routine operation of the liquid phase); the mass spectrometry method column is the method called when the mass spectrometer analyzes the sample (the temperature gradient and other information will be saved in a certain file in advance to control the operation rules of the mass spectrometer, and it will be directly called when needed, which is the routine operation of the mass spectrometer); the injection volume column involves the issue of protein content, and a batch of samples must ensure that the total amount of protein is the same, so each sample has a different injection volume due to different protein concentrations, and this value is calculated by the experimenter; the storage location column is the location where the mass spectrometry analysis results are stored; the status column is used for subsequent program upgrades, and currently has no effect, and the default value is waiting to be run.
[0170] 2. Open pycharm. Here we use pycharm, but you can also use other methods. The requirement is to install python 3.8 or above. The expansion packages that need to be installed in advance include pandas, numpy, uiautomation, python-opencv, streamlit, easyocr, etc. The expansion package version is not limited; After opening pycharm, click Terminal.
[0171] On the interactive page, first enter the path where UI-WEB.py is located. You can use the cd command to do this, and then enter the following command: python -m streamlit run . / UI-WEB.py. After pressing Enter, the software will run and automatically open a browser to access the generated UI interface; or you can directly run the website built in the LAN.
[0172] Since self-developed software is needed to replace Xcalibur and Hystar, a UI interface must be implemented, and the web version of the UI interface is developed with the help of the Streamlit framework; the company network is in an internal LAN, and other computers can directly access the UI interface through the IP address, thereby realizing remote control of the sample.
[0173] In addition, in order to achieve higher flexibility, by setting up intranet penetration services and domain names, users can access the UI interface through a home computer or mobile phone by entering the URL in the browser to view the sample operation status and control it, avoiding the need for personnel to go to the company for on-site operation. This not only effectively avoids equipment idleness, but also reduces labor costs and improves work efficiency.
[0174] like Figure 3 As shown, the information required for mass spectrometry liquid phase operation can be configured on this interface, and the file prepared in the first step can be imported. With the help of the buttons below, operations such as adding a row, moving up and down, deleting, and copying can be performed.
[0175] In actual operation, you can also use the file import function, click the Browse files button (there is also a check box at the upper and lower parts of the interface, which is selected by default, and the effect is to delete all existing sample information before importing), and select the corresponding configuration file for import.
[0176] After checking the manually entered or imported configuration information, you can click the Start Run button:
[0177] Above the button is a checkbox. By default, all samples currently queued for liquid chromatography and mass spectrometry will be deleted. You can select this option as needed. After clicking the Start Run button, the program will take over the running program (the UI interface is designed and implemented using Python's streamlit expansion package. Self-written code creates all the above components and associates the background functions).
[0178] The specific liquid phase and mass spectrometry operation process includes the following steps:
[0179] Open the Xcalibur software. If it is already open, it will be moved to the top of the screen. If it is not open, it will call a command to open it. This is done by using Python's uiautomation to find the corresponding handle of this software. The startfile command in Python's os library is used to open the software.
[0180] The program will determine whether this interface is displayed in the software. The judgment standard is the configuration table above the software. If it is not displayed, click View--Sequece Setup view to jump in.
[0181] This step is to find the corresponding handles of these components through commands such as GridControl and MenuItemControl in the uiautomation expansion package;
[0182] After opening, since the checkbox for clearing the queued samples is selected, the existing information in the configuration table will be deleted first. Use the GridControl command of uiautomation to find the table, control the mouse to select all samples, press the DETELE key; click OK to delete. These operations are completed by writing python code to call the command of the uiautomation package. If the table is too long (too many samples that have not been run), the above operations will be repeated many times until the number of rows in the table is 0 (python calls uiautomation to determine).
[0183] This table is used to configure the location of sample information. To ensure accuracy, a file in a format that can be recognized by this software is first generated based on the page information. The table format conversion is completed with the help of commands in the python expansion package pandas.
[0184] After obtaining the table, press the shortcut key CTRL+I (command in uiautomation) to import the table;
[0185] Use the BottonControl command in the uiautomation extension package of Python to find and operate the buttons on the corresponding web interface;
[0186] At this point, the sample information configuration is complete. Save the sample information, call uiautomation, press the shortcut key CTRL+S, a pop-up window appears, click OK, fill in the file name to be saved in the Save As page, and click the Save button to complete the save operation. This step is still completed with the help of the uiautomation command, and then minimize this interface (the command in the pywin package of python).
[0187] Then you need to configure Hystar. If it is already turned on, it will be adjusted to the top of the screen. If it is not turned on, a command will be called to turn it on. This is done through python's uiautomation, and the handle corresponding to this software is found for operation. The startfile command in the python os library used to open the software.
[0188] Similar to Xcalibur, this software also requires entering the configuration page first and then clicking Acquisition directly. Due to software limitations, uiautomation cannot find the handle of the Acquisition button and can only find the component where it is located, find the upper left corner of the area corresponding to the component, and then click the relative position.
[0189] Then you need to delete the queued samples. Uiautomation can only find this table, but cannot get the content inside. Use the CapturePicture command of Uiautomation to take a screenshot of the table, use opencv-python to analyze the bottom of the colored area, and then pass the picture below the colored area to the Python machine learning package easyocr for text recognition. If there is text, it proves that there are still samples that have not been run. Use Uiautomation to control the mouse click and press the DETELE key to delete. This step is also repeated many times until the text recognition fails, proving that the deletion is complete.
[0190] After the deletion is completed, you need to import the data and use python's pandas tool to organize the information on the UI interface into a format that hystar can recognize; click the Export / Import---Import button above the table to import the file; fill in the file path and click Open (both call the uiautomation command to find the corresponding component handle for operation).
[0191] The sample information in the mass spectrometer is the same as that in Xcalibur, but the method selection is different, because this is the only way to achieve the effect of liquid chromatography-mass spectrometry coupling, that is, at the same time, the liquid chromatography and mass spectrometry must process the same sample.
[0192] To save the corresponding information, press CTRL+S with uiautomation. Enter the name and click OK to complete the save (both call the uiautomation command to find the corresponding component handle for operation).
[0193] At this point, the configuration is complete and the next step is to trigger the MS and HPLC runs.
[0194] Call pywin to put xcalibur on the top of the screen, click Action----Run Squence..., click OK (both call uiautomation commands to find the corresponding component handle for operation), call pywin to put Hystar on the top of the screen, click Start----Start Sequence to run the mass spectrometer.
[0195] At this point, the liquid chromatography and mass spectrometry have been triggered and you only need to wait for the results to come out.
[0196] Example 6
[0197] In this embodiment, the liquid phase-mass spectrometry co-control coupling method of the present invention can be used in conjunction with the mass spectrometry production system currently being used by the company. The sample information of each project is recorded on the interface of the mass spectrometry production system, such as Figure 7 shown.
[0198] In combination with the method of the present invention, by communicating with the system at regular intervals to obtain sample information of new projects, a default machine list is generated, thereby further reducing the workload of experimenters.
[0199] In the specific implementation, 1. To log in to the system and obtain a token, you need to create a json with the username, password and timestamp, and use the cryptography package to encrypt it with the specified key and IV value (there is also a step to adjust the field size in the middle), and use python's requests package to post communication with the URL https: / / erpapi.i-sanger.cn / basic / openApi / auth / login. This interface will return a json data packet, and the token value will be obtained after parsing; 2. After obtaining the token value, put the token value in the header (when visiting the website, the verification field will basically be placed in this data body), and then post to https: / / erpapi.i-sanger.cn / production / openApi / protein / task / step / 120. This interface will return a json data packet. After parsing, you will get the information of the projects (several projects) in the pending state, such as customer name and project number; 3. Get the project information, check it on the disk through the os library, and pass Filter out the projects for which the machine table has been generated, and the remaining projects proceed to the next step; 4. For each project, put the task number in the request body, the token value in the header, and use requests to communicate with the URL https: / / erpapi.i-sanger.cn / production / openApi / protein / getLiquids / {task_sn}. This interface will return the sample information of this project, such as the sample name, etc.; 5. After parsing the sample information, create a default table and a list. The first element is designated as blank (blank sample, in order to maintain the cleanliness of the machine). Each sample is an element, and each element is a dictionary. The table requires six columns, and each column is installed with corresponding rules to specify the corresponding default value. After editing, use the DataFrame command of the pandas package to convert it into a table, and use the to_excel command to output it to a specific folder; 6. The experimenter opens the corresponding table in excel, and then edits the sample loading position according to actual needs, and can directly upload and run liquid chromatography and mass spectrometry on the UI interface, further reducing the workload.
[0200] Example 7
[0201] like Figure 1 As shown, it is a specific flow chart of the liquid phase-mass spectrometry co-control coupling method in a specific embodiment of the present invention, comprising:
[0202] 1. Start the UI interface and configure sample information
[0203] 1) Open the self-developed software UI interface
[0204] Display sample information input box: supports manual input and file import;
[0205] Display method selection box: provides multiple preset method options;
[0206] Display result path setting: supports local path and network storage;
[0207] After the configuration is completed, click the Run button: execute after verifying that the configuration information is correct;
[0208] 2) Automatically check the validity of configuration information
[0209] Is the sample name filled in? If not filled in, a prompt will pop up;
[0210] Whether the method has been selected: If not selected, the common method is selected by default;
[0211] Is the result path valid? If not, prompt to reselect; if valid, check the path permissions and storage space.
[0212] 2. Self-developed software control Xcalibur software (liquid phase control)
[0213] 1) Automatically open the Xcalibur software
[0214] Start the Xcalibur software process: Make sure the software starts normally;
[0215] 2) Automatically delete non-running software:
[0216] Identify the list of samples that have not been run by judging the sample status;
[0217] Delete unrunning samples one by one to ensure that the deletion operation is correct;
[0218] 3) Configure the sample to run
[0219] Import sample information into Xcalibur to ensure that the sample information is accurate;
[0220] Set the sample running parameters and select the corresponding parameters according to the method;
[0221] Save the configuration and exit editing to ensure the configuration is saved.
[0222] 3. Self-developed software controls HyStar software (mass spectrometer control)
[0223] 1) Automatically open HyStar software
[0224] Start the Hystar software process and ensure that the software starts normally;
[0225] 2) Automatically delete unrun samples
[0226] Identify the list of samples that have not been run, and judge by the sample status;
[0227] Delete unrunning samples one by one to ensure that the deletion operation is correct;
[0228] 3) Configure the sample to run
[0229] Import sample information into Hystar to ensure that the sample information is accurate;
[0230] Set the sample running parameters and select the corresponding parameters according to the method;
[0231] Save the configuration and exit editing to ensure the configuration is saved.
[0232] 4. Run and monitor machine progress
[0233] 1) Automatically click the Run button
[0234] Click the run button of xcalibur and hystar respectively to ensure that all configurations have taken effect;
[0235] 2) Monitor the machine operation status
[0236] Real-time display of running progress, displayed through the self-developed software interface;
[0237] Monitor abnormal alarm information and pop up alarm prompts in time;
[0238] Record the operation log and save it to the specified path;
[0239] 3) Processing after the operation is completed
[0240] Arrange the result files according to the result path;
[0241] Generate run reports, save run interface screenshots, and display sample information on the screen.
[0242] The protection content of the present invention is not limited to the above embodiments. Without departing from the spirit and scope of the present invention, changes and advantages that can be thought of by those skilled in the art are included in the present invention and are protected by the attached claims.
Claims
1. A liquid chromatography-mass spectrometry co-control coupling method, characterized in that: The method comprises the following steps: Step 1: Import the dependent library and set the path of the liquid phase control script, mass spectrometry control script and method configuration file; Step 2: Load the last sample test configuration information or initialize the sample test configuration information, modify and save the sample test configuration information according to the requirements; Step 3: convert the sample test configuration information to generate a liquid phase configuration file applicable to the liquid phase device and a mass spectrometry configuration file applicable to the mass spectrometry device; Step 4: sequentially call the liquid phase control script to load the liquid phase configuration file, call the mass spectrometry control script to load the mass spectrometry configuration file, and start the operation of the liquid phase device and the mass spectrometry device; Step 5: The liquid phase device and the mass spectrometry device respectively generate and save the analysis results of each sample.
2. The method according to claim 1, characterized in that In step 1, the dependent libraries include streamlit library, pandas library, numpy library, os library, glob library, pickle library, functools library, and re library; The streamlit library is used to create and display a web interface that provides visual operations; The pandas library is used to read and process the template files of liquid phase and mass spectrometry equipment, and generate the liquid phase configuration file and mass spectrometry configuration file required by the liquid phase or mass spectrometry equipment; The numpy library is used to generate and manipulate array data, helping to process sample-related numerical data; The os library is used to set and manage file paths and execute external scripts; The glob library is used for file path pattern matching to search for liquid phase or mass spectrometry method files; The pickle library is used to serialize objects including sample test configuration information and save them to files, and to deserialize and read objects from files; The functools library is used to generate new functions with some fixed parameters to simplify code calls; The re library is used to match and verify string content and check sample information content; and / or, In step 1, the relative paths of the liquid phase control script and the mass spectrometry control script are first generated, and then converted into absolute paths for easy transplantation and compatibility; the paths of the liquid phase configuration file and the mass spectrometry configuration file are defined and set for reading the method configuration file; and / or, Select the corresponding method configuration file, run status, and sample selection status through the drop-down menu in the visual operation web interface.
3. The method according to claim 1, characterized in that In step 2, try to find, open and read the last sample test configuration information, the sample test configuration information includes sample name, sample location, liquid phase method, mass spectrometry method, injection volume, whether selected, sample result path, and running status; When the last sample test configuration information cannot be found, the default configuration information is used for initialization; and / or, Modify and update the initial default configuration information according to test requirements and save it for subsequent test runs; The modification of the sample test configuration information includes deleting the selected sample row, retaining the unselected sample row, modifying the sequence of the sample rows that need to be tested, and copying the selected sample row.
4. The method according to claim 1, characterized in that In step 3, the field data containing the sample information in the template file of the liquid phase equipment is read and updated, the data in the updated template file is converted into a table, and saved in a CSV format file as a liquid phase configuration file for the liquid phase test; The field data containing sample information in the template file of the mass spectrometry device is read and updated, the data in the updated template file is converted into a table, and the table is saved in an XLS format file as a mass spectrometry configuration file for the mass spectrometry test.
5. The method according to claim 1, characterized in that In step 4, the control scripts of the liquid phase device and the mass spectrometer device are called in sequence to load the generated liquid phase configuration file and the mass spectrometer configuration file into their respective devices; after completion, the control script of the device is called to start the actual operation process and start processing the sample; and / or, Monitor the operating status of the equipment. When the configuration and / or operation of the liquid phase equipment and / or mass spectrometry equipment fails, an abnormality will be prompted and execution will be stopped.
6. The method according to claim 1, characterized in that Before step 1, the method further includes: accessing the browser through a script, opening and running the UI control interface written by the streamlit package; and / or, Remote access to the UI control interface can be achieved by setting the LAN IP and / or intranet penetration service and domain name.
7. The method according to claim 1, characterized in that During the mass spectrometry setting process, it is necessary to delete the unrunning samples. The unrunning samples can be deleted by identifying the color blocks and corresponding text information on the mass spectrometry control interface: the sample area is obtained by scrolling the interface and taking screenshots, and then opencv-python is used to identify the color blocks of the running samples, and easyocr is used to identify whether there is text under the color blocks. If there is and the text length is greater than the preset threshold, it is determined as a unrunning sample; click and delete the unrunning sample until all unrunning samples are deleted.
8. A liquid chromatography-mass spectrometry co-control coupling system, characterized in that: The system adopts the liquid chromatography-mass spectrometry co-control coupling method as described in any one of claims 1 to 7, and the system includes: a system initialization module, a data processing module, a device control module, an exception handling module, a state management and storage module; The system initialization module is used to set the system basic environment including file path, method configuration file loading and recovery of the last running state; The data processing module is used to parse and process the input sample data and generate method configuration files required by the liquid chromatography and mass spectrometry equipment; The device control module is used to control the liquid chromatography and mass spectrometry equipment through system commands to complete the configuration and operation of the sample; The exception handling module is used to monitor the operating status of the equipment in real time, detect and handle abnormal situations that occur during operation; The state management and storage module is used to save and update the system state, including the current state and configuration information of the sample, and provide management functions for the sample.
9. The system according to claim 8, characterized in that The system also includes a UI auxiliary module, which designs a front-end UI interface and implements functions including file uploading, control operations, and information display through the UI interface.
10. Use of the liquid phase-mass spectrometry co-control coupling method according to any one of claims 1 to 7, or the liquid phase-mass spectrometry co-control coupling system according to claim 8 or 9 in a biochemical test process.
Citation Information
Patent Citations
Full-automatic ultra-high performance liquid chromatography-tandem mass spectrometry detection system and working method
CN113358767A
High performance liquid chromatography tandem mass spectrometry system based on cloud computing
CN117007724A