Skip to content
Snippets Groups Projects
Unverified Commit 9e0a4763 authored by Todor Kondic's avatar Todor Kondic
Browse files

Add R/api.R

DESCRIPTION: New dependencies.

NAMESPACE: New imports.

R/api.R (read_conf,vrfy_conf): New functions.
parent d0a64a3d
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@ Collate:
'mix.R'
'extraction.R'
'run.R'
'api.R'
'shinyUI.R'
Depends:
RMassBank,
......@@ -60,6 +61,8 @@ Imports:
yaml,
mzR,
MSnbase,
data.table,
assertthat,
ggplot2,
cowplot,
RColorBrewer,
......
# Generated by roxygen2: do not edit by hand
export(launch)
export(read_conf)
R/api.R 0 → 100644
## Copyright (C) 2020 by University of Luxembourg
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
## http://www.apache.org/licenses/LICENSE-2.0
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
read_conf <- function(fn_conf) {
conf <- yaml::yaml.load_file(fn_conf)
conf <- vrfy_conf(conf)
conf
}
vrfy_conf <- function(conf) {
for (fn in unlist(conf,recursive=T)) assertthat::assert_that(file.exists(fn),msg=paste("Data file does not exist:",fn))
return(conf)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment