R/SNPgenmap.R

SNPgenmap <- function(physmap, chromosomes) {
   genmap <- rep(NA, length(chromosomes))
   for (chr in 1:22) {
      physpos <- CrypticIBDcheck::RutgersMapB36[[paste0("chr", chr)]]$Build36_map_physical_position
      genmappos<-CrypticIBDcheck::RutgersMapB36[[paste0("chr", chr)]]$Sex.averaged_map_position
      chrmap <- approxfun(physpos,genmappos)
      ind <- which(chromosomes == chr)
      genmap[ind] <- chrmap(physmap[ind])
   }
   return(genmap)
}

Try the CrypticIBDcheck package in your browser

Any scripts or data that you put into this service are public.

CrypticIBDcheck documentation built on May 2, 2019, 7:30 a.m.