Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Environmental Cheminformatics
pubchem
Commits
3da1c424
Commit
3da1c424
authored
Oct 26, 2021
by
Todor Kondic
Browse files
Merge branch 'ccsbase-integration' into 'master'
pcl: pb-lite-driver: Add new phase buildccs See merge request
!12
parents
13422631
6e43f94b
Changes
2
Hide whitespace changes
Inline
Side-by-side
pubchemlite/R/add_ccs2csv.R
View file @
3da1c424
...
...
@@ -7,37 +7,20 @@
require
(
data.table
)
require
(
assertthat
)
require
(
yaml
)
USAGE_STRING
<-
"Rscript [--vanilla] add_ccs2csv.R <
input ccs csv
> <input metfrag csv> <output metfrag csv>"
USAGE_STRING
<-
"Rscript [--vanilla] add_ccs2csv.R <
pubchemlite input file
> <input metfrag csv> <output metfrag csv>"
SEL_ADDUCTS
<-
NULL
# Change to adducts needed, if a subset of adducts
# desired. Otherwise, all shall be returned.
## Alternative way of adding arguments, read from FN_CONFIG with these
## contents.
##
## config:
## - fn_ccs: ...
## - fn_mf_csv: ...
## - fn_mf_res_csv: ...
FN_CONFIG
<-
"add_ccs2csv.yaml"
dir_start
<-
Sys.getenv
(
"STARTDIR"
)
args
<-
commandArgs
(
trailingOnly
=
T
)
if
(
length
(
args
)
==
3
)
{
fn_ccs
<-
args
[[
1
]]
fn_mf_csv
<-
args
[[
2
]]
fn_mf_res_csv
<-
args
[[
3
]]
}
else
{
x
<-
yaml
::
yaml.load_file
(
FN_CONFIG
)
fn_ccs
<-
x
$
config
$
fn_ccs
fn_mf_csv
<-
x
$
config
$
fn_mf_csv
fn_mf_res_csv
<-
x
$
config
$$
fn_mf_res_csv
}
fn_config
<-
args
[[
1
]]
if
(
!
file.exists
(
fn_config
))
stop
(
"Config file"
,
fn_config
,
" does not exist."
)
x
<-
yaml
::
yaml.load_file
(
fn_config
)
fn_ccs
<-
file.path
(
dir_start
,
x
$
ccs_src_path
)
fn_mf_csv
<-
args
[[
2
]]
fn_mf_res_csv
<-
args
[[
3
]]
message
(
"Input CCS file: "
,
fn_ccs
)
...
...
pubchemlite/pb-lite-driver.sh
View file @
3da1c424
declare
-gx
INPUTDIR
declare
-agx
ALL_STAGES
=(
"cleanup"
"prepare"
"fetch_scripts_sources"
"build"
"sanity_postbuild"
"eval4pub"
"quotes"
"epilog"
)
declare
-agx
ALL_STAGES
=(
"cleanup"
"prepare"
"fetch_scripts_sources"
"build"
"quotes"
"buildccs"
"sanity_postbuild"
"eval4pub"
"epilog"
)
declare
-a
STAGES
STAGES
=()
# Which stages should be run.
...
...
@@ -54,6 +54,10 @@ function finputdir() {
declare
-gx
OUTMFFILE
=
$(
basename
"
${
MAPFILE
%.map
}
_
$(
date
+%Y%m%d
)
.csv"
)
declare
-gx
OUTMFCLONE
=
$(
basename
"
${
MAPFILE
%.map
}
.csv"
)
# CCS filename.
declare
-gx
OUTMFCCSFILE
=
$(
basename
"
${
MAPFILE
%.map
}
_CCSBase_
$(
date
+%Y%m%d
)
.csv"
)
declare
-gx
OUTMFCCCSCLONE
=
$(
basename
"
${
MAPFILE
%.map
}
_CCSBase.csv"
)
# Does manifest exist?
[
!
-e
"
$MANIF
"
]
&&
fatal
"(pb-lite-driver.sh): Manifest file
$MANIF
not found, or unreadable."
...
...
@@ -118,6 +122,13 @@ function build() {
(
cd
"
$WORKDIR
"
;
source
"
${
SCRIPTDIR
}
/generate"
"
$FILTERFILE
"
"
$LEGENDFILE
"
)
footer BUILD
}
function
buildccs
()
{
header BUILDCCS
(
export
STARTDIR
=
"
$PWD
"
;
cd
"
$WORKDIR
"
;
Rscript
--vanilla
"
${
SCRIPTDIR
}
/R/add_ccs2csv.R"
"
$STARTDIR
/
$MANIF
"
"
$WORKDIR
/
$OUTMFFILE
"
"
$WORKDIR
/
$OUTMFCCSFILE
"
)
footer BUILDCCS
}
function
quotes
()
{
header FIX TRIPLE QUOTES IN MZ
(
cd
"WORKDIR"
;
${
SCRIPTDIR
}
/fix_mass_quotes.R
"
$WORKDIR
/
$OUTMFFILE
"
)
...
...
@@ -204,6 +215,12 @@ for stage in "${STAGES[@]}";do
"build"
)
build
;;
"quotes"
)
quotes
;;
"buildccs"
)
buildccs
;;
"sanity_postbuild"
)
header POST-BUILD CHECK
"
${
SCRIPTDIR
}
"
/sanity_postbuild
...
...
@@ -214,9 +231,6 @@ for stage in "${STAGES[@]}";do
(
cd
"
$WORKDIR
"
;
source
"
${
SCRIPTDIR
}
/eval4pub.sh"
)
footer EVAL4PUB CHECK
;;
"quotes"
)
quotes
;;
"epilog"
)
epilog
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment