Mercurial > repos > workflow4metabolomics > w4mconcatenate
comparison concatenation_wrapper.R @ 0:c577f13705f2 draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics commit eba1150dad55ad9eca5e93358d9f75e6b6dba2ec
| author | workflow4metabolomics |
|---|---|
| date | Wed, 10 Jul 2024 15:20:11 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:c577f13705f2 |
|---|---|
| 1 rm(list = ls()) | |
| 2 #Chargement des library et des ressources | |
| 3 | |
| 4 library("W4MRUtils") | |
| 5 library(dplyr) | |
| 6 | |
| 7 | |
| 8 source_local("concatenation.R") | |
| 9 source_local("fonctions_auxiliaires.R") | |
| 10 | |
| 11 | |
| 12 para <- W4MRUtils::parse_args(args = commandArgs()) | |
| 13 | |
| 14 | |
| 15 cat("\nJob starting time:\n", format(Sys.time(), "%a %d %b %Y %X"), | |
| 16 "\n\n--------------------------------------------------------------------", | |
| 17 "\nParameters used by the 'W4M concatenate' tool:\n\n") | |
| 18 print(para) | |
| 19 cat("--------------------------------------------------------------------\n\n") | |
| 20 | |
| 21 | |
| 22 #Lancement de l'outil | |
| 23 | |
| 24 A <- W4MRUtils::import2(para$dataMatrix_1, para$metadata_1, para$type, disable_comm = FALSE) | |
| 25 B <- W4MRUtils::import2(para$dataMatrix_2, para$metadata_2, para$type, disable_comm = FALSE) | |
| 26 | |
| 27 DM1 <- A$dataMatrix | |
| 28 M1 <- A$metadata | |
| 29 | |
| 30 DM2 <- B$dataMatrix | |
| 31 M2 <- B$metadata | |
| 32 | |
| 33 | |
| 34 result_tables <- concat(DM1, M1, DM2, M2, para$type, para$tab1, para$tab2, para$concatenation, para$choice_keep, para$keep) | |
| 35 | |
| 36 write.table(result_tables[[1]], file = para$metadata_out, sep = "\t", row.names = FALSE, quote = FALSE) | |
| 37 write.table(result_tables[[2]], file = para$dataMatrix_1_out, sep = "\t", row.names = FALSE, quote = FALSE) | |
| 38 write.table(result_tables[[3]], file = para$dataMatrix_2_out, sep = "\t", row.names = FALSE, quote = FALSE) | |
| 39 | |
| 40 cat("\n--------------------------------------------------------------------", | |
| 41 "\nInformation about R (version, Operating System, attached or loaded packages):\n\n") | |
| 42 sessionInfo() | |
| 43 cat("--------------------------------------------------------------------\n", | |
| 44 "\nJob ending time:\n", format(Sys.time(), "%a %d %b %Y %X")) |
