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
f1a30085
Commit
f1a30085
authored
5 years ago
by
Todor Kondic
Browse files
Options
Downloads
Patches
Plain Diff
...
parent
b97e2d51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/mix.R
+0
-23
0 additions, 23 deletions
R/mix.R
R/run.R
+14
-8
14 additions, 8 deletions
R/run.R
with
14 additions
and
31 deletions
R/mix.R
+
0
−
23
View file @
f1a30085
...
...
@@ -265,29 +265,6 @@ presc.single <- function(fn_data,stgs_alist,wd,mode,fn_cmpd_l,ppm_lim_fine=10,EI
}
##' Performs a single MassBank workflow after preparation.
##'
##' @title Single MassBank workflow.
##' @param mb A mbWorkspace object.
##' @param infodir Directory containing the infolist.
##' @param fn_stgs The settings associated with the mbWorkspace
##' object.
##' @return A mbWorkflow object.
##' @author Todor Kondić
mb.single
<-
function
(
mb
,
infodir
,
fn_stgs
)
{
RMassBank
::
loadRmbSettings
(
fn_stgs
)
mb
<-
RMassBank
::
resetInfolists
(
mb
)
mb
<-
RMassBank
::
loadInfolists
(
mb
,
infodir
)
## loadInfolists
## addPeaks
prevd
<-
setwd
(
infodir
)
res
<-
RMassBank
::
mbWorkflow
(
mb
,
step
=
1
:
8
)
setwd
(
prevd
)
res
}
##' Vectorises presc.single.
##'
##' @title Vectorises presc.single
...
...
This diff is collapsed.
Click to expand it.
R/run.R
+
14
−
8
View file @
f1a30085
...
...
@@ -106,6 +106,7 @@ sw.do <- function(fn_data, fn_cmpd_l, mode, dest=".", combine=F,
}
w
<-
fwork
(
w
,
wd
,
steps
=
(
split
+1
)
:
8
)
names
(
w
)
<-
wd
w
}
##' Creates and prepares mbWorkspace objects before the full workflow
...
...
@@ -142,22 +143,27 @@ mb.prep<-function(w) {
##'
##' @title Perform the Mass Bank workflow
##' @param mb The list of prepared mbWorkspace objects.
##' @param rdir Root data dir.
##' @param proc Split work between this amount of processes. If FALSE
##' (or, 1), run sequential.
##' @return The named list of processed mbWorkspace objects.
##' @author Todor Kondić
##' @export
mb.do
<-
function
(
mb
,
rdir
=
"."
,
proc
=
F
)
{
idir
<-
function
(
n
)
file.path
(
rdir
,
stripext
(
n
))
infodir
<-
sapply
(
names
(
mb
),
function
(
n
)
file.path
(
idir
(
n
),
"info"
))
fn_stgs
<-
sapply
(
names
(
mb
),
function
(
n
)
file.path
(
idir
(
n
),
attch
(
n
,
'.ini'
)))
mb.do
<-
function
(
mb
,
proc
=
F
)
{
wd
<-
names
(
mb
)
infodir
<-
get_info_dir
(
wd
)
fwork
<-
Vectorize
(
function
(
mb
,
id
,
wd
)
{
reconf
(
wd
)
mb
<-
RMassBank
::
resetInfolists
(
mb
)
mb
<-
RMassBank
::
loadInfolists
(
mb
,
id
)
dcur
<-
setwd
(
id
)
mb
<-
RMassBank
::
mbWorkflow
(
mb
,
step
=
1
:
8
)
setwd
(
dcur
)
mb
},
vectorize.args
=
c
(
"mb"
,
"id"
,
"wd"
))
if
(
proc
)
{
cl
<-
parallel
::
makeCluster
(
proc
)
parallel
::
clusterEvalQ
(
cl
,
library
(
"rmbmix"
))
mb.p
(
mb
,
infodir
,
fn
<-
stgs
,
cl
=
cl
)
parallel
::
clusterMap
(
cl
,
fwork
,
mb
,
infodir
,
wd
)
}
else
{
mb.v
(
mb
,
infodir
,
fn_stgs
)
fwork
(
mb
,
infodir
,
wd
)
}
}
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