Repository 'xcms_group'
hg clone https://toolshed.g2.bx.psu.edu/repos/lecorguille/xcms_group

Changeset 26:0d05d0458376 (2020-07-21)
Previous changeset 25:a066b8581b97 (2020-04-28) Next changeset 27:d45a786cbc40 (2021-04-07)
Commit message:
"planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 0dcc8bcb1e645574c7f81ec1a43f86be38acd065"
modified:
abims_xcms_group.xml
lib.r
b
diff -r a066b8581b97 -r 0d05d0458376 abims_xcms_group.xml
--- a/abims_xcms_group.xml Tue Apr 28 09:34:27 2020 -0400
+++ b/abims_xcms_group.xml Tue Jul 21 09:17:27 2020 -0400
b
@@ -1,4 +1,4 @@
-<tool id="abims_xcms_group" name="xcms groupChromPeaks (group)" version="@TOOL_VERSION@+galaxy1">
+<tool id="abims_xcms_group" name="xcms groupChromPeaks (group)" version="@TOOL_VERSION@+galaxy2">
 
     <description>Perform the correspondence, the grouping of chromatographic peaks within and between samples.</description>
 
b
diff -r a066b8581b97 -r 0d05d0458376 lib.r
--- a/lib.r Tue Apr 28 09:34:27 2020 -0400
+++ b/lib.r Tue Jul 21 09:17:27 2020 -0400
[
@@ -149,7 +149,11 @@
 
     par(mfrow = c(3, 1), mar = c(4, 4, 1, 0.5))
 
-    group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1")
+    if(length(unique(xdata$sample_group))<10){
+        group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1")
+    }else{
+        group_colors <- hcl.colors(length(unique(xdata$sample_group)), palette="Dark 3")
+    }
     names(group_colors) <- unique(xdata$sample_group)
     col_per_samp <- as.character(xdata$sample_group)
     for(i in 1:length(group_colors)){col_per_samp[col_per_samp==(names(group_colors)[i])]<-group_colors[i]}
@@ -172,7 +176,11 @@
     pdf(file="raw_vs_adjusted_rt.pdf", width=16, height=12)
 
     # Color by group
-    group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1")
+    if(length(unique(xdata$sample_group))<10){
+        group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1")
+    }else{
+        group_colors <- hcl.colors(length(unique(xdata$sample_group)), palette="Dark 3")
+    }
     if (length(group_colors) > 1) {
         names(group_colors) <- unique(xdata$sample_group)
         plotAdjustedRtime(xdata, col = group_colors[xdata$sample_group])
@@ -241,7 +249,11 @@
     pdf(pdfname, width=16, height=10)
 
     # Color by group
-    group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1")
+    if(length(unique(xdata$sample_group))<10){
+        group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1")
+    }else{
+        group_colors <- hcl.colors(length(unique(xdata$sample_group)), palette="Dark 3")
+    }
     if (length(group_colors) > 1) {
         names(group_colors) <- unique(xdata$sample_group)
         plot(chrom, col = group_colors[as.factor(chrom$sample_group)], main=main, peakType = "none")