changeset 13:6b36be80febb draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit 39bd480e8813fa7a96b640150365577a69885d17-dirty"
author galaxyp
date Sun, 29 Nov 2020 23:45:08 +0000
parents e0669b1854b1
children f1897eb07081
files preprocessing.xml test-data/Heatmaps_LM8_file16.pdf test-data/Heatmaps_analyze75.pdf test-data/Heatmaps_imzml.pdf test-data/Heatmaps_processed.pdf test-data/Heatmaps_rdata.pdf test-data/centroids_proc.pdf test-data/preprocessing_results1.ibd test-data/preprocessing_results1.imzml test-data/preprocessing_results1.imzml.txt test-data/preprocessing_results1.pdf test-data/preprocessing_results2.ibd test-data/preprocessing_results2.imzml test-data/preprocessing_results2.imzml.txt test-data/preprocessing_results2.pdf test-data/preprocessing_results3.ibd test-data/preprocessing_results3.imzml test-data/preprocessing_results3.imzml.txt test-data/preprocessing_results3.pdf
diffstat 19 files changed, 142 insertions(+), 152 deletions(-) [+]
line wrap: on
line diff
--- a/preprocessing.xml	Thu Oct 22 20:38:29 2020 +0000
+++ b/preprocessing.xml	Sun Nov 29 23:45:08 2020 +0000
@@ -1,4 +1,4 @@
-<tool id="cardinal_preprocessing" name="MSI preprocessing" version="@VERSION@.1">
+<tool id="cardinal_preprocessing" name="MSI preprocessing" version="@VERSION@.2">
     <description>
         mass spectrometry imaging preprocessing
     </description>
@@ -47,7 +47,6 @@
 
 
 ## remove duplicated coordinates, otherwise peak picking and log2 transformation will fail
-msidata <- msidata[,!duplicated(coord(msidata)[,1:2])] 
 
 ## set variable to False
 #set $used_peak_picking = False
@@ -135,24 +134,29 @@
                 print('gaussian smoothing')
 
                 msidata = smoothSignal(msidata, method="$method.methods_conditional.methods_for_smoothing.smoothing_method", window=$method.methods_conditional.window_smoothing, sd = $method.methods_conditional.methods_for_smoothing.sd_gaussian)
+                msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu))
 
             #elif str( $method.methods_conditional.methods_for_smoothing.smoothing_method) == 'sgolay':
                 print('sgolay smoothing')
 
                 msidata = smoothSignal(msidata, method="$method.methods_conditional.methods_for_smoothing.smoothing_method", window=$method.methods_conditional.window_smoothing, order = $method.methods_conditional.methods_for_smoothing.order_of_filters)
+                msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu))
 
                 ## if selected replace negative intensities with zero
                 #if $method.methods_conditional.methods_for_smoothing.replace_negatives:
-                    spectra(msidata)[spectra(msidata)<0] = 0
+                    ## bring spectra matrix to disk
+                    spectra_df = as.matrix(spectra(msidata))
+                    spectra_df[spectra_df<0] = 0
+                    spectra(msidata) = spectra_df
                 #end if
 
             #elif str($method.methods_conditional.methods_for_smoothing.smoothing_method) == 'ma':
                 print('moving average smoothing')
 
                 msidata = smoothSignal(msidata, method="$method.methods_conditional.methods_for_smoothing.smoothing_method", window=$method.methods_conditional.window_smoothing, coef = $method.methods_conditional.methods_for_smoothing.coefficients_ma_filter)
+                msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu))
 
             #end if
-            msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu))
 
             ############################### QC ###########################
 
@@ -170,7 +174,7 @@
     ############################### Mz alignment ###########################
 
         #elif str( $method.methods_conditional.preprocessing_method ) == 'mz_alignment':
-            print('M/z alignment')
+            print('m/z alignment')
             ## M/z alignment
 
             #if str( $method.methods_conditional.mzalign_ref_type.align_reference_datatype) == 'align_table':
@@ -183,7 +187,7 @@
 
             #elif str( $method.methods_conditional.mzalign_ref_type.align_reference_datatype) == 'align_noref':
 
-                msidata = mzAlign(msidata,tolerance = $method.methods_conditional.alignment_tol, units = "$method.methods_conditional.alignment_units", , quantile = $method.methods_conditional.quantile, span = $method.methods_conditional.span)
+                msidata = mzAlign(msidata,tolerance = $method.methods_conditional.alignment_tol, units = "$method.methods_conditional.alignment_units", quantile = $method.methods_conditional.quantile, span = $method.methods_conditional.span)
 
             #end if
 
