Mercurial > repos > recetox > isolib
comparison isolib.R @ 2:b3251a7dae25 draft
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/isolib commit b9574494a6f9d2239dc81899e6d4074b33b078b7
| author | recetox |
|---|---|
| date | Wed, 24 Apr 2024 14:51:32 +0000 |
| parents | 8a1893635ac0 |
| children | 6b0fef8a77c0 |
comparison
equal
deleted
inserted
replaced
| 1:7a4540275084 | 2:b3251a7dae25 |
|---|---|
| 1 library(enviPat) | 1 library(enviPat) |
| 2 library(Spectra) | 2 library(Spectra) |
| 3 library(MsBackendMsp) | 3 library(MsBackendMsp) |
| 4 library(MetaboCoreUtils) | 4 library(MetaboCoreUtils) |
| 5 library(readr) | |
| 5 | 6 |
| 6 #' @param args A list of command line arguments. | 7 #' @param args A list of command line arguments. |
| 7 main <- function() { | 8 main <- function() { |
| 8 data(isotopes) | 9 data(isotopes) |
| 9 data(adducts) | 10 data(adducts) |
| 10 | 11 |
| 11 args <- commandArgs(trailingOnly = TRUE) | 12 args <- commandArgs(trailingOnly = TRUE) |
| 12 compound_table <- read.delim(args[1], stringsAsFactors = FALSE) | 13 compound_table <- read_tsv( |
| 14 file = args[1], | |
| 15 col_types = "ccd", | |
| 16 col_select = tidyselect::all_of(c("name", "formula")) | tidyselect::any_of("rt") | |
| 17 ) | |
| 13 adducts_to_use <- c(unlist(strsplit(args[2], ",", fixed = TRUE))) | 18 adducts_to_use <- c(unlist(strsplit(args[2], ",", fixed = TRUE))) |
| 14 | 19 |
| 15 chemforms <- compound_table$formula | 20 chemforms <- compound_table$formula |
| 16 chemforms <- check_chemform(isotopes, chemforms)[, 2] | 21 chemforms <- check_chemform(isotopes, chemforms)[, 2] |
| 17 | 22 |
