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
3dd2b609
Commit
3dd2b609
authored
5 years ago
by
Todor Kondic
Browse files
Options
Downloads
Patches
Plain Diff
Extend sw.do to use parallel features
* R/run.R(sw.do): New argument. [proc] * man/sw.do.Rd: Update docs.
parent
ba39c920
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/run.R
+9
-3
9 additions, 3 deletions
R/run.R
man/sw.do.Rd
+4
-1
4 additions, 1 deletion
man/sw.do.Rd
with
13 additions
and
4 deletions
R/run.R
+
9
−
3
View file @
3dd2b609
...
...
@@ -31,16 +31,22 @@ attch<-function(...) paste(...,sep='')
##' @param rdir The root data directory.
##' @param combine If TRUE, use combineMultiplicies to merge
##' workspaces corresponding to different collisional energies.
##' @param proc Split work between this amount of processes. If FALSE
##' (or, 1), run sequential.
##' @return A named list of msmsWorkspace objects.
##' @author Todor Kondić
##' @export
sw.do
<-
function
(
fn_data
,
fn_cmpd_list
,
mode
,
rdir
=
"."
,
combine
=
F
)
{
sw.do
<-
function
(
fn_data
,
fn_cmpd_list
,
mode
,
rdir
=
"."
,
combine
=
F
,
proc
=
F
)
{
no_drama_mkdir
(
rdir
)
wdirs
<-
sapply
(
basename
(
fn_data
),
function
(
nm
)
file.path
(
rdir
,
stripext
(
nm
)))
sapply
(
wdirs
,
no_drama_mkdir
)
stgs
<-
sapply
(
basename
(
wdirs
),
function
(
nm
)
paste
(
nm
,
"yml"
,
sep
=
'.'
))
v
(
fn_data
,
stgs
,
wdirs
,
fn_cmpd_list
,
mode
,
combine
=
combine
)
cl
<-
parallel
::
makeCluster
(
proc
)
if
(
proc
)
{
p.sw
(
fn_data
,
stgs
,
wdirs
,
fn_cmpd_list
,
mode
,
combine
=
combine
,
cl
=
cl
)
}
else
{
v
(
fn_data
,
stgs
,
wdirs
,
fn_cmpd_list
,
mode
,
combine
=
combine
)
}
}
##' Creates and prepares mbWorkspace objects before the full workflow
...
...
This diff is collapsed.
Click to expand it.
man/sw.do.Rd
+
4
−
1
View file @
3dd2b609
...
...
@@ -4,7 +4,7 @@
\alias{sw.do}
\title{Perform MassBank Workflow on Multiple Compound Mixtures}
\usage{
sw.do(fn_data, fn_cmpd_list, mode, rdir = ".", combine = F)
sw.do(fn_data, fn_cmpd_list, mode, rdir = ".", combine =
F, proc =
F)
}
\arguments{
\item{fn_data}{List of mzML data filenames to be processed.}
...
...
@@ -17,6 +17,9 @@ sw.do(fn_data, fn_cmpd_list, mode, rdir = ".", combine = F)
\item{combine}{If TRUE, use combineMultiplicies to merge
workspaces corresponding to different collisional energies.}
\item{proc}{Split work between this amount of processes. If FALSE
(or, 1), run sequential.}
}
\value{
A named list of msmsWorkspace objects.
...
...
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