# HG changeset patch # User galaxyp # Date 1540466443 14400 # Node ID c8ab1b6f383466574c687055dbea136425503ecf # Parent 01d12e7e48d3b050a4cab78898a20572c3a5c273 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit d2f311f7fff24e54c565127c40414de708e31b3c diff -r 01d12e7e48d3 -r c8ab1b6f3834 macros.xml --- a/macros.xml Mon Oct 01 01:01:04 2018 -0400 +++ b/macros.xml Thu Oct 25 07:20:43 2018 -0400 @@ -4,10 +4,17 @@ bioconductor-cardinal + r-base + + /dev/null | grep -v -i "WARNING: ") + ]]> + + - + + @@ -198,12 +206,12 @@ - - + - - - + + + diff -r 01d12e7e48d3 -r c8ab1b6f3834 preprocessing.xml --- a/preprocessing.xml Mon Oct 01 01:01:04 2018 -0400 +++ b/preprocessing.xml Thu Oct 25 07:20:43 2018 -0400 @@ -1,4 +1,4 @@ - + mass spectrometry imaging preprocessing @@ -6,16 +6,26 @@ macros.xml - r-gridextra - r-lattice - r-ggplot2 + r-gridextra + r-ggplot2 + r-lattice $outfile_imzml && + ls -l "$outfile_imzml.files_path" >> $outfile_imzml + ]]> @@ -31,6 +41,11 @@ @READING_MSIDATA@ + +## remove duplicated coordinates, otherwise peak picking and log2 transformation will fail +print(paste0(sum(duplicated(coord(msidata))), " duplicated coordinates were removed")) +msidata <- msidata[,!duplicated(coord(msidata))] + print(paste0("Number of NA in input file: ",sum(is.na(spectra(msidata)[])))) @@ -127,10 +142,6 @@ print('Peak_picking') ## Peakpicking - ## remove duplicated coordinates, otherwise peak picking will fail - print(paste0(sum(duplicated(coord(msidata))), " duplicated coordinates were removed")) - msidata <- msidata[,!duplicated(coord(msidata))] - #if str( $method.methods_conditional.methods_for_picking.picking_method) == 'adaptive': print('adaptive peakpicking') @@ -234,6 +245,12 @@ msidata = reduceDimension(msidata, method="bin", width=$method.methods_conditional.methods_for_reduction.bin_width, units="$method.methods_conditional.methods_for_reduction.bin_units", fun=$method.methods_conditional.methods_for_reduction.bin_fun) + ## optional: replace NA with 0 + #if $method.methods_conditional.methods_for_reduction.replace_NA_bin: + print(paste0("Number of NA that were set to zero after binning:",sum(is.na(spectra(msidata)[])))) + spectra(msidata)[][is.na(spectra(msidata)[])] = 0 + #end if + #elif str( $method.methods_conditional.methods_for_reduction.reduction_method) == 'resample': print('resample reduction') @@ -275,9 +292,17 @@ #if str( $method.methods_conditional.transf_conditional.trans_type) == 'log2': print('log2 transformation') - spectra(msidata)[][spectra(msidata)[] ==0] = NA - print(paste0("Number of 0 which were converted into NA:",sum(is.na(spectra(msidata)[])))) - spectra(msidata)[] = log2(spectra(msidata)[]) + ## replace 0 with NA + spectra_df = spectra(msidata)[] + spectra_df[spectra_df ==0] = NA + print(paste0("Number of 0 which were converted into NA:",sum(is.na(spectra_df)))) + spectra(msidata) = spectra_df + ## log transformation + spectra(msidata) = log2(spectra(msidata)) + ## optional: replace NA with 0 + #if $method.methods_conditional.transf_conditional.replace_NA_trans: + spectra(msidata)[][is.na(spectra(msidata)[])] = 0 + #end if #elif str( $method.methods_conditional.transf_conditional.trans_type) == 'sqrt': print('squareroot transformation') @@ -300,7 +325,7 @@ #end if #end for - ############# Outputs: RData and QC report ############# + ############# Outputs: RData, imzml and QC report ############# ################################################################################ print(paste0("Number of NA in output file: ",sum(is.na(spectra(msidata)[])))) @@ -308,6 +333,13 @@ ## save as (.RData) save(msidata, file="$msidata_preprocessed") + ## save msidata as imzML file, will only work if there is at least 1 m/z left + #if $imzml_output: + if (nrow(msidata) > 0){ +print("write outputfile") + writeImzML(msidata, "out")} + #end if + ## save QC report pdf("Preprocessing.pdf", fonts = "Times", pointsize = 12) @@ -455,6 +487,7 @@ + log2 - + + + + + + imzml_output + @@ -650,7 +689,7 @@ This tool provides multiple Cardinal functions to preprocess mass spectrometry imaging data. @MSIDATA_INPUT_DESCRIPTION@ -- Coordinates stored as decimals rather than integers will be rounded to obtain a regular pixel grid. This might lead to duplicated coordinates which will be automatically removed before peak picking. +- Coordinates stored as decimals rather than integers will be rounded to obtain a regular pixel grid. This might lead to duplicated coordinates which will be automatically removed after the data is read by the tool. @MZ_TABULAR_INPUT_DESCRIPTION@ **Options** @@ -671,7 +710,8 @@ **Output** -- imzML file, preprocessed +- MSI data as .RData output (can be read with the Cardinal package in R) +- optional: MSI data as imzML file - pdf with key values after each processing step ]]> diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/Heatmaps_LM8_file16.pdf Binary file test-data/Heatmaps_LM8_file16.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/Heatmaps_analyze75.pdf Binary file test-data/Heatmaps_analyze75.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/Heatmaps_imzml.pdf Binary file test-data/Heatmaps_imzml.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/Heatmaps_rdata.pdf Binary file test-data/Heatmaps_rdata.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/Plot_analyze75.pdf Binary file test-data/Plot_analyze75.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/Plot_analyze75_allpixels.pdf Binary file test-data/Plot_analyze75_allpixels.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/Plot_empty_spectra.pdf Binary file test-data/Plot_empty_spectra.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/Plot_imzml.pdf Binary file test-data/Plot_imzml.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/Plot_rdata.pdf Binary file test-data/Plot_rdata.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/QC_analyze75.pdf Binary file test-data/QC_analyze75.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/QC_empty_spectra.pdf Binary file test-data/QC_empty_spectra.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/QC_imzml.pdf Binary file test-data/QC_imzml.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/QC_rdata.pdf Binary file test-data/QC_rdata.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/analyze75.svg --- a/test-data/analyze75.svg Mon Oct 01 01:01:04 2018 -0400 +++ b/test-data/analyze75.svg Thu Oct 25 07:20:43 2018 -0400 @@ -1,15 +1,15 @@ - + - - - - - - - - - - + + + + + + + + + + diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/analyze75_filtered2.pdf Binary file test-data/analyze75_filtered2.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/analyze_filteredoutside.RData Binary file test-data/analyze_filteredoutside.RData has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/centroids_rdata.pdf Binary file test-data/centroids_rdata.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/cluster_skm.RData Binary file test-data/cluster_skm.RData has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/imzml_filtered2.RData diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/imzml_filtered2.pdf Binary file test-data/imzml_filtered2.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/imzml_filtered3.RData Binary file test-data/imzml_filtered3.RData has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/imzml_filtered3.pdf Binary file test-data/imzml_filtered3.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/imzml_filtered4.RData Binary file test-data/imzml_filtered4.RData has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/imzml_filtered4.pdf Binary file test-data/imzml_filtered4.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/imzml_filtered5.RData Binary file test-data/imzml_filtered5.RData has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/imzml_filtered5.pdf Binary file test-data/imzml_filtered5.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/kmeans_analyze.pdf Binary file test-data/kmeans_analyze.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/pca_imzml.pdf Binary file test-data/pca_imzml.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/rdata_notfiltered.RData Binary file test-data/rdata_notfiltered.RData has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/rdata_notfiltered.pdf Binary file test-data/rdata_notfiltered.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test1.pdf Binary file test-data/test1.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test2.pdf Binary file test-data/test2.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test2.rdata Binary file test-data/test2.rdata has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test3.pdf Binary file test-data/test3.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test4.pdf Binary file test-data/test4.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test4.rdata Binary file test-data/test4.rdata has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test5.pdf Binary file test-data/test5.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test6.pdf Binary file test-data/test6.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test6.rdata Binary file test-data/test6.rdata has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test7.pdf Binary file test-data/test7.pdf has changed diff -r 01d12e7e48d3 -r c8ab1b6f3834 test-data/test7.rdata Binary file test-data/test7.rdata has changed