@@ -332,23 +336,23 @@
         #elif str( $method.methods_conditional.preprocessing_method) == 'Mass_binning':
             print('mass binning')
 
-            #if str( $method.methods_conditional.mz_range.features_filtering) == 'change_mz_range':
-
-                #if str($processed_cond.processed_file) == "processed":
+            #if str($method.methods_conditional.mz_range.features_filtering) == 'change_mz_range':
 
                 msidata = mse_bin = mzBin(msidata,resolution=$method.methods_conditional.bin_width, from=$method.methods_conditional.mz_range.min_mz, to=$method.methods_conditional.mz_range.max_mz, units="$method.methods_conditional.bin_units", fun="$method.methods_conditional.bin_fun")
-                
-                #else 
-                    ## continuous file cannot be binned from m/z to m/z, therefore first cut m/z range and then do mzbin:
-                    msidata = msidata[mz(msidata) >= $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
 
 		   
-	    #elif str( $method.methods_conditional.mz_range.features_filtering) == 'none':	    
+	    #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)
 
+	    #elif str($method.methods_conditional.mz_range.features_filtering) == 'bin_to_reference':
+
+	        bin_reference_mz = read.delim("$method.methods_conditional.mz_range.mz_tabular", header = $method.methods_conditional.mz_range.feature_header, stringsAsFactors = FALSE)
+                bin_reference_mz = bin_reference_mz[,$method.methods_conditional.mz_range.feature_column]
+
+	       msidata = mse_bin = mzBin(msidata,resolution=$method.methods_conditional.bin_width, units="$method.methods_conditional.bin_units", fun=$method.methods_conditional.bin_fun,
+	       ref=bin_reference_mz)
+
             #end if
              
             msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu))
@@ -385,7 +389,7 @@
                 print('log2 transformation')
 
                 ## replace 0 with NA to prevent Inf
-                spectra_df = spectra(msidata) ## convert into R matrix
+                spectra_df = as.matrix(spectra(msidata)) ## convert into R matrix
                 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
@@ -422,25 +426,14 @@
     ################################################################################
 
     ## 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
             coord(msidata)\$y = as.integer(coord(msidata)\$y)
             coord(msidata)\$x = as.integer(coord(msidata)\$x)
-        #if $used_peak_picking:
-            #if $continuous_format:
-                msidata = as(msidata, "MSContinuousImagingExperiment")
-            #end if
-        #elif $used_peak_alignment
-            #if $continuous_format:
-                msidata = as(msidata, "MSContinuousImagingExperiment")
-            #end if
-        #end if
-        writeImzML(msidata, "out")
+            ## only continuous files can currently be exported
+            msidata = as(msidata, "MSContinuousImagingExperiment")
+            writeImzML(msidata, "out")
         }
 
     plot(0,type='n',axes=FALSE,ann=FALSE)
@@ -620,15 +613,19 @@
                     </param>
                     <param name="replace_NA_bin" type="boolean" label="Replace NA with 0" truevalue="TRUE" falsevalue="FALSE" checked="True" help="Binning can introduce NAs, should they be replaced with 0"/>
                     <conditional name="mz_range">
-            		 <param name="features_filtering" type="select" label="Select m/z feature filtering option">
+                    	<param name="features_filtering" type="select" label="Select m/z options">
                             <option value="none" selected="True">none</option>
                             <option value="change_mz_range">change m/z range</option>
+                            <option value="bin_to_reference">bin m/z to reference</option>
                         </param>
 			    <when value="none"/>
 			    <when value="change_mz_range">
 				<param name="min_mz" type="float" value="1" label="Minimum value for m/z"/>
 				<param name="max_mz" type="float" value="10000" label="Maximum value for m/z"/>
 			    </when>
+			    <when value="bin_to_reference">
+		                <expand macro="reading_1_column_mz_tabular" label="Tabular file with m/z features as reference for binning. Only the m/z values from the tabular file will be kept."/>
+	                   </when>
                     </conditional>
                 </when>
                 <when value="Transformation">
@@ -645,7 +642,6 @@
                 </when>
             </conditional>
         </repeat>
-        <param name="imzml_output" type="boolean" label="imzML output in processed format" checked="True" truevalue="proc_format" falsevalue="cont_format"/>
     </inputs>
     <outputs>
         <data format="imzml" name="outfile_imzml" label="${tool.name} on ${on_string}: imzML"/>
@@ -666,10 +662,8 @@
                 <conditional name="methods_conditional">
                     <param name="preprocessing_method" value="Smoothing"/>
                     <conditional name="methods_for_smoothing">
-                        <param name="smoothing_method" value="gaussian"/>
-                        <param name="sd_gaussian" value="4"/>
+                        <param name="smoothing_method" value="sgolay"/>
                     </conditional>
