From 02f4e5d705299f9238fcb2c5b74ea4d40e9acd6b Mon Sep 17 00:00:00 2001 From: Julia Gustavsen Date: Wed, 19 Jul 2023 14:33:07 +0200 Subject: [PATCH 1/4] fixed single quote issue in description --- DESCRIPTION | 12 ++++++------ NEWS.md | 8 ++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f7f617d..f0ed6ae 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,12 @@ Package: rsnps -Title: Get 'SNP' ('Single-Nucleotide' 'Polymorphism') Data on the Web -Description: A programmatic interface to various 'SNP' 'datasets' - on the web: 'OpenSNP' (), and 'NBCIs' 'dbSNP' database +Title: Get SNP (Single-Nucleotide Polymorphism) Data on the Web +Description: A programmatic interface to various SNP datasets + on the web: OpenSNP (), and NBCIs dbSNP database (). Functions - are included for searching for 'NCBI'. For 'OpenSNP', functions are included - for getting 'SNPs', and data for 'genotypes', 'phenotypes', annotations, + are included for searching for NCBI. For OpenSNP, functions are included + for getting SNPs, and data for genotypes, phenotypes, annotations, and bulk downloads of data by user. -Version: 0.6.1 +Version: 0.6.2 License: MIT + file LICENSE Authors@R: c( person("Julia", "Gustavsen", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 1b40097..47120c2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +rsnps 0.6.2 +=========== + +### MINOR IMPROVEMENTS + +* removed quotes from abbreviation in package description upon request from CRAN + + rsnps 0.6.0 =========== From 71903d4cb1d83076ad20ac3b76d9abe8426331a9 Mon Sep 17 00:00:00 2001 From: Julia Gustavsen Date: Wed, 19 Jul 2023 14:47:54 +0200 Subject: [PATCH 2/4] removed tryget internal function and added value params for the deprecated functions as requested by CRAN. --- NAMESPACE | 1 - R/LDSearch.R | 1 + R/deprecated-defunct.R | 5 +++++ R/utils.R | 10 +--------- man/LDSearch-defunct.Rd | 3 +++ man/NCBI_snp_query-defunct.Rd | 7 +++++++ man/NCBI_snp_query2-defunct.Rd | 3 +++ man/ld_search-defunct.Rd | 3 +++ man/tryget.Rd | 12 ------------ 9 files changed, 23 insertions(+), 22 deletions(-) delete mode 100644 man/tryget.Rd diff --git a/NAMESPACE b/NAMESPACE index cda557b..975744b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,7 +17,6 @@ export(phenotypes) export(phenotypes_byid) export(read_users) export(rsnpsCache) -export(tryget) export(users) importFrom(crul,HttpClient) importFrom(plyr,compact) diff --git a/R/LDSearch.R b/R/LDSearch.R index 7644704..74e7057 100644 --- a/R/LDSearch.R +++ b/R/LDSearch.R @@ -1,6 +1,7 @@ #' This function is defunct. #' @export #' @rdname ld_search-defunct +#' @return a error message telling the user that this function has been removed #' @keywords internal ld_search <- function(...) { .Defunct(msg = "This function is defunct; SNAP has been taken down. diff --git a/R/deprecated-defunct.R b/R/deprecated-defunct.R index fb8c252..4222964 100644 --- a/R/deprecated-defunct.R +++ b/R/deprecated-defunct.R @@ -1,6 +1,7 @@ #' This function is defunct. #' @export #' @rdname LDSearch-defunct +#' @return a error message telling the user that this function has been removed #' @keywords internal LDSearch <- function(...) { .Defunct(new = "ld_search", package = "rsnps", msg = "the LDSearch() function name has been changed to ld_search()") @@ -9,6 +10,7 @@ LDSearch <- function(...) { #' This function is defunct. #' @export #' @rdname NCBI_snp_query-defunct +#' @return a error message telling the user that this function has been deprecated in favour of another function #' @keywords internal ncbi_snp_summary <- function(...) { .Defunct(new = "ncbi_snp_summary", package = "rsnps", msg = "the ncbi_snp_summary() function name has been changed to ncbi_snp_query()") @@ -18,6 +20,7 @@ ncbi_snp_summary <- function(...) { #' This function is defunct. #' @export #' @rdname NCBI_snp_query-defunct +#' @return a error message telling the user that this function has been deprecated in favour of another function #' @keywords internal ncbi_snp_query2 <- function(...) { .Defunct(new = "ncbi_snp_query2", package = "rsnps", msg = "the ncbi_snp_query2() function name has been changed to ncbi_snp_query()") @@ -26,6 +29,7 @@ ncbi_snp_query2 <- function(...) { #' This function is defunct. #' @export #' @rdname NCBI_snp_query-defunct +#' @return a error message telling the user that this function has been deprecated in favour of another function #' @keywords internal NCBI_snp_query <- function(...) { .Defunct(new = "ncbi_snp_query", package = "rsnps", msg = "the NCBI_snp_query() function name has been changed to ncbi_snp_query()") @@ -34,6 +38,7 @@ NCBI_snp_query <- function(...) { #' This function is defunct. #' @export #' @rdname NCBI_snp_query2-defunct +#' @return a error message telling the user that this function has been deprecated in favour of another function #' @keywords internal NCBI_snp_query2 <- function(...) { .Defunct(new = "ncbi_snp_query2", package = "rsnps", msg = "the NCBI_snp_query2() function name has been changed to ncbi_snp_query()") diff --git a/R/utils.R b/R/utils.R index 63b0f5f..001c504 100644 --- a/R/utils.R +++ b/R/utils.R @@ -82,15 +82,7 @@ split_to_df <- function(x, sep, fixed = FALSE, perl = TRUE, useBytes = FALSE, na return(tmp) } -#' Tryget -#' -#' @export -#' @keywords internal -tryget <- function(x) { - return(tryCatch(return(x), error = function(e) { - return(NA) - })) -} + strtrim <- function(str) { gsub("^\\s+|\\s+$", "", str) diff --git a/man/LDSearch-defunct.Rd b/man/LDSearch-defunct.Rd index 47e598a..8bc3446 100644 --- a/man/LDSearch-defunct.Rd +++ b/man/LDSearch-defunct.Rd @@ -6,6 +6,9 @@ \usage{ LDSearch(...) } +\value{ +a error message telling the user that this function has been removed +} \description{ This function is defunct. } diff --git a/man/NCBI_snp_query-defunct.Rd b/man/NCBI_snp_query-defunct.Rd index e45a22b..6a09567 100644 --- a/man/NCBI_snp_query-defunct.Rd +++ b/man/NCBI_snp_query-defunct.Rd @@ -12,6 +12,13 @@ ncbi_snp_query2(...) NCBI_snp_query(...) } +\value{ +a error message telling the user that this function has been deprecated in favour of another function + +a error message telling the user that this function has been deprecated in favour of another function + +a error message telling the user that this function has been deprecated in favour of another function +} \description{ This function is defunct. diff --git a/man/NCBI_snp_query2-defunct.Rd b/man/NCBI_snp_query2-defunct.Rd index 22c1d3f..b729488 100644 --- a/man/NCBI_snp_query2-defunct.Rd +++ b/man/NCBI_snp_query2-defunct.Rd @@ -6,6 +6,9 @@ \usage{ NCBI_snp_query2(...) } +\value{ +a error message telling the user that this function has been deprecated in favour of another function +} \description{ This function is defunct. } diff --git a/man/ld_search-defunct.Rd b/man/ld_search-defunct.Rd index 07345a2..75f583f 100644 --- a/man/ld_search-defunct.Rd +++ b/man/ld_search-defunct.Rd @@ -6,6 +6,9 @@ \usage{ ld_search(...) } +\value{ +a error message telling the user that this function has been removed +} \description{ This function is defunct. } diff --git a/man/tryget.Rd b/man/tryget.Rd deleted file mode 100644 index e0ecb13..0000000 --- a/man/tryget.Rd +++ /dev/null @@ -1,12 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R -\name{tryget} -\alias{tryget} -\title{Tryget} -\usage{ -tryget(x) -} -\description{ -Tryget -} -\keyword{internal} From 6e5fd0ed502d1f0154ed34899449034db5c834ff Mon Sep 17 00:00:00 2001 From: Julia Gustavsen Date: Wed, 19 Jul 2023 14:55:58 +0200 Subject: [PATCH 3/4] uncommented lines from example in read_users() upon request from CRAN. --- R/download_users.R | 6 +++--- man/read_users.Rd | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/download_users.R b/R/download_users.R index 76a0823..7ad93f4 100644 --- a/R/download_users.R +++ b/R/download_users.R @@ -66,9 +66,9 @@ get_write <- function(x, y, ...) { #' the path. #' @return A data.frame. #' @examples \dontrun{ -#' # dat <- read_users(name = "kevinmcc") -#' # head(dat) -#' # dat <- read_users(id = 285) +#' dat <- read_users(name = "kevinmcc") +#' head(dat) +#' dat <- read_users(id = 285) #' } read_users <- function(name = NULL, id = NULL, path = NULL, ...) { if (is.null(name) && is.null(id) && is.null(path)) { diff --git a/man/read_users.Rd b/man/read_users.Rd index d6473be..97dcf00 100644 --- a/man/read_users.Rd +++ b/man/read_users.Rd @@ -31,8 +31,8 @@ the path. } \examples{ \dontrun{ -# dat <- read_users(name = "kevinmcc") -# head(dat) -# dat <- read_users(id = 285) +dat <- read_users(name = "kevinmcc") +head(dat) +dat <- read_users(id = 285) } } From 7b8af74e0017b3e5f4bfc4caeb21eb1f829f1eaf Mon Sep 17 00:00:00 2001 From: Julia Gustavsen Date: Fri, 27 Oct 2023 13:52:25 +0200 Subject: [PATCH 4/4] Add more description to value fields of exported functions. --- R/allphenotypes.R | 4 ++-- R/annotations.R | 2 +- R/download_users.R | 2 +- R/phenotypes.R | 2 +- R/phenotypes_byid.R | 2 +- R/users.R | 2 +- man/allphenotypes.Rd | 4 ++-- man/annotations.Rd | 2 +- man/phenotypes.Rd | 2 +- man/phenotypes_byid.Rd | 2 +- man/read_users.Rd | 2 +- man/users.Rd | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/R/allphenotypes.R b/R/allphenotypes.R index e1bdc06..8eb4896 100644 --- a/R/allphenotypes.R +++ b/R/allphenotypes.R @@ -11,12 +11,12 @@ #' can take multiple values, so the other columns id, characteristic, and #' number_of_users are replicated in the data.frame. Default: `FALSE` #' @param ... Curl options passed on to [crul::HttpClient] -#' @return data.frame of results, or list if `df=FALSE` +#' @return data.frame of openSNP phenotypes, variants and users per phenotype, or list if `df=FALSE` #' @examples \dontrun{ #' # Get all data #' allphenotypes(df = TRUE) #' -#' # Output a list, then call the characterisitc of interest by 'id' or +#' # Output a list, then call the characteristic of interest by 'id' or #' # 'characteristic' #' datalist <- allphenotypes() #' names(datalist) # get list of all characteristics you can call diff --git a/R/annotations.R b/R/annotations.R index 04b5afa..039bc0f 100644 --- a/R/annotations.R +++ b/R/annotations.R @@ -12,7 +12,7 @@ #' are: 'plos', 'mendeley', 'snpedia', 'metadata'). 'metadata' gives the #' metadata for the response. #' @param ... Curl options passed on to [crul::HttpClient] -#' @return data.frame of results +#' @return data.frame of openSNP phenotypes from specified source #' @examples \dontrun{ #' # Get all data #' ## get just the metadata diff --git a/R/download_users.R b/R/download_users.R index 7ad93f4..160703d 100644 --- a/R/download_users.R +++ b/R/download_users.R @@ -64,7 +64,7 @@ get_write <- function(x, y, ...) { #' written in the function download_users, and then searches against those #' variables for the path to the file saved. Alternatively, you can supply #' the path. -#' @return A data.frame. +#' @return A data.frame with openSNP user files retrieved from local storage #' @examples \dontrun{ #' dat <- read_users(name = "kevinmcc") #' head(dat) diff --git a/R/phenotypes.R b/R/phenotypes.R index 59fa5f5..0f17eb3 100644 --- a/R/phenotypes.R +++ b/R/phenotypes.R @@ -5,7 +5,7 @@ #' @param userid ID of openSNP user. #' @param df Return data.frame (`TRUE`) or not (`FALSE`). Default: `FALSE` #' @param ... Curl options passed on to [crul::HttpClient] -#' @return List of phenotypes for specified user(s). +#' @return List of phenotypes for specified user(s) from openSNP. #' #' @examples \dontrun{ #' phenotypes(userid = 1) diff --git a/R/phenotypes_byid.R b/R/phenotypes_byid.R index e2dc94d..e0b43d0 100644 --- a/R/phenotypes_byid.R +++ b/R/phenotypes_byid.R @@ -7,7 +7,7 @@ #' @param return_ Return data.frame (`TRUE`) or not (`FALSE`). Default: `FALSE` #' @param ... Curl options passed on to [crul::HttpClient] #' @return List of description of phenotype, list of known variants, or -#' data.frame of variants for each user with that phenotype. +#' data.frame of variants for each user with that phenotype retrieved from openSNP. #' #' @examples \dontrun{ #' phenotypes_byid(phenotypeid = 12, return_ = "desc") diff --git a/R/users.R b/R/users.R index 1264e55..6fc74bd 100644 --- a/R/users.R +++ b/R/users.R @@ -4,7 +4,7 @@ #' @family opensnp-fxns #' @param df Return data.frame (`TRUE`) or not (`FALSE`). Default: `FALSE` #' @param ... Curl options passed on to [crul::HttpClient] -#' @return List of openSNP users, their ID numbers, and XX if available. +#' @return List of openSNP users, their ID numbers, and genome data if available. #' @examples \dontrun{ #' # just the list #' data <- users(df = FALSE) diff --git a/man/allphenotypes.Rd b/man/allphenotypes.Rd index 55ddb53..03151ca 100644 --- a/man/allphenotypes.Rd +++ b/man/allphenotypes.Rd @@ -15,7 +15,7 @@ number_of_users are replicated in the data.frame. Default: \code{FALSE}} \item{...}{Curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ -data.frame of results, or list if \code{df=FALSE} +data.frame of openSNP phenotypes, variants and users per phenotype, or list if \code{df=FALSE} } \description{ Either return data.frame with all results, or output a list, then call @@ -27,7 +27,7 @@ the characteristic by id (parameter = "id") or name (parameter = # Get all data allphenotypes(df = TRUE) -# Output a list, then call the characterisitc of interest by 'id' or +# Output a list, then call the characteristic of interest by 'id' or # 'characteristic' datalist <- allphenotypes() names(datalist) # get list of all characteristics you can call diff --git a/man/annotations.Rd b/man/annotations.Rd index 460d69f..a15b301 100644 --- a/man/annotations.Rd +++ b/man/annotations.Rd @@ -21,7 +21,7 @@ metadata for the response.} \item{...}{Curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ -data.frame of results +data.frame of openSNP phenotypes from specified source } \description{ Either return data.frame with all results, or output a list, then call diff --git a/man/phenotypes.Rd b/man/phenotypes.Rd index 188719e..06899b6 100644 --- a/man/phenotypes.Rd +++ b/man/phenotypes.Rd @@ -14,7 +14,7 @@ phenotypes(userid = NA, df = FALSE, ...) \item{...}{Curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ -List of phenotypes for specified user(s). +List of phenotypes for specified user(s) from openSNP. } \description{ Get openSNP phenotype data for one or multiple users. diff --git a/man/phenotypes_byid.Rd b/man/phenotypes_byid.Rd index 26c8118..6bbdab3 100644 --- a/man/phenotypes_byid.Rd +++ b/man/phenotypes_byid.Rd @@ -20,7 +20,7 @@ phenotypes_byid( } \value{ List of description of phenotype, list of known variants, or -data.frame of variants for each user with that phenotype. +data.frame of variants for each user with that phenotype retrieved from openSNP. } \description{ Get all openSNP known variations and all users sharing that phenotype for diff --git a/man/read_users.Rd b/man/read_users.Rd index 97dcf00..47f96ea 100644 --- a/man/read_users.Rd +++ b/man/read_users.Rd @@ -16,7 +16,7 @@ read_users(name = NULL, id = NULL, path = NULL, ...) \item{...}{Parameters passed on to \code{\link[=read.table]{read.table()}}} } \value{ -A data.frame. +A data.frame with openSNP user files retrieved from local storage } \description{ Beware, these tables can be large. Check your RAM before executing. Or diff --git a/man/users.Rd b/man/users.Rd index 65d309c..5918c4a 100644 --- a/man/users.Rd +++ b/man/users.Rd @@ -12,7 +12,7 @@ users(df = FALSE, ...) \item{...}{Curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ -List of openSNP users, their ID numbers, and XX if available. +List of openSNP users, their ID numbers, and genome data if available. } \description{ Get openSNP users.