# HG changeset patch
# User galaxyp
# Date 1540466969 14400
# Node ID 1b22c1e7bfe719d7d448890a61e94df44385a56d
# Parent 8c05a34f160a99ea906ed0a670b5fbd8cc26c50c
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit d2f311f7fff24e54c565127c40414de708e31b3c
diff -r 8c05a34f160a -r 1b22c1e7bfe7 macros.xml
--- a/macros.xml Mon Oct 01 01:07:44 2018 -0400
+++ b/macros.xml Thu Oct 25 07:29:29 2018 -0400
@@ -4,10 +4,17 @@
bioconductor-cardinal
+ r-base
+
+ /dev/null | grep -v -i "WARNING: ")
+ ]]>
+
+
-
+
+
@@ -198,12 +206,12 @@
-
-
+
-
-
-
+
+
+
diff -r 8c05a34f160a -r 1b22c1e7bfe7 preprocessing.xml
--- a/preprocessing.xml Mon Oct 01 01:07:44 2018 -0400
+++ b/preprocessing.xml Thu Oct 25 07:29:29 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 8c05a34f160a -r 1b22c1e7bfe7 test-data/Heatmaps_LM8_file16.pdf
Binary file test-data/Heatmaps_LM8_file16.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/Heatmaps_analyze75.pdf
Binary file test-data/Heatmaps_analyze75.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/Heatmaps_imzml.pdf
Binary file test-data/Heatmaps_imzml.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/Heatmaps_rdata.pdf
Binary file test-data/Heatmaps_rdata.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/Plot_analyze75.pdf
Binary file test-data/Plot_analyze75.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/Plot_analyze75_allpixels.pdf
Binary file test-data/Plot_analyze75_allpixels.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/Plot_empty_spectra.pdf
Binary file test-data/Plot_empty_spectra.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/Plot_imzml.pdf
Binary file test-data/Plot_imzml.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/Plot_rdata.pdf
Binary file test-data/Plot_rdata.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/QC_analyze75.pdf
Binary file test-data/QC_analyze75.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/QC_empty_spectra.pdf
Binary file test-data/QC_empty_spectra.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/QC_imzml.pdf
Binary file test-data/QC_imzml.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/QC_rdata.pdf
Binary file test-data/QC_rdata.pdf has changed
diff -r 8c05a34f160a -r 1b22c1e7bfe7 test-data/analyze75.svg
--- a/test-data/analyze75.svg Mon Oct 01 01:07:44 2018 -0400
+++ b/test-data/analyze75.svg Thu Oct 25 07:29:29 2018 -0400
@@ -1,15 +1,15 @@
-