Skip to content

Commit

Permalink
Add example for the mmconvert() function
Browse files Browse the repository at this point in the history
  • Loading branch information
kbroman committed Sep 28, 2021
1 parent 54c7663 commit 33cfa10
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Package: mmconvert
Version: 0.1-4
Date: 2021-09-27
Version: 0.1-5
Date: 2021-09-28
Title: Mouse Map Converter
Description: Function to convert mouse genome positions between the build 39 physical map and the Cox genetic map <doi:10.1534/genetics.109.105486>.
Author: Karl W Broman [aut, cre] (<https://orcid.org/0000-0002-4914-6671>)
Maintainer: Karl W Broman <[email protected]>
Authors@R: person("Karl W", "Broman", role=c("aut", "cre"),
email="[email protected]", comment=c(ORCID = "0000-0002-4914-6671"))
email="[email protected]", comment=c(ORCID = "0000-0002-4914-6671"))
Depends:
R (>= 3.5.0)
Imports:
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## mmconvert 0.1-4 (2021-09-27)
## mmconvert 0.1-5 (2021-09-28)

- New package
20 changes: 20 additions & 0 deletions R/mmconvert.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@
#' @export
#'
#' @seealso [coxmap]
#'
#' @examples
#' # input as character strings like chr:position
#' input_char <- c(rs13482072="14:6738536", rs13482231="14:67215850", gnf14.117.278="14:121955310")
#' mmconvert(input_char)
#'
#' # input as list, as in the map object for R/qtl1 and R/qtl2
#' input_list <- list("14"=c(rs13482072=6738536, rs13482231=67215850, gnf14.117.278=121955310))
#' mmconvert(input_list)
#'
#' # input as data frame; *must* have chr as first column and position as second
#' # (marker names can be third column, or can be row names)
#' input_df <- data.frame(chr=c(14,14,14),
#' pos=c(6738536, 67215850, 121955310),
#' marker=c("rs13482072", "rs13482231", "gnf14.117.278"))
#' mmconvert(input_df)
#'
#' # input can also be in Mbp
#' input_df$pos <- input_df$pos / 1e6
#' mmconvert(input_df, input_type="Mbp")

mmconvert <-
function(positions, input_type=c("bp", "Mbp", "ave_cM", "female_cM", "male_cM"))
Expand Down
20 changes: 20 additions & 0 deletions man/mmconvert.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 33cfa10

Please sign in to comment.