Unverified Commit c4752d1a authored by Todor Kondic's avatar Todor Kondic
Browse files

pcl: R/add_ccs2csv,pb-lite-driver: Update CCS adding script

parent f266b1bf
## Copyright (C) 2020 by University of Luxembourg
## Copyright (C) 2020,2021 by University of Luxembourg
## Usage:
##
......@@ -7,37 +7,17 @@
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"
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]]
x <- yaml::yaml.load_file(fn_config)
fn_ccs <- x$ccs_src_path
fn_mf_csv <- args[[2]]
fn_mf_res_csv <- args[[3]]
message("Input CCS file: ",fn_ccs)
......
......@@ -125,7 +125,7 @@ function build() {
function buildccs() {
header BUILDCCS
(cd "$WORKDIR"; Rscript --vanilla add_ccs2csv.R "$INPUTFILE" "$WORKDIR/$OUTMFCCSFILE")
(cd "$WORKDIR"; Rscript --vanilla add_ccs2csv.R "$INPUTFILE" "$WORKDIR/$OUTMFFILE" "$WORKDIR/$OUTMFCCSFILE")
footer BUILDCCS
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment