InterOp in Python
What is a Metric File in Python?
Python language provides a platform to perform various operations. Running a program in Python includes numerous tasks that are going on in the compiler. Running a program in Python generates some specific binary files known as the metric files. These files provide detailed statistics about that specific program run. Most of the time, these metric file creation takes place during a program run. However, there can be some cases where the file creation occurs after a run. Moreover, it happens when the secondary analysis is going on side by side. The creation of files after the program can also cause a faster display of a subset of the original data.
What is Illumina InterOp in Python?
The Illumina InterOp libraries are a set or a combination of numerous functions or routines which help perform reading and writing operations on the metrics file. These libraries are essential owning to their ability to support a wide range of platforms. Although these libraries have been compatible until their prior releases, not all standard InterOp libraries can provide platform compatibility. The main reason for this exception is that the Genetic Algorithm (GA) systems in Python are not compatible with these standard libraries.
Limitations of Illumina InterOp Library
Although the InterOp library is becoming popular over the years for its benefits, the current library also possesses some known limitations. Some of these limitations are following:
No Shared Library:
There is a limitation on building a shared library on Windows. The CMake build script does not support creating a shared library. However, there is an option to work with the static library for Windows. Moreover, under certain circumstances where there is a dire need of creating a shared library, the features support creating it for Simplified Wrapper and Interface Generator (SWIG) bindings like C #.
The current InterOp library does not support some specific versions of Mono and Microsoft .Net. For example, the lesser versions from v4.0.30319 of Microsoft .Net are not currently compatible with these libraries. Similarly, there are some restrictions on supporting Mono for windows and the 32-bit builds. Moreover, there is no support for Visual Studio 12-13 for the C# bindings due to heap corruption.
Compilation and Linkage Problems:
The common issue that the developers have to face is a linkage problem of libraries with MinGW W64 4.9.x and previous versions. Moreover, there is also a problem in code compilation in MinGW while having the backward compatibility flag on enable. Additionally, there is a priority of using Visual Studio for C# while having Mono and Visual Studio.
Working with InterOp in Python
These libraries provide support while working with various Python versions like Python 2.7, 3.5, 3.6, 3.7, and 3.8. There is a language-specific package for Python, which is known as Wheel for Python. This package can provide help in working with metrics for SAV. This package is available on Github Releases or PyPI. The code for installing the InterOp is following:
#for the new version $ pip install interop #for older versions $ pip install -f https://github.com/Illumina/interop/releases/tag/v1.1.2 interop $ pip install -f https://github.com/Illumina/interop/releases/latest interop
Following is the piece of code to import available modules of interop in Python:
#importing available modules from interop import py_interop_run from interop import py_interop_metrics from interop import py_interop_plot from interop import py_interop_comm from interop import py_interop_table from interop import py_interop_run_metrics
Moreover, most data structures inside the python interop library use vector classes such as bool_vector and uint_vector. Finally, this library has various built-in functions and modules that the users can utilize to develop their programs. For instance, they can build the parser for their specific needs using py_interop_matrix, py_interop_run, and py_interop_summary, modules of the interop library.
One of the most important and useful modules in Python Interop is the module “py_interop_run.” This module is critical as it includes all of the C++ classes, exceptions, and enums. The enum is a famous class in Python which helps create enumerations. These enumerations are a set of symbolic names which tend to be associated with unique and constant values. These enums are beneficial in situations where all the possible values at the compile time are known. For example, the customized choices of the menu, the rounding modes, command-line flags, and many more. Therefore, these classes, exceptions, and enums are available in the following:
interop/model/run/*.h interop/util/xml_exceptions.h interop/constants/enums.h interop/logic/utils/enums.h
Basic Available Types
The underlying data structures of InterOp in Python normally utilize the “std::vector class.” However, numerous basic types are available in Python for InterOp. These basic types are following:
Compatibility of Illumina InterOp
Since the Illumina InterOp supports and releases various platforms, a sav backward compatibility is maintained with the previous releases. The supported interfaces of Python include 2.7, versions 3.5 to 3.9, and NextSeq 1k/2k. The following piece of code helps in using the new simplified interface InterOp:
from interop import * ar=imaging(“path/to/run_folder”)
Moreover, the following piece of code can help to find out all of the available methods and fields in the interop:
Applications of InterOp
There are various command-line tools available in the InterOp package that benefit from extracting valuable information from the InterOp files. Some of the most used command-line tools in the InterOp package are following:
- dumptext tool helps in converting the binary InterOp data into a CSV text file format.
- summary tool enables generating the SAV Summary Tab summary table in a text file format.
- dumpbin tool proves beneficial for the developer application in creating unit tests by dumping the binary format.
- index-summary tool enables the interop to generate the SAV Indexing Tab summary table in a CSV file format.
- imaging_table tool proves helpful in creating SAV Imaging Tab tables in the format of a CSV text file.
- aggregate tool helps in providing the aggregate by cycle InterOps.
- plot_by_cycle tool generates the SAV Analysis Tab By Cycle Plot in a GNUPlot text file format.
- plot_by_lane tool helps generate the SAV Analysis Tab By Lane Plot in a GNUPlot text file format.
- plot_sample_qc tool helps generate the SAV Indexing Tab index graph in a GNUPlot text file format.
Moreover, there are other helpful tools such as plot_flowcell, plot_qscore_heatmap, and plot_qscore_histogram, along with the tools mentioned above.
Other useful articles:
- OOP in Python
- Python v2 vs Python v3
- Variables, Data Types, and Syntaxes in Python
- Operators, Booleans, and Tuples
- Loops and Statements in Python
- Python Functions and Modules
- Regular Expressions in Python
- Python Interfaces
- JSON Data and Python
- Pip and its Uses in Python
- File Handling in Python
- Searching and Sorting Algorithms in Python
- System Programming (Pipes &Threads etc.)
- Database Programming in Python
- Debugging with Assertion in Python
- Sockets in Python
- InterOp in Python
- Exception Handling in Python
- Environments in Python
- Foundation of Data Science
- Reinforcement Learning
- Python for AI
- Applied Text Mining in Python
- Python Iterations using Libraries
- NumPy vs SciPy
- Python Array Indexing and Slicing
- Python & Libraries