Skip to contents

This function determines whether two adjacent AI (allelic imbalance) segments should be merged, based on the difference in their GMM means and quality thresholds.

Usage

MergeAICheck(cur_row, next_row, mergeai, snpmin)

Arguments

cur_row

A data frame row (as a list or tibble row) representing the current segment. Must include relevant columns (e.g., gmm_mean, gmm_weight, nonzero_count).

next_row

A data frame row (as a list or tibble row) representing the next segment. Must include relevant columns (e.g., gmm_mean, gmm_weight, nonzero_count).

mergeai

Numeric. Threshold for the difference in MAF (gmm_mean) between adjacent segments to allow merging.

snpmin

Numeric. Minimum SNP count required for a segment to be considered as a separate segment.

Value

Logical value: TRUE if the two segments should be merged, FALSE otherwise.