Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
shinyscreen
Manage
Activity
Members
Labels
Plan
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Environmental Cheminformatics
shinyscreen
Commits
27537e48
Commit
27537e48
authored
2 years ago
by
Todor Kondić
Browse files
Options
Downloads
Patches
Plain Diff
api, envopts, errors: Add max_proc parameter to envopts.
parent
555e4d63
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#68463
failed
2 years ago
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
DESCRIPTION
+1
-1
1 addition, 1 deletion
DESCRIPTION
R/api.R
+6
-2
6 additions, 2 deletions
R/api.R
R/envopts.R
+11
-2
11 additions, 2 deletions
R/envopts.R
R/errors.R
+4
-0
4 additions, 0 deletions
R/errors.R
man/envopts.Rd
+9
-1
9 additions, 1 deletion
man/envopts.Rd
man/init.Rd
+9
-1
9 additions, 1 deletion
man/init.Rd
with
40 additions
and
7 deletions
DESCRIPTION
+
1
−
1
View file @
27537e48
Package: shinyscreen
Title: Pre-screening of Mass Spectrometry Data
Version: 1.2.900
6
Version: 1.2.900
7
Author: Todor Kondić
Maintainer: Todor Kondić <todor.kondic@uni.lu>
Authors@R:
...
...
This diff is collapsed.
Click to expand it.
R/api.R
+
6
−
2
View file @
27537e48
...
...
@@ -862,9 +862,13 @@ report <- function(m) {
#' @inheritParams envopts
#' @return Nothing.
#' @author Todor Kondić
init
<-
function
(
metfrag_db_dir
=
""
,
metfrag_jar
=
""
,
java_bin
=
Sys.which
(
"java"
))
{
init
<-
function
(
metfrag_db_dir
=
""
,
metfrag_jar
=
""
,
java_bin
=
Sys.which
(
"java"
),
metfrag_max_proc
=
parallel
::
detectCores
())
{
e
=
envopts
(
metfrag_db_dir
=
metfrag_db_dir
,
metfrag_jar
=
metfrag_jar
,
java_bin
=
java_bin
)
java_bin
=
java_bin
,
metfrag_max_proc
=
metfrag_max_proc
)
save_envopts
(
o
=
e
)
}
This diff is collapsed.
Click to expand it.
R/envopts.R
+
11
−
2
View file @
27537e48
...
...
@@ -30,9 +30,14 @@
#' pipeline.
#' @param metfrag_db_dir `character(1)`, a path to the directory which contains MetFrag databases
#' @param metfrag_jar `character(1)`, a path to MetFrag JAR file
#' @param metfrag_max_proc `integer(1)`, maximum number of CPU cores
#' available for MetFrag.
#' @return An `envopts` object.
#' @author Todor Kondić
envopts
<-
function
(
metfrag_db_dir
=
""
,
metfrag_jar
=
""
,
java_bin
=
Sys.which
(
"java"
))
{
envopts
<-
function
(
metfrag_db_dir
=
""
,
metfrag_jar
=
""
,
java_bin
=
Sys.which
(
"java"
),
metfrag_max_proc
=
parallel
::
detectCores
())
{
res
=
list
(
metfrag
=
list
())
class
(
res
)
=
c
(
"envopts"
,
"list"
)
#Just to officially make it an
#object.
...
...
@@ -41,8 +46,12 @@ envopts <- function(metfrag_db_dir="",metfrag_jar="",java_bin=Sys.which("java"))
res
$
metfrag
$
db_dir
=
norm_path
(
metfrag_db_dir
)
check_file_absent
(
metfrag_jar
,
what
=
"mf-jar"
)
res
$
metfrag
$
jar
=
norm_path
(
metfrag_jar
)
check_not_integer
(
value
=
metfrag_max_proc
,
what
=
"metfrag_max_proc"
)
res
$
metfrag
$
jar
=
norm_path
(
metfrag_jar
)
res
$
metfrag
$
max_proc
=
metfrag_max_proc
if
(
nchar
(
res
$
metfrag
$
jar
)
>
0L
)
{
check_file_absent
(
java_bin
,
"java-bin"
)
res
$
metfrag
$
java_bin
=
java_bin
...
...
This diff is collapsed.
Click to expand it.
R/errors.R
+
4
−
0
View file @
27537e48
...
...
@@ -38,6 +38,10 @@ check_extension <- function(extfileval,what) {
class
=
paste0
(
what
,
'-no-ext-found'
)))
}
check_not_integer
<-
function
(
value
,
what
)
{
if
(
!
is.integer
(
value
))
stop
(
errorCondition
(
paste0
(
"The value of `"
,
what
,
"' must be an integer."
)),
class
=
paste0
(
what
,
'-not-an-int'
))
}
check_key_absent
<-
function
(
keys
,
l
,
what
)
{
nms
=
names
(
l
)
...
...
This diff is collapsed.
Click to expand it.
man/envopts.Rd
+
9
−
1
View file @
27537e48
...
...
@@ -4,12 +4,20 @@
\alias{envopts}
\title{Create a \code{envopts} Object}
\usage{
envopts(metfrag_db_dir = "", metfrag_jar = "", java_bin = Sys.which("java"))
envopts(
metfrag_db_dir = "",
metfrag_jar = "",
java_bin = Sys.which("java"),
metfrag_max_proc = parallel::detectCores()
)
}
\arguments{
\item{metfrag_db_dir}{\code{character(1)}, a path to the directory which contains MetFrag databases}
\item{metfrag_jar}{\code{character(1)}, a path to MetFrag JAR file}
\item{metfrag_max_proc}{\code{integer(1)}, maximum number of CPU cores
available for MetFrag.}
}
\value{
An \code{envopts} object.
...
...
This diff is collapsed.
Click to expand it.
man/init.Rd
+
9
−
1
View file @
27537e48
...
...
@@ -4,12 +4,20 @@
\alias{init}
\title{Initialise Shinyscreen Configuration}
\usage{
init(metfrag_db_dir = "", metfrag_jar = "", java_bin = Sys.which("java"))
init(
metfrag_db_dir = "",
metfrag_jar = "",
java_bin = Sys.which("java"),
metfrag_max_proc = parallel::detectCores()
)
}
\arguments{
\item{metfrag_db_dir}{\code{character(1)}, a path to the directory which contains MetFrag databases}
\item{metfrag_jar}{\code{character(1)}, a path to MetFrag JAR file}
\item{metfrag_max_proc}{\code{integer(1)}, maximum number of CPU cores
available for MetFrag.}
}
\value{
Nothing.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment