-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjust for deleted files and validate UUIDs
- Loading branch information
Showing
8 changed files
with
118 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: tgR.data | ||
Type: Package | ||
Title: Data Management Support for Fred Hutch Translational Genomics | ||
Version: 0.0.2 | ||
Version: 0.0.3 | ||
Author: Amy Paguirigan | ||
Maintainer: Amy Paguirigan <[email protected]> | ||
Description: Supports the curation of scientific metadata associated with files stored | ||
|
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#' Checks to ensure a uuid is not already used | ||
#' | ||
#' @param uuid (Required) uuid you'd like to check | ||
#' @return Returns NA if all uuids are valid, and an array of invalid uuids if any are invalid | ||
#' @details Note: Only works for admin users. | ||
#' @export | ||
#' | ||
validate_uuid <- function(uuid = NULL) { | ||
if(is.null(uuid)) {stop("Please provide at least one uuid.")} | ||
suppressMessages(check_credentials()) | ||
message("Checking for existing record(s) with the uuid(s) provided.") | ||
logic <- paste0("[uuid] = '", paste(uuid, collapse = "' OR [uuid] = '"), "'") | ||
formData <- list("token"=Sys.getenv("S3META"), | ||
content='record', | ||
action='export', | ||
format='csv', | ||
type='flat', | ||
csvDelimiter=',', | ||
'fields[0]'='uuid', | ||
rawOrLabel='raw', | ||
rawOrLabelHeaders='raw', | ||
exportCheckboxLabel='false', | ||
exportSurveyFields='false', | ||
exportDataAccessGroups='false', | ||
returnFormat='csv', | ||
filterLogic=logic) | ||
alreadyUsed <- suppressMessages(httr::content( | ||
httr::POST(url = Sys.getenv("REDURI"), | ||
body = formData, encode = "form", show_col_types = FALSE))) | ||
|
||
if (nrow(alreadyUsed)>0) {result <- alreadyUsed$uuid} else {result <- NA} | ||
return(result) | ||
} |
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,4 +1,4 @@ | ||
### vortexing/r_tgr.data:v0.0.2 | ||
### vortexing/r_tgr.data:v0.0.3 | ||
## Pull the R base image | ||
FROM rocker/r-base:4.1.1 | ||
# Update | ||
|
@@ -7,6 +7,6 @@ RUN apt-get install -y libssl-dev libxml2-dev libcurl4-openssl-dev | |
# Install required packages | ||
RUN R -e "install.packages('remotes', dependencies = TRUE)" | ||
# Install from github | ||
RUN R -e "remotes::install_github('FredHutch/[email protected].2', dependencies = TRUE)" | ||
RUN R -e "remotes::install_github('FredHutch/[email protected].3', dependencies = TRUE)" | ||
# Override the R CMD for workflow managers | ||
CMD ["/bin/bash"] | ||
CMD ["/bin/bash"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.