From 42e930d845fb98ca7c7218e53a913b8815b61780 Mon Sep 17 00:00:00 2001 From: GregFa <36859310+GregFa@users.noreply.github.com> Date: Sun, 25 Sep 2022 23:01:06 -0500 Subject: [PATCH 1/2] Added ".geno" format to group name in the query. Adding .geno to the group name fixes the get_geno() issue. --- R/get_data.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_data.R b/R/get_data.R index af16dda..a96e1ba 100644 --- a/R/get_data.R +++ b/R/get_data.R @@ -76,7 +76,7 @@ get_geno <- { stopifnot(length(group) == 1) - result <- query_gn(paste0("genotypes/", group), url=url, output="text") + result <- query_gn(paste0("genotypes/", group, ".geno"), url=url, output="text") # replace @ with # result <- gsub("@", "#", result, fixed=TRUE) From d863b888a90ba60a3c0ac62432a86b7739f71773 Mon Sep 17 00:00:00 2001 From: GregFa <36859310+GregFa@users.noreply.github.com> Date: Sun, 25 Sep 2022 23:37:43 -0500 Subject: [PATCH 2/2] Add format argument in get_geno() Added format argument, default = "geno" --- R/get_data.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/get_data.R b/R/get_data.R index a96e1ba..5c75f41 100644 --- a/R/get_data.R +++ b/R/get_data.R @@ -61,6 +61,7 @@ get_pheno <- #' #' @param group Name of group #' @param url The URL for the GeneNetwork API +#' @param format The group's genotypes format #' #' @return A data frame #' @@ -72,11 +73,11 @@ get_pheno <- #' @examples #' g <- get_geno("QSM") get_geno <- - function(group, url=gnapi_url()) + function(group, url=gnapi_url(), format = "geno") { stopifnot(length(group) == 1) - result <- query_gn(paste0("genotypes/", group, ".geno"), url=url, output="text") + result <- query_gn(paste0("genotypes/", group, ".", format), url=url, output="text") # replace @ with # result <- gsub("@", "#", result, fixed=TRUE)