Skip to content

Commit

Permalink
Save NCBI refs to cache dir. Adjust .Rbuildignore for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
bschilder committed Feb 25, 2022
1 parent cbd84a0 commit fddf8b3
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ Dockerfile
^LICENSE\.md$
inst/hex/
MAGMA.Celltyping/inst/hex

^node_modules$
package-lock.json
package.json
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: MAGMA.Celltyping
Type: Package
Title: Find Causal Cell-Types Underlying Complex Trait Genetics
Version: 2.0.1
Version: 2.0.2
Authors@R:
c(person(given = "Brian",
family = "Schilder",
Expand Down Expand Up @@ -53,7 +53,8 @@ Imports:
parallel,
Matrix,
methods,
reshape2
reshape2,
tools
Suggests:
markdown,
rmarkdown,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ importFrom(stats,quantile)
importFrom(stats,residuals)
importFrom(stats,setNames)
importFrom(stringr,str_split)
importFrom(tools,R_user_dir)
importFrom(utils,download.file)
importFrom(utils,read.table)
importFrom(utils,unzip)
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# MAGMA.Celltyping 2.0.2

## New features

* `get_genomeLocFile`: Store NCBI ref file in cache dir by default.

## Bug fixes

* Add windows-specific files/folders to *.Rbuildignore*.

# MAGMA.Celltyping 2.0.1

## New features
Expand Down
8 changes: 6 additions & 2 deletions R/get_genomeLocFile.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@
#' @return File path.
#'
#' @keywords internal
#' @importFrom tools R_user_dir
#' @importFrom data.table fread
get_genomeLocFile <- function(build,
storage_dir = tempdir(),
storage_dir = tools::R_user_dir(
"MAGMA.Celltyping",
which="cache"),
overwrite = FALSE) {
build <- toupper(build[1])
dict <- c(GRCH36 = "NCBI36.3.gene.loc",
Expand All @@ -58,7 +62,7 @@ get_genomeLocFile <- function(build,
overwrite = overwrite
)
#### Check that download was successful ####
d <- data.table::fread(tmp, nrows = 10)
d <- data.table::fread(tmp, nrows = 10, nThread = 1)
if(nrow(d)!=10 || ncol(d)!=6){
stopper("genomeLocFile did not download properly.",
"Please check that you have a stable internet connection,
Expand Down
6 changes: 5 additions & 1 deletion man/get_genomeLocFile.Rd

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

0 comments on commit fddf8b3

Please sign in to comment.