# HG changeset patch
# User galaxyp
# Date 1604443281 0
# Node ID e0bbaf9f7da0f705e3bb019eb8c38e4a3584089f
# Parent 413a1b74f49699ee394b163e1121b57b6a3cc99e
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit e499c9124d3fd85a7fc47b95c206ce91a5e3678c-dirty"
diff -r 413a1b74f496 -r e0bbaf9f7da0 macros.xml
--- a/macros.xml Wed May 13 17:56:03 2020 +0000
+++ b/macros.xml Tue Nov 03 22:41:21 2020 +0000
@@ -1,10 +1,10 @@
- 2.4.0
+ 2.6.0
bioconductor-cardinal
- r-base
+
@@ -117,6 +117,13 @@
0, for if conditions
- npeaks= sum(as.matrix(spectra(msidata))>0, na.rm=TRUE)
+ npeaks= sum(int_matrix>0)
## Number of NA in spectra matrix
- NAcount = sum(is.na(spectra(msidata)))
- ## Number of NA in spectra matrix
- infcount = sum(is.infinite(as.matrix(spectra(msidata))))
+ infcount = sum(is.infinite(int_matrix))
## Number of duplicated coordinates
dupl_coord = sum(duplicated(coord(msidata)))
properties = c("Number of m/z features",
@@ -175,7 +180,7 @@
- imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format `_
- Analyze7.5 (upload hdr, img and t2m file via the "composite" function)
- - Cardinal "MSImageSet" data saved as .RData
+ - Cardinal "MSImageSet" or "MSImagingExperiment" saved as .RData
]]>
-
+
diff -r 413a1b74f496 -r e0bbaf9f7da0 preprocessing.xml
--- a/preprocessing.xml Wed May 13 17:56:03 2020 +0000
+++ b/preprocessing.xml Tue Nov 03 22:41:21 2020 +0000
@@ -1,4 +1,4 @@
-
+
mass spectrometry imaging preprocessing
@@ -7,7 +7,7 @@
r-gridextra
- r-ggplot2
+ r-ggplot2
= $method.methods_conditional.mz_range.min_mz & mz(msidata) <= $method.methods_conditional.mz_range.max_mz,]
+ msidata = mse_bin = mzBin(msidata,resolution=$method.methods_conditional.bin_width, units="$method.methods_conditional.bin_units", fun="$method.methods_conditional.bin_fun")
+ #end if
- 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)
+
+ #elif str( $method.methods_conditional.mz_range.features_filtering) == 'none':
+
+ msidata = mse_bin = mzBin(msidata,resolution=$method.methods_conditional.bin_width, units="$method.methods_conditional.bin_units", fun=$method.methods_conditional.bin_fun)
+ #end if
+
+ msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu))
+
## optional: replace NA with 0
- #if $method.methods_conditional.methods_for_reduction.replace_NA_bin:
+ #if $method.methods_conditional.replace_NA_bin:
## count and replace NAs
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')
-
- msidata = reduceDimension(msidata, method="resample", step=$method.methods_conditional.methods_for_reduction.resample_step)
- #end if
-
- ## coercition into new format
- msidata = as(msidata, "MSImagingExperiment")
-
+
############################### QC ###########################
maxfeatures =nrow(msidata)
@@ -385,8 +369,8 @@
reduced = c(minmz, maxmz,maxfeatures, pixelcount)
QC_numbers= cbind(QC_numbers, reduced)
vectorofactions = append(vectorofactions, "reduced")
- print(plot(msidata, pixel=random_spectra))
- title("Spectra after data reduction", outer=TRUE, line=0)
+ print(plot(msidata, pixel=random_spectra, col="black"))
+ title("Spectra after m/z binning", outer=TRUE, line=0)
############################### Transformation ###########################
@@ -428,7 +412,7 @@
transformed = c(minmz, maxmz,maxfeatures, pixelcount)
QC_numbers= cbind(QC_numbers, transformed)
vectorofactions = append(vectorofactions, "transformed")
- print(plot(msidata, pixel=random_spectra))
+ print(plot(msidata, pixel=random_spectra, col="black"))
title("Spectra after transformation", outer=TRUE, line=0)
#end if
@@ -438,6 +422,10 @@
################################################################################
## save msidata as imzML file, will only work if there is at least 1 m/z left
+
+ #if str($imzml_output) == "cont_format":
+ #set $continuous_format = True
+ #end if
if (nrow(msidata) > 0){
## make sure that coordinates are integers
@@ -479,7 +467,7 @@
-
+
@@ -576,7 +564,6 @@
-
-
@@ -620,31 +606,29 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
@@ -661,6 +645,7 @@
+
@@ -696,13 +681,11 @@
-
-
@@ -719,6 +702,7 @@
+