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
57760b74
Commit
57760b74
authored
5 years ago
by
Todor Kondic
Browse files
Options
Downloads
Patches
Plain Diff
Update various things
parent
33c79f2d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
R/mix.R
+19
-8
19 additions, 8 deletions
R/mix.R
R/run.R
+1
-1
1 addition, 1 deletion
R/run.R
man/presc.p.Rd
+3
-3
3 additions, 3 deletions
man/presc.p.Rd
with
23 additions
and
12 deletions
R/mix.R
+
19
−
8
View file @
57760b74
...
...
@@ -495,7 +495,7 @@ RMB_EIC_prescreen_df <- function (wd, RMB_mode, FileList, cmpd_list,
msms_found
[
n_spec
]
<-
TRUE
}
}
write.csv
(
x
=
cpd_df
,
file
=
fn_out
(
cpdID
,
".kids"
),
row.names
=
F
)
if
(
nrow
(
cpd_df
)
>
0
)
write.csv
(
x
=
cpd_df
,
file
=
fn_out
(
cpdID
,
".kids"
),
row.names
=
F
)
## title(main = cpdID, xlab = "RT (sec)", ylab = "Intensity")
## text(as.numeric(cmpd_RT_maxI[n_spec]), as.numeric(max_I_prec[n_spec]),
## labels = as.numeric(cmpd_RT_maxI_min[n_spec]), pos = 4)
...
...
@@ -516,23 +516,24 @@ RMB_EIC_prescreen_df <- function (wd, RMB_mode, FileList, cmpd_list,
##' Parallel version of presc.single.
##'
##' @title Parallel version of presc.single
##' @param cl Cluster object.
##' @param fn_data Sequence of mzML files.
##' @param fn_cmpd_l Filename of the compound list.
##' @param mode RMB mode.
##' @param cl Cluster object.
##' @param ppm_lim_fine See ReSOLUTION.
##' @param EIC_limit See ReSOLUTION.
##' @return Nothing useful.
##' @author Todor Kondić
##' @export
presc.p
<-
function
(
fn_data
,
fn_cmpd_l
,
mode
,
cl
=
NULL
,
ppm_lim_fine
=
10
,
EIC_limit
=
0.001
)
{
presc.p
<-
function
(
cl
,
fn_data
,
fn_cmpd_l
,
mode
,
ppm_lim_fine
=
10
,
EIC_limit
=
0.001
)
{
idir
<-
function
(
n
)
file.path
(
"."
,
stripext
(
n
))
wd
<-
sapply
(
fn_data
,
idir
)
stgs_alist
<-
sapply
(
wd
,
function
(
d
)
{
paste
(
d
,
".ini"
,
sep
=
''
)})
f
<-
function
(
fn_data
,
stgs_alist
,
wd
)
{
presc.single
(
fn_data
,
stgs_alist
,
wd
,
mode
,
fn_cmpd_l
,
ppm_lim_fine
=
ppm_lim_fine
,
EIC_limit
=
EIC_limit
)}
parallel
::
clusterMap
(
cl
,
f
,
fn_data
,
stgs_alist
,
wd
)
f
<-
function
(
fn_data
,
stgs_alist
,
wd
)
presc.single
(
fn_data
=
fn_data
,
stgs_alist
=
stgs_alist
,
wd
=
wd
,
mode
=
mode
,
fn_cmpd_l
=
fn_cmpd_l
,
ppm_lim_fine
=
ppm_lim_fine
,
EIC_limit
=
EIC_limit
)
parallel
::
clusterMap
(
cl
,
fun
=
f
,
fn_data
,
stgs_alist
,
wd
)
}
...
...
@@ -556,7 +557,11 @@ presc.plot <- function(wd,out="prescreen.pdf",pal="Accent") {
eic
<-
eics
[[
i
]]
maybekid
<-
maybekids
[[
i
]]
plot.new
()
dfs
<-
lapply
(
file.path
(
dfdir
,
eic
),
read.csv
,
stringsAsFactors
=
F
)
dfs
<-
lapply
(
file.path
(
dfdir
,
eic
),
function
(
fn
)
{
tryCatch
(
read.csv
(
fn
,
stringsAsFactors
=
F
),
error
=
function
(
e
)
{
message
(
paste
(
e
,
"; offending file:"
,
fn
))})
})
## Find max intensity for the first in the group.
...
...
@@ -583,7 +588,13 @@ presc.plot <- function(wd,out="prescreen.pdf",pal="Accent") {
maybes
<-
file.path
(
dfdir
,
maybekid
)
indkids
<-
which
(
file.exists
(
maybes
))
kids
<-
maybes
[
indkids
]
dfs
<-
lapply
(
kids
,
read.csv
,
stringsAsFactors
=
F
)
dfs
<-
lapply
(
kids
,
function
(
fn
)
{
tryCatch
(
read.csv
(
fn
,
stringsAsFactors
=
F
),
error
=
function
(
e
)
{
message
(
paste
(
e
,
"; offending file:"
,
fn
))
return
(
NA
)},
finally
=
{
return
(
NA
)})
})
dfs
<-
dfs
[
!
is.na
(
dfs
)]
for
(
df
in
dfs
)
{
lines
(
intensity
~
retentionTime
,
data
=
df
,
type
=
"h"
,
col
=
"blue"
)
}
...
...
This diff is collapsed.
Click to expand it.
R/run.R
+
1
−
1
View file @
57760b74
...
...
@@ -24,7 +24,7 @@ presc.do<-function(fn_data,fn_cmpd_list,mode,proc=F) {
if
(
proc
)
{
cl
<-
parallel
::
makeCluster
(
proc
)
presc.p
(
fn_data
,
fn_cmpd_l
=
fn_cmpd_list
,
mode
=
mode
,
cl
=
cl
)
presc.p
(
cl
=
cl
,
fn_data
,
fn_cmpd_l
=
fn_cmpd_list
,
mode
=
mode
)
}
else
{
presc.v
(
fn_data
,
fn_cmpd_l
=
fn_cmpd_list
,
mode
)
}
...
...
This diff is collapsed.
Click to expand it.
man/presc.p.Rd
+
3
−
3
View file @
57760b74
...
...
@@ -4,18 +4,18 @@
\alias{presc.p}
\title{Parallel version of presc.single}
\usage{
presc.p(fn_data, fn_cmpd_l, mode,
cl = NULL,
ppm_lim_fine = 10,
presc.p(
cl,
fn_data, fn_cmpd_l, mode, ppm_lim_fine = 10,
EIC_limit = 0.001)
}
\arguments{
\item{cl}{Cluster object.}
\item{fn_data}{Sequence of mzML files.}
\item{fn_cmpd_l}{Filename of the compound list.}
\item{mode}{RMB mode.}
\item{cl}{Cluster object.}
\item{ppm_lim_fine}{See ReSOLUTION.}
\item{EIC_limit}{See ReSOLUTION.}
...
...
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