API: segmentation¶
-
class
blockify.segmentation.
SegmentationRecord
[source]¶ A class to store a single Bayesian block genomic segmentation.
-
blockify.segmentation.
blocksToDF
(chrom, ranges)[source]¶ Convert a set of contiguous Bayesian blocks to
pandas
DataFrame format.- Parameters
chrom (str) – String specifying the chromsome
ranges (array) – Array whose entries specify the coordinates of block boundaries
- Returns
output
- Return type
pandas
DataFrame
-
blockify.segmentation.
segment
(input_file, method, p0=None, prior=None)[source]¶ Core segmentation method.
- Parameters
input_file (BedTool object) – BedTool object (instantiated from pybedtools) for input data
method (str) – String specifying whether to use OP or PELT for the segmentation
p0 (float, optional) – Float used to parameterize the prior on the total number of blocks; must be in the interval [0, 1]. Default: 0.05
prior (float, optional) – Explicit value for the total number of priors (specifying this is not recommended)
- Returns
segmentation – A SegmentationRecord from segmenting the provided data
- Return type