bsxplorer.UniversalReader
- class UniversalReader(file: str | Path, report_type: Literal['bismark', 'cgmap', 'bedgraph', 'coverage', 'binom'], use_threads: bool = False, bar: bool = True, **kwargs)[source]
Class for batched reading methylation reports.
- Parameters:
file – Path to the methylation report file.
report_type – Type of the methylation report. Possible types: “bismark”, “cgmap”, “bedgraph”, “coverage”, “binom”
use_threads – Will reading be multithreaded.
bar – Indicate the progres bar while reading.
kwargs – Specific keyword arguments to the reader.
cytosine_file (str | Path) – Instance of
Sequence
for reading bedGraph or .coverage reports.methylation_pvalue (float) – Pvalue with which cytosine will be considered methylated.
block_size_mb (int) – Size of batch in bytes, which will be read from report file (for report types other than “binom”).
Examples
>>> reader = UniversalReader("path/to/file.txt", report_type="bismark", use_threads=True) >>> for batch in reader: >>> do_something(batch)
Methods
- property batch_size
returns: Size of batch in bytes. :rtype: int
- property file_size
returns: File size in bytes. :rtype: int