Skip to content

Commit

Permalink
Update validations.R
Browse files Browse the repository at this point in the history
  • Loading branch information
biodavidjm committed Jan 5, 2024
1 parent 5a5f1fa commit d916a28
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions R/validations.R
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,9 @@ validate_na_empty <- function(df, col_name, verbose = TRUE) {
#' @export
validate_phase <- function(input_results_folder, return_phase = TRUE){
phase <- stringr::str_extract(string = input_results_folder,
pattern = "(PASS1A-06|PASS1A-18|PASS1B-06|PASS1B-18|PASS1C-06|PASS1C-18|PASS1AC-06|HUMAN-PRECOVID|HUMAN-MAIN)")
pattern = "(PASS1A-06|PASS1A-18|PASS1B-06|PASS1B-18|PASS1C-06|PASS1C-18|PASS1AC-06|HUMAN|HUMAN-PRECOVID|HUMAN-MAIN)")
if( is.na(phase) | phase == "NA" ){
if(phase == "HUMAN"){
if(return_phase) return(phase)
}else{
stop("- (-) Project phase is not found in the folder structure. Please, check the MoTrPAC control vocabulary guidelines")
}
stop("- (-) Project phase is not found in the folder structure. Please, check the MoTrPAC control vocabulary guidelines")
}else{
if(return_phase) return(phase)
}
Expand Down

0 comments on commit d916a28

Please sign in to comment.