knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(gwhap)

RESOURCE_ROOT = "<YOUR_LOCAL_RESOURCE_FS>"

Create the augmented genetic map

Using SNP list and genetic map on the same chromosome

snp_list=c(100,150,200)
genetic_map=data.frame(bp=c(100,200),
                        cM=c(0.0,0.01))
new_map=genetic_map_interp_chr(genetic_map = genetic_map,
                              snp_list = snp_list)
head(new_map)

Using SNP list and genetic map on several chromosome

We have 2 regions of 3 SNPs in 2 chromosomes chr1 and chr2 :

snp_list=data.frame(chr=c(rep("chr1",3),rep("chr2",3)),
                    bp=c(100,150,200,100,150,200))
head(snp_list)

We create a reference genetic map :

genetic_map=data.frame(chr=c(rep("chr1",2),rep("chr2",2)),
                       bp=c(100,200,100,200),
                        cM=c(0.0,0.01,0.0,0.1))
head(genetic_map)

Now we can interpolate the missing posistion in cM for all the chromosomes :

new_map=genetic_map_interp(genetic_map_all  = genetic_map,
                                snp_list  = snp_list)
head(new_map)


yasmina-mekki/gwhap documentation built on Dec. 31, 2021, 9:19 p.m.