diff --git a/R/required_cols.R b/R/required_cols.R index 957426d..157074e 100644 --- a/R/required_cols.R +++ b/R/required_cols.R @@ -5,6 +5,7 @@ #' @param dataset_type Dataset type ("GWAS" or "QTL"). #' @param for_all Columns required for all methods. #' @param add_versions Add software versions for each method. +#' @param add_sources Add source code URLs for each method. #' @param add_citations Add citations for each method. #' @param add_executables Add path to executables for each method. #' @param verbose Print messages. @@ -15,6 +16,7 @@ required_cols <- function(dataset_type = "GWAS", for_all = c("SNP","CHR","POS","Effect","StdErr"), add_versions = FALSE, + add_sources = TRUE, add_citations = TRUE, add_executables = FALSE, verbose = TRUE){ @@ -42,22 +44,11 @@ required_cols <- function(dataset_type = "GWAS", PAINTOR=c("MAF"), COJO_stepwise=c("Freq","P","N"), COJO_conditional=c("Freq","P","N"), - COJO_joint=c("Freq","P","N")) # check these - #### Add GitHub repos #### - url_dict <- list(ABF="https://github.com/chr1swallace/coloc", - FINEMAP="http://www.christianbenner.com/", - SUSIE="https://github.com/stephenslab/susieR", - POLYFUN_SUSIE="https://github.com/omerwe/polyfun", - POLYFUN_FINEMAP="https://github.com/omerwe/polyfun", - PAINTOR="https://github.com/gkichaev/PAINTOR_V3.0", - COJO_stepwise="https://github.com/jianyangqt/gcta", - COJO_conditional="https://github.com/jianyangqt/gcta", - COJO_joint="https://github.com/jianyangqt/gcta") + COJO_joint=c("Freq","P","N")) # check these d <- data.table::data.table(method=names(required_dict), required=required_dict) d$suggested <- suggested_dict[d$method] - d$url <- url_dict[d$method] #### Extract software versions #### if(isTRUE(add_versions)){ messager("Gathering method versions.",v=verbose) @@ -74,9 +65,23 @@ required_cols <- function(dataset_type = "GWAS", COJO_joint=cojo_version) d$version <- unlist(lapply(versions_dict[d$method],as.character)) } + #### Add GitHub repos #### + if(isTRUE(add_sources)){ + messager("Gathering method sources.",v=verbose) + source_dict <- list(ABF="https://github.com/chr1swallace/coloc", + FINEMAP="http://www.christianbenner.com/", + SUSIE="https://github.com/stephenslab/susieR", + POLYFUN_SUSIE="https://github.com/omerwe/polyfun", + POLYFUN_FINEMAP="https://github.com/omerwe/polyfun", + PAINTOR="https://github.com/gkichaev/PAINTOR_V3.0", + COJO_stepwise="https://github.com/jianyangqt/gcta", + COJO_conditional="https://github.com/jianyangqt/gcta", + COJO_joint="https://github.com/jianyangqt/gcta") + d$source <- source_dict[d$method] + } #### Extract executable paths #### if(isTRUE(add_executables)){ - messager("Gathering method executables",v=verbose) + messager("Gathering method executables.",v=verbose) finemap <- FINEMAP_find_executable(verbose = FALSE) polyfun <- POLYFUN_find_folder() paintor <- PAINTOR_find_executable() @@ -94,7 +99,7 @@ required_cols <- function(dataset_type = "GWAS", } #### Add citations #### if(isTRUE(add_citations)){ - messager("Gathering method citations",v=verbose) + messager("Gathering method citations.",v=verbose) citations_dict <- list( ABF="https://doi.org/10.1086%2F519024", FINEMAP="https://doi.org/10.1093%2Fbioinformatics%2Fbtw018", diff --git a/man/required_cols.Rd b/man/required_cols.Rd index 84f9c0a..c3a7578 100644 --- a/man/required_cols.Rd +++ b/man/required_cols.Rd @@ -8,6 +8,7 @@ required_cols( dataset_type = "GWAS", for_all = c("SNP", "CHR", "POS", "Effect", "StdErr"), add_versions = FALSE, + add_sources = TRUE, add_citations = TRUE, add_executables = FALSE, verbose = TRUE @@ -20,6 +21,8 @@ required_cols( \item{add_versions}{Add software versions for each method.} +\item{add_sources}{Add source code URLs for each method.} + \item{add_citations}{Add citations for each method.} \item{add_executables}{Add path to executables for each method.}