From 23adbddb2be37f4d6166503bd2788d2d2dae350f Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Tue, 2 Jun 2020 22:08:48 -0500 Subject: [PATCH 01/15] Revise package title; add single quotes in package description --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4c87c70..4462733 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: qtl2convert Version: 0.22 Date: 2020-05-21 -Title: Convert Data among R/qtl2, R/qtl, and DOQTL -Description: Functions to convert data structures among the R/qtl2, R/qtl, and DOQTL packages. +Title: Convert Data among QTL Mapping Packages +Description: Functions to convert data structures among the 'R/qtl2', 'R/qtl', and 'DOQTL' packages. Author: Karl W Broman [aut, cre] () Maintainer: Karl W Broman Authors@R: c(person("Karl W", "Broman", role=c("aut", "cre"), From 9d656d6edb55848603655681d93781554ab568ac Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Tue, 2 Jun 2020 22:13:04 -0500 Subject: [PATCH 02/15] Update roxygen2 to 7.1 --- DESCRIPTION | 6 +++--- man/count_unique_geno.Rd | 3 +-- man/encode_geno.Rd | 8 ++++++-- man/find_consensus_geno.Rd | 3 +-- man/find_unique_geno.Rd | 3 +-- man/map_df_to_list.Rd | 9 +++++++-- man/map_list_to_df.Rd | 8 ++++++-- man/probs_doqtl_to_qtl2.Rd | 10 ++++++++-- man/qtl2convert-package.Rd | 6 +++--- man/write2csv.Rd | 13 ++++++++++--- 10 files changed, 46 insertions(+), 23 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4462733..49b02f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: qtl2convert -Version: 0.22 -Date: 2020-05-21 +Version: 0.22-2 +Date: 2020-06-02 Title: Convert Data among QTL Mapping Packages Description: Functions to convert data structures among the 'R/qtl2', 'R/qtl', and 'DOQTL' packages. Author: Karl W Broman [aut, cre] () @@ -26,6 +26,6 @@ LinkingTo: Rcpp LazyData: true Encoding: UTF-8 ByteCompile: true -RoxygenNote: 6.1.1 +RoxygenNote: 7.1.0 Roxygen: list(markdown=TRUE) Remotes: rqtl/qtl2 diff --git a/man/count_unique_geno.Rd b/man/count_unique_geno.Rd index b34c4b4..aed1062 100644 --- a/man/count_unique_geno.Rd +++ b/man/count_unique_geno.Rd @@ -4,8 +4,7 @@ \alias{count_unique_geno} \title{Count the unique genotypes for each row of a genotype matrix} \usage{ -count_unique_geno(genotypes, na.strings = c("N", "H", "NA", ""), - cores = 1) +count_unique_geno(genotypes, na.strings = c("N", "H", "NA", ""), cores = 1) } \arguments{ \item{genotypes}{Matrix of genotypes (markers x individuals)} diff --git a/man/encode_geno.Rd b/man/encode_geno.Rd index 31db2c3..d6b55ae 100644 --- a/man/encode_geno.Rd +++ b/man/encode_geno.Rd @@ -4,8 +4,12 @@ \alias{encode_geno} \title{Encode a matrix of genotypes using a set of allele codes} \usage{ -encode_geno(geno, allele_codes, output_codes = c("-", "A", "H", "B"), - cores = 1) +encode_geno( + geno, + allele_codes, + output_codes = c("-", "A", "H", "B"), + cores = 1 +) } \arguments{ \item{geno}{Character matrix of genotypes (rows as markers, columns as individuals)} diff --git a/man/find_consensus_geno.Rd b/man/find_consensus_geno.Rd index 86c963c..2be61da 100644 --- a/man/find_consensus_geno.Rd +++ b/man/find_consensus_geno.Rd @@ -4,8 +4,7 @@ \alias{find_consensus_geno} \title{Find the consensus genotype for each row of a genotype matrix} \usage{ -find_consensus_geno(genotypes, na.strings = c("N", "H", "NA", ""), - cores = 1) +find_consensus_geno(genotypes, na.strings = c("N", "H", "NA", ""), cores = 1) } \arguments{ \item{genotypes}{Matrix of genotypes (markers x individuals)} diff --git a/man/find_unique_geno.Rd b/man/find_unique_geno.Rd index 990109d..43a1916 100644 --- a/man/find_unique_geno.Rd +++ b/man/find_unique_geno.Rd @@ -4,8 +4,7 @@ \alias{find_unique_geno} \title{Find the unique genotypes for each row of a genotype matrix} \usage{ -find_unique_geno(genotypes, na.strings = c("N", "H", "NA", ""), - cores = 1) +find_unique_geno(genotypes, na.strings = c("N", "H", "NA", ""), cores = 1) } \arguments{ \item{genotypes}{Matrix of genotypes (markers x individuals)} diff --git a/man/map_df_to_list.Rd b/man/map_df_to_list.Rd index 7093695..43d631d 100644 --- a/man/map_df_to_list.Rd +++ b/man/map_df_to_list.Rd @@ -4,8 +4,13 @@ \alias{map_df_to_list} \title{Marker map data frame to list} \usage{ -map_df_to_list(map, chr_column = "chr", pos_column = "cM", - marker_column = "marker", Xchr = c("x", "X")) +map_df_to_list( + map, + chr_column = "chr", + pos_column = "cM", + marker_column = "marker", + Xchr = c("x", "X") +) } \arguments{ \item{map}{Data frame with marker map} diff --git a/man/map_list_to_df.Rd b/man/map_list_to_df.Rd index 033251d..e399f68 100644 --- a/man/map_list_to_df.Rd +++ b/man/map_list_to_df.Rd @@ -4,8 +4,12 @@ \alias{map_list_to_df} \title{Marker map list to data frame} \usage{ -map_list_to_df(map_list, chr_column = "chr", pos_column = "pos", - marker_column = "marker") +map_list_to_df( + map_list, + chr_column = "chr", + pos_column = "pos", + marker_column = "marker" +) } \arguments{ \item{map_list}{List of vectors containing marker positions} diff --git a/man/probs_doqtl_to_qtl2.Rd b/man/probs_doqtl_to_qtl2.Rd index f80d520..1920a61 100644 --- a/man/probs_doqtl_to_qtl2.Rd +++ b/man/probs_doqtl_to_qtl2.Rd @@ -4,8 +4,14 @@ \alias{probs_doqtl_to_qtl2} \title{Convert DOQTL genotype probabilities to R/qtl2 format} \usage{ -probs_doqtl_to_qtl2(probs, map, is_female = NULL, chr_column = "chr", - pos_column = "cM", marker_column = "marker") +probs_doqtl_to_qtl2( + probs, + map, + is_female = NULL, + chr_column = "chr", + pos_column = "cM", + marker_column = "marker" +) } \arguments{ \item{probs}{3d array of genotype probabilities as calculated from DOQTL diff --git a/man/qtl2convert-package.Rd b/man/qtl2convert-package.Rd index a00ad8c..6da138c 100644 --- a/man/qtl2convert-package.Rd +++ b/man/qtl2convert-package.Rd @@ -4,9 +4,9 @@ \name{qtl2convert-package} \alias{qtl2convert} \alias{qtl2convert-package} -\title{qtl2convert: Convert Data among R/qtl2, R/qtl, and DOQTL} +\title{qtl2convert: Convert Data among QTL Mapping Packages} \description{ -Functions to convert data structures among the R/qtl2, R/qtl, and DOQTL packages. +Functions to convert data structures among the 'R/qtl2', 'R/qtl', and 'DOQTL' packages. } \section{Vignettes}{ @@ -29,7 +29,7 @@ Useful links: } \author{ -\strong{Maintainer}: Karl W Broman \email{broman@wisc.edu} (0000-0002-4914-6671) +\strong{Maintainer}: Karl W Broman \email{broman@wisc.edu} (\href{https://orcid.org/0000-0002-4914-6671}{ORCID}) } \keyword{internal} diff --git a/man/write2csv.Rd b/man/write2csv.Rd index 919f8c6..cd71ea4 100644 --- a/man/write2csv.Rd +++ b/man/write2csv.Rd @@ -4,8 +4,15 @@ \alias{write2csv} \title{Write a data frame to a CSV file} \usage{ -write2csv(df, filename, comment = "", sep = ",", comment.char = "#", - row.names = NULL, overwrite = FALSE) +write2csv( + df, + filename, + comment = "", + sep = ",", + comment.char = "#", + row.names = NULL, + overwrite = FALSE +) } \arguments{ \item{df}{A data frame (or matrix)} @@ -32,7 +39,7 @@ Write a data frame to a CSV file in a special form, with info about the number o \details{ If the file already exists, the function will refuse to write over it. -The file will include comments at the top, using \code{#} as a +The file will include comments at the top, using \verb{#} as a comment character, including the number of rows (not including the header) and the number of columns. From 9c758344f3f9debe0281268d50335b95a0be8956 Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Tue, 2 Jun 2020 22:13:39 -0500 Subject: [PATCH 03/15] Add \value{} to write2csv() help file --- R/write2csv.R | 2 ++ man/write2csv.Rd | 3 +++ 2 files changed, 5 insertions(+) diff --git a/R/write2csv.R b/R/write2csv.R index c99f510..b87074a 100644 --- a/R/write2csv.R +++ b/R/write2csv.R @@ -15,6 +15,8 @@ #' @param overwrite If TRUE, overwrite file if it exists. If FALSE #' (the default) and the file exists, stop with an error. #' +#' @return None. +#' #' @details #' If the file already exists, the function will refuse to write over it. #' diff --git a/man/write2csv.Rd b/man/write2csv.Rd index cd71ea4..0691a6c 100644 --- a/man/write2csv.Rd +++ b/man/write2csv.Rd @@ -33,6 +33,9 @@ to be the name for that column.} \item{overwrite}{If TRUE, overwrite file if it exists. If FALSE (the default) and the file exists, stop with an error.} } +\value{ +None. +} \description{ Write a data frame to a CSV file in a special form, with info about the number of rows and columns. } From 6131890ca2c560225a85a02da145bf7a66ed3acd Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Tue, 2 Jun 2020 22:17:15 -0500 Subject: [PATCH 04/15] Revise multi-core tests to never use >2 cores --- tests/testthat/test-count_unique_geno.R | 6 ++---- tests/testthat/test-encode_geno.R | 6 ++---- tests/testthat/test-find_consensus_geno.R | 6 ++---- tests/testthat/test-find_unique_geno.R | 6 ++---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/testthat/test-count_unique_geno.R b/tests/testthat/test-count_unique_geno.R index b0700dc..7eb4427 100644 --- a/tests/testthat/test-count_unique_geno.R +++ b/tests/testthat/test-count_unique_geno.R @@ -30,12 +30,10 @@ test_that("count_unique_geno works multi-core", { c("C", "C", "G", "G", NA)) expected <- c(2,1,3,0,1,2,2) expect_equal(count_unique_geno(g), expected) - expect_equal(count_unique_geno(g, cores=4), expected) - expect_equal(count_unique_geno(g, cores=0), expected) + expect_equal(count_unique_geno(g, cores=2), expected) rownames(g) <- names(expected) <- paste0("mar", 1:7) expect_equal(count_unique_geno(g), expected) - expect_equal(count_unique_geno(g, cores=4), expected) - expect_equal(count_unique_geno(g, cores=0), expected) + expect_equal(count_unique_geno(g, cores=2), expected) }) diff --git a/tests/testthat/test-encode_geno.R b/tests/testthat/test-encode_geno.R index 54ac5d2..77fcec1 100644 --- a/tests/testthat/test-encode_geno.R +++ b/tests/testthat/test-encode_geno.R @@ -46,15 +46,13 @@ test_that("encode_geno works multi-core", { c("A", "B", "-", "H", "A")) expect_equal(encode_geno(geno, codes), expected) - expect_equal(encode_geno(geno, codes, cores=4), expected) - expect_equal(encode_geno(geno, codes, cores=0), expected) + expect_equal(encode_geno(geno, codes, cores=2), expected) expected2 <- gsub("Z", "A", gsub("A", "B", gsub("B", "Z", expected))) expect_equal(encode_geno(geno, cbind(codes[,2], codes[,1])), expected2) - expect_equal(encode_geno(geno, cbind(codes[,2], codes[,1]), cores=4), expected2) - expect_equal(encode_geno(geno, cbind(codes[,2], codes[,1]), cores=1), expected2) + expect_equal(encode_geno(geno, cbind(codes[,2], codes[,1]), cores=2), expected2) }) diff --git a/tests/testthat/test-find_consensus_geno.R b/tests/testthat/test-find_consensus_geno.R index 90e63b0..dd2fbcf 100644 --- a/tests/testthat/test-find_consensus_geno.R +++ b/tests/testthat/test-find_consensus_geno.R @@ -22,12 +22,10 @@ test_that("find_consensus_geno works multi-core", { c("C", "C", "G", "G", "G", "C", "G", "G")) expected <- c("A", NA, NA, "G") expect_equal(find_consensus_geno(g), expected) - expect_equal(find_consensus_geno(g, cores=4), expected) - expect_equal(find_consensus_geno(g, cores=0), expected) + expect_equal(find_consensus_geno(g, cores=2), expected) rownames(g) <- names(expected) <- paste0("mar", 1:4) expect_equal(find_consensus_geno(g), expected) - expect_equal(find_consensus_geno(g, cores=4), expected) - expect_equal(find_consensus_geno(g, cores=0), expected) + expect_equal(find_consensus_geno(g, cores=2), expected) }) diff --git a/tests/testthat/test-find_unique_geno.R b/tests/testthat/test-find_unique_geno.R index 9d59a35..96f82b8 100644 --- a/tests/testthat/test-find_unique_geno.R +++ b/tests/testthat/test-find_unique_geno.R @@ -40,11 +40,9 @@ test_that("find_unique_geno works multi-core", { c("A", "T"), c("C", "G")) expect_equal(find_unique_geno(g), expected) - expect_equal(find_unique_geno(g, cores=4), expected) - expect_equal(find_unique_geno(g, cores=0), expected) + expect_equal(find_unique_geno(g, cores=2), expected) rownames(g) <- rownames(expected) <- paste0("mar", 1:7) expect_equal(find_unique_geno(g), expected) - expect_equal(find_unique_geno(g, cores=4), expected) - expect_equal(find_unique_geno(g, cores=0), expected) + expect_equal(find_unique_geno(g, cores=2), expected) }) From e4a3c64b60ce1ffdd6b09b624e2c940d0bc9130f Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Thu, 4 Jun 2020 13:29:25 -0500 Subject: [PATCH 05/15] Revise example for write2csv to use R's temporary directory --- R/write2csv.R | 3 ++- man/write2csv.Rd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/R/write2csv.R b/R/write2csv.R index b87074a..fd6278b 100644 --- a/R/write2csv.R +++ b/R/write2csv.R @@ -40,7 +40,8 @@ #' matrix(rnorm(nr*nc), ncol=nc)) #' colnames(x)[1:nc + 1] <- paste0("col", 1:nc) #' \dontrun{ -#' write2csv(x, "/tmp/tmpfile.csv", "A file created by write2csv")} +#' testfile <- file.path(tempdir(), "tmpfile.csv") +#' write2csv(x, testfile, "A file created by write2csv")} write2csv <- function(df, filename, comment="", sep=",", comment.char="#", row.names=NULL, overwrite=FALSE) diff --git a/man/write2csv.Rd b/man/write2csv.Rd index 0691a6c..353cf48 100644 --- a/man/write2csv.Rd +++ b/man/write2csv.Rd @@ -59,5 +59,6 @@ x <- data.frame(id=paste0("ind", 1:nr), matrix(rnorm(nr*nc), ncol=nc)) colnames(x)[1:nc + 1] <- paste0("col", 1:nc) \dontrun{ -write2csv(x, "/tmp/tmpfile.csv", "A file created by write2csv")} +testfile <- file.path(tempdir(), "tmpfile.csv") +write2csv(x, testfile, "A file created by write2csv")} } From f6454728071e1d445f3545ca14ecfb465f1c4e04 Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Thu, 4 Jun 2020 13:32:10 -0500 Subject: [PATCH 06/15] Bump version; explain changes in NEWS.md --- DESCRIPTION | 4 ++-- NEWS.md | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 49b02f2..05b071b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: qtl2convert -Version: 0.22-2 -Date: 2020-06-02 +Version: 0.22-3 +Date: 2020-06-04 Title: Convert Data among QTL Mapping Packages Description: Functions to convert data structures among the 'R/qtl2', 'R/qtl', and 'DOQTL' packages. Author: Karl W Broman [aut, cre] () diff --git a/NEWS.md b/NEWS.md index 3d2d7cd..efbfaa7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,18 @@ +## qtl2convert 0.22-3 (2020-06-04) + +## Minor changes + +Cosmetic changes to prepare for posting to CRAN: + +- Revise package title and description. + +- Revise multi-core tests to never use >2 cores, even locally + +- Revise example for write2csv to use R's temporary directory + +- Fix link to DOQTL, which is no longer in bioconductor release + + ## qtl2convert 0.22 (2020-05-21) ### New features From 02570feef437529edfb9f541cec0408e8eee8a98 Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Sun, 14 Jun 2020 13:47:27 -0500 Subject: [PATCH 07/15] remove \dontrun{} from example for write2csv --- DESCRIPTION | 4 ++-- NEWS.md | 2 +- R/write2csv.R | 7 +++++-- man/write2csv.Rd | 7 +++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 05b071b..b57c16e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: qtl2convert -Version: 0.22-3 -Date: 2020-06-04 +Version: 0.22-4 +Date: 2020-06-14 Title: Convert Data among QTL Mapping Packages Description: Functions to convert data structures among the 'R/qtl2', 'R/qtl', and 'DOQTL' packages. Author: Karl W Broman [aut, cre] () diff --git a/NEWS.md b/NEWS.md index efbfaa7..e5758b0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -## qtl2convert 0.22-3 (2020-06-04) +## qtl2convert 0.22-4 (2020-06-14) ## Minor changes diff --git a/R/write2csv.R b/R/write2csv.R index fd6278b..dc5629e 100644 --- a/R/write2csv.R +++ b/R/write2csv.R @@ -39,9 +39,12 @@ #' x <- data.frame(id=paste0("ind", 1:nr), #' matrix(rnorm(nr*nc), ncol=nc)) #' colnames(x)[1:nc + 1] <- paste0("col", 1:nc) -#' \dontrun{ +#' #' testfile <- file.path(tempdir(), "tmpfile.csv") -#' write2csv(x, testfile, "A file created by write2csv")} +#' write2csv(x, testfile, "A file created by write2csv") +#' +#' # Remove the file, to clean up temporary directory +#' unlink(testfile) write2csv <- function(df, filename, comment="", sep=",", comment.char="#", row.names=NULL, overwrite=FALSE) diff --git a/man/write2csv.Rd b/man/write2csv.Rd index 353cf48..fe20a69 100644 --- a/man/write2csv.Rd +++ b/man/write2csv.Rd @@ -58,7 +58,10 @@ nc <- 5 x <- data.frame(id=paste0("ind", 1:nr), matrix(rnorm(nr*nc), ncol=nc)) colnames(x)[1:nc + 1] <- paste0("col", 1:nc) -\dontrun{ + testfile <- file.path(tempdir(), "tmpfile.csv") -write2csv(x, testfile, "A file created by write2csv")} +write2csv(x, testfile, "A file created by write2csv") + +# Remove the file, to clean up temporary directory +unlink(testfile) } From 2c596fc99155b5637ec1a620a1518197b0de6f89 Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Fri, 26 Jun 2020 06:24:55 -0500 Subject: [PATCH 08/15] Small changes to README, .travis.yml, and DESCRIPTION, since R/qtl2 now on CRAN --- .travis.yml | 6 ------ DESCRIPTION | 5 ++--- README.md | 8 +++----- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 637357e..c21af82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,6 @@ language: r sudo: false cache: packages -r_packages: - - devtools - -r_github_packages: - - rqtl/qtl2 - warnings_are_errors: true notifications: diff --git a/DESCRIPTION b/DESCRIPTION index b57c16e..89d94e3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: qtl2convert -Version: 0.22-4 -Date: 2020-06-14 +Version: 0.22-5 +Date: 2020-06-26 Title: Convert Data among QTL Mapping Packages Description: Functions to convert data structures among the 'R/qtl2', 'R/qtl', and 'DOQTL' packages. Author: Karl W Broman [aut, cre] () @@ -28,4 +28,3 @@ Encoding: UTF-8 ByteCompile: true RoxygenNote: 7.1.0 Roxygen: list(markdown=TRUE) -Remotes: rqtl/qtl2 diff --git a/README.md b/README.md index a8faddc..9291153 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,12 @@ and [R/qtl](https://rqtl.org) formats. ### Installation -Make sure you have the latest version of [R](https://cran.r-project.org). -Then install R/qtl2 using the following. (For more -detail, see the instructions at .) +Install R/qtl2 from [CRAN](https://cran.r-project.org): - install.packages("qtl2", repos="https://rqtl.org/qtl2cran") + install.packages("qtl2") Then install the [qtl2convert](https://github.com/rqtl/qtl2convert) -package. +package from a separate mini-CRAN. install.packages("qtl2convert", repos="https://rqtl.org/qtl2cran") From e2d978441e5091a17891a3c1796147c549799354 Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Fri, 26 Jun 2020 06:25:45 -0500 Subject: [PATCH 09/15] Update NEWS.md [skip ci] --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index e5758b0..82c02fd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -## qtl2convert 0.22-4 (2020-06-14) +## qtl2convert 0.22-5 (2020-06-26) ## Minor changes From 70665024c5071a77cbe6da7531b28e721610d0a0 Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Sun, 28 Jun 2020 14:10:09 -0500 Subject: [PATCH 10/15] cosmetic change in DESCRIPTION --- DESCRIPTION | 8 ++++---- NEWS.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 89d94e3..40965c1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,12 @@ Package: qtl2convert Version: 0.22-5 -Date: 2020-06-26 +Date: 2020-06-28 Title: Convert Data among QTL Mapping Packages Description: Functions to convert data structures among the 'R/qtl2', 'R/qtl', and 'DOQTL' packages. Author: Karl W Broman [aut, cre] () Maintainer: Karl W Broman -Authors@R: c(person("Karl W", "Broman", role=c("aut", "cre"), - email="broman@wisc.edu", comment=c(ORCID = "0000-0002-4914-6671"))) +Authors@R: person("Karl W", "Broman", role=c("aut", "cre"), + email="broman@wisc.edu", comment=c(ORCID = "0000-0002-4914-6671")) Depends: R (>= 3.1.0) Imports: @@ -26,5 +26,5 @@ LinkingTo: Rcpp LazyData: true Encoding: UTF-8 ByteCompile: true -RoxygenNote: 7.1.0 +RoxygenNote: 7.1.1 Roxygen: list(markdown=TRUE) diff --git a/NEWS.md b/NEWS.md index 82c02fd..f1b9bf8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -## qtl2convert 0.22-5 (2020-06-26) +## qtl2convert 0.22-5 (2020-06-28) ## Minor changes From 378bd6fcb32084330df86086b7f6597c6f831e18 Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Sun, 28 Jun 2020 14:11:27 -0500 Subject: [PATCH 11/15] bump version and revise installation instructions --- DESCRIPTION | 2 +- NEWS.md | 2 +- README.md | 9 ++------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 40965c1..56c59a4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: qtl2convert -Version: 0.22-5 +Version: 0.22-6 Date: 2020-06-28 Title: Convert Data among QTL Mapping Packages Description: Functions to convert data structures among the 'R/qtl2', 'R/qtl', and 'DOQTL' packages. diff --git a/NEWS.md b/NEWS.md index f1b9bf8..f9c3b45 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -## qtl2convert 0.22-5 (2020-06-28) +## qtl2convert 0.22-6 (2020-06-28) ## Minor changes diff --git a/README.md b/README.md index 9291153..8a3dd9d 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,9 @@ and [R/qtl](https://rqtl.org) formats. ### Installation -Install R/qtl2 from [CRAN](https://cran.r-project.org): +Install the qtl2convert package from [CRAN](https://cran.r-project.org): - install.packages("qtl2") - -Then install the [qtl2convert](https://github.com/rqtl/qtl2convert) -package from a separate mini-CRAN. - - install.packages("qtl2convert", repos="https://rqtl.org/qtl2cran") + install.packages("qtl2convert") --- From 0a16de77397fa51e0ca094fc58117ccbcf4d7fb3 Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Tue, 30 Jun 2020 05:15:17 -0500 Subject: [PATCH 12/15] Revise package description to explain "QTL". --- DESCRIPTION | 6 +++--- NEWS.md | 2 +- man/qtl2convert-package.Rd | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 56c59a4..1b08390 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: qtl2convert -Version: 0.22-6 -Date: 2020-06-28 +Version: 0.22-7 +Date: 2020-06-30 Title: Convert Data among QTL Mapping Packages -Description: Functions to convert data structures among the 'R/qtl2', 'R/qtl', and 'DOQTL' packages. +Description: Functions to convert data structures among the 'qtl2', 'qtl', and 'DOQTL' packages for mapping quantitative trait loci (QTL). Author: Karl W Broman [aut, cre] () Maintainer: Karl W Broman Authors@R: person("Karl W", "Broman", role=c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index f9c3b45..c33f589 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -## qtl2convert 0.22-6 (2020-06-28) +## qtl2convert 0.22-7 (2020-06-30) ## Minor changes diff --git a/man/qtl2convert-package.Rd b/man/qtl2convert-package.Rd index 6da138c..5d30406 100644 --- a/man/qtl2convert-package.Rd +++ b/man/qtl2convert-package.Rd @@ -6,7 +6,7 @@ \alias{qtl2convert-package} \title{qtl2convert: Convert Data among QTL Mapping Packages} \description{ -Functions to convert data structures among the 'R/qtl2', 'R/qtl', and 'DOQTL' packages. +Functions to convert data structures among the 'qtl2', 'qtl', and 'DOQTL' packages for mapping quantitative trait loci (QTL). } \section{Vignettes}{ From 2818d07ea88ed1e02cd8664ab9d82118912a9591 Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Tue, 30 Jun 2020 05:30:27 -0500 Subject: [PATCH 13/15] Remove quiet arg from internal function setup_cluster --- R/cluster_util.R | 2 +- R/count_unique_geno.R | 2 +- R/encode_geno.R | 2 +- R/find_consensus_geno.R | 2 +- R/find_unique_geno.R | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/cluster_util.R b/R/cluster_util.R index 5b6c381..a51f8fa 100644 --- a/R/cluster_util.R +++ b/R/cluster_util.R @@ -17,7 +17,7 @@ n_cores <- # set up a cluster setup_cluster <- - function(cores, quiet=TRUE) + function(cores) { if(is_cluster(cores)) return(cores) diff --git a/R/count_unique_geno.R b/R/count_unique_geno.R index fa71c56..265bd94 100644 --- a/R/count_unique_geno.R +++ b/R/count_unique_geno.R @@ -35,7 +35,7 @@ function(genotypes, na.strings=c("N", "H", "NA", ""), cores=1) # if no rows, return NULL if(nrow(genotypes)==0) return(NULL) - cores <- setup_cluster(cores, quiet=TRUE) + cores <- setup_cluster(cores) by_batch_func <- function(batch) .count_unique_geno(genotypes[batch,,drop=FALSE]) diff --git a/R/encode_geno.R b/R/encode_geno.R index d1a56e5..84c92cf 100644 --- a/R/encode_geno.R +++ b/R/encode_geno.R @@ -46,7 +46,7 @@ function(geno, allele_codes, output_codes=c("-", "A", "H", "B"), cores=1) paste0(allele_codes[,1], allele_codes[,2]), # AB paste0(allele_codes[,2], allele_codes[,1])) # BA - cores <- setup_cluster(cores, quiet=TRUE) + cores <- setup_cluster(cores) by_batch_func <- function(batch) .encode_geno(geno[batch,,drop=FALSE], geno_codes[batch,,drop=FALSE], output_codes[c(2,4,2,4,3,3)]) batches <- batch_vec(1:nrow(geno), n_cores=n_cores(cores)) diff --git a/R/find_consensus_geno.R b/R/find_consensus_geno.R index c673724..a064f93 100644 --- a/R/find_consensus_geno.R +++ b/R/find_consensus_geno.R @@ -35,7 +35,7 @@ function(genotypes, na.strings=c("N", "H", "NA", ""), cores=1) # if no rows, return NULL if(nrow(genotypes)==0) return(NULL) - cores <- setup_cluster(cores, quiet=TRUE) + cores <- setup_cluster(cores) by_batch_func <- function(batch) .find_consensus_geno(genotypes[batch,,drop=FALSE]) diff --git a/R/find_unique_geno.R b/R/find_unique_geno.R index ad65a0b..d9c7354 100644 --- a/R/find_unique_geno.R +++ b/R/find_unique_geno.R @@ -38,7 +38,7 @@ function(genotypes, na.strings=c("N", "H", "NA", ""), cores=1) # if no rows, return NULL if(nrow(genotypes)==0) return(NULL) - cores <- setup_cluster(cores, quiet=TRUE) + cores <- setup_cluster(cores) by_batch_func <- function(batch) .find_unique_geno(genotypes[batch,,drop=FALSE]) From 8e8c54be522dca80f6f925636bd2b8be10757518 Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Tue, 30 Jun 2020 06:52:16 -0500 Subject: [PATCH 14/15] Revise examples to assign results to objects --- R/cbind_smother.R | 2 +- R/count_unique_geno.R | 2 +- R/encode_geno.R | 2 +- R/find_consensus_geno.R | 2 +- R/find_unique_geno.R | 2 +- R/scan_qtl_to_qtl2.R | 3 --- man/cbind_smother.Rd | 2 +- man/count_unique_geno.Rd | 2 +- man/encode_geno.Rd | 2 +- man/find_consensus_geno.Rd | 2 +- man/find_unique_geno.Rd | 2 +- man/scan_qtl_to_qtl2.Rd | 3 --- 12 files changed, 10 insertions(+), 16 deletions(-) diff --git a/R/cbind_smother.R b/R/cbind_smother.R index 2bf7d2d..27049ae 100644 --- a/R/cbind_smother.R +++ b/R/cbind_smother.R @@ -19,7 +19,7 @@ #' @examples #' df1 <- data.frame(x=c(1,2,3,NA,4), y=c(5,8,9,10,11), row.names=c("A", "B", "C", "D", "E")) #' df2 <- data.frame(z=c(7,8,0,9,10), y=c(6,NA,NA,9,10), row.names=c("A", "B", "F", "C", "D")) -#' cbind_smother(df1, df2) +#' df1n2 <- cbind_smother(df1, df2) cbind_smother <- function(mat1, mat2) { diff --git a/R/count_unique_geno.R b/R/count_unique_geno.R index 265bd94..d91dae5 100644 --- a/R/count_unique_geno.R +++ b/R/count_unique_geno.R @@ -23,7 +23,7 @@ #' c("NA", "NA", "NA", "A", "A"), #' c("A", "A", "T", "G", "G"), #' c("C", "C", "G", "G", "NA")) -#' count_unique_geno(g) +#' counts <- count_unique_geno(g) count_unique_geno <- function(genotypes, na.strings=c("N", "H", "NA", ""), cores=1) { diff --git a/R/encode_geno.R b/R/encode_geno.R index 84c92cf..05e2d4a 100644 --- a/R/encode_geno.R +++ b/R/encode_geno.R @@ -23,7 +23,7 @@ #' c("A", "A", "AT", "TA", "TT"), #' c("T", "G", NA, "GT", "TT")) #' codes <- rbind(c("C", "G"), c("A", "T"), c("T", "G")) -#' encode_geno(geno, codes) +#' geno_encoded <- encode_geno(geno, codes) #' encode_geno <- function(geno, allele_codes, output_codes=c("-", "A", "H", "B"), cores=1) diff --git a/R/find_consensus_geno.R b/R/find_consensus_geno.R index a064f93..39fbda2 100644 --- a/R/find_consensus_geno.R +++ b/R/find_consensus_geno.R @@ -24,7 +24,7 @@ #' c("C", "C", "G", "G", "A", NA, NA, NA), #' rep(NA, 8), #' c("C", "C", "G", "G", "G", "C", "G", "G")) -#' find_consensus_geno(g) +#' consensus <- find_consensus_geno(g) find_consensus_geno <- function(genotypes, na.strings=c("N", "H", "NA", ""), cores=1) { diff --git a/R/find_unique_geno.R b/R/find_unique_geno.R index d9c7354..3cd4733 100644 --- a/R/find_unique_geno.R +++ b/R/find_unique_geno.R @@ -26,7 +26,7 @@ #' c("NA", "NA", "NA", "A", "A"), #' c("A", "A", "T", "G", "G"), #' c("C", "C", "G", "G", "NA")) -#' find_unique_geno(g) +#' ug <- find_unique_geno(g) find_unique_geno <- function(genotypes, na.strings=c("N", "H", "NA", ""), cores=1) { diff --git a/R/scan_qtl_to_qtl2.R b/R/scan_qtl_to_qtl2.R index c988f4f..7c1b639 100644 --- a/R/scan_qtl_to_qtl2.R +++ b/R/scan_qtl_to_qtl2.R @@ -15,9 +15,6 @@ #' out <- scanone(hyper) #' out2 <- scan_qtl_to_qtl2(out) #' -#' library(qtl2) -#' plot(out2$scan1, out2$map) -#' #' @seealso [scan_qtl_to_qtl2()] #' #' @export diff --git a/man/cbind_smother.Rd b/man/cbind_smother.Rd index c0e93f8..d1772d3 100644 --- a/man/cbind_smother.Rd +++ b/man/cbind_smother.Rd @@ -26,5 +26,5 @@ in its place. \examples{ df1 <- data.frame(x=c(1,2,3,NA,4), y=c(5,8,9,10,11), row.names=c("A", "B", "C", "D", "E")) df2 <- data.frame(z=c(7,8,0,9,10), y=c(6,NA,NA,9,10), row.names=c("A", "B", "F", "C", "D")) -cbind_smother(df1, df2) +df1n2 <- cbind_smother(df1, df2) } diff --git a/man/count_unique_geno.Rd b/man/count_unique_geno.Rd index aed1062..40b62c4 100644 --- a/man/count_unique_geno.Rd +++ b/man/count_unique_geno.Rd @@ -28,7 +28,7 @@ g <- rbind(c("NA", "A", "A", "A", "T"), c("NA", "NA", "NA", "A", "A"), c("A", "A", "T", "G", "G"), c("C", "C", "G", "G", "NA")) -count_unique_geno(g) +counts <- count_unique_geno(g) } \seealso{ \code{\link[=find_unique_geno]{find_unique_geno()}} diff --git a/man/encode_geno.Rd b/man/encode_geno.Rd index d6b55ae..09b71bb 100644 --- a/man/encode_geno.Rd +++ b/man/encode_geno.Rd @@ -34,7 +34,7 @@ geno <- rbind(c("C", "G", "C", "GG", "CG"), c("A", "A", "AT", "TA", "TT"), c("T", "G", NA, "GT", "TT")) codes <- rbind(c("C", "G"), c("A", "T"), c("T", "G")) -encode_geno(geno, codes) +geno_encoded <- encode_geno(geno, codes) } \seealso{ diff --git a/man/find_consensus_geno.Rd b/man/find_consensus_geno.Rd index 2be61da..9d39247 100644 --- a/man/find_consensus_geno.Rd +++ b/man/find_consensus_geno.Rd @@ -29,7 +29,7 @@ g <- rbind(c("NA", "N", "A", "A", "T", "G", NA, "H"), c("C", "C", "G", "G", "A", NA, NA, NA), rep(NA, 8), c("C", "C", "G", "G", "G", "C", "G", "G")) -find_consensus_geno(g) +consensus <- find_consensus_geno(g) } \seealso{ \code{\link[=find_unique_geno]{find_unique_geno()}}, \code{\link[=encode_geno]{encode_geno()}} diff --git a/man/find_unique_geno.Rd b/man/find_unique_geno.Rd index 43a1916..601af62 100644 --- a/man/find_unique_geno.Rd +++ b/man/find_unique_geno.Rd @@ -31,7 +31,7 @@ g <- rbind(c("NA", "A", "A", "A", "T"), c("NA", "NA", "NA", "A", "A"), c("A", "A", "T", "G", "G"), c("C", "C", "G", "G", "NA")) -find_unique_geno(g) +ug <- find_unique_geno(g) } \seealso{ \code{\link[=count_unique_geno]{count_unique_geno()}}, \code{\link[=encode_geno]{encode_geno()}} diff --git a/man/scan_qtl_to_qtl2.Rd b/man/scan_qtl_to_qtl2.Rd index 258b3dc..e6fc9d5 100644 --- a/man/scan_qtl_to_qtl2.Rd +++ b/man/scan_qtl_to_qtl2.Rd @@ -24,9 +24,6 @@ hyper <- calc.genoprob(hyper, step=1, error.prob=0.002) out <- scanone(hyper) out2 <- scan_qtl_to_qtl2(out) -library(qtl2) -plot(out2$scan1, out2$map) - } \seealso{ \code{\link[=scan_qtl_to_qtl2]{scan_qtl_to_qtl2()}} From 99f3ab44f88ccd05b79aae275682b1e956d3792f Mon Sep 17 00:00:00 2001 From: Karl Broman Date: Wed, 1 Jul 2020 06:02:36 -0500 Subject: [PATCH 15/15] Add CRAN badge to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8a3dd9d..b6a1f06 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ### R/qtl2convert [![Build Status](https://travis-ci.org/rqtl/qtl2convert.svg?branch=master)](https://travis-ci.org/rqtl/qtl2convert) +[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/qtl2convert)](https://cran.r-project.org/package=qtl2convert) [Karl Broman](https://kbroman.org)