-                        <param name="window_smoothing" value="9"/>
                 </conditional>
             </repeat>
             <repeat name="methods">
@@ -702,7 +696,6 @@
                         </conditional>
                 </conditional>
             </repeat>
-            <param name="imzml_output" value="cont_format"/>
             <output name="QC_overview" file="preprocessing_results1.pdf" compare="sim_size"/>
             <output name="outfile_imzml" ftype="imzml" file="preprocessing_results1.imzml.txt" compare="sim_size">
                 <extra_files type="file" file="preprocessing_results1.imzml" name="imzml" lines_diff="6"/>
@@ -727,7 +720,6 @@
                     <param name="preprocessing_method" value="Peak_alignment"/>
                 </conditional>
             </repeat>
-            <param name="imzml_output" value="cont_format"/>
             <output name="QC_overview" file="preprocessing_results2.pdf" compare="sim_size"/>
             <output name="outfile_imzml" ftype="imzml" file="preprocessing_results2.imzml.txt" compare="sim_size">
                 <extra_files type="file" file="preprocessing_results2.imzml" name="imzml" lines_diff="6"/>
@@ -753,13 +745,11 @@
                     <conditional name="methods_for_picking">
                         <param name="picking_method" value="mad"/>
                     </conditional>
-                <param name="imzml_output" value="proc_format"/>
                 </conditional>
             </repeat>
             <repeat name="methods">
                 <conditional name="methods_conditional">
                     <param name="preprocessing_method" value="Peak_alignment"/>
-                    <param name="imzml_output" value="proc_format"/>
                 </conditional>
             </repeat>
             <output name="QC_overview" file="preprocessing_results3.pdf" compare="sim_size"/>
@@ -850,7 +840,7 @@
 
 **Output**
 
-- MSI data as continuous or processed imzML file
+- MSI data as continuous imzML file
 - pdf with key values and four random mass spectra after each processing step
 
         ]]>
Binary file test-data/Heatmaps_LM8_file16.pdf has changed
Binary file test-data/Heatmaps_analyze75.pdf has changed
Binary file test-data/Heatmaps_imzml.pdf has changed
Binary file test-data/Heatmaps_processed.pdf has changed
Binary file test-data/Heatmaps_rdata.pdf has changed
Binary file test-data/centroids_proc.pdf has changed
Binary file test-data/preprocessing_results1.ibd has changed
--- a/test-data/preprocessing_results1.imzml	Thu Oct 22 20:38:29 2020 +0000
+++ b/test-data/preprocessing_results1.imzml	Sun Nov 29 23:45:08 2020 +0000
@@ -9,8 +9,8 @@
 		<fileContent>
 			<cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" />
 			<cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum" value="" />
-			<cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="07177fdd-3760-4df6-8fe2-53d28b280ae8" />
-			<cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="749fe32c8243da06001cf4643c5ce4f1ef5a98a8" />
+			<cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="22bd3147-231d-4076-b6bd-67c1fa7c6ef3" />
+			<cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="831eba0fc850529d1351bcbb1baf779fe0773e1b" />
 			<cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" />
 		</fileContent>
 	</fileDescription>
@@ -86,15 +86,15 @@
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
 						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="36" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="48" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -115,15 +115,15 @@
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
 						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="56" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="80" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -144,15 +144,15 @@
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
 						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="76" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="112" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -173,15 +173,15 @@
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
 						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="96" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="144" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -202,15 +202,15 @@
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
 						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="116" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="176" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -231,15 +231,15 @@
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
 						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="136" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="208" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -260,15 +260,15 @@
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
 						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="156" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="240" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -289,15 +289,15 @@
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
 						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="176" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="272" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -318,15 +318,15 @@
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
 						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="196" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="304" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
--- a/test-data/preprocessing_results1.imzml.txt	Thu Oct 22 20:38:29 2020 +0000
+++ b/test-data/preprocessing_results1.imzml.txt	Sun Nov 29 23:45:08 2020 +0000
@@ -1,4 +1,4 @@
 imzML file:
 total 24
--rw-rw-r-- 1 meli meli   216 Oct  5 19:57 ibd
--rw-rw-r-- 1 meli meli 18090 Oct  5 19:57 imzml
+-rw-rw-r-- 1 meli meli   336 Nov 29 01:14 ibd
+-rw-rw-r-- 1 meli meli 18092 Nov 29 01:14 imzml
Binary file test-data/preprocessing_results1.pdf has changed
Binary file test-data/preprocessing_results2.ibd has changed
--- a/test-data/preprocessing_results2.imzml	Thu Oct 22 20:38:29 2020 +0000
+++ b/test-data/preprocessing_results2.imzml	Sun Nov 29 23:45:08 2020 +0000
@@ -9,8 +9,8 @@
 		<fileContent>
 			<cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" />
 			<cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum" value="" />
