Skip to contents

This function removes rows with positions within ±1mb of a "cis" or "cis-trans_cis" row, excluding the "cis" or "cis-trans_cis" row itself. It iterates through rows with "cis" or "cis-trans_cis" in "cis_trans", checks for other rows with the same chromosome but positions within the threshold. If such rows exist and their "cis_trans" is not "cis" or "cis-trans_cis", it removes those rows.

Usage

remove_nearby_positions(df)

Arguments

df

A data frame containing chr.exposure, pos.exposure, and cis_trans columns.

Value

A modified data frame with rows removed based on nearby positions (excluding "cis" and "cis-trans_cis").

Details

Example usage: for (i in seq_along(list_data_cis_trans)) { df <- list_data_cis_trans[[i]] df <- remove_duplicate_SNP(df) df <- remove_nearby_positions(df) list_data_cis_trans[[i]] <- df }