Skip to content

Commit

Permalink
Avoid printing in find_executables_remote [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
bschilder committed Sep 12, 2022
1 parent e229cd2 commit 6c52a8b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
33 changes: 19 additions & 14 deletions R/required_cols.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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){
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions man/required_cols.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6c52a8b

Please sign in to comment.