changeset 6:207e36770d18 draft

" master branch Updating"
author lain
date Wed, 20 Jan 2021 17:47:51 +0000
parents 4d50e9324082
children 5be8a770a11d
files README.md XSeekerPreparator.R XSeekerPreparator.xml data/SERUM_v2019Jan17.tabular galaxy/tools/LC-MSMS/XSeekerPreparator.R galaxy/tools/LC-MSMS/XSeekerPreparator.xml
diffstat 6 files changed, 50 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/README.md	Wed Jan 20 09:17:48 2021 +0000
+++ b/README.md	Wed Jan 20 17:47:51 2021 +0000
@@ -37,7 +37,6 @@
 REQUIREMENT
 =====
 
- - R-4.0.0
  - optparse
  - xcms
  - blob
@@ -97,7 +96,7 @@
 --------
 
  - **@name**: XSeekerPreparator
- - **@version**: 1.1.2
+ - **@version**: 1.1.3
  - **@authors**: Lain Pavot
  - **@date creation**: 15/09/2020
 
@@ -105,7 +104,6 @@
 -----
 Developed and tested using:
 
- - R 4.0.0
  - optparse 1.6.6
  - xcms 3.10.2
  - blob 1.2.1
--- a/XSeekerPreparator.R	Wed Jan 20 09:17:48 2021 +0000
+++ b/XSeekerPreparator.R	Wed Jan 20 17:47:51 2021 +0000
@@ -1,7 +1,7 @@
 
 
 TOOL_NAME <- "XSeekerPreparator"
-VERSION <- "1.1.2"
+VERSION <- "1.1.3"
 
 OUTPUT_SPECIFIC_TOOL <- "XSeeker_Galaxy"
 
