Mercurial > repos > lecorguille > ipo
changeset 1:508ab373b524 draft
planemo upload commit 2c68962f28b58980db71ac15b6a3e75bbcf7885b-dirty
| author | lecorguille |
|---|---|
| date | Mon, 25 Jul 2016 09:49:16 -0400 |
| parents | b2032600d98f |
| children | 27319c399f07 |
| files | ipo.r ipo4xcmsSet.xml lib.r planemo_test.sh repository_dependencies.xml test-data/MM14.mzML test-data/MM14_IPO_parameters4xcmsSet.tsv test-data/faahKO_IPO_parameters4xcmsSet.tsv test-data/faahKO_reduce.zip test-data/sacuri_2files_IPO_parameters4xcmsSet.tsv test-data/sacuri_2files_centWave_IPO_parameters4xcmsSet.tsv test-data/sacuri_2files_matchedFilter_IPO_parameters4xcmsSet.tsv |
| diffstat | 12 files changed, 3733 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/ipo.r Tue May 24 19:49:14 2016 -0400 +++ b/ipo.r Mon Jul 25 09:49:16 2016 -0400 @@ -64,13 +64,28 @@ zipfile= listArguments[["zipfile"]]; listArguments[["zipfile"]]=NULL } -if (!is.null(listArguments[["library"]])){ - directory=listArguments[["library"]]; listArguments[["library"]]=NULL - if(!file.exists(directory)){ - error_message=paste("Cannot access the directory:",directory,". Please verify if the directory exists or not.") - print(error_message) - stop(error_message) - } + +if (!is.null(listArguments[["singlefile_galaxyPath"]])){ + singlefile_galaxyPath = listArguments[["singlefile_galaxyPath"]]; listArguments[["singlefile_galaxyPath"]]=NULL + singlefile_sampleName = listArguments[["singlefile_sampleName"]]; listArguments[["singlefile_sampleName"]]=NULL +} + +# single file case +#@TODO: need to be refactoring +if(exists("singlefile_galaxyPath") && (singlefile_galaxyPath!="")) { + 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) + } + + cwd=getwd() + dir.create("raw") + setwd("raw") + file.symlink(singlefile_galaxyPath,singlefile_sampleName) + setwd(cwd) + + directory = "raw" + } # We unzip automatically the chromatograms from the zip files. @@ -86,10 +101,10 @@ #unzip - suppressWarnings(unzip(zipfile, unzip="unzip")) + suppressWarnings(unzip(zipfile, unzip="unzip", exdir="exdir")) #get the directory name - filesInZip=unzip(zipfile, list=T); + filesInZip=unzip(zipfile, list=T, exdir="exdir"); directories=unique(unlist(lapply(strsplit(filesInZip$Name,"/"), function(x) x[1]))); directories=directories[!(directories %in% c("__MACOSX")) & file.info(directories)$isdir] directory = "."
--- a/ipo4xcmsSet.xml Tue May 24 19:49:14 2016 -0400 +++ b/ipo4xcmsSet.xml Mon Jul 25 09:49:16 2016 -0400 @@ -14,6 +14,8 @@ #if $inputs.input == "zip_file": zipfile $inputs.zip_file + #elif $inputs.input == "single_file": + singlefile_galaxyPath $inputs.single_file singlefile_sampleName $inputs.single_file.name #end if parametersOutput $parametersOutput @@ -39,10 +41,14 @@ <conditional name="inputs"> <param name="input" type="select" label="Choose your inputs method" > <option value="zip_file" selected="true">Zip file from your history containing your chromatograms</option> + <option value="single_file">mzXML file from your history</option> </param> <when value="zip_file"> <param name="zip_file" type="data" format="no_unzip.zip,zip" label="Zip file" /> - </when> + </when> + <when value="single_file"> + <param name="single_file" type="data" format="mzxml" label="Single file" /> + </when> </conditional> <param name="samplebyclass" type="integer" value="2" label="Number of samples used per class to estimate the best parameters" help="Set to 0 to use the whole dataset. To save time, reduce this number" /> @@ -55,12 +61,12 @@ <!-- centWave Filter options --> <when value="centWave"> - <param name="ppm" type="integer" value="25" label="Max tolerated ppm m/z deviation in consecutive scans in ppm" help="[ppm]" optional="false" /> + <param name="ppm" type="text" value="5,25" label="Max tolerated ppm m/z deviation in consecutive scans in ppm" help="[ppm]" optional="false" /> <param name="min_peakwidth" type="text" value="15,25" label="Min peak width range in seconds" help="[peakwidth]" optional="true" /> <param name="max_peakwidth" type="text" value="45,55" label="Max peak width range in seconds" help="[peakwidth]" optional="true" /> </when> - <!-- matched Filter options --> + <!-- matched Filter options --> <when value="matchedFilter"> <param name="step" type="float" value="0.01" label="Step size to use for profile generation" help="[step] The peak detection algorithm creates extracted ion base peak chromatograms (EIBPC) on a fixed step size" optional="true" /> <param name="fwhm" type="integer" value="30" label="Full width at half maximum of matched filtration gaussian model peak" help="[fwhm] Only used to calculate the actual sigma" optional="true" /> @@ -77,23 +83,37 @@ <tests> <test> + <param name="inputs|input" value="single_file" /> + <param name="inputs|single_file" value="MM14.mzML" ftype="mzxml" /> + <param name="methods|method" value="centWave" /> + <param name="methods|ppm" value="56" /> + <param name="methods|min_peakwidth" value="3,9.5" /> + <param name="methods|max_peakwidth" value="10,20" /> + <output name="parametersOutput" file="MM14_IPO_parameters4xcmsSet.tsv" /> + </test> + <!--Failed: + Error in resultIncreased(history) : + No isotopes have been detected, peak picking not optimizable by IPO!--> + <!--<test> <param name="inputs|input" value="zip_file" /> - <param name="inputs|zip_file" value="faahKO_reduce.zip" ftype="zip" /> + <param name="inputs|zip_file" value="sacuri_2files.zip" ftype="zip" /> + <param name="samplebyclass" value="1" /> <param name="methods|method" value="centWave" /> <param name="methods|ppm" value="25" /> <param name="methods|min_peakwidth" value="20,30" /> <param name="methods|max_peakwidth" value="45,55" /> - <output name="parametersOutput" file="faahKO_IPO_parameters4xcmsSet.tsv" /> - </test> - <test> + <output name="parametersOutput" file="sacuri_2files_centWave_IPO_parameters4xcmsSet.tsv" /> + </test>--> + <!-- Too long for Travis CI --> + <!--<test> <param name="inputs|input" value="zip_file" /> <param name="inputs|zip_file" value="sacuri_2files.zip" ftype="zip" /> - <param name="methods|method" value="centWave" /> - <param name="methods|ppm" value="25" /> - <param name="methods|min_peakwidth" value="20,30" /> - <param name="methods|max_peakwidth" value="45,55" /> - <output name="parametersOutput" file="sacuri_2files_IPO_parameters4xcmsSet.tsv" /> - </test> + <param name="samplebyclass" value="1" /> + <param name="methods|method" value="matchedFilter" /> + <param name="methods|step" value="0.01" /> + <param name="methods|fwhm" value="4" /> + <output name="parametersOutput" file="sacuri_2files_matchedFilter_IPO_parameters4xcmsSet.tsv" /> + </test>--> </tests> <help><