
Adds a chromosome arm column to df at the respective positions for each chromosome.
AddChromosomeArmHelper.Rd
Determines the chromosome arm for each segment in each chromosome. This is determined by the positions given in centromere_positions
.
Segments before centromere are in Chr_N (first arm), segments after centromere are in Chr_N.5 (second arm). '
The procedure goes like this. For each chromosome, the segments that are before its middle position have their chromosome arm set to 1. The segments that are after the middle position have their chromosome arm set to 2. Then, the chromosome arm column is: chromosome_arm = chromosome_number + (chromosome_arm - 1)/2 So the segments whose arm was 1 have 0 added to their chromosome number, meaning that if a segment its chromosome arm is Chr_N. But, the segments whose arm was 2 have 1 added to their chromosome number, meaning that its chromosome arm is Chr_N.5.
Edge case: segments that start before the middle pos but end after the middle pos. In that case, we split it into 2 and proceed like above.