bsxplorer.UniversalBatch

class UniversalBatch(data: DataFrame, raw: Table | RecordBatch | None)[source]

Class for storing and converting methylation report data.

Methods

__init__

colnames

filter_data

Filter data by expression or keyword arguments

filter_not_none

Filter cytosines which have 0 reads.

get_validated

pa_schema

pl_schema

returns:

Dictionary with column names and data types for polars.

to_arrow

to_bedGraph

returns:

DataFrame with methylation data as bedGraph.

to_bismark

returns:

DataFrame with methylation data as Bismark methylation report.

to_cgmap

returns:

DataFrame with methylation data as CGmap.

to_coverage

returns:

DataFrame with methylation data as coverage.

classmethod pl_schema() OrderedDict[source]
Returns:

Dictionary with column names and data types for polars.

Return type:

collections.OrderedDict

filter_not_none()[source]

Filter cytosines which have 0 reads.

to_bismark()[source]
Returns:

DataFrame with methylation data as Bismark methylation report.

Return type:

polars.DataFrame

to_cgmap()[source]
Returns:

DataFrame with methylation data as CGmap.

Return type:

polars.DataFrame

to_coverage()[source]
Returns:

DataFrame with methylation data as coverage.

Return type:

polars.DataFrame

to_bedGraph()[source]
Returns:

DataFrame with methylation data as bedGraph.

Return type:

polars.DataFrame

filter_data(**kwargs)[source]

Filter data by expression or keyword arguments

Parameters:

kwargs – keywords arguements to pass to polars.filter()

Return type:

UniversalBatch