This function is used to summarize ROH by window size Contain three functions First is to generate sliding windows by the customized size for all Chromosomes Second is to find out the overlap between sliding windows and roh by Chromosome, Start and End position Third is to summary results, count the roh frequency in each sliding window

roh_window(
  roh,
  window_size = 1,
  max_chr = 29,
  length_autosomal = 2489.386,
  threshold = 0.3,
  length_group = c(1, 2, 4, 8, 16),
  folder = "roh_window",
  col_higher = "red",
  col_lower = "black",
  height_1 = 18,
  width_1 = 21,
  legend_x = 0.9,
  legend_y = 0.1,
  ncol_1 = 6,
  x_label = "Physical Position (Mb)",
  y_label = "Number of Samples"
)

Arguments

roh

roh file from plink results, or generated by cnv_clean for CNVPartition results

window_size

the length of sliding windows for dividing the chromosome, the unit is Mb

max_chr

The maximum number of chromosome

length_autosomal

Important, total autosomal length of the corresponding species, used in calculated the F_ROH

threshold

the proportion used in the roh windows distribution plot. For example 1000 samples, if threshold set as 0.5, and 1000*0.5 = 500, the value of histogram above 500 will be color as red and the group below 500 will filling with other color

length_group

Vector, must be 5 integer unit in 'Mb'. The default value are 1, 2, 4, 8 and 16 Mb, used for category the length group of ROH

folder

set name of new created folder

col_higher

set the color of bar which frequency higher than threshold in high frequent ROH plot

col_lower

set the color of bar which frequency lower than threshold in high frequent ROH plot

height_1

set the height of final high frequent ROH plot, units ='cm'

width_1

set the width of final high frequent ROH plot, units = 'cm'

legend_x

set position of legend, 0 to 1 indicate from left to right

legend_y

set position of legend, 0 to 1 indicate from bottom to top

ncol_1

set how many columns to present in facet plot

x_label

customize the label of x axis in ROH plot, default text is "Physical Position (Mb)"

y_label

customize the label of y axis in ROH plot, default text is "Number of Samples"

Value

Summary results of ROH by sliding windows across all chromosomes.