@@ -241,19 +241,9 @@ batches <- function(access_token = check_access_token())
241241# ' if not then does not perform authentication
242242# '
243243# ' @export
244- # ' @return Dataframe. If `gwasglue = TRUE` then returns a gwasglue2 object.
244+ # ' @return Dataframe
245245associations <- function (variants , id , proxies = 1 , r2 = 0.8 , align_alleles = 1 , palindromes = 1 , maf_threshold = 0.3 , access_token = check_access_token()){
246246
247- # Query specific variants from specific GWAS using associations_query internal function (old version)
248- out <- associations_query(variants = variants , id = id , proxies = proxies , r2 = r2 , align_alleles = align_alleles , palindromes = palindromes , maf_threshold = maf_threshold , access_token = access_token )
249-
250- return (out )
251- }
252-
253-
254- # Query specific variants from specific GWAS - associations internal function to allow for future gwasglue2 integration
255- associations_query <- function (variants = variants , id = id , proxies = proxies , r2 = r2 , align_alleles = align_alleles , palindromes = palindromes , maf_threshold = maf_threshold , access_token = access_token )
256- {
257247 id <- legacy_ids(id )
258248 out <- api_query(" associations" , query = list (
259249 variant = variants ,
@@ -265,7 +255,6 @@ associations_query <- function(variants=variants, id=id, proxies=proxies, r2=r2,
265255 maf_threshold = maf_threshold
266256 ), access_token = access_token ) %> % get_query_content()
267257
268- if (inherits(out , " response" ))
269258 if (inherits(out , " response" ))
270259 {
271260 return (out )
@@ -274,8 +263,11 @@ associations_query <- function(variants=variants, id=id, proxies=proxies, r2=r2,
274263 } else {
275264 return (dplyr :: tibble())
276265 }
266+
267+ return (out )
277268}
278269
270+
279271# ' Look up sample sizes when meta data is missing from associations
280272# '
281273# ' @param d Output from [`associations`]
@@ -409,7 +401,6 @@ tophits_query <- function(id, pval=5e-8, clump = 1, r2 = 0.001, kb = 10000, pop=
409401 pop = pop
410402 ), access_token = access_token ) %> % get_query_content()
411403 if (inherits(out , " response" ))
412- if (inherits(out , " response" ))
413404 {
414405 return (out )
415406 } else if (is.data.frame(out )) {
0 commit comments