Skip to content

Background data check #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 82 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
bfd21f9
update sidebar menu depending on chosen mode (diyabc-rf analysis or d…
gdurif Mar 3, 2021
a927836
remove useless (deprecated) home page ui
gdurif Mar 3, 2021
e2cd1de
rename home page ui and server
gdurif Mar 3, 2021
7ab8d8d
disable analysis and data generations modules, ready to refactor the …
gdurif Mar 3, 2021
e92aa27
simplify file name (replace page denomination by module)
gdurif Mar 3, 2021
27631f3
use proj_name and proj_dir in environment
gdurif Mar 3, 2021
12234d4
check if reactive values before using reactive values to list function
gdurif Mar 3, 2021
1c481f6
use variables from global environment
gdurif Mar 3, 2021
e69a4e9
WIP: refactoring analysis module (TODO: setup, training set simulatio…
gdurif Mar 3, 2021
4e45426
use shinyFeedback package
gdurif Mar 4, 2021
c6a6d8b
rewrite global environment and rectiveValues in global environment de…
gdurif Mar 4, 2021
e2eaa88
rewrite project name module with global environment update
gdurif Mar 4, 2021
9c7fca9
use shinyFeedback + reset project environment when starting new project
gdurif Mar 4, 2021
304f1ea
WIP: refactoring analysis module, DONE: using new version of project …
gdurif Mar 4, 2021
c07e7ee
move help regarding project type in helper
gdurif Mar 4, 2021
c9ea9a4
provide initial value for locus_type and seq_mode
gdurif Mar 4, 2021
2df2236
update corresponding global environment when selecting data type
gdurif Mar 4, 2021
02a82a7
log project directory
gdurif Mar 4, 2021
dc686a7
move clean on exit to main analysis module + rename proj name module …
gdurif Mar 4, 2021
571e918
WIP: writing project type module (to choose between new, existing or …
gdurif Mar 4, 2021
aff2dd2
reformat project type/file help + manage project file input with pote…
gdurif Mar 10, 2021
0639a70
update version number for the app refactoring
gdurif Apr 26, 2021
9b0b03f
inline doc minor edition + WIP modification of project input file man…
gdurif Apr 29, 2021
eff44e4
WIP: analysis project file input management + corresponding tests (zi…
gdurif Apr 29, 2021
45bc5dd
manage project file input (+tests)
gdurif Apr 29, 2021
5b02db9
test function + WIP parsing statobs
gdurif Apr 29, 2021
d120a0a
parse and check statobs file (+test)
gdurif Apr 29, 2021
42a0412
WIP: rewriting project input file reading, parsing and checking
gdurif Apr 29, 2021
2bc4cfd
fix typo in file names
gdurif Apr 29, 2021
b35baa0
parse scenario in header file OK + WIP read header file (and TODO rea…
gdurif Apr 30, 2021
4560ee6
check prior extracted from header file
gdurif Apr 30, 2021
7e66331
check condition extracted from header file
gdurif Apr 30, 2021
73a7f71
check loci description extracted from header file
gdurif Apr 30, 2021
e884c68
remove useless lines + init at FALSE before branching checks
gdurif Apr 30, 2021
c187023
new regex (to extract 1E10 notation) + tests
gdurif Apr 30, 2021
5d8c708
check MSS group prior
gdurif Apr 30, 2021
594442d
forgot notation 1e12
gdurif Apr 30, 2021
9645aae
easier debugging
gdurif Apr 30, 2021
ed6c435
additional check case
gdurif Apr 30, 2021
b065000
useless file
gdurif Apr 30, 2021
3619f1d
implement header reader and related functions
gdurif Apr 30, 2021
4022458
remove old functions to parse project header
gdurif Apr 30, 2021
7d2e81e
function to read reftable header
gdurif May 3, 2021
eedcbee
remove commented lines regarding header reader unused internal function
gdurif May 3, 2021
adee449
fix typo
gdurif May 3, 2021
4959b02
function to test all input files (except the data file) from a project
gdurif May 3, 2021
8a56734
manage project file input for existing project
gdurif May 3, 2021
c6a35b4
feedback when uploading files to an existing project
gdurif May 3, 2021
7a98246
function to clean the current project directory
gdurif May 3, 2021
c764cf3
move the bin dir cleaning function with other directory related funct…
gdurif May 3, 2021
03d846c
additional environment reactive values storing project related metadata
gdurif May 3, 2021
3a24d0d
add counter for file modification in project directory in environment…
gdurif May 3, 2021
110502e
dedicated module to input files for an existing project (WIP, todo: f…
gdurif May 3, 2021
71336a8
function to update project file list and modification counter
gdurif May 3, 2021
718549b
additional dependencies
gdurif May 3, 2021
3935028
init global env sooner at startup + fix issue with datagen env init
gdurif May 4, 2021
3468f01
ui to list project files (WIP: ui to check project files and ui for e…
gdurif May 4, 2021
44284cc
example proj ui + fix proj cleaning in existing proj ui
gdurif May 4, 2021
a41ffa9
change naming convention for number of summary stats
gdurif May 4, 2021
3a1ae8b
change naming convention for number of scenarii
gdurif May 4, 2021
42115a7
save header file name
gdurif May 4, 2021
8032936
get number of parameters per scenario when reading header file
gdurif May 5, 2021
2224699
verify consistency between header and reftable
gdurif May 5, 2021
e2988e2
project configuration setup check (TODO: manage data file)
gdurif May 5, 2021
7333605
data file input (TODO: data file check)
gdurif May 5, 2021
7f567f9
WIP: preparation for data file check refactoring
gdurif May 5, 2021
ad9de24
fix typo
gdurif May 5, 2021
8fa4d22
WIP: function to read data files (DONE: function to process and check…
gdurif May 6, 2021
356f151
WIP: function to read data files (DONE: function to check all SNPs fr…
gdurif May 6, 2021
3ee6027
function to read IndSeq SNP data file is ok
gdurif May 6, 2021
e85e356
function to read poolseq file (+ implementation of monomorphic locus …
gdurif May 6, 2021
0782ccc
fix typo + use vector instead of data frame for header file content
gdurif May 6, 2021
bda8161
function to read mss file (including missing pop check)
gdurif May 6, 2021
c5e6412
check data file
gdurif May 6, 2021
5e2caa1
remove functions due to refactoring
gdurif May 6, 2021
ea4d8f4
fonction to format data info to be printed in the GUI
gdurif May 6, 2021
6222eb6
move data check function to another file + minor modification in data…
gdurif May 6, 2021
461df44
Exising and example project reset when changing mode + data check fee…
gdurif May 6, 2021
b130111
fix typo
gdurif May 7, 2021
02befb8
additional env variable and improve reset
gdurif May 7, 2021
70f43fe
use global env proj type + better job at reseting project (TODO: fix …
gdurif May 7, 2021
0cd01d9
WIP: run data check in background
gdurif May 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions R-pkg/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: diyabcGUI
Type: Package
Title: Graphical User Interface for DYIABC-RF software
Version: 1.0.14
Date: 2021-03-12
Version: 1.1.0
Date: 2021-04-26
Authors@R: c(
person(
"Ghislain", "Durif", comment="diyabcGUI main developer",
Expand Down Expand Up @@ -55,15 +55,18 @@ VignetteBuilder: knitr
Imports:
dplyr,
fs,
future,
ggplot2,
lubridate,
jsonlite,
magrittr,
mime,
parallel, pbapply, processx,
readr,
rlang,
shiny,
shinybusy (>= 0.2.2),
shinydashboard, shinyFiles,
shinydashboard, shinyFeedback, shinyFiles,
shinyhelper, shinyjs, shinyWidgets,
stringr,
tibble,
Expand Down
9 changes: 9 additions & 0 deletions R-pkg/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ importFrom(fs,file_chmod)
importFrom(fs,file_copy)
importFrom(fs,file_delete)
importFrom(fs,path_home)
importFrom(future,future)
importFrom(future,multisession)
importFrom(future,plan)
importFrom(ggplot2,aes)
importFrom(ggplot2,aes_string)
importFrom(ggplot2,annotate)
Expand Down Expand Up @@ -53,12 +56,16 @@ importFrom(ggplot2,ylim)
importFrom(jsonlite,fromJSON)
importFrom(lubridate,now)
importFrom(magrittr,"%>%")
importFrom(mime,guess_type)
importFrom(parallel,detectCores)
importFrom(parallel,makeCluster)
importFrom(parallel,stopCluster)
importFrom(pbapply,pblapply)
importFrom(processx,process)
importFrom(readr,read_file)
importFrom(rlang,duplicate)
importFrom(shinyFeedback,feedbackWarning)
importFrom(shinyFeedback,useShinyFeedback)
importFrom(shinyWidgets,actionBttn)
importFrom(shinyWidgets,actionGroupButtons)
importFrom(shinyWidgets,ask_confirmation)
Expand All @@ -74,7 +81,9 @@ importFrom(shinydashboard,dashboardHeader)
importFrom(shinydashboard,dashboardPage)
importFrom(shinydashboard,dashboardSidebar)
importFrom(shinydashboard,menuItem)
importFrom(shinydashboard,renderMenu)
importFrom(shinydashboard,sidebarMenu)
importFrom(shinydashboard,sidebarMenuOutput)
importFrom(shinydashboard,tabItem)
importFrom(shinydashboard,tabItems)
importFrom(shinydashboard,updateTabItems)
Expand Down
41 changes: 41 additions & 0 deletions R-pkg/R/01_directory.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,44 @@ mk_proj_dir <- function(tag = "diyabc") {
# output
return(tmp_dir)
}


#' Clean project directory
#' @keywords internal
#' @description Remove all files and sub-folders in a given project directory.
#' @author Ghislain Durif
#' @param proj_dir character string, path to project directory.
clean_proj_dir <- function(proj_dir) {
# check if project directory exists
if(length(proj_dir) != 1 && !dir.exists(proj_dir)) {
stop("Input argument should be a valid path to a project directory")
}
# sub-folders
subdir_list <- list.dirs(proj_dir, full.names = FALSE, recursive = FALSE)
subdir_list <- subdir_list[subdir_list != ""]
if(length(subdir_list) > 0) {
fs::dir_delete(file.path(proj_dir, subdir_list))
}
# files
file_list <- list.files(proj_dir)
if(length(file_list) > 0) {
fs::file_delete(file.path(proj_dir, file_list))
}
}


#' Clean binary directory
#' @keywords internal
#' @author Ghislain Durif
clean_bin_dir <- function() {
# bin directory
path <- bin_dir()
# existing binary file
existing_bin_files <- list.files(path)
existing_bin_files <- existing_bin_files[str_detect(existing_bin_files,
"diyabc|abcranger|dll")]
# delete diyabc/abcranger files
if(length(existing_bin_files) > 0) {
fs::file_delete(file.path(path, existing_bin_files))
}
}
7 changes: 7 additions & 0 deletions R-pkg/R/02_regex.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ num_regex <- function() {
return("[0-9]+\\.?[0-9]*")
}

#' return numerical (xxEyy notation) regex
#' @keywords internal
#' @author Ghislain Durif
numexp_regex <- function() {
return("[0-9]+\\.?[0-9]*((E|e)\\-?[0-9]+)?")
}

#' return event numerical rate regex
#' @keywords internal
#' @author Ghislain Durif
Expand Down
15 changes: 0 additions & 15 deletions R-pkg/R/03_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,6 @@ find_bin <- function(prog = "diyabc") {
return(bin_file)
}

#' Clean binary directory
#' @keywords internal
#' @author Ghislain Durif
clean_bin_dir <- function() {
# bin directory
path <- bin_dir()
# existing binary file
existing_bin_files <- list.files(path)
existing_bin_files <- existing_bin_files[str_detect(existing_bin_files,
"diyabc|abcranger|dll")]
# delete diyabc/abcranger files
if(length(existing_bin_files) > 0) {
fs::file_delete(file.path(path, existing_bin_files))
}
}

#' Find which OS is running
#' @keywords internal
Expand Down
Loading