diff data_exporter.xml @ 17:56da27be956a draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit 91e77c139cb3b7c6d67727dc39140dd79355fa0c
author galaxyp
date Thu, 04 Jul 2024 13:34:08 +0000
parents b6a4dd06cde0
children
line wrap: on
line diff
--- a/data_exporter.xml	Wed Apr 19 22:52:19 2023 +0000
+++ b/data_exporter.xml	Thu Jul 04 13:34:08 2024 +0000
@@ -1,4 +1,4 @@
-<tool id="cardinal_data_exporter" name="MSI data exporter" version="@VERSION@.0">
+<tool id="cardinal_data_exporter" name="MSI data exporter" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05">
     <description>
         exports imzML and Analyze7.5 to tabular files
     </description>
@@ -102,7 +102,7 @@
             count = 1
             for (subsample in levels(msidata\$annotation)){
                 subsample_pixels = msidata[,msidata\$annotation == subsample]
-                subsample_calc = rowMeans(spectra(subsample_pixels), na.rm=TRUE)
+                subsample_calc = rowMeans(as.matrix(spectra(subsample_pixels)), na.rm=TRUE)
                 sample_matrix = cbind(sample_matrix, subsample_calc)
                 count = count+1}
             sample_matrix_mean = cbind(mz_names,sample_matrix)
@@ -117,7 +117,7 @@
             count = 1
             for (subsample in levels(msidata\$annotation)){
                 subsample_pixels = msidata[,msidata\$annotation == subsample]
-                subsample_calc = apply(spectra(subsample_pixels),1,median, na.rm=TRUE)
+                subsample_calc = apply(as.matrix(spectra(subsample_pixels)),1,median, na.rm=TRUE)
                 sample_matrix = cbind(sample_matrix, subsample_calc)
                 count = count+1}
             sample_matrix_median = cbind(mz_names,sample_matrix)
@@ -190,13 +190,13 @@
 
                 for (mass in 1:length(inputcalibrantmasses)){
                     filtered_data = msidata[mz(msidata) >= inputcalibrantmasses[mass]-plusminusvalues[mass] & mz(msidata) <= inputcalibrantmasses[mass]+plusminusvalues[mass],]
-                    if (nrow(filtered_data) > 1 & sum(spectra(filtered_data),na.rm=TRUE) > 0){
+                    if (nrow(filtered_data) > 1 & sum(as.matrix(spectra(filtered_data)), na.rm=TRUE) > 0){
                         ## intensity of all m/z > 0
-                          intensity_sum = colSums(spectra(filtered_data), na.rm=TRUE) > 0
+                          intensity_sum = colSums(as.matrix(spectra(filtered_data)), na.rm=TRUE) > 0
 
-                    }else if(nrow(filtered_data) == 1 & sum(spectra(filtered_data), na.rm=TRUE) > 0){
+                    }else if(nrow(filtered_data) == 1 & sum(as.matrix(spectra(filtered_data)), na.rm=TRUE) > 0){
                         ## intensity of only m/z > 0
-                        intensity_sum = spectra(filtered_data) > 0 
+                        intensity_sum = as.matrix(spectra(filtered_data)) > 0
                     }else{
                         intensity_sum = rep(FALSE, ncol(filtered_data))}
                     ## for each pixel add sum of intensities > 0 in the given m/z range
@@ -343,7 +343,11 @@
                 <param name="feature_header" value="False"/>
                 <param name="plusminus_ppm" value="200"/>
             </conditional>
-            <output name="feature_output" file="features_out4.tabular"/>
+            <output name="feature_output">
+                <assert_contents>
+                    <has_text text="100.120072029209"/>
+                </assert_contents>
+            </output>
             <output name="pixel_output" file="pixel_out4.tabular"/>
         </test>
     </tests>