bsxplorer.PivotRegion

class PivotRegion(df: ~polars.dataframe.frame.DataFrame, calls=<class 'polars.dataframe.frame.DataFrame'>, chr: str = <built-in function chr>)[source]

Class for storing and calculating methylation entropy, epipolymorphism and PDR stats.

This class should not be initialized by user, but by BAMReader

Methods

PDR

Wrapper for _jit_epipolymorphism – JIT compiled PDR calculating function

__init__

epipolymorphism

Wrapper for _jit_epipolymorphism – JIT compiled EPM calculating function

filter

from_calls

matrix_df

methylation_entropy

Wrapper for _jit_methylation_entropy – JIT compiled ME calculating function

methylation_entropy(window_length: int = 4, min_depth: int = 4)[source]

Wrapper for _jit_methylation_entropy – JIT compiled ME calculating function

Parameters:
  • window_length – Length of the sliding window

  • min_depth – Minimal depth of reads to consider this window for calculation

Return type:

Matrix with position of cytosines from window and array with their ME values

epipolymorphism(window_length: int = 4, min_depth: int = 4)[source]

Wrapper for _jit_epipolymorphism – JIT compiled EPM calculating function

Parameters:
  • window_length – Length of the sliding window

  • min_depth – Minimal depth of reads to consider this window for calculation

Return type:

Matrix with position of cytosines from window and array with their ME values

PDR(min_cyt: int = 5, min_depth: int = 4)[source]

Wrapper for _jit_epipolymorphism – JIT compiled PDR calculating function

Parameters:
  • min_cyt – Mimimal number of cytosines in region.

  • min_depth – Minimal depth of reads to consider this window for calculation

Return type:

Array with cytosine positions, Array of PDR values, Matrix with concordant/discordant reads.