-			<cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="503079b4-538a-4be6-b70d-e52542c66482" />
-			<cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="a597fe6a0184ef339105b3a932f58726a9af549b" />
+			<cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="ebbd9c5a-19a7-4db5-91e0-858065743606" />
+			<cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="471a838ffd01331ad8e6d23a59004e05745bf39c" />
 			<cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" />
 		</fileContent>
 	</fileDescription>
--- a/test-data/preprocessing_results2.imzml.txt	Thu Oct 22 20:38:29 2020 +0000
+++ b/test-data/preprocessing_results2.imzml.txt	Sun Nov 29 23:45:08 2020 +0000
@@ -1,4 +1,4 @@
 imzML file:
 total 64
--rw-rw-r-- 1 meli meli 37404 Oct  5 19:57 ibd
--rw-rw-r-- 1 meli meli 22796 Oct  5 19:57 imzml
+-rw-rw-r-- 1 meli meli 37404 Nov 29 18:03 ibd
+-rw-rw-r-- 1 meli meli 22796 Nov 29 18:03 imzml
Binary file test-data/preprocessing_results2.pdf has changed
Binary file test-data/preprocessing_results3.ibd has changed
--- a/test-data/preprocessing_results3.imzml	Thu Oct 22 20:38:29 2020 +0000
+++ b/test-data/preprocessing_results3.imzml	Sun Nov 29 23:45:08 2020 +0000
@@ -9,9 +9,9 @@
 		<fileContent>
 			<cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" />
 			<cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum" value="" />
-			<cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="be549a7e-87af-4413-9b4c-27221f55ee9a" />
-			<cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="4ee7ca6fb3f60e1adbe196068f86bc3209bace58" />
-			<cvParam cvRef="IMS" accession="IMS:1000031" name="processed" value="" />
+			<cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="476b127d-a8e1-4595-aae9-e9245db50d28" />
+			<cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="8a36ea2658fcfc8cfa9ae4d0dd73cd7ed2f5b96f" />
+			<cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" />
 		</fileContent>
 	</fileDescription>
 	<referenceableParamGroupList count="4">
@@ -86,15 +86,15 @@
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
 						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="64" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="80" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="16" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="64" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="160" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -114,16 +114,16 @@
 				<binaryDataArrayList count="2">
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="144" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="164" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="5" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="20" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="304" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -143,16 +143,16 @@
 				<binaryDataArrayList count="2">
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="184" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="18" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="72" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="256" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="18" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="72" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="448" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -172,16 +172,16 @@
 				<binaryDataArrayList count="2">
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="328" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="21" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="84" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="412" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="21" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="84" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="592" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -201,16 +201,16 @@
 				<binaryDataArrayList count="2">
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="496" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="4" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="16" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="512" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="4" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="16" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="736" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -230,16 +230,16 @@
 				<binaryDataArrayList count="2">
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="528" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="18" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="72" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="600" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="18" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="72" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="880" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -259,16 +259,16 @@
 				<binaryDataArrayList count="2">
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="672" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="17" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="68" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="740" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="17" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="68" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="1024" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -288,16 +288,16 @@
 				<binaryDataArrayList count="2">
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="808" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="840" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="8" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="32" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="1168" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
@@ -317,16 +317,16 @@
 				<binaryDataArrayList count="2">
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="mzArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="872" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="11" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="44" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="16" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 					<binaryDataArray encodedLength="0">
 						<referenceableParamGroupRef ref="intensityArray" />
-						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="916" />
-						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="11" />
-						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="44" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="1312" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="36" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="144" />
 						<binary />
 					</binaryDataArray>
 				</binaryDataArrayList>
--- a/test-data/preprocessing_results3.imzml.txt	Thu Oct 22 20:38:29 2020 +0000
+++ b/test-data/preprocessing_results3.imzml.txt	Sun Nov 29 23:45:08 2020 +0000
@@ -1,4 +1,4 @@
 imzML file:
 total 24
--rw-rw-r-- 1 meli meli   960 Oct  5 19:58 ibd
--rw-rw-r-- 1 meli meli 18112 Oct  5 19:58 imzml
+-rw-rw-r-- 1 meli meli  1456 Nov 29 18:04 ibd
+-rw-rw-r-- 1 meli meli 18133 Nov 29 18:04 imzml
Binary file test-data/preprocessing_results3.pdf has changed