Skip to contents

Pretty much the same as in MergeSegmentsTwo. Both helpers difference in the genomic data we search for through GRanges. as well as which segment (large or small) we add into the large_segments frame. For example, start position of the large segment? Or the small segment?

Usage

MergeSegmentsFour(
  granges_obj,
  small_segment,
  large_segments,
  j,
  below_thr,
  end_of_file
)

Arguments

granges_obj

A GRanges object: is used as reference to obtain true genomic data from specified regions.

small_segment

An array: the given small segment that might be merged into the large_segments frame.

large_segments

A data frame: segment data. Initially contains only segments with size >= 3Mb, but as we merge small segments into it, smaller segments are progressively added.

j

An integer/index: the position of the large segment we're comparing with small_segment, within large_segments.

below_thr

A boolean: whether large_segment and small_segment ratio_median difference is below the threshold

end_of_file

A boolean: whether there's any large segments after j.