diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index c41bda2..1f34717 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -7,6 +7,11 @@ assignees: ''
---
+:warning: :warning: :warning:
+PLEASE NOTE, YOUR ISSUE WILL BE AUTOMATICALLY CLOSED IF IT DOES NOT USE AND COMPLETE THE TEMPLATE.
+These templates are designed to give us the basic information necessary to help debug your issues.
+:warning: :warning: :warning:
+
## 1. Bug description
(A clear and concise description of what the bug is.)
diff --git a/.github/workflows/auto-close-issues.yml b/.github/workflows/auto-close-issues.yml
new file mode 100644
index 0000000..bfc9cd8
--- /dev/null
+++ b/.github/workflows/auto-close-issues.yml
@@ -0,0 +1,16 @@
+on:
+ issues:
+ types: [opened, edited]
+
+jobs:
+ auto_close_issues:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v1
+ - name: Automatically close issues that don't follow the issue template
+ uses: lucasbento/auto-close-issues@v1.0.2
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ issue-close-message: "@${issue.user.login}: hello! :wave:\n\nThis issue is being automatically closed because it does not follow the issue template." # optional property
+ closed-issues-label: "🙁 Not following issue template" # optional property
diff --git a/DESCRIPTION b/DESCRIPTION
index a861f6b..53c44ff 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: MAGMA.Celltyping
Type: Package
Title: Find Causal Cell-Types Underlying Complex Trait Genetics
-Version: 2.0.12
+Version: 2.0.13
Authors@R:
c(person(given = "Brian",
family = "Schilder",
@@ -73,6 +73,6 @@ Suggests:
SystemRequirements: A system installation of
[MAGMA](https://ctg.cncr.nl/software/magma) is required
but can be installed automatically by this package.
-RoxygenNote: 7.3.1
+RoxygenNote: 7.3.2
Encoding: UTF-8
Config/testthat/edition: 3
diff --git a/NEWS.md b/NEWS.md
index c177f7a..d3dea2a 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,15 @@
+# MAGMA.Celltyping 2.0.13
+
+## New features
+
+* Fully remove deprecated function `format.sumstats.for.magma`
+* Add auto-close-template: https://github.com/marketplace/actions/auto-close-issues
+
+## Bug fixes
+
+* Update URLs for getting MAGMA reference genome files (#154).
+* *test-magma_links.R*: `package_version` comparisons now only work with strings instead of numbers.
+
# MAGMA.Celltyping 2.0.12
## Bug fixes
diff --git a/R/format_sumstats_for_magma.r b/R/format_sumstats_for_magma.r
index a61db83..b8187fe 100644
--- a/R/format_sumstats_for_magma.r
+++ b/R/format_sumstats_for_magma.r
@@ -21,7 +21,4 @@ format_sumstats_for_magma <- function(path) {
mungesumstats_deprecation_msg()
}
-
-format.sumstats.for.magma <- function(path){
- format_sumstats_for_magma(path)
-}
+
diff --git a/R/get_example_gwas_raw.R b/R/get_example_gwas_raw.R
index 0744bb2..c1341ef 100644
--- a/R/get_example_gwas_raw.R
+++ b/R/get_example_gwas_raw.R
@@ -2,9 +2,9 @@
#'
#' Write example GWAS summary statistics to disk.
#'
-#' @param save_path Path to save sum stats.
#' @param timeout How many seconds to wait before timeout.
#' @param verbose Print messages.
+#' @inheritParams get_data
#'
#' @return Path to sumstats
#'
diff --git a/R/get_genome_ref.R b/R/get_genome_ref.R
index 8188a49..0c23eae 100644
--- a/R/get_genome_ref.R
+++ b/R/get_genome_ref.R
@@ -32,28 +32,21 @@
#'
#' @examples
#' \dontrun{
-#' genome_ref_path <- MAGMA.Celltyping::get_genome_ref()
+#' genome_ref_path <- get_genome_ref()
#' }
get_genome_ref <- function(genome_ref_path = NULL,
storage_dir = tools::R_user_dir(
"MAGMA.Celltyping",
which="cache"),
- method = c("magma","piggback"),
+ method = c("magma"),
population = c("eur", "afr", "amr", "eas", "sas"),
timeout = 60 * 5,
verbose = TRUE) {
#### population ####
dir.create(storage_dir,showWarnings = FALSE, recursive = TRUE)
population <- tolower(population[1])
+ population <- match.arg(population)
method <- tolower(method[1])
- pop_opts <- c("eur", "afr", "amr", "eas", "sas")
- if (!population %in% pop_opts) {
- stop_msg <- paste0(
- "population must be one of:\n",
- paste0(" - ", pop_opts, collapse = "\n")
- )
- stop(stop_msg)
- }
#### Set up paths ####
if (is.null(genome_ref_path)) {
genome_ref_dir <- file.path(storage_dir,
@@ -83,7 +76,12 @@ get_genome_ref <- function(genome_ref_path = NULL,
verbose = verbose
)
}
-
+ ### Reference file is too large to be stored in GitHub Releases now
+ #else if(method == "piggyback"){
+ # get_genome_ref_piggyback(
+ # genome_ref_dir = genome_ref_dir,
+ # verbose = verbose
+ # )
}
#### Return the folder + the file prefix ####
return(genome_ref_path)
diff --git a/R/get_genome_ref_magma.R b/R/get_genome_ref_magma.R
index 88b5e24..34d079f 100644
--- a/R/get_genome_ref_magma.R
+++ b/R/get_genome_ref_magma.R
@@ -6,18 +6,22 @@
#'
#' @param genome_ref_dir Folder to download reference to.
#' @param verbose Print messages.
-#' @source \href{https://ctg.cncr.nl/software/MAGMA/ref_data/}{MAGMA archives}
+#' @source \href{https://cncr.nl/research/magma/}{MAGMA site}
#'
#' @keywords internal
get_genome_ref_magma <- function(genome_ref_dir,
+ population = "eur",
timeout = 60 * 5,
verbose = TRUE) {
#### Get link ####
- input_url <- paste(
- "https://ctg.cncr.nl/software/MAGMA",
- "ref_data",paste0(basename(genome_ref_dir),".zip"),
- sep="/"
- )
+ link_dict <- list(
+ "g1000_eur"="https://vu.data.surfsara.nl/index.php/s/VZNByNwpD8qqINe/download",
+ "g1000_afr"="https://vu.data.surfsara.nl/index.php/s/ePXET6IWVTwTes4/download",
+ "g1000_eas"="https://vu.data.surfsara.nl/index.php/s/dz6PYdKOi3xVqHn/download",
+ "g1000_sas"="https://vu.data.surfsara.nl/index.php/s/C6UkTV5nuFo8cJC/download",
+ "g1000_amr"="https://vu.data.surfsara.nl/index.php/s/TXDEm70eEO7AgOb/download"
+ )
+ input_url <- link_dict[[paste0("g1000_",tolower(population))]]
##### Link to 1000 genomes reference data. ####
zipfile <- sprintf("%s.zip", genome_ref_dir)
#### Download file ####
diff --git a/R/get_genome_ref_piggyback.R b/R/get_genome_ref_piggyback.R
index 587752c..d351322 100644
--- a/R/get_genome_ref_piggyback.R
+++ b/R/get_genome_ref_piggyback.R
@@ -6,9 +6,10 @@
#'
#' @param genome_ref_dir Folder to download reference to.
#' @param verbose Print messages.
+#' @inheritDotParams get_data
#' @source
#' \code{
-#' genome_ref_path <- MAGMA.Celltyping::get_genome_ref(method = "magma")
+#' genome_ref_path <- get_genome_ref(method = "magma")
#'
#' piggyback::pb_upload(file = genome_ref_path,
#' repo = "neurogenomics/MAGMA_Celltyping",
@@ -16,14 +17,16 @@
#' }
#' @keywords internal
get_genome_ref_piggyback <- function(genome_ref_dir,
- verbose = TRUE) {
+ verbose = TRUE,
+ ...) {
##### Link to 1000 genomes reference data. ####
zipfile <- sprintf("%s.zip", genome_ref_dir)
#### Download file ####
options(timeout = 60 * 5)
get_data(paste0(basename(genome_ref_dir),".zip"),
repo = "neurogenomics/MAGMA_Celltyping",
- storage_dir = genome_ref_dir)
+ storage_dir = genome_ref_dir,
+ ...)
#### Unzip file ####
messager("Unzipping file.", v = verbose)
utils::unzip(
diff --git a/README.md b/README.md
index 87d4124..415c163 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
[![License:
GPL-3](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://cran.r-project.org/web/licenses/GPL-3)
-[![](https://img.shields.io/badge/devel%20version-2.0.9-black.svg)](https://github.com/neurogenomics/MAGMA_Celltyping)
+[![](https://img.shields.io/badge/devel%20version-2.0.13-black.svg)](https://github.com/neurogenomics/MAGMA_Celltyping)
[![](https://img.shields.io/github/languages/code-size/neurogenomics/MAGMA_Celltyping.svg)](https://github.com/neurogenomics/MAGMA_Celltyping)
[![](https://img.shields.io/github/last-commit/neurogenomics/MAGMA_Celltyping.svg)](https://github.com/neurogenomics/MAGMA_Celltyping/commits/master)
[![R build
status](https://github.com/neurogenomics/MAGMA_Celltyping/workflows/rworkflows/badge.svg)](https://github.com/neurogenomics/MAGMA_Celltyping/actions)
-[![](https://codecov.io/gh/neurogenomics/MAGMA_Celltyping/branch/master/graph/badge.svg)](https://codecov.io/gh/neurogenomics/MAGMA_Celltyping)
+[![](https://codecov.io/gh/neurogenomics/MAGMA_Celltyping/branch/master/graph/badge.svg)](https://app.codecov.io/gh/neurogenomics/MAGMA_Celltyping)