Add physical map contents to tibble
add_pmap(tib, pmap)
tib | a tibble with 3 columns: marker, trace, and profile lod values, typically outputted by calc_profile_lods() |
---|---|
pmap | a physical map for a single chromosome |
a tibble with 4 columns: marker, trait, profile_lod, marker_position
pm <- 1:3 names(pm) <- as.character(paste0('m', 1:3)) expand.grid(paste0('m', 1:3), paste0('m', 1:3)) %>% tibble::as_tibble() %>% dplyr::mutate(log10lik = rgamma(9, 5)) %>% calc_profile_lods() %>% add_pmap(pm)#> Warning: replacing previous import ‘vctrs::data_frame’ by ‘tibble::data_frame’ when loading ‘dplyr’#>#> # A tibble: 9 x 4 #> marker marker_position trait profile_lod #> <chr> <int> <chr> <dbl> #> 1 m1 1 tr1 3.36 #> 2 m1 1 tr2 1.62 #> 3 m1 1 pleiotropy -0.847 #> 4 m2 2 tr1 0.535 #> 5 m2 2 tr2 3.36 #> 6 m2 2 pleiotropy -0.132 #> 7 m3 3 tr1 1.62 #> 8 m3 3 tr2 0.535 #> 9 m3 3 pleiotropy 0