Mercurial > repos > lecorguille > xcms_merge
comparison xcms_merge.r @ 3:f439ed7a8f03 draft
planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 9f72e947d9c241d11221cad561f3525d27231857
author | lecorguille |
---|---|
date | Tue, 18 Sep 2018 16:09:25 -0400 |
parents | |
children | a26679f68d4d |
comparison
equal
deleted
inserted
replaced
2:3a5204f14fff | 3:f439ed7a8f03 |
---|---|
1 #!/usr/bin/env Rscript | |
2 | |
3 #Import the different functions | |
4 source_local <- function(fname){ argv <- commandArgs(trailingOnly=FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) } | |
5 source_local("lib.r") | |
6 source_local("lib-xcms3.x.x.r") | |
7 | |
8 pkgs <- c("xcms","batch") | |
9 loadAndDisplayPackages(pkgs) | |
10 cat("\n\n"); | |
11 | |
12 args <- parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects | |
13 | |
14 | |
15 cat("\tXSET MERGING...\n") | |
16 | |
17 mergeXDataReturn <- mergeXData(args) | |
18 xdata <- mergeXDataReturn$xdata | |
19 singlefile <- mergeXDataReturn$singlefile | |
20 md5sumList <- mergeXDataReturn$md5sumList | |
21 sampleNamesList <- mergeXDataReturn$sampleNamesList | |
22 chromTIC <- mergeXDataReturn$chromTIC | |
23 chromBPI <- mergeXDataReturn$chromBPI | |
24 | |
25 # Create a sampleMetada file | |
26 sampleNamesList <- getSampleMetadata(xdata=xdata, sampleMetadataOutput="sampleMetadata.tsv") | |
27 | |
28 cat("\n\n") | |
29 | |
30 cat("\tXCMSnExp OBJECT INFO\n") | |
31 print(pData(xdata)) | |
32 print(xdata) | |
33 cat("\n\n") | |
34 | |
35 cat("\txcmsSet OBJECT INFO\n") | |
36 # Get the legacy xcmsSet object | |
37 xset <- getxcmsSetObject(xdata) | |
38 print(xset@phenoData) | |
39 print(xset) | |
40 cat("\n\n") | |
41 | |
42 cat("\tSAVE RData\n") | |
43 #saving R data in .Rdata file to save the variables used in the present tool | |
44 objects2save <- c("xdata", "zipfile", "singlefile", "md5sumList", "sampleNamesList", "chromTIC", "chromBPI") | |
45 save(list=objects2save[objects2save %in% ls()], file="merged.RData") |