
Adds small segments in small_segments
that meet certain criteria (position wise w.r.t large segments) into the large_segments
data frame. Merges if necessary (i.e. if ratio_median difference < threshold).
InsertSmallSegments.Rd
Does a lot of things. In InitializeSmallSegments, we insert all the small segments that come before the first
large segment in large_segments
(hence initializing). In FinalizeSmallSegments, we insert all the remaining small segments,
according to 6 different cases, which are listed in the FinalizeSmallSegments documentation. In the end, returns the updated
large_segments
with small segments appropriately re-inserted.
Arguments
- large_segments
A data frame. Segments with size >= 3Mb.
- small_segments
A data frame. Segments with 3Mb > size >= 0.1Mb.
- threshold
A float: the estimated threshold for ratio_median difference via KDE.
- granges_obj
A GRanges object: is used as reference to check whenever we have an overlap of segments and get the ratio_median of this overlap.