Mercurial > repos > lecorguille > xcms_plot_chromatogram
comparison xcms_plot_chromatogram.r @ 16:9291271ec4d9 draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/ commit 95721ced8347c09e79340e6d67ecb41c5cc64163
author | workflow4metabolomics |
---|---|
date | Mon, 03 Feb 2025 14:46:19 +0000 |
parents | 8846a03995d3 |
children |
comparison
equal
deleted
inserted
replaced
15:c8bef8f6a1cb | 16:9291271ec4d9 |
---|---|
2 | 2 |
3 | 3 |
4 # ----- PACKAGE ----- | 4 # ----- PACKAGE ----- |
5 cat("\tSESSION INFO\n") | 5 cat("\tSESSION INFO\n") |
6 | 6 |
7 #Import the different functions | 7 # Import the different functions |
8 source_local <- function(fname) { | 8 source_local <- function(fname) { |
9 argv <- commandArgs(trailingOnly = FALSE) | 9 argv <- commandArgs(trailingOnly = FALSE) |
10 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) | 10 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) |
11 source(paste(base_dir, fname, sep = "/")) | 11 source(paste(base_dir, fname, sep = "/")) |
12 } | 12 } |
13 source_local("lib.r") | 13 source_local("lib.r") |
14 | 14 |
15 pkgs <- c("xcms", "batch", "RColorBrewer") | 15 pkgs <- c("xcms", "batch", "RColorBrewer") |
16 loadAndDisplayPackages(pkgs) | 16 loadAndDisplayPackages(pkgs) |
17 cat("\n\n") | 17 cat("\n\n") |
18 | 18 |
19 | 19 |
20 # ----- ARGUMENTS ----- | 20 # ----- ARGUMENTS ----- |
21 cat("\tARGUMENTS INFO\n") | 21 cat("\tARGUMENTS INFO\n") |
22 args <- parseCommandArgs(evaluate = FALSE) #interpretation of arguments given in command line as an R list of objects | 22 args <- parseCommandArgs(evaluate = FALSE) # interpretation of arguments given in command line as an R list of objects |
23 write.table(as.matrix(args), col.names = FALSE, quote = FALSE, sep = "\t") | 23 write.table(as.matrix(args), col.names = FALSE, quote = FALSE, sep = "\t") |
24 | 24 |
25 cat("\n\n") | 25 cat("\n\n") |
26 | 26 |
27 # ----- PROCESSING INFILE ----- | 27 # ----- PROCESSING INFILE ----- |
52 | 52 |
53 cat("\t\tDRAW GRAPHICS\n") | 53 cat("\t\tDRAW GRAPHICS\n") |
54 | 54 |
55 register(SerialParam()) | 55 register(SerialParam()) |
56 if (!exists("chromTIC") || is.null(chromTIC)) { | 56 if (!exists("chromTIC") || is.null(chromTIC)) { |
57 cat("\t\t\tCompute TIC\n") | 57 cat("\t\t\tCompute TIC\n") |
58 chromTIC <- chromatogram(xdata, aggregationFun = "sum") | 58 chromTIC <- chromatogram(xdata, aggregationFun = "sum") |
59 } | 59 } |
60 if (!exists("chromBPI") || is.null(chromBPI)) { | 60 if (!exists("chromBPI") || is.null(chromBPI)) { |
61 cat("\t\t\tCompute BPI\n") | 61 cat("\t\t\tCompute BPI\n") |
62 chromBPI <- chromatogram(xdata, aggregationFun = "max") | 62 chromBPI <- chromatogram(xdata, aggregationFun = "max") |
63 } | 63 } |
64 | 64 |
65 if (!is.null(chromTIC_adjusted)) chromTIC <- chromTIC_adjusted | 65 if (!is.null(chromTIC_adjusted)) chromTIC <- chromTIC_adjusted |
66 if (!is.null(chromBPI_adjusted)) chromBPI <- chromBPI_adjusted | 66 if (!is.null(chromBPI_adjusted)) chromBPI <- chromBPI_adjusted |
67 | 67 |