IO: Reading and Writing Data

The io module provides tools and utilities for handling input and output operations in PyProphet. It supports various file formats, including SQLite (OSW), Parquet, Split Parquet, and TSV, and provides functionality for reading, writing, and validating data.

Submodules:

  • util: Contains utility functions for file validation, schema inspection, and logging.

  • dispatcher: Provides dispatcher classes for routing I/O configurations to the appropriate reader and writer implementations based on file type and context.

  • _base: Defines abstract base classes and utility methods for implementing custom readers and writers for different data formats.

Dependencies:

  • pandas

  • `pyarrow`(optional, for Parquet support)

  • duckdb

  • sqlite3

  • loguru

  • click

Abstract Base Classes

_base.BaseReader

Abstract base class for implementing readers that load data from different sources (OSW, Parquet, etc.).

_base.BaseWriter

Abstract base class for implementing writers that save results to various output formats.

_base.BaseOSWReader

Class for reading and processing data from an OpenSWATH workflow OSW-sqlite based file.

_base.BaseOSWWriter

Class for writing OpenSWATH results to an OSW-sqlite based file.

_base.BaseParquetReader

Class for reading and processing data from OpenSWATH results stored in Parquet format.

_base.BaseParquetWriter

Class for writing OpenSWATH results to a Parquet file.

_base.BaseSplitParquetReader

Class for reading and processing data from OpenSWATH results stored in a directoy containing split Parquet files.

_base.BaseSplitParquetWriter

Class for writing OpenSWATH results to a directory containing split Parquet files.

dispatcher.ReaderDispatcher

Dispatcher class to route I/O configuration to the appropriate reader implementation.

dispatcher.WriterDispatcher

Dispatcher class to route I/O configuration to the appropriate writer implementation.

These submodules provide specific implementations for reading and writing data for specific algorithms.

Scoring

osw.OSWReader

Class for reading and processing data from an OpenSWATH workflow OSW-sqlite based file.

osw.OSWWriter

Class for writing OpenSWATH results to an OSW-sqlite based file.

parquet.ParquetReader

Class for reading and processing data from OpenSWATH results stored in Parquet format.

parquet.ParquetWriter

Class for writing OpenSWATH results to a Parquet file.

split_parquet.SplitParquetReader

Class for reading and processing data from OpenSWATH results stored in a directoy containing split Parquet files.

split_parquet.SplitParquetWriter

Class for writing OpenSWATH results to a directory containing split Parquet files.

tsv.TSVReader

Class for reading and processing data from OpenSWATH results stored in a tsv format.

tsv.TSVWriter

Class for writing OpenSWATH results to a tsv format.

IPF

osw.OSWReader

Class for reading and processing data from an OpenSWATH workflow OSW-sqlite based file.

osw.OSWWriter

Class for writing OpenSWATH results to an OSW-sqlite based file.

parquet.ParquetReader

Class for reading and processing data from OpenSWATH results stored in Parquet format.

parquet.ParquetWriter

Class for writing OpenSWATH results to a Parquet file.

split_parquet.SplitParquetReader

Class for reading and processing data from OpenSWATH results stored in a directoy containing split Parquet files.

split_parquet.SplitParquetWriter

Class for writing OpenSWATH results to a directory containing split Parquet files.

Levels Context

osw.OSWReader

Class for reading and processing data from an OpenSWATH workflow OSW-sqlite based file.

osw.OSWWriter

Class for writing OpenSWATH results to an OSW-sqlite based file.

parquet.ParquetReader

Class for reading and processing data from OpenSWATH results stored in Parquet format.

parquet.ParquetWriter

Class for writing OpenSWATH results to a Parquet file.

split_parquet.SplitParquetReader

Class for reading and processing data from OpenSWATH results stored in a directoy containing split Parquet files.

split_parquet.SplitParquetWriter

Class for writing OpenSWATH results to a directory containing split Parquet files.

Export

osw.OSWReader

Class for reading and processing data from an OpenSWATH workflow OSW-sqlite based file.

osw.OSWWriter

Class for writing OpenSWATH results to various formats.

parquet.ParquetReader

Class for reading and processing data from an OpenSWATH workflow parquet based file.

parquet.ParquetWriter

Class for writing OpenSWATH results to various formats.

split_parquet.SplitParquetReader

Class for reading and processing data from an OpenSWATH workflow parquet split based file.

split_parquet.SplitParquetWriter

Class for writing OpenSWATH results to various formats.