@@ -551,12 +551,24 @@
 }
 
 find_grouping_var <- function(var_meta) {
-    for (grouping_var in c(".", "Bio")) {
-        if (!is.null(rdata$variableMetadata[[grouping_var]])) {
-            return (grouping_var)
+    known_colnames = c(
+        "name", "namecustom", "mz", "mzmin", "mzmax",
+        "rt", "rtmin", "rtmax", "npeaks", "isotopes", "adduct", "pcgroup"
+    )
+    col_names <- colnames(var_meta)
+    classes = list()
+    for (name in col_names) {
+        if (!(name %in% known_colnames)) {
+            classes[[length(classes)+1]] = name
         }
     }
-    return (NULL)
+    if (length(classes) > 1) {
+        stop(sprintf("Only one class expected in the variable metadata. Found %d .", length(classes)))
+    }
+    if (length(classes) === 0) {
+        stop("Could not find any class column in your variableMetadata.")
+    }
+    return (classes[[1]])
 }
 
 add_sample_to_database <- function(orm, env, context, smol_xcms_set) {
--- a/XSeekerPreparator.xml	Wed Jan 20 09:17:48 2021 +0000
+++ b/XSeekerPreparator.xml	Wed Jan 20 17:47:51 2021 +0000
@@ -1,6 +1,6 @@
 <tool id="xseeker_preparator"
       name="XSeeker Preparator"
-      version="1.1.2"
+      version="1.1.3"
 >
     <description>Prepare RData file from CAMERA to be visualized in XSeeker</description>
     
@@ -13,7 +13,6 @@
         <requirement type="package" version="3.12.0">bioconductor-xcms</requirement>
         <requirement type="package">bioconductor-camera</requirement>
         <requirement type="package" version="2.29.2">git</requirement> 
-        <requirement type="package" version="4.0">R</requirement>
         <requirement type="package" version="1.2.1">r-blob</requirement>
         <requirement type="package" version="1.1.0">r-dbi</requirement>
         <requirement type="package" version="0.9.4">r-fst</requirement>
--- a/data/SERUM_v2019Jan17.tabular	Wed Jan 20 09:17:48 2021 +0000
+++ b/data/SERUM_v2019Jan17.tabular	Wed Jan 20 17:47:51 2021 +0000
@@ -251,3 +251,16 @@
 HMDB0000474	72.057514878	73.064791278	71.050238478	Butanone	C4H8O	ZWEHNKRNPOVVGH-UHFFFAOYSA-N
 HMDB0000479	169.085126611	170.092403011	168.077850211	3-Methylhistidine	C7H11N3O2	JDHILDINMRGULE-LURJTMIESA-N
 HMDB0000481	268.080769514	269.088045914	267.073493114	"Allopurinol riboside"	C10H12N4O5	KFQUAMTWOJHPEJ-DAGMQNCNSA-N
+	161.1051934	162.11247		L-Carnitine	C7H15NO3	
+	203.1157534	204.12303		Acylcarnitine-C2	C9H17NO4	
+	217.1314034	218.13868		Acylcarnitine-C3	C10H19NO4	
+	231.1470534	232.15433		Acylcarnitine-C4	C11H21NO4	
+	245.1627034	246.16998		Acylcarnitine-C5	C12H23NO4	
+	259.1783534	260.18563		Acylcarnitine-C6	C13H25NO4	
+	287.2096534	288.21693		Acylcarnitine-C8	C15H29NO4	
+	315.2409634	316.24824		Acylcarnitine-C10	C17H33NO4	
+	343.2722634	344.27954		Acylcarnitine-C12	C19H37NO4	
+	371.3035634	372.31084		Acylcarnitine-C14	C21H41NO4	
+	399.3348634	400.34214		hexadecanoylcarnitine C16:0	C23H45NO4	
+	427.3661634	428.37344		Stearoylcarnitine	C25H49NO4	
+	444.3689034	445.37618		3-HydroxyStearoyl-L-carnitine	C25H50NO5	
--- a/galaxy/tools/LC-MSMS/XSeekerPreparator.R	Wed Jan 20 09:17:48 2021 +0000
+++ b/galaxy/tools/LC-MSMS/XSeekerPreparator.R	Wed Jan 20 17:47:51 2021 +0000
@@ -1,7 +1,7 @@
 
 
 TOOL_NAME <- "XSeekerPreparator"
-VERSION <- "1.1.2"
+VERSION <- "1.1.3"
 
 OUTPUT_SPECIFIC_TOOL <- "XSeeker_Galaxy"
 
@@ -551,12 +551,24 @@
 }
 
 find_grouping_var <- function(var_meta) {
-    for (grouping_var in c(".", "Bio")) {
-        if (!is.null(rdata$variableMetadata[[grouping_var]])) {
-            return (grouping_var)
+    known_colnames = c(
+        "name", "namecustom", "mz", "mzmin", "mzmax",
+        "rt", "rtmin", "rtmax", "npeaks", "isotopes", "adduct", "pcgroup"
+    )
+    col_names <- colnames(var_meta)
+    classes = list()
+    for (name in col_names) {
+        if (!(name %in% known_colnames)) {
+            classes[[length(classes)+1]] = name
         }
     }
-    return (NULL)
+    if (length(classes) > 1) {
+        stop(sprintf("Only one class expected in the variable metadata. Found %d .", length(classes)))
+    }
+    if (length(classes) === 0) {
+        stop("Could not find any class column in your variableMetadata.")
+    }
+    return (classes[[1]])
 }
 
 add_sample_to_database <- function(orm, env, context, smol_xcms_set) {
--- a/galaxy/tools/LC-MSMS/XSeekerPreparator.xml	Wed Jan 20 09:17:48 2021 +0000
+++ b/galaxy/tools/LC-MSMS/XSeekerPreparator.xml	Wed Jan 20 17:47:51 2021 +0000
@@ -1,6 +1,6 @@
 <tool id="xseeker_preparator"
       name="XSeeker Preparator"
-      version="1.1.2"
+      version="1.1.3"
 >
     <description>Prepare RData file from CAMERA to be visualized in XSeeker</description>
     
@@ -13,7 +13,6 @@
         <requirement type="package" version="3.12.0">bioconductor-xcms</requirement>
         <requirement type="package">bioconductor-camera</requirement>
         <requirement type="package" version="2.29.2">git</requirement> 
-        <requirement type="package" version="4.0">R</requirement>
         <requirement type="package" version="1.2.1">r-blob</requirement>
         <requirement type="package" version="1.1.0">r-dbi</requirement>
         <requirement type="package" version="0.9.4">r-fst</requirement>