-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
saral98
committed
Apr 23, 2024
1 parent
f7656af
commit 25ed97e
Showing
20 changed files
with
58,990 additions
and
59,733 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,32 @@ | ||
#' Download PrecomputedData.db | ||
#' | ||
#' Downloads the PrecomputedData.db database that is needed for the | ||
#' Download PrecomputedDataLight.db | ||
#' | ||
#' Downloads the PrecomputedDataLight.db database that is needed for the | ||
#' computeGenericFeatures() function. This databased contains the values | ||
#' of the Wilcoxon Rank tests and the CRUP correlations. | ||
#' | ||
#' | ||
#' @param method Method to be used for downloading files. Check download.file() | ||
#' manuals to see the current available methods | ||
#' @return Integer code 0 if download was succesful and the file was saved in the | ||
#' correct directory. In the case of failure errors will be raised. | ||
#' manuals to see the current available methods | ||
#' @param all Boolean value. When set to true, the PrecomputedDataAllTests.db | ||
#' database will be downloaded too. This database holds all of the p-values | ||
#' which are combined in "combined_tests" column. | ||
#' @return Integer code 0 if download was succesful and the file was saved in | ||
#' the correct directory. In the case of failure errors will be raised. | ||
#' @examples | ||
#' # methods accepts "internal", "wininet" (Windows only) ,"wget", "curl" etc. | ||
#' # Assuming the user has wget available | ||
#' downloadPrecomputedData(method="wget") | ||
#' @export | ||
#' @import utils | ||
|
||
downloadPrecomputedData <- function(method) { | ||
start_time <- Sys.time() | ||
url <- "http://owww.molgen.mpg.de/~CENTRE_data/PrecomputedData.db" | ||
cat("Downloading PrecomputedData.db\n") | ||
exit <- download.file(url, | ||
destfile=paste(system.file("extdata",package = "CENTRE") | ||
, "PrecomputedData.db", | ||
sep = "/") , | ||
method = method) | ||
if (exit != 0 ) { | ||
stop("Download of PrecomputedData.db failed. Non-zero exit status.") | ||
} | ||
|
||
f <- system.file("extdata","PrecomputedData.db", package = "CENTRE") | ||
if (!file.exists(f)){ | ||
stop("Download of of PrecomputedData.db failed or file was saved in the wrong directory.") | ||
} | ||
##Download sysdata.rda | ||
url_sys <- "http://owww.molgen.mpg.de/~CENTRE_data/Annotation.db" | ||
cat("Downloading sysdata.rda\n") | ||
exit_sys <- download.file(url_sys, | ||
destfile=paste(system.file("extdata", | ||
package="CENTRE"), "Annotation.db", sep = "/"), | ||
method = method) | ||
if (exit_sys != 0 ) { | ||
stop("Download Annotation.db failed. Non-zero exit status.") | ||
} | ||
|
||
fs <- system.file("extdata","PrecomputedData.db", package = "CENTRE") | ||
if (!file.exists(fs)){ | ||
stop("Download Annotation.db failed or file was saved in the wrong directory.") | ||
} | ||
|
||
cat(paste0('time: ', format(Sys.time() - start_time), "\n")) | ||
return(0) | ||
downloadPrecomputedData <- function(method, all = FALSE) { | ||
start_time <- Sys.time() | ||
#Download PrecomputedDataLight.db | ||
downloader("PrecomputedDataLight.db", method) | ||
#Download Annotation.db | ||
downloader("Annotation.db", method) | ||
if (all == TRUE) { | ||
downloader("PrecomputedAllTests.db", method) | ||
} | ||
cat(paste0("time: ", format(Sys.time() - start_time), "\n")) | ||
return(0) | ||
} |
Oops, something went wrong.