changeset 0:01212bf66f61 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/MALDIquant commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
author galaxyp
date Wed, 22 Aug 2018 11:49:29 -0400
parents
children eaaa73b043e6
files maldi_macros.xml maldi_quant_peakdetection.xml test-data/Analyze75.hdr test-data/Analyze75.img test-data/Analyze75.t2m test-data/Example_Continuous.ibd test-data/Example_Continuous.imzML test-data/Preprocessing1_QC.pdf test-data/Preprocessing2_QC.pdf test-data/Preprocessing3_QC.pdf test-data/align_reference_test2.tabular test-data/annotations_output3.tabular test-data/int1.tabular test-data/int2.tabular test-data/intensity_matrix3.tabular test-data/masspeaks1.tabular test-data/masspeaks1_forinput.tabular test-data/masspeaks2.tabular test-data/masspeaks3.tabular test-data/msidata_1.RData test-data/outfile1.ibd test-data/outfile1.imzML test-data/outfile2.ibd test-data/outfile2.imzML test-data/outfile3.ibd test-data/outfile3.imzML test-data/peakdetection1_QC.pdf test-data/peakdetection2_QC.pdf test-data/peakdetection3_QC.pdf test-data/pixel_annotations.tabular test-data/restricted_pixels.tabular
diffstat 29 files changed, 1538 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/maldi_macros.xml	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,26 @@
+<macros>
+    <token name="@R_IMPORTS@"><![CDATA[
+        ## Libraries
+        library (Cardinal)
+        library (MALDIquantForeign)
+        library (MALDIquant)
+        library (ggplot2)
+
+    ]]>
+    </token>
+
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>
+            <requirement type="package" version="0.11.5">r-maldiquantforeign</requirement>
+            <requirement type="package" version="1.18">r-maldiquant</requirement>
+            <requirement type="package" version="2.2.1">r-ggplot2</requirement>
+        </requirements>
+    </xml>
+
+    <xml name="citation">
+    <citations>
+        <citation type="doi">10.1093/bioinformatics/bts447</citation>
+    </citations>
+    </xml>
+</macros>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/maldi_quant_peakdetection.xml	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,505 @@
+<tool id="maldi_quant_peak_detection" name="MALDIquant peak detection" version="1.18.0.0">
+    <description>
+        Peak detection, binning and filtering for mass-spectrometry imaging data
+    </description>
+    <macros>
+        <import>maldi_macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <command detect_errors="exit_code">
+    <![CDATA[
+        #if $infile.ext == 'imzml'
+            cp '${infile.extra_files_path}/imzml' infile.imzML &&
+            cp '${infile.extra_files_path}/ibd' infile.ibd &&
+        #elif $infile.ext == 'analyze75'
+            cp '${infile.extra_files_path}/hdr' infile.hdr &&
+            cp '${infile.extra_files_path}/img' infile.img &&
+            cp '${infile.extra_files_path}/t2m' infile.t2m &&
+        #end if
+        Rscript '${maldi_quant_peak_detection}'&&
+        mkdir $outfile_imzml.files_path &&
+        mv ./out.imzMl "${os.path.join($outfile_imzml.files_path, 'imzml')}" | true &&
+        mv ./out.ibd "${os.path.join($outfile_imzml.files_path, 'ibd')}" | true &&
+        echo "imzML file:" > $outfile_imzml &&
+        ls -l "$outfile_imzml.files_path" >> $outfile_imzml
+    ]]>
+    </command>
+    <configfiles>
+        <configfile name="maldi_quant_peak_detection"><![CDATA[
+
+@R_IMPORTS@
+
+summarized_spectra = FALSE
+
+#if $restriction_conditional.restriction == 'restrict':
+
+    print('Reading mask region')
+    ## Import imzML file
+    coordinate_matrix = as.matrix(read.delim("$restriction_conditional.coordinates_file", header = FALSE, stringsAsFactors = FALSE))[,1:2]
+
+    maldi_data <- importImzMl('infile.imzML',
+                     coordinates = coordinate_matrix, centroided = $centroids)
+    pixelnames = paste0("x = ", coordinates(maldi_data)[,1],", y = ", coordinates(maldi_data)[,2])
+
+#else:
+
+    print('Reading entire file')
+    ## Import imzML file
+
+
+    #if $infile.ext == 'imzml'
+
+        #if str($centroids) == "TRUE"
+            peaks <- importImzMl('infile.imzML', centroided = $centroids)
+            pixelnames = paste0("x = ", coordinates(peaks)[,1],", y = ", coordinates(peaks)[,2])
+
+        #else
+            maldi_data <- importImzMl('infile.imzML', centroided = $centroids)
+            pixelnames = paste0("x = ", coordinates(maldi_data)[,1],", y = ", coordinates(maldi_data)[,2])
+        #end if
+    #elif $infile.ext == 'tabular'
+
+        peak_tabular = read.delim("$infile", header = TRUE, stringsAsFactors = FALSE)
+        peak_list = split(peak_tabular, f = peak_tabular\$spectrum) ## will be ordered according to spectrum
+        pixelnames = unique(peak_tabular\$spectrum)
+
+        peaks = list()
+        for (spectra in 1:length(peak_list))
+        {
+        single_peaks = createMassPeaks(peak_list[[spectra]]\$mass, peak_list[[spectra]]\$intensity, snr=peak_list[[spectra]]\$snr)
+        peaks[[spectra]] = single_peaks
+        }
+
+    #end if
+
+
+#end if
+
+## Quality control plots during peak detection
+
+pdf("peaks_qc_plot.pdf", fonts = "Times", pointsize = 12)
+plot(0,type='n',axes=FALSE,ann=FALSE)
+
+## if no filename is given, name of file in Galaxy history is used
+#set $filename = $infile.display_name
+
+title(main=paste("$filename"))
+
+## plot input file spectrum: 
+#if $infile.ext == 'imzml'
+
+    #if str($centroids) == "TRUE"
+            plot(peaks[[1]], main="First spectrum of input file")
+    #else
+        avgSpectra <- averageMassSpectra(maldi_data,method="mean")
+        plot(avgSpectra, main="Average spectrum of input file")
+    #end if
+#elif $infile.ext == 'tabular'
+    plot(peaks[[1]], main="First spectrum of input file")
+#end if
+
+
+#if str($tabular_annotation.load_annotation) == 'yes_annotation':
+
+    ## read and extract x,y,annotation information
+    input_tabular = read.delim("$tabular_annotation.annotation_file", header = $tabular_annotation.tabular_header, stringsAsFactors = FALSE)
+    annotation_input = input_tabular[,c($tabular_annotation.column_x, $tabular_annotation.column_y, $tabular_annotation.column_names)]
+    colnames(annotation_input) = c("x", "y", "annotation") ## rename annotations header to default name "annotation"
+
+    ## merge with coordinate information of MSI data
+
+    coordinates_st = cbind(coordinates(maldi_data)[,1:2], c(1:length(maldi_data)))
+    colnames(coordinates_st)[3] = "pixel_index"
+    merged_annotation = merge(coordinates_st, annotation_input, by=c("x", "y"), all.x=TRUE)
+    merged_annotation[is.na(merged_annotation)] = "NA"
+    merged_annotation = merged_annotation[order(merged_annotation\$pixel_index),]
+    samples = as.factor(merged_annotation\$annotation)
+
+## print annotation overview into PDF output
+
+        ## the more annotation groups a file has the smaller will be the legend
+        number_combined = length(levels(as.factor(merged_annotation\$annotation)))
+        if (number_combined<20){
+            legend_size = 10
+        }else if (number_combined>20 && number_combined<40){
+            legend_size = 9
+        }else if (number_combined>40 && number_combined<60){
+            legend_size = 8
+        }else if (number_combined>60 && number_combined<100){
+            legend_size = 7
+        }else{
+            legend_size = 6
+        }
+
+        combine_plot = ggplot(merged_annotation, aes(x=x, y=y, fill=annotation))+
+               geom_tile() +
+               coord_fixed()+
+               ggtitle("Spatial orientation of annotated data")+
+               theme_bw()+
+               theme(plot.title = element_text(hjust = 0.5))+
+               theme(text=element_text(family="ArialMT", face="bold", size=12))+
+               theme(legend.position="bottom",legend.direction="vertical")+
+               theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+
+               guides(fill=guide_legend(ncol=5,byrow=TRUE))
+
+        print(combine_plot)
+
+#end if
+
+
+#################### Preprocessing methods #####################################
+
+#for $method in $methods:
+
+
+    #if str( $method.methods_conditional.method ) == 'Peak_detection':
+        print('peak detection')
+        ##peak detection
+
+        #if $method.methods_conditional.use_annotations:
+            maldi_data <- averageMassSpectra(maldi_data, labels=samples,method="mean") ## use average spectra for peak picking
+            pixelnames = merged_annotation\$annotation
+            summarized_spectra = TRUE
+
+        #end if
+
+        peaks <- detectPeaks(maldi_data, method="$method.methods_conditional.peak_method",
+                  halfWindowSize=$method.methods_conditional.halfWindowSize,SNR=$method.methods_conditional.snr)
+
+        ## QC plot
+        plot(peaks[[1]], main="First spectrum after peak detection")
+
+        if (length(peaks[!sapply(peaks, isEmpty)])>0){
+            #if $infile.ext == 'imzml'
+                #if str($centroids) == "FALSE"
+                    featureMatrix <- intensityMatrix(peaks, maldi_data)
+                #end if
+            #else
+                featureMatrix <- intensityMatrix(peaks)
+            #end if
+            featureMatrix2 =cbind(pixelnames, featureMatrix)
+            colnames(featureMatrix2)[1] = c("mz | spectra")
+            featureMatrix2 = t(featureMatrix2)
+            write.table(featureMatrix2, file="$intensity_matrix", quote = FALSE, row.names = TRUE, col.names=FALSE, sep = "\t")
+        }else{print("There are no spectra with peaks left")}
+
+
+    #elif str( $method.methods_conditional.method ) == 'monoisotopic_peaks':
+
+        print('monoisotopic peaks')
+        ##monoisotopic peaks
+
+        peaks = monoisotopicPeaks(peaks, minCor=$method.methods_conditional.minCor, tolerance=$method.methods_conditional.tolerance, distance=$method.methods_conditional.distance, size=$method.methods_conditional.size)
+
+        ## QC plot
+        plot(peaks[[1]], main="First spectrum after monoisotopic peaks detection")
+
+        if (length(peaks[!sapply(peaks, isEmpty)])>0){
+            #if $infile.ext == 'imzml'
+                #if str($centroids) == "FALSE"
+                    featureMatrix <- intensityMatrix(peaks, maldi_data)
+                #end if
+            #else
+                featureMatrix <- intensityMatrix(peaks)
+            #end if
+            featureMatrix2 =cbind(pixelnames, featureMatrix)
+            colnames(featureMatrix2)[1] = c("mz | spectra")
+            featureMatrix2 = t(featureMatrix2)
+            write.table(featureMatrix2, file="$intensity_matrix", quote = FALSE, row.names = TRUE, col.names=FALSE, sep = "\t")
+        }else{print("There are no spectra with peaks left")}
+
+    #elif str( $method.methods_conditional.method ) == 'Binning':
+
+        print('binning')
+        ##m/z binning
+
+        peaks <- binPeaks(peaks, tolerance=$method.methods_conditional.bin_tolerance)
+        ## QC plot
+        plot(peaks[[1]], main="First spectrum after binning")
+
+        if (length(peaks[!sapply(peaks, isEmpty)])>0){
+            #if $infile.ext == 'imzml'
+                #if str($centroids) == "FALSE"
+                    featureMatrix <- intensityMatrix(peaks, maldi_data)
+                #end if
+                    #if str($centroids) == "TRUE"
+                        featureMatrix <- intensityMatrix(peaks)
+                    #end if
+            #else
+                featureMatrix <- intensityMatrix(peaks)
+            #end if
+            featureMatrix2 =cbind(pixelnames, featureMatrix)
+            colnames(featureMatrix2)[1] = c("mz | spectra")
+            featureMatrix2 = t(featureMatrix2)
+            write.table(featureMatrix2, file="$intensity_matrix", quote = FALSE, row.names = TRUE, col.names=FALSE, sep = "\t")
+        }else{print("There are no spectra with peaks left")}
+
+
+    #elif str( $method.methods_conditional.method ) == 'Filtering':
+
+        print('filtering')
+        ##m/z filtering
+
+        ## filtering on all pixels or on pixel groups:
+        #if str($method.methods_conditional.filter_annot_groups ) == 'FALSE':
+
+            peaks <- filterPeaks(peaks,
+            minFrequency=$method.methods_conditional.minFrequency,
+            minNumber=$method.methods_conditional.minNumber,
+            mergeWhitelists=$method.methods_conditional.mergeWhitelists)
+
+        #elif str( $method.methods_conditional.filter_annot_groups ) == 'TRUE':
+
+            peaks <- filterPeaks(peaks,
+            minFrequency=$method.methods_conditional.minFrequency,
+            minNumber=$method.methods_conditional.minNumber,
+            mergeWhitelists=$method.methods_conditional.mergeWhitelists, label = samples)
+        #end if
+
+        ##QC plot
+        plot(peaks[[1]], main="First spectrum after m/z filtering")
+  
+        if (length(peaks[!sapply(peaks, isEmpty)])>0){
+            #if $infile.ext == 'imzml'
+                #if str($centroids) == "FALSE"
+                    featureMatrix <- intensityMatrix(peaks, maldi_data)
+                #end if
+            #else
+                featureMatrix <- intensityMatrix(peaks)
+            #end if
+            featureMatrix2 =cbind(pixelnames, featureMatrix)
+            colnames(featureMatrix2)[1] = c("mz | spectra")
+            featureMatrix2 = t(featureMatrix2)
+            write.table(featureMatrix2, file="$intensity_matrix", quote = FALSE, row.names = TRUE, col.names=FALSE, sep = "\t")
+        }else{print("There are no spectra with peaks left")}
+
+    #end if
+#end for
+
+        if (length(peaks[!sapply(peaks, isEmpty)])>0){
+           ## mass peaks output
+            mass_peaks = data.frame(matrix(,ncol=3, nrow=0))
+            for (spectrum in 1:length(peaks)){
+            spectrum_df = data.frame(peaks[[spectrum]]@snr, peaks[[spectrum]]@mass, peaks[[spectrum]]@intensity)
+            spectrum_df\$spectrum_id = rep(pixelnames[[spectrum]], length(peaks[[spectrum]]@mass))
+            mass_peaks = rbind(mass_peaks,spectrum_df)
+            }
+            colnames(mass_peaks) = c("snr", "mass", "intensity", "spectrum")
+            write.table(mass_peaks, file="$masspeaks", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t")
+        }else{print("There are no spectra with peaks left")}
+
+dev.off()
+
+if (summarized_spectra == FALSE){ 
+    #if $infile.ext == 'imzml'
+        exportImzMl(peaks, file="out.imzMl", processed=$export_processed)
+    #elif $infile.ext == 'tabular'
+        masspeaks_coordinates = matrix(unlist(strsplit(as.character(pixelnames), "\\,")), ncol=2, byrow=TRUE)
+        ## extract x and y values and create the coordinate matrix in case tabular was input
+        peaklist_coordinates = unique(cbind(as.numeric(substring(masspeaks_coordinates[,1], 5, last = 1000000L)), as.numeric(substring(masspeaks_coordinates[,2], 5, last = 1000000L))))
+        exportImzMl(peaks, file="out.imzMl", processed=$export_processed, coordinates=peaklist_coordinates)
+    #end if
+}
+
+    ]]>
+        </configfile>
+    </configfiles>
+    <inputs>
+        <param name="infile" type="data" format="imzml,tabular" label="MS metadata" help="This file is in imzML or tabular format (peak list, peak detection cannot be run again)"/>
+        <param name="centroids" type="boolean" label="Is the imzML data centroided (picked)" help="Choose Yes if peak detection has already been done. Peak detection cannot be run again on centroided data" truevalue="TRUE" falsevalue="FALSE"/>
+        <conditional name="restriction_conditional">
+            <param name="restriction" type="select" label="Restrict the preprocessing to coordinates of interest">
+                <option value="no_restriction" selected="True">Calculate on entire file</option>
+                <option value="restrict">Restrict to coordinates of interest</option>
+            </param>
+            <when value="restrict">
+                <param name="coordinates_file" type="data" format="tabular" label="Tabular file with coordinates which should be read" help="x-values in first column, y-values in second column"/>
+            </when>
+            <when value="no_restriction"/>
+        </conditional>
+
+        <conditional name="tabular_annotation">
+            <param name="load_annotation" type="select" label="Use pixel annotation from tabular file - select in peak detection or filtering step where you want to apply the annotation information">
+                <option value="no_annotation" selected="True">pixels belong into one group only</option>
+                <option value="yes_annotation">use pixel annotation from a tabular file</option>
+            </param>
+            <when value="yes_annotation">
+                <param name="annotation_file" type="data" format="tabular" label="Use annotations from tabular file"
+                    help="Tabular file with three columns: x values, y values and pixel annotations"/>
+                <param name="column_x" data_ref="annotation_file" label="Column with x values" type="data_column"/>
+                <param name="column_y" data_ref="annotation_file" label="Column with y values" type="data_column"/>
+                <param name="column_names" data_ref="annotation_file" label="Column with pixel annotations" type="data_column"/>
+                <param name="tabular_header" type="boolean" label="Tabular file contains a header line" truevalue="TRUE" falsevalue="FALSE"/>
+            </when>
+            <when value="no_annotation"/>
+        </conditional>
+        <repeat name="methods" title="Method" min="1">
+            <conditional name="methods_conditional">
+                <param name="method" type="select" label="Select the method you want to apply">
+                    <option value="Peak_detection">Peak detection</option>
+                    <option value="monoisotopic_peaks">Keep only monoisotopic peaks</option>
+                    <option value="Binning">Binning</option>
+                    <option value="Filtering">Filtering</option>
+                </param>
+                <when value="Peak_detection">
+                    <param name="peak_method" type="select" label="Noise estimation function">
+                        <option value="MAD" selected="True">MAD</option>
+                        <option value="SuperSmoother">SuperSmoother</option>
+                    </param>
+                    <param name="halfWindowSize" type="integer" value="20"
+                        label="Half window size"
+                        help="The resulting window reaches from 
+                            mass[currentIndex-halfWindowSize] to mass[currentIndex+halfWindowSize]
+                            (window size is 2*halfWindowSize+1).
+                            The best size differs depending on the selected smoothing method."/>
+                    <param name="snr" type="integer" value="2" label="Signal-to-noise-ratio" help=""/>
+                    <param name="use_annotations" type="boolean" label="Generate average mass spectra for each annotation group" help="Spectra with same annotation are summarized, no imzML export possible" truevalue="TRUE" falsevalue="FALSE"/>
+                </when>
+                <when value="monoisotopic_peaks">
+                    <param name="minCor" type="float" value="0.95" label="minimal correlation"
+                        help="double , minimal correlation between the peak pattern generated by the model and the experimental peaks in the MassPeaks object to be recognized as isotopic pattern"/>
+                    <param name="tolerance" type="float" label="tolerance" value="0.0004"
+                        help="double, maximal relative deviation of peaks position (mass) to be considered as isotopic distance"/>
+                    <param name="distance" type="float" label="distance" value="1.00235" help="double, distance between two consecutive peaks in an isotopic pattern"/>
+                    <param name="size" type="integer" label="size" value="3" help="double, size (length) of isotopic pattern, longer patterns are prefered over shorter ones"/>
+                </when>
+                <when value="Binning">
+                    <param name="bin_tolerance" type="float" value="0.002" label="Peak binning tolerance"
+                        help="After the alignment the peak positions (mass) are very similar but not identical. The binning is needed to make similar peak mass values identical."/>
+                </when>
+                <when value="Filtering">
+                    <param name="minFrequency" type="float" value="0.25"
+                        label="Remove all peaks which occur in less than minFrequency spectra" help="It is a relative threshold."/>
+                    <param name="minNumber" type="float" value="1.0"
+                        label="remove all peaks which occur in less than minNumber spectra" help="It is an absolute threshold."/>
+                    <param name="filter_annot_groups" type="boolean" label="Group wise filtering with pixel annotations. If not specified a single group is assumed or when filtering has been done group wise it will automatically be group wise when selecting filtering on all pixel" truevalue="TRUE" falsevalue="FALSE"/>
+                    <param name="mergeWhitelists" type="boolean" truevalue="TRUE" falsevalue="FALSE"
+                        label="mergeWhitelists" help="if FALSE the filtering criteria are applied groupwise. If TRUE peaks that survive the filtering in one group (level of labels) these peaks are also kept in other groups even if their frequencies are below minFrequency"/>
+                </when>
+            </conditional>
+        </repeat>
+        <param name="export_processed" type="boolean" label="Export file as processed imzML" help="otherwise continuous imzML will be exported" checked="true" truevalue="TRUE" falsevalue="FALSE"/>
+    </inputs>
+    <outputs>
+        <data format="imzml" name="outfile_imzml" label="$infile.display_name peaks" />
+        <data format="pdf" name="plots" from_work_dir="peaks_qc_plot.pdf" label = "$infile.display_name peakdetection QC"/>
+        <data format="tabular" name="masspeaks" label="$infile.display_name mass_peaks"/>
+        <data format="tabular" name="intensity_matrix" label="intensity_matrix"/>
+    </outputs>
+    <tests>
+        <test>
+            <param name="infile" value="" ftype="imzml">
+                <composite_data value="Example_Continuous.imzML"/>
+                <composite_data value="Example_Continuous.ibd"/>
+            </param>
+                <conditional name="tabular_annotation">
+                    <param name="load_annotation" value="yes_annotation"/>
+                    <param name="annotation_file" value="pixel_annotations.tabular"/>
+                    <param name="column_x" value="1"/>
+                    <param name="column_y" value="2"/>
+                    <param name="column_names" value="3"/>
+                    <param name="tabular_header" value="TRUE"/>
+                </conditional>
+            <repeat name="methods">
+                <conditional name="methods_conditional">
+                    <param name="method" value="Peak_detection"/>
+                    <param name="peak_method" value="SuperSmoother"/>
+                    <param name="halfWindowSize" value="1"/>
+                    <param name="snr" value="5"/>
+                    <param name="use_annotations" value="TRUE"/>
+                </conditional>
+            </repeat>
+            <output name="plots" file="peakdetection1_QC.pdf" compare="sim_size"/>
+            <output name="masspeaks" file="masspeaks1.tabular"/>
+            <output name="intensity_matrix" file="int1.tabular"/>
+        </test>
+        <test>
+            <param name="infile" value="masspeaks1_forinput.tabular"/>
+            <param name="centroids" value="TRUE"/>
+             <repeat name="methods">
+                <conditional name="methods_conditional">
+                <param name="method" value="monoisotopic_peaks"/>
+                <param name="minCor" value="0.60"/>
+                <param name="tolerance" value="0.0001"/>
+            </conditional>
+            </repeat>
+            <output name="plots" file="peakdetection2_QC.pdf" compare="sim_size"/>
+            <output name="masspeaks" file="masspeaks2.tabular"/>
+            <output name="intensity_matrix" file="int2.tabular"/>
+        </test>
+        <test>
+            <param name="infile" value="" ftype="imzml">
+                <composite_data value="Example_Continuous.imzML"/>
+                <composite_data value="Example_Continuous.ibd"/>
+            </param>
+                <conditional name="tabular_annotation">
+                    <param name="load_annotation" value="yes_annotation"/>
+                    <param name="annotation_file" value="pixel_annotations.tabular"/>
+                    <param name="column_x" value="1"/>
+                    <param name="column_y" value="2"/>
+                    <param name="column_names" value="3"/>
+                    <param name="tabular_header" value="TRUE"/>
+                </conditional>
+            <repeat name="methods">
+                <conditional name="methods_conditional">
+                    <param name="method" value="Peak_detection"/>
+                    <param name="peak_method" value="MAD"/>
+                    <param name="halfWindowSize" value="1"/>
+                    <param name="snr" value="2"/>
+                </conditional>
+            </repeat>
+            <repeat name="methods">
+                <conditional name="methods_conditional">
+                    <param name="method" value="Binning"/>
+                    <param name="bin_tolerance" value="0.01"/>
+                </conditional>
+            </repeat>
+            <repeat name="methods">
+                <conditional name="methods_conditional">
+                    <param name="method" value="Filtering"/>
+                    <param name="bin_tolerance" value="0.01"/>
+                    <param name="minFrequency" value="0.5"/>
+                    <param name="minNumber" value="3"/>
+                    <param name="filter_annot_groups" value="TRUE"/>
+                    <param name="mergeWhitelists" value="FALSE"/>
+                </conditional>
+            </repeat>
+            <output name="plots" file="peakdetection3_QC.pdf" compare="sim_size"/>
+            <output name="intensity_matrix" file="intensity_matrix3.tabular"/>
+            <output name="masspeaks" file="masspeaks3.tabular"/>
+        </test>
+    </tests>
+    <help>
+        <![CDATA[
+
+MALDIquant_ provides a complete analysis pipeline for MALDI-TOF and other mass spectrometry data. So far we have only implemented the functionalities for mass spectrometry imaging data.
+
+Input data: 
+
+- MSI data as imzML or file (upload via the "composite" function) `Introduction to the imzml format <https://ms-imaging.org/wp/imzml/>`_
+- or MSI data as peak list (tabular file) with the columns named "snr", "mass", "intensity" and "spectrum". To obtain a valid imzML output file spectrum should contain the pixel coordinates in the format: "x = 1, y = 1"
+- optinal tabular file with pixel coordinates to restrict reading of imzML file to coordinates of interest
+- optional tabular file with pixel annotations. The annotations can be used to summarize pixels of an imzML file which belong to the same group and detect peaks on average spectra, further steps will be done on average spectra as well and average spectra are exported. If this option was not chosen the filtering tool can use the annotations to filter for peaks within pixel groups (select "Group wise filtering")
+
+
+Options:
+
+- Peak detection: detection of peaks, only possible with imzML input
+- Monoisotopic peaks: detection of monoisotopic peaks
+- Peak binning: After the alignment the peak positions (mass) are very similar but not identical. The binning is needed to make similar peak mass values identical.
+- Peak filtering: Removal of less frequent peaks (either with a minimum ratio or with an absolute minimum number of spectra in which the peak has to occur)
+
+
+Output: 
+
+- centroided processed or continuous imzML file
+- pdf with mass spectra after each preprocessing step
+- peak list (tabular file) with the columns "snr", "mass", "intensity" and "spectrum"
+- tabular file with intensity matrix (m/z in rows and spectra in columns). If the input file was imzML in profile mode the intensities before peak picking are also stored in the matrix . For all other inputs not picked values are set to NA. 
+
+.. _MALDIquant: http://strimmerlab.org/software/maldiquant/
+
+        ]]>
+    </help>
+    <expand macro="citation"/>
+</tool>
Binary file test-data/Analyze75.hdr has changed
Binary file test-data/Analyze75.img has changed
Binary file test-data/Analyze75.t2m has changed
Binary file test-data/Example_Continuous.ibd has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/Example_Continuous.imzML	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,313 @@
+<?xml version="1.0"?>
+<mzML version="1.1" xmlns="http://psi.hupo.org/ms/mzml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.0_idx.xsd">
+	<cvList count="3">
+		<cv id="MS" fullName="Proteomics Standards Initiative Mass Spectrometry Ontology" version="1.3.1" URI="http://psidev.info/ms/mzML/psi-ms.obo" />
+		<cv id="UO" fullName="Unit Ontology" version="1.15" URI="http://obo.cvs.sourceforge.net/obo/obo/ontology/phenotype/unit.obo" />
+		<cv id="IMS" fullName="Imaging MS Ontology" version="0.9.1" URI="http://www.maldi-msi.org/download/imzml/imagingMS.obo" />
+	</cvList>
+	<fileDescription>
+		<fileContent>
+			<cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" />
+			<cvParam cvRef="MS" accession="MS:1000128" name="profile spectrum" value="" />
+			<cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="{51BB7C6F-9974-4626-B35F-5B65547BAE6B}" />
+			<cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="26C26A63DCF7CD1AD768A67AEDB7131C5D88C397" />
+			<cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" />
+		</fileContent>
+	</fileDescription>
+	<referenceableParamGroupList count="4">
+		<referenceableParamGroup id="spectrum1">
+			<cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" />
+			<cvParam cvRef="MS" accession="MS:1000511" name="ms level" value="0" />
+			<cvParam cvRef="MS" accession="MS:1000128" name="profile spectrum" value="" />
+		</referenceableParamGroup>
+		<referenceableParamGroup id="scan1">
+			<cvParam cvRef="MS" accession="MS:1000093" name="increasing m/z scan" value="" />
+			<cvParam cvRef="MS" accession="MS:1000095" name="linear" value="" />
+		</referenceableParamGroup>
+		<referenceableParamGroup id="mzArray">
+			<cvParam cvRef="MS" accession="MS:1000576" name="no compression" value="" />
+			<cvParam cvRef="MS" accession="MS:1000514" name="m/z array" value="" unitCvRef="MS" unitAccession="MS:1000040" unitName="m/z" />
+			<cvParam cvRef="IMS" accession="IMS:1000101" name="external data" value="true" />
+			<cvParam cvRef="MS" accession="MS:1000521" name="32-bit float" value="32-bit float" />
+		</referenceableParamGroup>
+		<referenceableParamGroup id="intensityArray">
+			<cvParam cvRef="MS" accession="MS:1000576" name="no compression" value="" />
+			<cvParam cvRef="MS" accession="MS:1000515" name="intensity array" value="" unitCvRef="MS" unitAccession="MS:1000131" unitName="number of counts" />
+			<cvParam cvRef="IMS" accession="IMS:1000101" name="external data" value="true" />
+			<cvParam cvRef="MS" accession="MS:1000521" name="32-bit float" value="32-bit float" />
+		</referenceableParamGroup>
+	</referenceableParamGroupList>
+	<sampleList count="1">
+		<sample id="sample1" name="Sample1">
+			<cvParam cvRef="MS" accession="MS:1000001" name="sample number" value="1" />
+		</sample>
+	</sampleList>
+	<softwareList count="1">
+		<software id="Cardinal" version="1.12.0">
+			<cvParam cvRef="MS" accession="MS:1000799" name="custom unreleased software tool" value="" />
+		</software>
+	</softwareList>
+	<scanSettingsList count="1">
+		<scanSettings id="scansettings1">
+			<cvParam cvRef="IMS" accession="IMS:1000042" name="max count of pixel x" value="3" />
+			<cvParam cvRef="IMS" accession="IMS:1000043" name="max count of pixel y" value="3" />
+		</scanSettings>
+	</scanSettingsList>
+	<instrumentConfigurationList count="1">
+		<instrumentConfiguration id="IC1" />
+	</instrumentConfigurationList>
+	<dataProcessingList count="1">
+		<dataProcessing id="CardinalWriteImzML">
+			<processingMethod order="1" softwareRef="Cardinal">
+				<cvParam cvRef="MS" accession="MS:1000544" name="Conversion to mzML" value="" />
+			</processingMethod>
+		</dataProcessing>
+	</dataProcessingList>
+	<run defaultInstrumentConfigurationRef="IC1" id="Experiment01" sampleRef="sample1">
+		<spectrumList count="9" defaultDataProcessingRef="CardinalWriteImzML">
+			<spectrum id="Spectrum=1" defaultArrayLength="0" index="1">
+				<referenceableParamGroupRef ref="spectrum1" />
+				<scanList count="1">
+					<cvParam cvRef="MS" accession="MS:1000795" name="no combination" value="" />
+					<scan instrumentConfigurationRef="IC1">
+						<referenceableParamGroupRef ref="scan1" />
+						<cvParam cvRef="IMS" accession="IMS:1000050" name="position x" value="1" />
+						<cvParam cvRef="IMS" accession="IMS:1000051" name="position y" value="1" />
+					</scan>
+				</scanList>
+				<binaryDataArrayList count="2">
+					<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="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+					<binaryDataArray encodedLength="0">
+						<referenceableParamGroupRef ref="intensityArray" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="4812" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+				</binaryDataArrayList>
+			</spectrum>
+			<spectrum id="Spectrum=2" defaultArrayLength="0" index="2">
+				<referenceableParamGroupRef ref="spectrum1" />
+				<scanList count="1">
+					<cvParam cvRef="MS" accession="MS:1000795" name="no combination" value="" />
+					<scan instrumentConfigurationRef="IC1">
+						<referenceableParamGroupRef ref="scan1" />
+						<cvParam cvRef="IMS" accession="IMS:1000050" name="position x" value="2" />
+						<cvParam cvRef="IMS" accession="IMS:1000051" name="position y" value="1" />
+					</scan>
+				</scanList>
+				<binaryDataArrayList count="2">
+					<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="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+					<binaryDataArray encodedLength="0">
+						<referenceableParamGroupRef ref="intensityArray" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="9608" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+				</binaryDataArrayList>
+			</spectrum>
+			<spectrum id="Spectrum=3" defaultArrayLength="0" index="3">
+				<referenceableParamGroupRef ref="spectrum1" />
+				<scanList count="1">
+					<cvParam cvRef="MS" accession="MS:1000795" name="no combination" value="" />
+					<scan instrumentConfigurationRef="IC1">
+						<referenceableParamGroupRef ref="scan1" />
+						<cvParam cvRef="IMS" accession="IMS:1000050" name="position x" value="3" />
+						<cvParam cvRef="IMS" accession="IMS:1000051" name="position y" value="1" />
+					</scan>
+				</scanList>
+				<binaryDataArrayList count="2">
+					<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="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+					<binaryDataArray encodedLength="0">
+						<referenceableParamGroupRef ref="intensityArray" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="14404" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+				</binaryDataArrayList>
+			</spectrum>
+			<spectrum id="Spectrum=4" defaultArrayLength="0" index="4">
+				<referenceableParamGroupRef ref="spectrum1" />
+				<scanList count="1">
+					<cvParam cvRef="MS" accession="MS:1000795" name="no combination" value="" />
+					<scan instrumentConfigurationRef="IC1">
+						<referenceableParamGroupRef ref="scan1" />
+						<cvParam cvRef="IMS" accession="IMS:1000050" name="position x" value="1" />
+						<cvParam cvRef="IMS" accession="IMS:1000051" name="position y" value="2" />
+					</scan>
+				</scanList>
+				<binaryDataArrayList count="2">
+					<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="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+					<binaryDataArray encodedLength="0">
+						<referenceableParamGroupRef ref="intensityArray" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="19200" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+				</binaryDataArrayList>
+			</spectrum>
+			<spectrum id="Spectrum=5" defaultArrayLength="0" index="5">
+				<referenceableParamGroupRef ref="spectrum1" />
+				<scanList count="1">
+					<cvParam cvRef="MS" accession="MS:1000795" name="no combination" value="" />
+					<scan instrumentConfigurationRef="IC1">
+						<referenceableParamGroupRef ref="scan1" />
+						<cvParam cvRef="IMS" accession="IMS:1000050" name="position x" value="2" />
+						<cvParam cvRef="IMS" accession="IMS:1000051" name="position y" value="2" />
+					</scan>
+				</scanList>
+				<binaryDataArrayList count="2">
+					<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="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+					<binaryDataArray encodedLength="0">
+						<referenceableParamGroupRef ref="intensityArray" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="23996" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+				</binaryDataArrayList>
+			</spectrum>
+			<spectrum id="Spectrum=6" defaultArrayLength="0" index="6">
+				<referenceableParamGroupRef ref="spectrum1" />
+				<scanList count="1">
+					<cvParam cvRef="MS" accession="MS:1000795" name="no combination" value="" />
+					<scan instrumentConfigurationRef="IC1">
+						<referenceableParamGroupRef ref="scan1" />
+						<cvParam cvRef="IMS" accession="IMS:1000050" name="position x" value="3" />
+						<cvParam cvRef="IMS" accession="IMS:1000051" name="position y" value="2" />
+					</scan>
+				</scanList>
+				<binaryDataArrayList count="2">
+					<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="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+					<binaryDataArray encodedLength="0">
+						<referenceableParamGroupRef ref="intensityArray" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="28792" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+				</binaryDataArrayList>
+			</spectrum>
+			<spectrum id="Spectrum=7" defaultArrayLength="0" index="7">
+				<referenceableParamGroupRef ref="spectrum1" />
+				<scanList count="1">
+					<cvParam cvRef="MS" accession="MS:1000795" name="no combination" value="" />
+					<scan instrumentConfigurationRef="IC1">
+						<referenceableParamGroupRef ref="scan1" />
+						<cvParam cvRef="IMS" accession="IMS:1000050" name="position x" value="1" />
+						<cvParam cvRef="IMS" accession="IMS:1000051" name="position y" value="3" />
+					</scan>
+				</scanList>
+				<binaryDataArrayList count="2">
+					<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="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+					<binaryDataArray encodedLength="0">
+						<referenceableParamGroupRef ref="intensityArray" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="33588" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+				</binaryDataArrayList>
+			</spectrum>
+			<spectrum id="Spectrum=8" defaultArrayLength="0" index="8">
+				<referenceableParamGroupRef ref="spectrum1" />
+				<scanList count="1">
+					<cvParam cvRef="MS" accession="MS:1000795" name="no combination" value="" />
+					<scan instrumentConfigurationRef="IC1">
+						<referenceableParamGroupRef ref="scan1" />
+						<cvParam cvRef="IMS" accession="IMS:1000050" name="position x" value="2" />
+						<cvParam cvRef="IMS" accession="IMS:1000051" name="position y" value="3" />
+					</scan>
+				</scanList>
+				<binaryDataArrayList count="2">
+					<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="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+					<binaryDataArray encodedLength="0">
+						<referenceableParamGroupRef ref="intensityArray" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="38384" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+				</binaryDataArrayList>
+			</spectrum>
+			<spectrum id="Spectrum=9" defaultArrayLength="0" index="9">
+				<referenceableParamGroupRef ref="spectrum1" />
+				<scanList count="1">
+					<cvParam cvRef="MS" accession="MS:1000795" name="no combination" value="" />
+					<scan instrumentConfigurationRef="IC1">
+						<referenceableParamGroupRef ref="scan1" />
+						<cvParam cvRef="IMS" accession="IMS:1000050" name="position x" value="3" />
+						<cvParam cvRef="IMS" accession="IMS:1000051" name="position y" value="3" />
+					</scan>
+				</scanList>
+				<binaryDataArrayList count="2">
+					<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="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+					<binaryDataArray encodedLength="0">
+						<referenceableParamGroupRef ref="intensityArray" />
+						<cvParam cvRef="IMS" accession="IMS:1000102" name="external offset" value="43180" />
+						<cvParam cvRef="IMS" accession="IMS:1000103" name="external array length" value="1199" />
+						<cvParam cvRef="IMS" accession="IMS:1000104" name="external encoded length" value="4796" />
+						<binary />
+					</binaryDataArray>
+				</binaryDataArrayList>
+			</spectrum>
+		</spectrumList>
+	</run>
+</mzML>
Binary file test-data/Preprocessing1_QC.pdf has changed
Binary file test-data/Preprocessing2_QC.pdf has changed
Binary file test-data/Preprocessing3_QC.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/align_reference_test2.tabular	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,2 @@
+350
+340
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/annotations_output3.tabular	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,4 @@
+x	y	pixel_index	annotation
+3	1	3	col3
+2	2	5	col2
+1	3	7	col1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/int1.tabular	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,91 @@
+mz | spectra	col1	col2	col3
+300.083343505859	0	0.0878976186116536	0
+304	9.438736829163e-11	0.137228806813558	0.203098436196645
+304.166687011719	0.104457606871923	0.0169352528949116	0.00765286510187286
+304.666687011719	0.00242311644190166	0.15201666439801	0.269343495368958
+305	0.238949338595072	0	0
+305.75	6.17044061804064e-07	0.155222187439613	1.2719295986822e-09
+305.916687011719	4.33073489900975e-15	0.20923868753016	0.186377684291186
+306.25	0.133792817751516	3.32863570899159e-06	0.00443744411071142
+306.666687011719	0.232789536317284	4.21300777966646e-07	0.00672620768781245
+306.916687011719	0.322907487551371	0.0935481031580518	0.012873843312233
+307.083343505859	0.146026631196443	0.151374835480731	0.218145370482365
+307.166687011719	0.0322767967978232	0.0595835944471799	0.48292171999357
+307.75	4.47047947697381e-07	0.14276859164238	2.35246092014329e-05
+308	4.74193198607586e-31	0.0105287345747153	0.107646773258845
+308.25	1.31886150149067e-10	0.34317347407341	2.12085331600466e-18
+309.833343505859	1.04017844226842e-22	8.99523714516626e-14	0.161644687255224
+311.5	8.2674876717639e-36	0.126103460788727	3.92025505301675e-14
+313.166687011719	0	0.11177615324661	5.93313226097344e-27
+314	0	0.114434331655502	0
+314.75	0	2.47147909294304e-07	0.168087442715963
+314.916687011719	0	3.68001171933446e-15	0.136831253767014
+315.833343505859	0.0782819290953461	0.110506186882656	0
+315.916687011719	0.134740673005581	0.0536241283018139	1.76432110120144e-21
+316.25	0.117780188719432	1.57039798130199e-18	0
+318.083343505859	1.04477046746738e-16	1.04089492472826e-18	0.131532917420069
+318.416687011719	2.8536126402641e-18	3.67994768120427e-34	0.202652255694071
+320.916687011719	0.0873032609621684	0	0
+321.25	0	0.0977287689844767	6.17799215750513e-23
+322.75	0.107258200645447	0	1.17608301635266e-34
+326.916687011719	0.266158272822825	0	0.25384642680486
+327.083343505859	0.593451981743177	0	0.121545955538704
+327.916687011719	0.0726512322822916	0.406224122348552	0.0411825639514337
+328	0.0619983620069211	0.283018628756205	0.340036729971568
+328.916687011719	1.71241245667165	1.60846790671349	1.28705859184265
+329	1.80600585540136	1.28919903437297	0.832459370295207
+329.083343505859	1.44297837217822	0.86747906605604	1.05529999732971
+339.416687011719	8.32534280571564e-20	0.214046796162923	0
+342.333343505859	0	2.34108821802421e-31	0.19008461634318
+343.083343505859	0.319934318463008	0.127889881531648	3.34769538329535e-07
+343.75	0.314895849686906	0.282544448971748	0
+343.916687011719	0.192538282524146	0.369042471672098	0.2857492963473
+344	0.41009783744812	0.313152864575386	0.128487586975098
+344.333343505859	6.71199025718861e-06	0.00336792658767905	0.225824773311615
+344.916687011719	0.452236284813179	0.751941124598185	0.559553499644753
+345	0.777459700902303	0.637996256351471	0.834977408250173
+345.083343505859	0.474276006223219	0.47266262769778	1.09834182262421
+346	0.08379993836085	0.407967170079549	0.326915502548218
+346.083343505859	0.311080597071943	0.257629831632696	0.192155251900998
+350.083343505859	3.19544159797888e-50	0.103204836448034	6.58952745712204e-35
+353.083343505859	0.0853602389494578	2.19854177802231e-35	0
+355.166687011719	0.093819797039032	0	9.60117347178297e-14
+355.333343505859	0.00248587271211127	0	0.218277891476949
+355.916687011719	0.124494592348735	0	1.39208229180778e-05
+356.916687011719	0.131409923235575	0	1.78067501255263e-25
+357.333343505859	0	0.132146000862122	0
+359.916687011719	0	0.0798314611117045	0.0977983176708221
+360.916687011719	0.159461249907811	1.15494471884766e-21	1.28835279183585e-21
+364.333343505859	0.279228508472443	1.73055019418061e-35	1.26172788173214e-35
+365.583343505859	0.189359684795294	0	0
+365.833343505859	1.7948316444194e-14	0.247531970342	0
+366.083343505859	0.0986319063122271	1.32588384715859e-13	0
+367.583343505859	0.0783568720022837	2.06453167823532e-14	0
+367.916687011719	1.61702145682012e-15	0.225095887978872	0
+369.083343505859	2.88841002516114e-35	0.167913814385732	0
+370.083343505859	0.149130453666051	0	0
+370.333343505859	2.4161228573405e-14	0.115314324833289	0.318489452203115
+370.416687011719	7.03686563996456e-35	0.129989445209503	0.125592420498229
+374.5	0.10046042005221	0	0
+376	0	0.0839582482973735	0
+376.833343505859	1.12191678323758e-19	1.39707496737756e-18	0.119955976804097
+378.75	0	0.090022732814153	0
+379.5	0	1.72464685495773e-08	0.138252675533295
+380.75	0	0	0.063951442639033
+382.583343505859	0	0.111637224753698	7.95723995096435e-27
+383.166687011719	0	0.194509585698446	0
+386.666687011719	0	0.0512171338003176	0.0939600268999736
+386.75	0	0.0984363655249278	0.0927414894104004
+387	0	6.52904607851611e-31	0.148616979519526
+387.166687011719	0	2.03704329008776e-17	0.213376681009928
+387.5	0	8.61125988498297e-35	0.135613699754079
+390.166687011719	0	4.36941183283449e-29	0.0942935446898143
+391.083343505859	0	4.42513011657232e-35	0.103488087654114
+392	0	0	0.184977193673452
+392.833343505859	0	0	0.264233609040578
+393.583343505859	0	0.136588126420975	8.05443629544114e-18
+394.833343505859	0	6.62304192985937e-11	0.103502949078878
+395.916687011719	0.170605540275574	2.68065472318023e-19	4.58339070400444e-10
+397.083343505859	0.0962067842483521	5.10727327656766e-39	1.3634908830594e-18
+398.166687011719	4.69207117603236e-10	0	0.142847468455633
+398.75	0.214157521724701	0	0.0781838993231456
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/intensity_matrix3.tabular	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,61 @@
+mz | spectra	x = 1, y = 1	x = 2, y = 1	x = 3, y = 1	x = 1, y = 2	x = 2, y = 2	x = 3, y = 2	x = 1, y = 3	x = 2, y = 3	x = 3, y = 3
+304.595254080636	1.76512676262064e-05	0	0.327420804051165	1.17177887401856e-13	2.65423709869989e-05	0	0.279548346996307	0.256212419994475	0.226718190873036
+305.119057791574	1.62699820283052e-09	0	1.36897748140363e-05	5.69736818276873e-18	1.71781823336396e-09	0	0.716848015785217	1.44706262158933e-05	9.11607707771881e-06
+305.66667175293	1.02237303638199e-13	0	0	5.6757509669499e-22	1.38465480219223e-13	0	6.01442479819525e-05	0.104363307437671	0
+306.32292175293	7.71168242810122e-18	1.93815667444142e-05	0.00166465085730497	0.401378452777863	2.31608719332144e-05	0	3.80939590982621e-09	2.58914169535274e-05	0
+307.031265258789	5.54882387838857e-22	1.36712752230039e-09	0	0.968722462654114	0.447774022817612	0	2.06235797064436e-17	0.2786685526371	0.24870975899223
+307.614593505859	3.61475171997316e-26	9.10052605105835e-14	2.66617127290192e-14	5.86232454224955e-05	0.428305774927139	0	1.33474952143388e-21	2.96689468086697e-05	2.29502790401684e-05
+308.266668701172	0	0.399492412805557	5.49709452157217e-18	3.16526760357059e-10	2.67954346782062e-05	0	9.61811965698005e-26	0.630028009414673	0
+308.718757629395	1.67789168240286e-34	2.19716112042079e-05	2.54779258531233e-22	2.7437655012591e-13	2.22558682594354e-09	0	6.1926750159511e-30	3.5055691114394e-05	2.52516152340681e-06
+309.250011444092	1.43981749664202e-38	1.93809390758304e-09	4.13472104092826e-30	2.22135184510828e-17	1.23887540308919e-13	0	5.40336274000115e-34	3.4764433554102e-09	1.38004015797696e-10
+309.833347865513	0	1.00940015081239e-13	0.48491979542541	3.12037946660539e-22	1.11220637212349e-17	0	1.58430967796518e-38	2.08417769262566e-13	1.59889560466104e-15
+310.361124674479	0	9.53307623430011e-18	1.55835089874954e-05	3.36954934268577e-26	5.68033014673253e-22	0	0	1.65365266219334e-17	3.7154492253661e-19
+310.902786254883	0	4.60080996999485e-22	1.95156964762021e-09	2.07421300132466e-30	5.44664266518465e-26	0	0	1.14908291585848e-21	2.22704717543506e-23
+311.430557250977	0	0.37831038236618	9.52911716684975e-14	1.77501055870647e-34	2.68241453784197e-30	0	0	7.77481833182232e-26	1.84811952636198e-27
+311.986119588216	0	3.04782115563285e-05	9.52204682948462e-18	4.44062812784588e-39	2.62427828124129e-34	0	0	6.04272858040201e-30	8.70672758122422e-32
+312.516674804688	0	1.61912494522909e-09	5.80865755353567e-22	0	1.58696420500477e-38	0	0	3.61853642833949e-34	6.93107025476741e-36
+321.050012207031	1.5556590571819e-38	0	2.03119570891005e-22	1.50940976188625e-38	0	0	0.261909782886505	0	0
+328.000010172526	0.481155782938004	0	0.454359894254041	0.217953696846962	0	0	2.71850386646122e-09	0.849008060761868	0.5657325952201
+328.937515258789	2.0283993482588	2.02454543113708	1.43158733844757	2.46865260601032	2.37836694717407	0.995543837547302	0.710380464792343	1.3272477388382	1.43404459953308
+329.152786254883	2.47849035263062	0.723605536849375	0.472820775018267	1.6380660533905	0.544302017292807	0.315756578190207	0.519839584827423	0.398567609342448	1.43721342372632
+329.697925567627	9.31685466657131e-05	4.36672562500462e-05	4.62229545519222e-05	4.39239451845604e-05	2.56914954661625e-05	3.03936976706609e-05	1.34288756694759e-05	0.000119319425721187	6.18351987213828e-05
+330.197929382324	1.09462394703996e-08	0.291347920894623	3.22762437610759e-09	0.533841967582703	2.05684469456457e-09	0.0402998076535276	2.44585240949391e-09	0.87813526391983	2.30255281506431e-09
+330.712968614366	5.96421675068404e-13	2.65860908257309e-05	2.11953542282421e-13	2.71527351287659e-05	1.42042993578166e-13	2.97629267151933e-05	1.88825666799612e-13	5.94691991864238e-05	3.4482751940304e-13
+331.259270562066	5.44180783738833e-17	1.33338984298348e-09	2.03012902874583e-17	2.59207522113059e-09	9.67603620520642e-18	1.62655666713363e-09	1.13914243343648e-17	4.48100578864796e-09	2.93395139921047e-17
+331.796308729384	2.72964412068832e-21	0.256167501211166	9.94915412632575e-22	1.59223044362937e-13	7.48378431587693e-22	1.42477311415937e-13	9.62779062132945e-22	2.77607174444319e-13	1.94369975414076e-21
+332.342600504557	2.65403450832136e-25	1.61519819812384e-05	9.78378697984054e-26	1.2307215842857e-17	4.50551773856038e-26	9.25888240485103e-18	5.25721990550878e-26	2.30068624134988e-17	1.38486306848585e-25
+332.879638671875	1.38079261482617e-29	0.473990738391876	5.89565674575821e-30	8.70707862088559e-22	3.81384647033894e-30	6.73557006833172e-22	4.78893314027823e-30	1.28379127790181e-21	1.03717248235199e-29
+333.44445461697	1.27447841383671e-33	3.11978510580957e-05	4.65177644766935e-34	5.77743854353985e-26	2.07898068639674e-34	4.97108094996007e-26	2.40634231736506e-34	1.15039499526719e-25	6.46787389371651e-34
+334.020843505859	4.19295075099593e-38	2.16568318833765e-09	3.24418811371231e-38	2.6320776944162e-31	1.92182899577831e-38	0.268675297498703	5.84361625277231e-39	5.88708673366388e-30	5.33374608969737e-38
+343.642865862165	0.282461315393448	4.07043262384832e-05	0	0.662226140499115	3.78152206840319e-30	0	2.33215705520706e-05	0.628214061260223	7.90256160631833e-11
+344.611124674479	0.638258039951324	0.050419380267186	0	0.267281413078308	0.0851623356965313	0	1.14931461158048e-13	0	0.00120643045131701
+345.629638671875	7.93658109614626e-05	0.388675004243851	3.101946276729e-05	2.6464356778888e-05	2.89905474346597e-05	8.61570297274739e-05	2.49274271482136e-05	2.52073332376312e-05	0.000100398268841673
+346.120378282335	6.64322641341641e-09	1.22390151023865	2.42813036344103e-09	0.933241784572601	2.03336369963836e-09	0.285138785839081	2.42154163387909e-09	2.42913511527831e-09	0.700047612190247
+346.700012207031	3.66650991252132e-13	0.0672352715263476	6.34549374101459e-14	5.34617865923792e-05	0.198722198605816	6.78352444085909e-06	1.25566657765974e-13	0.00229110755024777	5.02025509379003e-06
+347.296308729384	3.31281302377731e-17	2.53151047218125e-05	1.2331086620974e-17	2.65817307081306e-05	1.5656460163882e-05	1.30612853865841e-09	1.16314638763216e-17	3.06663314404432e-05	0.290130436420441
+347.814826117622	1.67992344863529e-21	2.07963690712631e-09	6.65060432147639e-22	2.63146238133061e-09	1.26892807372769e-09	1.26163240011384e-13	7.28580269542504e-22	1.64383595624429e-09	1.69061459018849e-05
+348.361117892795	1.61966283306326e-25	1.17175312421697e-13	6.1151591415287e-26	1.46233204581861e-13	7.2568185727033e-14	6.39862460913097e-18	5.51452352978133e-26	1.4698648114625e-13	1.38276745609289e-09
+348.888895670573	8.15391718679523e-30	1.04223425420895e-17	3.04086320241335e-30	1.25829507097872e-17	6.38326717387832e-18	6.06791151963729e-22	3.95872379808908e-30	9.42402156952173e-18	9.4092654945744e-14
+349.44445461697	7.79337969080295e-34	5.37785487481536e-22	2.97658725432968e-34	8.27559972606905e-22	3.33466297356616e-22	3.743162251606e-26	2.58541051461361e-34	6.95620575449764e-22	6.51254681822392e-18
+349.96297539605	4.78329195057699e-38	0.309614509344101	1.58814465883111e-38	5.94295388740686e-26	3.14223389850709e-26	2.88010014996665e-30	2.00786591889092e-38	5.08223484114241e-26	4.97919259365601e-22
+351.069458007812	0	1.2832610529756e-09	0	0	1.5203838193817e-34	0	0	2.63284561467787e-34	3.32229042394214e-31
+365.979179382324	3.88570062627783e-13	0	0	4.37134549429175e-05	0.173811576199161	0	0.29585200548172	0	0
+366.562515258789	1.91497258346089e-17	0	0	2.64647725956024e-09	4.52266677417036e-06	0	2.61009136011126e-05	0	0
+367.083343505859	1.88767583715038e-21	0	0	2.23088989772732e-13	3.42134404148904e-10	0	1.29202726295574e-09	0	0
+367.645835876465	0.235070616006851	0	0	1.22170415755601e-17	1.87340617860966e-14	0	1.26925610321495e-13	0	0
+368.222229003906	1.47346945595928e-05	0	0	1.11046018496466e-21	4.62989532461971e-19	0	6.86202649112451e-18	0	0
+368.666680908203	1.13727949280218e-09	4.43278103918769e-10	0	5.59376337511562e-26	2.64720312520856e-22	0	6.0804923995715e-22	0	0
+369.216674804688	6.86236075017783e-14	0.243361799416703	0	5.42113770011657e-30	1.91403560903029e-26	0	3.92168363149906e-26	0	0
+369.766680908203	5.79879376075753e-18	1.30925746630553e-05	0	2.78554944810064e-34	9.05948240607747e-31	0	2.87628364894794e-30	0	0
+370.523821149554	2.65765684162034e-05	2.16230963798365e-13	0.0328804283276356	2.60531652564813e-38	2.19204516215991e-38	0	2.11079916033934e-34	0.38996833562851	0
+387.850006103516	0	0	2.8698808819172e-05	0	0	0.197833687067032	0	1.17373640923254e-09	4.42154814663809e-05
+388.895843505859	0	0	1.5247652858201e-13	0	0	1.24303778381574e-09	0	5.31553152204143e-18	2.20461995013854e-13
+389.854179382324	0	0	9.39855267846122e-18	0	0	6.66746120334285e-18	0	5.16630861650634e-27	1.07776605300705e-21
+391.083335876465	0	0	3.90465670032414e-30	0	0	0.310464262962341	0	1.327545052754e-34	5.18557991695755e-30
+391.972229003906	0	0	1.99175119954855e-34	0	0	0.554931581020355	0	0	2.46211811583847e-38
+394.083351135254	0	0	3.94045773788321e-09	0	0	1.74293175463129e-17	0	2.60665914385164e-09	0.225453585386276
+394.791679382324	0	0	9.62898286324196e-18	0	0	1.05953142589779e-21	0	6.91928164298039e-10	0.310508847236633
+395.270843505859	0	0	0.23992046713829	0	0	8.90397842411612e-26	0	1.09278001533673e-13	2.11353399208747e-05
+395.816680908203	0	0	1.69494323927211e-05	0.0462248943014157	0	4.8930473332074e-30	0	6.3406399863305e-18	1.37501721120259e-09
+396.383337402344	0	0	1.12639098048817e-09	0	0	4.43552910897872e-34	0	3.41384280988713e-22	9.99066823194339e-14
+396.916674804687	0	0	8.86759402344249e-14	0	0	2.28012433765444e-38	0	2.33594034018325e-26	7.3794850397387e-18
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/masspeaks1.tabular	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,99 @@
+snr	mass	intensity	spectrum
+5.34196717869329	304.166687011719	0.104457606871923	col1
+12.0922480027988	305	0.238949338595072	col1
+6.80380283473404	306.25	0.133792817751516	col1
+11.9239943102966	306.666687011719	0.232789536317284	col1
+16.7672721943661	306.916687011719	0.322907487551371	col1
+14.5727405573344	315.916687011719	0.134740673005581	col1
+12.6587975530526	316.25	0.117780188719432	col1
+15.5891513371263	320.916687011719	0.0873032609621684	col1
+8.28066653191209	322.75	0.107258200645447	col1
+8.64305080588796	327.083343505859	0.593451981743177	col1
+22.5976205263238	329	1.80600585540136	col1
+6.62986417925206	343.083343505859	0.319934318463008	col1
+5.76872573536526	343.75	0.314895849686906	col1
+7.23012875909998	344	0.41009783744812	col1
+12.5923211364761	345	0.777459700902303	col1
+5.61154187261139	346.083343505859	0.311080597071943	col1
+11.6128628366043	353.083343505859	0.0853602389494578	col1
+8.93926402677033	355.166687011719	0.093819797039032	col1
+11.4518402499656	355.916687011719	0.124494592348735	col1
+12.2687590055812	356.916687011719	0.131409923235575	col1
+17.1598526473503	360.916687011719	0.159461249907811	col1
+19.5606964350667	364.333343505859	0.279228508472443	col1
+13.4363791597757	365.583343505859	0.189359684795294	col1
+7.2659142337533	366.083343505859	0.0986319063122271	col1
+6.78882554537553	367.583343505859	0.0783568720022837	col1
+19.2913990161673	370.083343505859	0.149130453666051	col1
+22.9258781818056	374.5	0.10046042005221	col1
+32.553974512381	395.916687011719	0.170605540275574	col1
+20.0044568991975	397.083343505859	0.0962067842483521	col1
+52.5251008144488	398.75	0.214157521724701	col1
+6.53932310180994	300.083343505859	0.0878976186116536	col2
+8.1332053348611	304	0.137228806813558	col2
+8.87376047659255	304.666687011719	0.15201666439801	col2
+9.0031548908286	305.75	0.155222187439613	col2
+12.1483037475036	305.916687011719	0.20923868753016	col2
+5.50393277232579	306.916687011719	0.0935481031580518	col2
+8.92694410124806	307.083343505859	0.151374835480731	col2
+8.53366295883023	307.75	0.14276859164238	col2
+20.8363523568967	308.25	0.34317347407341	col2
+9.03952553159105	311.5	0.126103460788727	col2
+9.21792692425819	313.166687011719	0.11177615324661	col2
+10.2836388640006	314	0.114434331655502	col2
+14.5366950159814	315.833343505859	0.110506186882656	col2
+29.6030745455647	321.25	0.0977287689844767	col2
+5.12133326721085	327.916687011719	0.406224122348552	col2
+18.2260181460723	328.916687011719	1.60846790671349	col2
+6.71691695849357	339.416687011719	0.214046796162923	col2
+5.42044735697872	343.916687011719	0.369042471672098	col2
+9.90109899068147	344.916687011719	0.751941124598185	col2
+5.7761050136785	346	0.407967170079549	col2
+9.53380778579935	350.083343505859	0.103204836448034	col2
+22.3739163562105	357.333343505859	0.132146000862122	col2
+17.1123310736305	359.916687011719	0.0798314611117045	col2
+21.5296474065392	365.833343505859	0.247531970342	col2
+17.6598326813686	367.916687011719	0.225095887978872	col2
+14.4139559364593	369.083343505859	0.167913814385732	col2
+13.4612234580055	370.416687011719	0.129989445209503	col2
+10.0270809962262	376	0.0839582482973735	col2
+13.7957864133576	378.75	0.090022732814153	col2
+21.7167106106545	382.583343505859	0.111637224753698	col2
+37.803872450968	383.166687011719	0.194509585698446	col2
+19.3443105357995	386.75	0.0984363655249278	col2
+40.2946953152003	393.583343505859	0.136588126420975	col2
+10.9042784289401	304	0.203098436196645	col3
+14.2536155186416	304.666687011719	0.269343495368958	col3
+9.73428286587393	305.916687011719	0.186377684291186	col3
+25.326392266369	307.166687011719	0.48292171999357	col3
+5.77081370276002	308	0.107646773258845	col3
+9.71607704287468	309.833343505859	0.161644687255224	col3
+12.3286648153297	314.75	0.168087442715963	col3
+10.0188114825306	314.916687011719	0.136831253767014	col3
+9.98544088935621	318.083343505859	0.131532917420069	col3
+15.9567928309838	318.416687011719	0.202652255694071	col3
+5.45721434599321	326.916687011719	0.25384642680486	col3
+6.94450239587698	328	0.340036729971568	col3
+26.3506501037786	328.916687011719	1.28705859184265	col3
+21.9755116973922	329.083343505859	1.05529999732971	col3
+6.26698769334215	342.333343505859	0.19008461634318	col3
+7.40453698942461	343.916687011719	0.2857492963473	col3
+5.47629632143471	344.333343505859	0.225824773311615	col3
+24.2489760518392	345.083343505859	1.09834182262421	col3
+7.55360848799134	346	0.326915502548218	col3
+31.8141872712877	355.333343505859	0.218277891476949	col3
+28.500421447754	359.916687011719	0.0977983176708221	col3
+35.9263674883478	370.333343505859	0.318489452203115	col3
+17.9023349585808	376.833343505859	0.119955976804097	col3
+14.165837350632	379.5	0.138252675533295	col3
+6.1026956808649	380.75	0.063951442639033	col3
+6.66805606030542	386.666687011719	0.0939600268999736	col3
+10.4761700777795	387	0.148616979519526	col3
+14.9996173987781	387.166687011719	0.213376681009928	col3
+9.49389038421466	387.5	0.135613699754079	col3
+6.40597511255643	390.166687011719	0.0942935446898143	col3
+6.91093965563744	391.083343505859	0.103488087654114	col3
+12.1864531063779	392	0.184977193673452	col3
+17.1091639921622	392.833343505859	0.264233609040578	col3
+6.41767571506743	394.833343505859	0.103502949078878	col3
+8.23619853479686	398.166687011719	0.142847468455633	col3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/masspeaks1_forinput.tabular	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,99 @@
+snr	mass	intensity	spectrum
+5.34196717869329	304.166687011719	0.104457606871923	x = 1, y = 1
+12.0922480027988	305	0.238949338595072	x = 1, y = 1
+6.80380283473404	306.25	0.133792817751516	x = 1, y = 1
+11.9239943102966	306.666687011719	0.232789536317284	x = 1, y = 1
+16.7672721943661	306.916687011719	0.322907487551371	x = 1, y = 1
+14.5727405573344	315.916687011719	0.134740673005581	x = 1, y = 1
+12.6587975530526	316.25	0.117780188719432	x = 1, y = 1
+15.5891513371263	320.916687011719	0.0873032609621684	x = 1, y = 1
+8.28066653191209	322.75	0.107258200645447	x = 1, y = 1
+8.64305080588796	327.083343505859	0.593451981743177	x = 1, y = 1
+22.5976205263238	329	1.80600585540136	x = 1, y = 1
+6.62986417925206	343.083343505859	0.319934318463008	x = 1, y = 1
+5.76872573536526	343.75	0.314895849686906	x = 1, y = 1
+7.23012875909998	344	0.41009783744812	x = 1, y = 1
+12.5923211364761	345	0.777459700902303	x = 1, y = 1
+5.61154187261139	346.083343505859	0.311080597071943	x = 1, y = 1
+11.6128628366043	353.083343505859	0.0853602389494578	x = 1, y = 1
+8.93926402677033	355.166687011719	0.093819797039032	x = 1, y = 1
+11.4518402499656	355.916687011719	0.124494592348735	x = 1, y = 1
+12.2687590055812	356.916687011719	0.131409923235575	x = 1, y = 1
+17.1598526473503	360.916687011719	0.159461249907811	x = 1, y = 1
+19.5606964350667	364.333343505859	0.279228508472443	x = 1, y = 1
+13.4363791597757	365.583343505859	0.189359684795294	x = 1, y = 1
+7.2659142337533	366.083343505859	0.0986319063122271	x = 1, y = 1
+6.78882554537553	367.583343505859	0.0783568720022837	x = 1, y = 1
+19.2913990161673	370.083343505859	0.149130453666051	x = 1, y = 1
+22.9258781818056	374.5	0.10046042005221	x = 1, y = 1
+32.553974512381	395.916687011719	0.170605540275574	x = 1, y = 1
+20.0044568991975	397.083343505859	0.0962067842483521	x = 1, y = 1
+52.5251008144488	398.75	0.214157521724701	x = 1, y = 1
+6.53932310180994	300.083343505859	0.0878976186116536	x = 2, y = 1
+8.1332053348611	304	0.137228806813558	x = 2, y = 1
+8.87376047659255	304.666687011719	0.15201666439801	x = 2, y = 1
+9.0031548908286	305.75	0.155222187439613	x = 2, y = 1
+12.1483037475036	305.916687011719	0.20923868753016	x = 2, y = 1
+5.50393277232579	306.916687011719	0.0935481031580518	x = 2, y = 1
+8.92694410124806	307.083343505859	0.151374835480731	x = 2, y = 1
+8.53366295883023	307.75	0.14276859164238	x = 2, y = 1
+20.8363523568967	308.25	0.34317347407341	x = 2, y = 1
+9.03952553159105	311.5	0.126103460788727	x = 2, y = 1
+9.21792692425819	313.166687011719	0.11177615324661	x = 2, y = 1
+10.2836388640006	314	0.114434331655502	x = 2, y = 1
+14.5366950159814	315.833343505859	0.110506186882656	x = 2, y = 1
+29.6030745455647	321.25	0.0977287689844767	x = 2, y = 1
+5.12133326721085	327.916687011719	0.406224122348552	x = 2, y = 1
+18.2260181460723	328.916687011719	1.60846790671349	x = 2, y = 1
+6.71691695849357	339.416687011719	0.214046796162923	x = 2, y = 1
+5.42044735697872	343.916687011719	0.369042471672098	x = 2, y = 1
+9.90109899068147	344.916687011719	0.751941124598185	x = 2, y = 1
+5.7761050136785	346	0.407967170079549	x = 2, y = 1
+9.53380778579935	350.083343505859	0.103204836448034	x = 2, y = 1
+22.3739163562105	357.333343505859	0.132146000862122	x = 2, y = 1
+17.1123310736305	359.916687011719	0.0798314611117045	x = 2, y = 1
+21.5296474065392	365.833343505859	0.247531970342	x = 2, y = 1
+17.6598326813686	367.916687011719	0.225095887978872	x = 2, y = 1
+14.4139559364593	369.083343505859	0.167913814385732	x = 2, y = 1
+13.4612234580055	370.416687011719	0.129989445209503	x = 2, y = 1
+10.0270809962262	376	0.0839582482973735	x = 2, y = 1
+13.7957864133576	378.75	0.090022732814153	x = 2, y = 1
+21.7167106106545	382.583343505859	0.111637224753698	x = 2, y = 1
+37.803872450968	383.166687011719	0.194509585698446	x = 2, y = 1
+19.3443105357995	386.75	0.0984363655249278	x = 2, y = 1
+40.2946953152003	393.583343505859	0.136588126420975	x = 2, y = 1
+10.9042784289401	304	0.203098436196645	x = 3, y = 1
+14.2536155186416	304.666687011719	0.269343495368958	x = 3, y = 1
+9.73428286587393	305.916687011719	0.186377684291186	x = 3, y = 1
+25.326392266369	307.166687011719	0.48292171999357	x = 3, y = 1
+5.77081370276002	308	0.107646773258845	x = 3, y = 1
+9.71607704287468	309.833343505859	0.161644687255224	x = 3, y = 1
+12.3286648153297	314.75	0.168087442715963	x = 3, y = 1
+10.0188114825306	314.916687011719	0.136831253767014	x = 3, y = 1
+9.98544088935621	318.083343505859	0.131532917420069	x = 3, y = 1
+15.9567928309838	318.416687011719	0.202652255694071	x = 3, y = 1
+5.45721434599321	326.916687011719	0.25384642680486	x = 3, y = 1
+6.94450239587698	328	0.340036729971568	x = 3, y = 1
+26.3506501037786	328.916687011719	1.28705859184265	x = 3, y = 1
+21.9755116973922	329.083343505859	1.05529999732971	x = 3, y = 1
+6.26698769334215	342.333343505859	0.19008461634318	x = 3, y = 1
+7.40453698942461	343.916687011719	0.2857492963473	x = 3, y = 1
+5.47629632143471	344.333343505859	0.225824773311615	x = 3, y = 1
+24.2489760518392	345.083343505859	1.09834182262421	x = 3, y = 1
+7.55360848799134	346	0.326915502548218	x = 3, y = 1
+31.8141872712877	355.333343505859	0.218277891476949	x = 3, y = 1
+28.500421447754	359.916687011719	0.0977983176708221	x = 3, y = 1
+35.9263674883478	370.333343505859	0.318489452203115	x = 3, y = 1
+17.9023349585808	376.833343505859	0.119955976804097	x = 3, y = 1
+14.165837350632	379.5	0.138252675533295	x = 3, y = 1
+6.1026956808649	380.75	0.063951442639033	x = 3, y = 1
+6.66805606030542	386.666687011719	0.0939600268999736	x = 3, y = 1
+10.4761700777795	387	0.148616979519526	x = 3, y = 1
+14.9996173987781	387.166687011719	0.213376681009928	x = 3, y = 1
+9.49389038421466	387.5	0.135613699754079	x = 3, y = 1
+6.40597511255643	390.166687011719	0.0942935446898143	x = 3, y = 1
+6.91093965563744	391.083343505859	0.103488087654114	x = 3, y = 1
+12.1864531063779	392	0.184977193673452	x = 3, y = 1
+17.1091639921622	392.833343505859	0.264233609040578	x = 3, y = 1
+6.41767571506743	394.833343505859	0.103502949078878	x = 3, y = 1
+8.23619853479686	398.166687011719	0.142847468455633	x = 3, y = 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/masspeaks3.tabular	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,298 @@
+snr	mass	intensity	spectrum
+Inf	304.595254080636	1.76512676262064e-05	x = 1, y = 1
+Inf	305.119057791574	1.62699820283052e-09	x = 1, y = 1
+Inf	305.66667175293	1.02237303638199e-13	x = 1, y = 1
+Inf	306.32292175293	7.71168242810122e-18	x = 1, y = 1
+Inf	307.031265258789	5.54882387838857e-22	x = 1, y = 1
+Inf	307.614593505859	3.61475171997316e-26	x = 1, y = 1
+Inf	308.718757629395	1.67789168240286e-34	x = 1, y = 1
+Inf	309.250011444092	1.43981749664202e-38	x = 1, y = 1
+Inf	321.050012207031	1.5556590571819e-38	x = 1, y = 1
+Inf	328.000010172526	0.481155782938004	x = 1, y = 1
+Inf	329.152786254883	2.47849035263062	x = 1, y = 1
+Inf	330.197929382324	1.09462394703996e-08	x = 1, y = 1
+Inf	330.712968614366	5.96421675068404e-13	x = 1, y = 1
+Inf	331.259270562066	5.44180783738833e-17	x = 1, y = 1
+Inf	331.796308729384	2.72964412068832e-21	x = 1, y = 1
+Inf	332.342600504557	2.65403450832136e-25	x = 1, y = 1
+Inf	332.879638671875	1.38079261482617e-29	x = 1, y = 1
+Inf	333.44445461697	1.27447841383671e-33	x = 1, y = 1
+Inf	343.642865862165	0.282461315393448	x = 1, y = 1
+Inf	344.611124674479	0.638258039951324	x = 1, y = 1
+Inf	345.629638671875	7.93658109614626e-05	x = 1, y = 1
+Inf	346.120378282335	6.64322641341641e-09	x = 1, y = 1
+Inf	346.700012207031	3.66650991252132e-13	x = 1, y = 1
+Inf	347.296308729384	3.31281302377731e-17	x = 1, y = 1
+Inf	347.814826117622	1.67992344863529e-21	x = 1, y = 1
+Inf	348.361117892795	1.61966283306326e-25	x = 1, y = 1
+Inf	348.888895670573	8.15391718679523e-30	x = 1, y = 1
+Inf	349.44445461697	7.79337969080295e-34	x = 1, y = 1
+Inf	349.96297539605	4.78329195057699e-38	x = 1, y = 1
+Inf	365.979179382324	3.88570062627783e-13	x = 1, y = 1
+Inf	366.562515258789	1.91497258346089e-17	x = 1, y = 1
+Inf	367.083343505859	1.88767583715038e-21	x = 1, y = 1
+Inf	367.645835876465	0.235070616006851	x = 1, y = 1
+Inf	368.222229003906	1.47346945595928e-05	x = 1, y = 1
+Inf	368.666680908203	1.13727949280218e-09	x = 1, y = 1
+Inf	369.216674804688	6.86236075017783e-14	x = 1, y = 1
+Inf	369.766680908203	5.79879376075753e-18	x = 1, y = 1
+Inf	370.523821149554	2.65765684162034e-05	x = 1, y = 1
+Inf	306.32292175293	1.93815667444142e-05	x = 2, y = 1
+Inf	307.031265258789	1.36712752230039e-09	x = 2, y = 1
+Inf	307.614593505859	9.10052605105835e-14	x = 2, y = 1
+Inf	308.266668701172	0.399492412805557	x = 2, y = 1
+Inf	308.718757629395	2.19716112042079e-05	x = 2, y = 1
+Inf	309.250011444092	1.93809390758304e-09	x = 2, y = 1
+Inf	309.833347865513	1.00940015081239e-13	x = 2, y = 1
+Inf	310.361124674479	9.53307623430011e-18	x = 2, y = 1
+Inf	310.902786254883	4.60080996999485e-22	x = 2, y = 1
+Inf	311.430557250977	0.37831038236618	x = 2, y = 1
+Inf	311.986119588216	3.04782115563285e-05	x = 2, y = 1
+Inf	312.516674804688	1.61912494522909e-09	x = 2, y = 1
+Inf	328.937515258789	2.02454543113708	x = 2, y = 1
+Inf	329.697925567627	4.36672562500462e-05	x = 2, y = 1
+Inf	330.197929382324	0.291347920894623	x = 2, y = 1
+Inf	330.712968614366	2.65860908257309e-05	x = 2, y = 1
+Inf	331.259270562066	1.33338984298348e-09	x = 2, y = 1
+Inf	331.796308729384	0.256167501211166	x = 2, y = 1
+Inf	332.342600504557	1.61519819812384e-05	x = 2, y = 1
+Inf	332.879638671875	0.473990738391876	x = 2, y = 1
+Inf	333.44445461697	3.11978510580957e-05	x = 2, y = 1
+Inf	334.020843505859	2.16568318833765e-09	x = 2, y = 1
+Inf	343.642865862165	4.07043262384832e-05	x = 2, y = 1
+Inf	345.629638671875	0.388675004243851	x = 2, y = 1
+Inf	346.120378282335	1.22390151023865	x = 2, y = 1
+Inf	347.296308729384	2.53151047218125e-05	x = 2, y = 1
+Inf	347.814826117622	2.07963690712631e-09	x = 2, y = 1
+Inf	348.361117892795	1.17175312421697e-13	x = 2, y = 1
+Inf	348.888895670573	1.04223425420895e-17	x = 2, y = 1
+Inf	349.44445461697	5.37785487481536e-22	x = 2, y = 1
+Inf	349.96297539605	0.309614509344101	x = 2, y = 1
+Inf	351.069458007812	1.2832610529756e-09	x = 2, y = 1
+Inf	370.523821149554	2.16230963798365e-13	x = 2, y = 1
+Inf	328.937515258789	1.43158733844757	x = 3, y = 1
+Inf	329.697925567627	4.62229545519222e-05	x = 3, y = 1
+Inf	330.712968614366	2.11953542282421e-13	x = 3, y = 1
+Inf	331.259270562066	2.03012902874583e-17	x = 3, y = 1
+Inf	331.796308729384	9.94915412632575e-22	x = 3, y = 1
+Inf	332.342600504557	9.78378697984054e-26	x = 3, y = 1
+Inf	332.879638671875	5.89565674575821e-30	x = 3, y = 1
+Inf	333.44445461697	4.65177644766935e-34	x = 3, y = 1
+Inf	334.020843505859	3.24418811371231e-38	x = 3, y = 1
+Inf	345.629638671875	3.101946276729e-05	x = 3, y = 1
+Inf	346.120378282335	2.42813036344103e-09	x = 3, y = 1
+Inf	347.296308729384	1.2331086620974e-17	x = 3, y = 1
+Inf	347.814826117622	6.65060432147639e-22	x = 3, y = 1
+Inf	348.361117892795	6.1151591415287e-26	x = 3, y = 1
+Inf	348.888895670573	3.04086320241335e-30	x = 3, y = 1
+Inf	349.44445461697	2.97658725432968e-34	x = 3, y = 1
+Inf	349.96297539605	1.58814465883111e-38	x = 3, y = 1
+Inf	387.850006103516	2.8698808819172e-05	x = 3, y = 1
+Inf	388.895843505859	1.5247652858201e-13	x = 3, y = 1
+Inf	389.854179382324	9.39855267846122e-18	x = 3, y = 1
+Inf	391.083335876465	3.90465670032414e-30	x = 3, y = 1
+Inf	391.972229003906	1.99175119954855e-34	x = 3, y = 1
+Inf	394.083351135254	3.94045773788321e-09	x = 3, y = 1
+Inf	394.791679382324	9.62898286324196e-18	x = 3, y = 1
+Inf	395.270843505859	0.23992046713829	x = 3, y = 1
+Inf	395.816680908203	1.69494323927211e-05	x = 3, y = 1
+Inf	396.383337402344	1.12639098048817e-09	x = 3, y = 1
+Inf	396.916674804687	8.86759402344249e-14	x = 3, y = 1
+Inf	304.595254080636	1.17177887401856e-13	x = 1, y = 2
+Inf	305.119057791574	5.69736818276873e-18	x = 1, y = 2
+Inf	305.66667175293	5.6757509669499e-22	x = 1, y = 2
+Inf	306.32292175293	0.401378452777863	x = 1, y = 2
+Inf	307.031265258789	0.968722462654114	x = 1, y = 2
+Inf	307.614593505859	5.86232454224955e-05	x = 1, y = 2
+Inf	308.718757629395	2.7437655012591e-13	x = 1, y = 2
+Inf	309.250011444092	2.22135184510828e-17	x = 1, y = 2
+Inf	321.050012207031	1.50940976188625e-38	x = 1, y = 2
+Inf	328.000010172526	0.217953696846962	x = 1, y = 2
+Inf	329.152786254883	1.6380660533905	x = 1, y = 2
+Inf	330.197929382324	0.533841967582703	x = 1, y = 2
+Inf	330.712968614366	2.71527351287659e-05	x = 1, y = 2
+Inf	331.259270562066	2.59207522113059e-09	x = 1, y = 2
+Inf	331.796308729384	1.59223044362937e-13	x = 1, y = 2
+Inf	332.342600504557	1.2307215842857e-17	x = 1, y = 2
+Inf	332.879638671875	8.70707862088559e-22	x = 1, y = 2
+Inf	333.44445461697	5.77743854353985e-26	x = 1, y = 2
+Inf	343.642865862165	0.662226140499115	x = 1, y = 2
+Inf	344.611124674479	0.267281413078308	x = 1, y = 2
+Inf	345.629638671875	2.6464356778888e-05	x = 1, y = 2
+Inf	346.120378282335	0.933241784572601	x = 1, y = 2
+Inf	346.700012207031	5.34617865923792e-05	x = 1, y = 2
+Inf	347.296308729384	2.65817307081306e-05	x = 1, y = 2
+Inf	347.814826117622	2.63146238133061e-09	x = 1, y = 2
+Inf	348.361117892795	1.46233204581861e-13	x = 1, y = 2
+Inf	348.888895670573	1.25829507097872e-17	x = 1, y = 2
+Inf	349.44445461697	8.27559972606905e-22	x = 1, y = 2
+Inf	349.96297539605	5.94295388740686e-26	x = 1, y = 2
+Inf	365.979179382324	4.37134549429175e-05	x = 1, y = 2
+Inf	366.562515258789	2.64647725956024e-09	x = 1, y = 2
+Inf	367.083343505859	2.23088989772732e-13	x = 1, y = 2
+Inf	367.645835876465	1.22170415755601e-17	x = 1, y = 2
+Inf	368.222229003906	1.11046018496466e-21	x = 1, y = 2
+Inf	368.666680908203	5.59376337511562e-26	x = 1, y = 2
+Inf	369.216674804688	5.42113770011657e-30	x = 1, y = 2
+Inf	369.766680908203	2.78554944810064e-34	x = 1, y = 2
+Inf	370.523821149554	2.60531652564813e-38	x = 1, y = 2
+Inf	306.32292175293	2.31608719332144e-05	x = 2, y = 2
+Inf	307.031265258789	0.447774022817612	x = 2, y = 2
+Inf	307.614593505859	0.428305774927139	x = 2, y = 2
+Inf	308.266668701172	2.67954346782062e-05	x = 2, y = 2
+Inf	308.718757629395	2.22558682594354e-09	x = 2, y = 2
+Inf	309.250011444092	1.23887540308919e-13	x = 2, y = 2
+Inf	309.833347865513	1.11220637212349e-17	x = 2, y = 2
+Inf	310.361124674479	5.68033014673253e-22	x = 2, y = 2
+Inf	310.902786254883	5.44664266518465e-26	x = 2, y = 2
+Inf	311.430557250977	2.68241453784197e-30	x = 2, y = 2
+Inf	311.986119588216	2.62427828124129e-34	x = 2, y = 2
+Inf	312.516674804688	1.58696420500477e-38	x = 2, y = 2
+Inf	328.937515258789	2.37836694717407	x = 2, y = 2
+Inf	329.697925567627	2.56914954661625e-05	x = 2, y = 2
+Inf	330.197929382324	2.05684469456457e-09	x = 2, y = 2
+Inf	330.712968614366	1.42042993578166e-13	x = 2, y = 2
+Inf	331.259270562066	9.67603620520642e-18	x = 2, y = 2
+Inf	331.796308729384	7.48378431587693e-22	x = 2, y = 2
+Inf	332.342600504557	4.50551773856038e-26	x = 2, y = 2
+Inf	332.879638671875	3.81384647033894e-30	x = 2, y = 2
+Inf	333.44445461697	2.07898068639674e-34	x = 2, y = 2
+Inf	334.020843505859	1.92182899577831e-38	x = 2, y = 2
+Inf	343.642865862165	3.78152206840319e-30	x = 2, y = 2
+Inf	345.629638671875	2.89905474346597e-05	x = 2, y = 2
+Inf	346.120378282335	2.03336369963836e-09	x = 2, y = 2
+Inf	347.296308729384	1.5656460163882e-05	x = 2, y = 2
+Inf	347.814826117622	1.26892807372769e-09	x = 2, y = 2
+Inf	348.361117892795	7.2568185727033e-14	x = 2, y = 2
+Inf	348.888895670573	6.38326717387832e-18	x = 2, y = 2
+Inf	349.44445461697	3.33466297356616e-22	x = 2, y = 2
+Inf	349.96297539605	3.14223389850709e-26	x = 2, y = 2
+Inf	351.069458007812	1.5203838193817e-34	x = 2, y = 2
+Inf	370.523821149554	2.19204516215991e-38	x = 2, y = 2
+Inf	328.937515258789	0.995543837547302	x = 3, y = 2
+Inf	329.697925567627	3.03936976706609e-05	x = 3, y = 2
+Inf	330.712968614366	2.97629267151933e-05	x = 3, y = 2
+Inf	331.259270562066	1.62655666713363e-09	x = 3, y = 2
+Inf	331.796308729384	1.42477311415937e-13	x = 3, y = 2
+Inf	332.342600504557	9.25888240485103e-18	x = 3, y = 2
+Inf	332.879638671875	6.73557006833172e-22	x = 3, y = 2
+Inf	333.44445461697	4.97108094996007e-26	x = 3, y = 2
+Inf	334.020843505859	0.268675297498703	x = 3, y = 2
+Inf	345.629638671875	8.61570297274739e-05	x = 3, y = 2
+Inf	346.120378282335	0.285138785839081	x = 3, y = 2
+Inf	347.296308729384	1.30612853865841e-09	x = 3, y = 2
+Inf	347.814826117622	1.26163240011384e-13	x = 3, y = 2
+Inf	348.361117892795	6.39862460913097e-18	x = 3, y = 2
+Inf	348.888895670573	6.06791151963729e-22	x = 3, y = 2
+Inf	349.44445461697	3.743162251606e-26	x = 3, y = 2
+Inf	349.96297539605	2.88010014996665e-30	x = 3, y = 2
+Inf	387.850006103516	0.197833687067032	x = 3, y = 2
+Inf	388.895843505859	1.24303778381574e-09	x = 3, y = 2
+Inf	389.854179382324	6.66746120334285e-18	x = 3, y = 2
+Inf	391.083335876465	0.310464262962341	x = 3, y = 2
+Inf	391.972229003906	0.554931581020355	x = 3, y = 2
+Inf	394.083351135254	1.74293175463129e-17	x = 3, y = 2
+Inf	394.791679382324	1.05953142589779e-21	x = 3, y = 2
+Inf	395.270843505859	8.90397842411612e-26	x = 3, y = 2
+Inf	395.816680908203	4.8930473332074e-30	x = 3, y = 2
+Inf	396.383337402344	4.43552910897872e-34	x = 3, y = 2
+Inf	396.916674804687	2.28012433765444e-38	x = 3, y = 2
+Inf	304.595254080636	0.279548346996307	x = 1, y = 3
+Inf	305.119057791574	0.716848015785217	x = 1, y = 3
+Inf	305.66667175293	6.01442479819525e-05	x = 1, y = 3
+Inf	306.32292175293	3.80939590982621e-09	x = 1, y = 3
+Inf	307.031265258789	2.06235797064436e-17	x = 1, y = 3
+Inf	307.614593505859	1.33474952143388e-21	x = 1, y = 3
+Inf	308.718757629395	6.1926750159511e-30	x = 1, y = 3
+Inf	309.250011444092	5.40336274000115e-34	x = 1, y = 3
+Inf	321.050012207031	0.261909782886505	x = 1, y = 3
+Inf	328.000010172526	2.71850386646122e-09	x = 1, y = 3
+Inf	329.152786254883	0.519839584827423	x = 1, y = 3
+Inf	330.197929382324	2.44585240949391e-09	x = 1, y = 3
+Inf	330.712968614366	1.88825666799612e-13	x = 1, y = 3
+Inf	331.259270562066	1.13914243343648e-17	x = 1, y = 3
+Inf	331.796308729384	9.62779062132945e-22	x = 1, y = 3
+Inf	332.342600504557	5.25721990550878e-26	x = 1, y = 3
+Inf	332.879638671875	4.78893314027823e-30	x = 1, y = 3
+Inf	333.44445461697	2.40634231736506e-34	x = 1, y = 3
+Inf	343.642865862165	2.33215705520706e-05	x = 1, y = 3
+Inf	344.611124674479	1.14931461158048e-13	x = 1, y = 3
+Inf	345.629638671875	2.49274271482136e-05	x = 1, y = 3
+Inf	346.120378282335	2.42154163387909e-09	x = 1, y = 3
+Inf	346.700012207031	1.25566657765974e-13	x = 1, y = 3
+Inf	347.296308729384	1.16314638763216e-17	x = 1, y = 3
+Inf	347.814826117622	7.28580269542504e-22	x = 1, y = 3
+Inf	348.361117892795	5.51452352978133e-26	x = 1, y = 3
+Inf	348.888895670573	3.95872379808908e-30	x = 1, y = 3
+Inf	349.44445461697	2.58541051461361e-34	x = 1, y = 3
+Inf	349.96297539605	2.00786591889092e-38	x = 1, y = 3
+Inf	365.979179382324	0.29585200548172	x = 1, y = 3
+Inf	366.562515258789	2.61009136011126e-05	x = 1, y = 3
+Inf	367.083343505859	1.29202726295574e-09	x = 1, y = 3
+Inf	367.645835876465	1.26925610321495e-13	x = 1, y = 3
+Inf	368.222229003906	6.86202649112451e-18	x = 1, y = 3
+Inf	368.666680908203	6.0804923995715e-22	x = 1, y = 3
+Inf	369.216674804688	3.92168363149906e-26	x = 1, y = 3
+Inf	369.766680908203	2.87628364894794e-30	x = 1, y = 3
+Inf	370.523821149554	2.11079916033934e-34	x = 1, y = 3
+Inf	306.32292175293	2.58914169535274e-05	x = 2, y = 3
+Inf	307.031265258789	0.2786685526371	x = 2, y = 3
+Inf	307.614593505859	2.96689468086697e-05	x = 2, y = 3
+Inf	308.266668701172	0.630028009414673	x = 2, y = 3
+Inf	308.718757629395	3.5055691114394e-05	x = 2, y = 3
+Inf	309.250011444092	3.4764433554102e-09	x = 2, y = 3
+Inf	309.833347865513	2.08417769262566e-13	x = 2, y = 3
+Inf	310.361124674479	1.65365266219334e-17	x = 2, y = 3
+Inf	310.902786254883	1.14908291585848e-21	x = 2, y = 3
+Inf	311.430557250977	7.77481833182232e-26	x = 2, y = 3
+Inf	311.986119588216	6.04272858040201e-30	x = 2, y = 3
+Inf	312.516674804688	3.61853642833949e-34	x = 2, y = 3
+Inf	328.937515258789	1.3272477388382	x = 2, y = 3
+Inf	329.697925567627	0.000119319425721187	x = 2, y = 3
+Inf	330.197929382324	0.87813526391983	x = 2, y = 3
+Inf	330.712968614366	5.94691991864238e-05	x = 2, y = 3
+Inf	331.259270562066	4.48100578864796e-09	x = 2, y = 3
+Inf	331.796308729384	2.77607174444319e-13	x = 2, y = 3
+Inf	332.342600504557	2.30068624134988e-17	x = 2, y = 3
+Inf	332.879638671875	1.28379127790181e-21	x = 2, y = 3
+Inf	333.44445461697	1.15039499526719e-25	x = 2, y = 3
+Inf	334.020843505859	5.88708673366388e-30	x = 2, y = 3
+Inf	343.642865862165	0.628214061260223	x = 2, y = 3
+Inf	345.629638671875	2.52073332376312e-05	x = 2, y = 3
+Inf	346.120378282335	2.42913511527831e-09	x = 2, y = 3
+Inf	347.296308729384	3.06663314404432e-05	x = 2, y = 3
+Inf	347.814826117622	1.64383595624429e-09	x = 2, y = 3
+Inf	348.361117892795	1.4698648114625e-13	x = 2, y = 3
+Inf	348.888895670573	9.42402156952173e-18	x = 2, y = 3
+Inf	349.44445461697	6.95620575449764e-22	x = 2, y = 3
+Inf	349.96297539605	5.08223484114241e-26	x = 2, y = 3
+Inf	351.069458007812	2.63284561467787e-34	x = 2, y = 3
+Inf	370.523821149554	0.38996833562851	x = 2, y = 3
+Inf	328.937515258789	1.43404459953308	x = 3, y = 3
+Inf	329.697925567627	6.18351987213828e-05	x = 3, y = 3
+Inf	330.712968614366	3.4482751940304e-13	x = 3, y = 3
+Inf	331.259270562066	2.93395139921047e-17	x = 3, y = 3
+Inf	331.796308729384	1.94369975414076e-21	x = 3, y = 3
+Inf	332.342600504557	1.38486306848585e-25	x = 3, y = 3
+Inf	332.879638671875	1.03717248235199e-29	x = 3, y = 3
+Inf	333.44445461697	6.46787389371651e-34	x = 3, y = 3
+Inf	334.020843505859	5.33374608969737e-38	x = 3, y = 3
+Inf	345.629638671875	0.000100398268841673	x = 3, y = 3
+Inf	346.120378282335	0.700047612190247	x = 3, y = 3
+Inf	347.296308729384	0.290130436420441	x = 3, y = 3
+Inf	347.814826117622	1.69061459018849e-05	x = 3, y = 3
+Inf	348.361117892795	1.38276745609289e-09	x = 3, y = 3
+Inf	348.888895670573	9.4092654945744e-14	x = 3, y = 3
+Inf	349.44445461697	6.51254681822392e-18	x = 3, y = 3
+Inf	349.96297539605	4.97919259365601e-22	x = 3, y = 3
+Inf	387.850006103516	4.42154814663809e-05	x = 3, y = 3
+Inf	388.895843505859	2.20461995013854e-13	x = 3, y = 3
+Inf	389.854179382324	1.07776605300705e-21	x = 3, y = 3
+Inf	391.083335876465	5.18557991695755e-30	x = 3, y = 3
+Inf	391.972229003906	2.46211811583847e-38	x = 3, y = 3
+Inf	394.083351135254	0.225453585386276	x = 3, y = 3
+Inf	394.791679382324	0.310508847236633	x = 3, y = 3
+Inf	395.270843505859	2.11353399208747e-05	x = 3, y = 3
+Inf	395.816680908203	1.37501721120259e-09	x = 3, y = 3
+Inf	396.383337402344	9.99066823194339e-14	x = 3, y = 3
+Inf	396.916674804687	7.3794850397387e-18	x = 3, y = 3
Binary file test-data/msidata_1.RData has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/outfile1.ibd	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,4 @@
+imzML file:
+total 84
+-rw-r--r-- 1 meli meli 67160 Aug 22 13:56 ibd
+-rw-r--r-- 1 meli meli 15071 Aug 22 13:56 imzml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/outfile1.imzML	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,4 @@
+imzML file:
+total 84
+-rw-r--r-- 1 meli meli 67160 Aug 22 13:56 ibd
+-rw-r--r-- 1 meli meli 15071 Aug 22 13:56 imzml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/outfile2.ibd	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,4 @@
+imzML file:
+total 276
+-rw-r--r-- 1 meli meli 268784 Aug 22 13:56 ibd
+-rw-r--r-- 1 meli meli   9286 Aug 22 13:56 imzml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/outfile2.imzML	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,4 @@
+imzML file:
+total 276
+-rw-r--r-- 1 meli meli 268784 Aug 22 13:56 ibd
+-rw-r--r-- 1 meli meli   9286 Aug 22 13:56 imzml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/outfile3.ibd	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,4 @@
+imzML file:
+total 52
+-rw-r--r-- 1 meli meli 38384 Aug 22 13:57 ibd
+-rw-r--r-- 1 meli meli  9551 Aug 22 13:57 imzml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/outfile3.imzML	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,4 @@
+imzML file:
+total 52
+-rw-r--r-- 1 meli meli 38384 Aug 22 13:57 ibd
+-rw-r--r-- 1 meli meli  9551 Aug 22 13:57 imzml
Binary file test-data/peakdetection1_QC.pdf has changed
Binary file test-data/peakdetection2_QC.pdf has changed
Binary file test-data/peakdetection3_QC.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/pixel_annotations.tabular	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,10 @@
+X	Y	annotation_name
+1	1	col1
+1	2	col1
+1	3	col1
+2	1	col2
+2	2	col2
+2	3	col2
+3	1	col3
+3	2	col3
+3	3	col3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/restricted_pixels.tabular	Wed Aug 22 11:49:29 2018 -0400
@@ -0,0 +1,6 @@
+1	1
+1	2
+1	3
+3	1
+3	2
+3	3