Skip to contents

Finds the missing chromosome arms and reinserts them into large_segments. Specifically, the arms that large_segments doesn't have, but small_segments does. For each of the missing values, we iterate through the large segments, and re-insert the small segments wherever appropriate.

For example (first case in while loop), if the missing_chr_arm value is greater than the largest chr_arm in the arm column (i.e., max(large_segments,3)), then we should bind the small segments to the right of the large segments frame, since there are no more segments after this largest chr_arm. Note that we only bind the small segments within this missing_chr_arm.

Otherwise, missing_chr_arm <= than the largest chr_arm. In this case we care about which large segment we're looping over (the value of i). If i = 1, i.e. the first segment, then we bind the small segments to the left of the large segments: this is trivial. Otherwise, we fit the small segments in between i-1 and i.

Usage

LargeMissingChrArms(large_segments, small_segments)

Arguments

large_segments

A data frame. Segments with size >= Mb.

small_segments

A data frame. Segments with 3Mb >= size >= 0.1Mb.