Skip to contents

Merges the initial bam_ratios_frame by segments in the same chromosome, and then assigns start/end pos to segments in segments, whenever we change Chr_N in the latter.

Usage

GetSegmentationBeforeLGACall(
  segments,
  bam_ratios_frame,
  granges_obj,
  second_round
)

Arguments

segments

A data frame of segments with size > 3Mb. Ideally this frame has already gone through merging, small segments reinsertion, etc.

bam_ratios_frame

A data frame. For first pass: the cleaned-up version of the initial ratio file tsv. For second pass: this clean-up segments but merged by ratio_median.

granges_obj

A GRanges object: used to obtain genomic data from regions we're merging.

second_round

A boolean: FALSE if first pass, TRUE if second pass.