10.18 BED files

Annotations of genomic intervals are commonly represented in a file format called BED.

We can utilize these files in admixr’s filter_bed() function, which excludes or restricts analyses to genomic intervals within a BED file.

Run the code below to re-calculate the \(f_4\)-ratio with promoters_hg19.bed – a bed file containing the coordiinates for promoters annotated in the Ensembl Regulatory Build. We can create a new snps data object that either keeps or excludes these regions from our analysis.

# get the path to the `regions.bed` file
bed <- file.path("promoters_hg19.bed")

# option 1: KEEP only these regions for analysis
new_snps_keep <- filter_bed(snps, bed)
# option 2: REMOVE these regions from analysis
new_snps_remove <- filter_bed(snps, bed, remove = TRUE)