Repository 'msi_filtering'
hg clone https://toolshed.g2.bx.psu.edu/repos/galaxyp/msi_filtering

Changeset 5:3d5ac78fb2b0 (2018-07-06)
Previous changeset 4:bf61fc662615 (2018-06-19) Next changeset 6:bab12ded74a5 (2018-07-24)
Commit message:
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_filtering commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
modified:
msi_filtering.xml
test-data/analyze75_filtered2.pdf
test-data/analyze_filtered.RData
test-data/analyze_filtered.pdf
test-data/analyze_filteredoutside.RData
test-data/analyze_matrix.tabular
test-data/imzml_filtered.RData
test-data/imzml_filtered.pdf
test-data/imzml_filtered2.RData
test-data/imzml_filtered2.pdf
test-data/imzml_filtered3.RData
test-data/imzml_filtered3.pdf
test-data/imzml_filtered4.RData
test-data/imzml_filtered4.pdf
test-data/imzml_filtered5.RData
test-data/imzml_filtered5.pdf
test-data/imzml_matrix3.tabular
test-data/rdata_matrix.tabular
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 msi_filtering.xml
--- a/msi_filtering.xml Tue Jun 19 18:07:17 2018 -0400
+++ b/msi_filtering.xml Fri Jul 06 14:13:22 2018 -0400
[
b'@@ -1,4 +1,4 @@\n-<tool id="mass_spectrometry_imaging_filtering" name="MSI filtering" version="1.10.0.2">\n+<tool id="mass_spectrometry_imaging_filtering" name="MSI filtering" version="1.10.0.3">\n     <description>tool for filtering mass spectrometry imaging data</description>\n     <requirements>\n         <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>\n@@ -33,343 +33,371 @@\n library(Cardinal)\n library(gridExtra)\n \n+\n #if $infile.ext == \'imzml\'\n-    msidata <- readImzML(\'infile\', mass.accuracy=$accuracy, units.accuracy = "$units")\n+    #if str($processed_cond.processed_file) == "processed":\n+        msidata <- readImzML(\'infile\', mass.accuracy=$processed_cond.accuracy, units.accuracy = "$processed_cond.units")\n+    #else\n+        msidata <- readImzML(\'infile\')\n+    #end if\n #elif $infile.ext == \'analyze75\'\n     msidata = readAnalyze(\'infile\')\n #else\n     load(\'infile.RData\')\n #end if\n \n+\n ########################### optional QC numbers ########################\n \n-#if $outputs.outputs_select == "quality_control":\n+if (sum(spectra(msidata)[]>0, na.rm=TRUE) > 0)\n+{\n+    #if $outputs.outputs_select == "quality_control":\n \n-    ## Number of features (m/z)\n-    maxfeatures = length(features(msidata))\n-    ## Range m/z\n-    minmz = round(min(mz(msidata)), digits=2)\n-    maxmz = round(max(mz(msidata)), digits=2)\n-    ## Number of spectra (pixels)\n-    pixelcount = length(pixels(msidata))\n-    ## Range x coordinates\n-    minimumx = min(coord(msidata)[,1])\n-    maximumx = max(coord(msidata)[,1])\n-    ## Range y coordinates\n-    minimumy = min(coord(msidata)[,2])\n-    maximumy = max(coord(msidata)[,2])\n-    ## Number of intensities > 0\n-    npeaks= sum(spectra(msidata)[]>0)\n-    ## Spectra multiplied with m/z (potential number of peaks)\n-    numpeaks = ncol(spectra(msidata)[])*nrow(spectra(msidata)[])\n-    ## Percentage of intensities > 0\n-    percpeaks = round(npeaks/numpeaks*100, digits=2)\n-    ## Number of empty TICs\n-    TICs = colSums(spectra(msidata)[])\n-    NumemptyTIC = sum(TICs == 0)\n-    ## median TIC\n-    medint = round(median(TICs), digits=2)\n-    ## Store features for QC plot\n-    featuresinfile = mz(msidata)\n+        ## Number of features (m/z)\n+        maxfeatures = length(features(msidata))\n+        ## Range m/z\n+        minmz = round(min(mz(msidata)), digits=2)\n+        maxmz = round(max(mz(msidata)), digits=2)\n+        ## Number of spectra (pixels)\n+        pixelcount = length(pixels(msidata))\n+        ## Range x coordinates\n+        minimumx = min(coord(msidata)[,1])\n+        maximumx = max(coord(msidata)[,1])\n+        ## Range y coordinates\n+        minimumy = min(coord(msidata)[,2])\n+        maximumy = max(coord(msidata)[,2])\n+        ## Number of intensities > 0\n+        npeaks= sum(spectra(msidata)[]>0, na.rm=TRUE)\n+        ## Spectra multiplied with m/z (potential number of peaks)\n+        numpeaks = ncol(spectra(msidata)[])*nrow(spectra(msidata)[])\n+        ## Percentage of intensities > 0\n+        percpeaks = round(npeaks/numpeaks*100, digits=2)\n+        ## Number of empty TICs\n+        TICs = colSums(spectra(msidata)[], na.rm=TRUE) \n+        NumemptyTIC = sum(TICs == 0)\n+        ## median TIC\n+        medint = round(median(TICs), digits=2)\n+        ## Store features for QC plot\n+        featuresinfile = mz(msidata)\n \n-#end if\n+    #end if\n \n-###################################### Filtering of pixels #####################\n-################################################################################\n+    ###################################### Filtering of pixels #####################\n+    ################################################################################\n \n-#################### Pixels in the one column format "x=,y=" #####################\n+    #################### Pixels in the one column format "x=,y=" #####################\n \n-#if str($pixels_cond.pixel_filtering) == "single_column":\n-    print("single column")\n+    #if str($pixels_cond.pixel_filtering) == "single'..b'ab="m/z", main="Removed m/z values")}\n+            #end if\n+        }else{\n+            print("file has no features or pixels left")}\n \n-#end if\n+        dev.off()\n+\n+    #end if\n \n-############################### optional intensity matrix ######################\n+    ############################### optional intensity matrix ######################\n \n-#if $output_matrix:\n+    #if $output_matrix:\n \n-if (length(features(msidata))> 0 & length(pixels(msidata)) > 0){\n-    spectramatrix = spectra(msidata)\n-    rownames(spectramatrix) = mz(msidata)\n-    newmatrix = rbind(pixels(msidata), spectramatrix)\n-    write.table(newmatrix[2:nrow(newmatrix),], file="$matrixasoutput", quote = FALSE, row.names = TRUE, col.names=NA, sep = "\\t")\n+        spectramatrix = spectra(msidata)[]\n+        spectramatrix = cbind(mz(msidata),spectramatrix)\n+        newmatrix = rbind(c("mz | spectra", names(pixels(msidata))), spectramatrix)\n+        write.table(newmatrix, file="$matrixasoutput", quote = FALSE, row.names = FALSE, col.names=FALSE, sep = "\\t")\n+\n+    #end if\n+\n }else{\n-    print("file has no features or pixels left")}\n-\n-#end if\n-\n-\n+    print("Inputfile or file filtered for pixels has no intensities > 0")\n+}\n     ]]></configfile>\n     </configfiles>\n     <inputs>\n         <param name="infile" type="data" format="imzml,rdata,analyze75"\n                label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData"\n                 help="Upload composite datatype imzML (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/>\n-        <param name="accuracy" type="float" value="50" label="Only for processed imzML files: enter mass accuracy to which the m/z values will be binned" help="This should be set to the native accuracy of the mass spectrometer, if known"/>\n-        <param name="units" display="radio" type="select" label="Only for processed imzML files: unit of the mass accuracy" help="either m/z or ppm">\n-            <option value="mz" >mz</option>\n-            <option value="ppm" selected="True" >ppm</option>\n-        </param>\n+        <conditional name="processed_cond">\n+            <param name="processed_file" type="select" label="Is the input file a processed imzML file ">\n+                <option value="no_processed" selected="True">not a processed imzML</option>\n+                <option value="processed">processed imzML</option>\n+            </param>\n+            <when value="no_processed"/>\n+            <when value="processed">\n+                <param name="accuracy" type="float" value="50" label="Mass accuracy to which the m/z values will be binned" help="This should be set to the native accuracy of the mass spectrometer, if known"/>\n+                <param name="units" display="radio" type="select" label="Unit of the mass accuracy" help="either m/z or ppm">\n+                    <option value="mz" >mz</option>\n+                    <option value="ppm" selected="True" >ppm</option>\n+                </param>\n+            </when>\n+        </conditional>\n         <conditional name="pixels_cond">\n             <param name="pixel_filtering" type="select" label="Select pixel filtering option">\n                 <option value="none" selected="True">none</option>\n@@ -605,7 +633,7 @@\n \n - pixel filtering: can use a tabular file containing x and y coordinates or by defining a range for x and y by hand\n - m/z feature filtering: can use a tabular file containing m/z of interest or by defining a range for the m/z values (! numeric input will be rounded to 2 digits before matching to m/z!)\n-- m/z feature removing: infering m/z such as matrix contaminants can be removed by specifying their m/z in a tabular file and optionally set a window (window in ppm or Da in which peaks should be removed)\n+- m/z feature removing: infering m/z such as matrix contaminants can be removed by specifying their m/z in a tabular file and optionally set a window (window in ppm or m/z in which peaks should be removed)\n \n \n Output: \n'
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/analyze75_filtered2.pdf
b
Binary file test-data/analyze75_filtered2.pdf has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/analyze_filtered.RData
b
Binary file test-data/analyze_filtered.RData has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/analyze_filtered.pdf
b
Binary file test-data/analyze_filtered.pdf has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/analyze_filteredoutside.RData
b
Binary file test-data/analyze_filteredoutside.RData has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/analyze_matrix.tabular
--- a/test-data/analyze_matrix.tabular Tue Jun 19 18:07:17 2018 -0400
+++ b/test-data/analyze_matrix.tabular Fri Jul 06 14:13:22 2018 -0400
b
@@ -1,4 +1,4 @@
- x = 1, y = 1 x = 1, y = 2 x = 3, y = 2 x = 1, y = 3
+mz | spectra x = 1, y = 1 x = 1, y = 2 x = 3, y = 2 x = 1, y = 3
 1201.3349609375 14 12 9 14
 1201.37634277344 17 21 11 20
 1201.45910644531 22 18 18 22
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_filtered.RData
b
Binary file test-data/imzml_filtered.RData has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_filtered.pdf
b
Binary file test-data/imzml_filtered.pdf has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_filtered2.RData
b
Binary file test-data/imzml_filtered2.RData has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_filtered2.pdf
b
Binary file test-data/imzml_filtered2.pdf has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_filtered3.RData
b
Binary file test-data/imzml_filtered3.RData has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_filtered3.pdf
b
Binary file test-data/imzml_filtered3.pdf has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_filtered4.RData
b
Binary file test-data/imzml_filtered4.RData has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_filtered4.pdf
b
Binary file test-data/imzml_filtered4.pdf has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_filtered5.RData
b
Binary file test-data/imzml_filtered5.RData has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_filtered5.pdf
b
Binary file test-data/imzml_filtered5.pdf has changed
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/imzml_matrix3.tabular
--- a/test-data/imzml_matrix3.tabular Tue Jun 19 18:07:17 2018 -0400
+++ b/test-data/imzml_matrix3.tabular Fri Jul 06 14:13:22 2018 -0400
b
@@ -1,4 +1,4 @@
- x = 1, y = 2 x = 2, y = 2 x = 3, y = 2
+mz | spectra x = 1, y = 2 x = 2, y = 2 x = 3, y = 2
 350 0 1.18586093356332e-26 7.10052307988494e-32
 350.083343505859 0 1.41173515299902e-27 0
 350.166687011719 5.94295388740686e-26 0 0
b
diff -r bf61fc662615 -r 3d5ac78fb2b0 test-data/rdata_matrix.tabular
--- a/test-data/rdata_matrix.tabular Tue Jun 19 18:07:17 2018 -0400
+++ b/test-data/rdata_matrix.tabular Fri Jul 06 14:13:22 2018 -0400
b
@@ -1,4 +1,4 @@
- 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
+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
 200.083343505859 46.3652739153013 0 9.17289559719717e-05 0 0 0 1.29693162341385 0 1.78496635304646e-05
 200.16667175293 22.4757921402152 0 0 5.8254927250654e-08 0 0 0 0 0
 200.25 38.2466047658708 0 0 3.59839441365526e-08 0 0 0 8.34774930605485e-08 0
@@ -1284,7 +1284,7 @@
 306.916687011719 2.2031921865656e-20 0 0 40.486491025881 0.122643497590777 0 0 13.9093994733916 1.33194911356925
 307 3.66559723583287e-21 6.29805161971829e-08 0 21.0239930982532 10.627775415752 0 0 4.96484942878176 0.176964102474979
 307.083343505859 0 3.73410909186729e-08 0 18.3089774049594 27.7952080229158 0 0 0.316976571174355 22.5696806926193
-307.166687011719 0 6.30821295171180e-09 6.89037923740047e-08 4.04689979105835 11.095809382106 0 1.35488457018982e-15 0 49.9638795251359
+307.166687011719 0 6.3082129517118e-09 6.89037923740047e-08 4.04689979105835 11.095809382106 0 1.35488457018982e-15 0 49.9638795251359
 307.25 0 0 2.43069082104212e-08 0 1.40410351777257 0 7.73638174561519e-16 0 19.1456170512867
 307.333343505859 0 0 2.66083795902358e-09 0 0 0 1.28100418575255e-16 0 2.34396309903659
 307.416687011719 2.49160463062269e-24 0 0 0 0 0 0 0.00148088913948611 0