# HG changeset patch
# User lecorguille
# Date 1490712715 14400
# Node ID ddce949e4b35e99010a1265f50ee680ccca94044
# Parent d67f7aa847bfc026826fe4627a06ed293457df4e
planemo upload commit d708b85fc764e790fac071552d19cd7a89d02d31
diff -r d67f7aa847bf -r ddce949e4b35 CAMERA.r
--- a/CAMERA.r Mon Feb 13 11:19:39 2017 -0500
+++ b/CAMERA.r Tue Mar 28 10:51:55 2017 -0400
@@ -98,64 +98,13 @@
#Import the different functions
source_local("lib.r")
-#necessary to unzip .zip file uploaded to Galaxy
-#thanks to .zip file it's possible to upload many file as the same time conserving the tree hierarchy of directories
-
-if (!is.null(listArguments[["zipfile"]])){
- zipfile= listArguments[["zipfile"]]; listArguments[["zipfile"]]=NULL
-}
-
-if (!is.null(listArguments[["singlefile_galaxyPath"]])){
- singlefile_galaxyPaths = unlist(strsplit(listArguments[["singlefile_galaxyPath"]],",")); listArguments[["singlefile_galaxyPath"]]=NULL
- singlefile_sampleNames = unlist(strsplit(listArguments[["singlefile_sampleName"]],",")); listArguments[["singlefile_sampleName"]]=NULL
-
- singlefile=NULL
- for (singlefile_galaxyPath_i in seq(1:length(singlefile_galaxyPaths))) {
- singlefile_galaxyPath=singlefile_galaxyPaths[singlefile_galaxyPath_i]
- singlefile_sampleName=singlefile_sampleNames[singlefile_galaxyPath_i]
- singlefile[[singlefile_sampleName]] = singlefile_galaxyPath
- }
-}
-
# We unzip automatically the chromatograms from the zip files.
if (thefunction %in% c("annotatediff")) {
- if(exists("singlefile") && (length("singlefile")>0)) {
- for (singlefile_sampleName in names(singlefile)) {
- singlefile_galaxyPath = singlefile[[singlefile_sampleName]]
- if(!file.exists(singlefile_galaxyPath)){
- error_message=paste("Cannot access the sample:",singlefile_sampleName,"located:",singlefile_galaxyPath,". Please, contact your administrator ... if you have one!")
- print(error_message); stop(error_message)
- }
-
- file.symlink(singlefile_galaxyPath,singlefile_sampleName)
- }
- directory = "."
-
-
- }
- if(exists("zipfile") && (zipfile!="")) {
- if(!file.exists(zipfile)){
- error_message=paste("Cannot access the Zip file:",zipfile,". Please, contact your administrator ... if you have one!")
- print(error_message)
- stop(error_message)
- }
-
- #list all file in the zip file
- #zip_files=unzip(zipfile,list=T)[,"Name"]
-
- #unzip
- suppressWarnings(unzip(zipfile, unzip="unzip"))
-
- #get the directory name
- filesInZip=unzip(zipfile, list=T);
- directories=unique(unlist(lapply(strsplit(filesInZip$Name,"/"), function(x) x[1])));
- directories=directories[!(directories %in% c("__MACOSX")) & file.info(directories)$isdir]
- directory = "."
- if (length(directories) == 1) directory = directories
-
- cat("files_root_directory\t",directory,"\n")
-
- }
+ rawFilePath = getRawfilePathFromArguments(listArguments)
+ zipfile = rawFilePath$zipfile
+ singlefile = rawFilePath$singlefile
+ listArguments = rawFilePath$listArguments
+ directory = retrieveRawfileInTheWorkingDirectory(singlefile, zipfile)
}
diff -r d67f7aa847bf -r ddce949e4b35 abims_CAMERA_combinexsAnnos.xml
--- a/abims_CAMERA_combinexsAnnos.xml Mon Feb 13 11:19:39 2017 -0500
+++ b/abims_CAMERA_combinexsAnnos.xml Tue Mar 28 10:51:55 2017 -0400
@@ -54,10 +54,7 @@
-
-
-
-
+
diff -r d67f7aa847bf -r ddce949e4b35 lib.r
--- a/lib.r Mon Feb 13 11:19:39 2017 -0500
+++ b/lib.r Tue Mar 28 10:51:55 2017 -0400
@@ -223,3 +223,84 @@
return(variableMetadata);
}
+
+# This function get the raw file path from the arguments
+getRawfilePathFromArguments <- function(listArguments) {
+ zipfile = NULL
+ singlefile = NULL
+ if (!is.null(listArguments[["zipfile"]])) zipfile = listArguments[["zipfile"]]
+ if (!is.null(listArguments[["zipfilePositive"]])) zipfile = listArguments[["zipfilePositive"]]
+ if (!is.null(listArguments[["zipfileNegative"]])) zipfile = listArguments[["zipfileNegative"]]
+
+ if (!is.null(listArguments[["singlefile_galaxyPath"]])) {
+ singlefile_galaxyPaths = listArguments[["singlefile_galaxyPath"]];
+ singlefile_sampleNames = listArguments[["singlefile_sampleName"]]
+ }
+ if (!is.null(listArguments[["singlefile_galaxyPathPositive"]])) {
+ singlefile_galaxyPaths = listArguments[["singlefile_galaxyPathPositive"]];
+ singlefile_sampleNames = listArguments[["singlefile_sampleNamePositive"]]
+ }
+ if (!is.null(listArguments[["singlefile_galaxyPathNegative"]])) {
+ singlefile_galaxyPaths = listArguments[["singlefile_galaxyPathNegative"]];
+ singlefile_sampleNames = listArguments[["singlefile_sampleNameNegative"]]
+ }
+ if (exists("singlefile_galaxyPaths")){
+ singlefile_galaxyPaths = unlist(strsplit(singlefile_galaxyPaths,","))
+ singlefile_sampleNames = unlist(strsplit(singlefile_sampleNames,","))
+
+ singlefile=NULL
+ for (singlefile_galaxyPath_i in seq(1:length(singlefile_galaxyPaths))) {
+ singlefile_galaxyPath=singlefile_galaxyPaths[singlefile_galaxyPath_i]
+ singlefile_sampleName=singlefile_sampleNames[singlefile_galaxyPath_i]
+ singlefile[[singlefile_sampleName]] = singlefile_galaxyPath
+ }
+ }
+ for (argument in c("zipfile","zipfilePositive","zipfileNegative","singlefile_galaxyPath","singlefile_sampleName","singlefile_galaxyPathPositive","singlefile_sampleNamePositive","singlefile_galaxyPathNegative","singlefile_sampleNameNegative")) {
+ listArguments[[argument]]=NULL
+ }
+ return(list(zipfile=zipfile, singlefile=singlefile, listArguments=listArguments))
+}
+
+
+# This function retrieve the raw file in the working directory
+# - if zipfile: unzip the file with its directory tree
+# - if singlefiles: set symlink with the good filename
+retrieveRawfileInTheWorkingDirectory <- function(singlefile, zipfile) {
+ if(!is.null(singlefile) && (length("singlefile")>0)) {
+ for (singlefile_sampleName in names(singlefile)) {
+ singlefile_galaxyPath = singlefile[[singlefile_sampleName]]
+ if(!file.exists(singlefile_galaxyPath)){
+ error_message=paste("Cannot access the sample:",singlefile_sampleName,"located:",singlefile_galaxyPath,". Please, contact your administrator ... if you have one!")
+ print(error_message); stop(error_message)
+ }
+
+ file.symlink(singlefile_galaxyPath,singlefile_sampleName)
+ }
+ directory = "."
+
+ }
+ if(!is.null(zipfile) && (zipfile!="")) {
+ if(!file.exists(zipfile)){
+ error_message=paste("Cannot access the Zip file:",zipfile,". Please, contact your administrator ... if you have one!")
+ print(error_message)
+ stop(error_message)
+ }
+
+ #list all file in the zip file
+ #zip_files=unzip(zipfile,list=T)[,"Name"]
+
+ #unzip
+ suppressWarnings(unzip(zipfile, unzip="unzip"))
+
+ #get the directory name
+ filesInZip=unzip(zipfile, list=T);
+ directories=unique(unlist(lapply(strsplit(filesInZip$Name,"/"), function(x) x[1])));
+ directories=directories[!(directories %in% c("__MACOSX")) & file.info(directories)$isdir]
+ directory = "."
+ if (length(directories) == 1) directory = directories
+
+ cat("files_root_directory\t",directory,"\n")
+
+ }
+ return (directory)
+}
diff -r d67f7aa847bf -r ddce949e4b35 macros.xml
--- a/macros.xml Mon Feb 13 11:19:39 2017 -0500
+++ b/macros.xml Tue Mar 28 10:51:55 2017 -0400
@@ -2,12 +2,11 @@
- r-snow
+ r-snow
bioconductor-camera
bioconductor-multtest
- r-batch
- libpng
- graphicsmagick
+ r-batch
+ graphicsmagick
@@ -20,61 +19,124 @@
LANG=C Rscript $__tool_directory__/CAMERA.r
-
+
- #if $file_load_conditional.file_load_select == "yes":
- #if $file_load_conditional.inputs.input == "zip_file":
- zipfile '$file_load_conditional.inputs.zip_file'
+ #if $file_load_section.file_load_conditional.file_load_select == "yes":
+ #if $file_load_section.file_load_conditional.input[0].is_of_type("mzxml") or $file_load_section.file_load_conditional.input[0].is_of_type("mzml") or $file_load_section.file_load_conditional.input[0].is_of_type("mzdata") or $file_load_section.file_load_conditional.input[0].is_of_type("netcdf"):
+ #set singlefile_galaxyPath = ','.join( [ str( $single_file ) for $single_file in $file_load_section.file_load_conditional.input ] )
+ #set singlefile_sampleName = ','.join( [ str( $single_file.name ) for $single_file in $file_load_section.file_load_conditional.input ] )
+ singlefile_galaxyPath '$singlefile_galaxyPath' singlefile_sampleName '$singlefile_sampleName'
#else
- #set singlefile_galaxyPath = ','.join( [ str( $single_file ) for $single_file in $file_load_conditional.inputs.single_file ] )
- #set singlefile_sampleName = ','.join( [ str( $single_file.name ) for $single_file in $file_load_conditional.inputs.single_file ] )
-
- singlefile_galaxyPath '$singlefile_galaxyPath' singlefile_sampleName '$singlefile_sampleName'
+ zipfile '$file_load_section.file_load_conditional.input'
#end if
#end if
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- convertRTMinute $convertRTMinute
- numDigitsMZ $numDigitsMZ
- numDigitsRT $numDigitsRT
- intval $intval
+ convertRTMinute $export.convertRTMinute
+ numDigitsMZ $export.numDigitsMZ
+ numDigitsRT $export.numDigitsRT
+ intval $export.intval
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+