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

Changeset 8:87bb011a4ee8 (2020-05-13)
Previous changeset 7:44a4b31fcbf3 (2020-04-23) Next changeset 9:ca727a6dede6 (2020-09-24)
Commit message:
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit d008f6ea0f5c8435fb975a34cb99ea4d42c5ebd2"
modified:
macros.xml
preprocessing.xml
test-data/QC_analyze75.pdf
test-data/QC_empty_spectra.pdf
test-data/QC_imzml.pdf
test-data/QC_rdata.pdf
test-data/preprocessing_results1.ibd
test-data/preprocessing_results1.imzml
test-data/preprocessing_results1.imzml.txt
test-data/preprocessing_results1.pdf
test-data/preprocessing_results2.ibd
test-data/preprocessing_results2.imzml
test-data/preprocessing_results2.imzml.txt
test-data/preprocessing_results2.pdf
test-data/preprocessing_results3.ibd
test-data/preprocessing_results3.imzml
test-data/preprocessing_results3.imzml.txt
test-data/preprocessing_results3.pdf
test-data/preprocessing_results4.ibd
test-data/preprocessing_results4.imzml
test-data/preprocessing_results4.imzml.txt
test-data/preprocessing_results4.pdf
test-data/preprocessing_results5.ibd
test-data/preprocessing_results5.imzml
test-data/preprocessing_results5.imzml.txt
test-data/preprocessing_results5.pdf
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 macros.xml
--- a/macros.xml Thu Apr 23 08:07:20 2020 -0400
+++ b/macros.xml Wed May 13 14:21:48 2020 -0400
[
@@ -32,6 +32,12 @@
     <token name="@READING_MSIDATA@"><![CDATA[
         ## importing MSI data files
 
+            ## read RData files (MSI and other data) independent of filename
+            loadRData <- function(fileName){
+            load(fileName)
+            get(ls()[ls() != "fileName"])
+            }
+
         #if $infile.ext == 'imzml'
             #if str($processed_cond.processed_file) == "processed":
                 msidata <- readImzML('infile', resolution=$processed_cond.accuracy, attach.only=TRUE, units = "$processed_cond.units")
@@ -45,11 +51,6 @@
             msidata = readAnalyze('infile', attach.only=TRUE)
             centroided(msidata) = $centroids
         #else
-            ## function to read RData files independent of filename
-            loadRData <- function(fileName){
-            load(fileName)
-            get(ls()[ls() != "fileName"])
-            }
             msidata = loadRData('infile.RData')
         #end if
 
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 preprocessing.xml
--- a/preprocessing.xml Thu Apr 23 08:07:20 2020 -0400
+++ b/preprocessing.xml Wed May 13 14:21:48 2020 -0400
[
b'@@ -1,4 +1,4 @@\n-<tool id="cardinal_preprocessing" name="MSI preprocessing" version="@VERSION@.1">\n+<tool id="cardinal_preprocessing" name="MSI preprocessing" version="@VERSION@.2">\n     <description>\n         mass spectrometry imaging preprocessing\n     </description>\n@@ -92,7 +92,7 @@\n                 msidata = as(msidata, "MSContinuousImagingExperiment")\n             }\n \n-            msidata = normalize(msidata, method="tic")\n+            msidata = normalize(msidata, method="$method.methods_conditional.methods_for_normalization.normalization_method")\n             msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu))\n \n \n@@ -179,6 +179,42 @@\n             print(plot(msidata, pixel=random_spectra))\n             title("Spectra after smoothing", outer=TRUE, line=0)\n \n+\n+    ############################### Mz alignment ###########################\n+\n+        #elif str( $method.methods_conditional.preprocessing_method ) == \'mz_alignment\':\n+            print(\'M/z alignment\')\n+            ## M/z alignment\n+\n+            #if str( $method.methods_conditional.mzalign_ref_type.align_reference_datatype) == \'align_table\':\n+\n+                reference_mz = read.delim("$method.methods_conditional.mzalign_ref_type.mz_tabular", header = $method.methods_conditional.mzalign_ref_type.feature_header, stringsAsFactors = FALSE)\n+                reference_mz = reference_mz[,$method.methods_conditional.mzalign_ref_type.feature_column]\n+\n+                msidata = mzAlign(msidata, ref=reference_mz, tolerance = $method.methods_conditional.alignment_tol, units = "$method.methods_conditional.alignment_units", quantile = $method.methods_conditional.quantile, span = $method.methods_conditional.span)\n+\n+\n+            #elif str( $method.methods_conditional.mzalign_ref_type.align_reference_datatype) == \'align_noref\':\n+\n+                msidata = mzAlign(msidata,tolerance = $method.methods_conditional.alignment_tol, units = "$method.methods_conditional.alignment_units", , quantile = $method.methods_conditional.quantile, span = $method.methods_conditional.span)\n+\n+            #end if\n+\n+            msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu))\n+\n+            ############################### QC ###########################\n+\n+            maxfeatures =nrow(msidata)\n+            pixelcount = ncol(msidata)\n+            minmz = round(min(mz(msidata)), digits=2)\n+            maxmz = round(max(mz(msidata)), digits=2)\n+            mz_aligned = c(minmz, maxmz,maxfeatures, pixelcount)\n+            QC_numbers= cbind(QC_numbers, mz_aligned)\n+            vectorofactions = append(vectorofactions, "mz aligned")\n+            print(plot(msidata, pixel=random_spectra))\n+            title("Spectra after m/z alignment", outer=TRUE, line=0)\n+\n+\n     ############################### Peak picking ###########################\n \n         #elif str( $method.methods_conditional.preprocessing_method) == \'Peak_picking\':\n@@ -438,6 +474,7 @@\n                     <option value="Normalization" selected="True">Intensity Normalization</option>\n                     <option value="Baseline_reduction">Baseline Reduction</option>\n                     <option value="Smoothing">Peak smoothing</option>\n+                    <option value="mz_alignment">m/z alignment</option>\n                     <option value="Peak_picking">Peak picking</option>\n                     <option value="Peak_alignment">Peak alignment</option>\n                     <option value="Peak_filtering">Peak filtering</option>\n@@ -487,6 +524,35 @@\n                     <param name="window_smoothing" type="float" value="8"\n                                 label="Window size"/>\n                 </when>\n+                <when value="mz_alignment">\n+                    <param name="alignment_tol" type="text" value="NA"\n+                           label="tolerance" help="The tolerance to be used when matching the peaks in the unaligned spectra to the reference spectrum. If this is NA, then automaticall'..b'elected="True">use mean spectrum as reference</option>\n+                            <option value="align_table" >m/z values from tabular file as reference</option>\n+                        </param>\n+                        <when value="align_noref"/>\n+                        <when value="align_table">\n+                            <expand macro="reading_1_column_mz_tabular" label="Tabular file with m/z features to use for alignment. Only the m/z values from the tabular file will be kept."/>\n+                        </when>\n+                    </conditional>\n+                    <param name="quantile" type="float" value="0.2"\n+                        label="quantile" help="The top quantile of reference points (peaks detected via local maxima) to use from the reference spectrum."/>\n+                    <param name="span" type="float" value="0.75"\n+                        label="span" help="The smoothing parameter for the local polynomial regression used to determine the warping function."/>\n+                </when>\n                 <when value="Peak_picking">\n                     <param name="SNR_picking_method" type="float" value="6"\n                         label="Signal to noise ratio"\n@@ -522,7 +588,7 @@\n                     <conditional name="align_ref_type">\n                         <param name="align_reference_datatype" type="select" label="Choose reference">\n                             <option value="align_noref" selected="True">no reference</option>\n-                            <option value="align_table" >tabular file as reference</option>\n+                            <option value="align_table" >m/z values from tabular file as reference</option>\n                         </param>\n                         <when value="align_noref"/>\n                         <when value="align_table">\n@@ -537,9 +603,10 @@\n                 <when value="Peak_binning">\n                     <expand macro="reading_1_column_mz_tabular" label="A reference to which the peaks are binned." help="Tabular file with m/z features to extract from input file"/>\n                     <param name="peakbin_tol" value="NA" type="text" label="The tolerance to be used when matching the m/z features in the dataset to the reference. If this is NA, then automatically guess a resolution from the data." >\n-                        <sanitizer invalid_char="">\n+                        <sanitizer>\n                             <valid initial="string.digits">\n-                                <add value="NA" />\n+                                <add value="N" />\n+                                <add value="A" />\n                             </valid>\n                         </sanitizer>\n                     </param>\n@@ -728,6 +795,11 @@\n             </repeat>\n             <repeat name="methods">\n                 <conditional name="methods_conditional">\n+                    <param name="preprocessing_method" value="mz_alignment"/>\n+                </conditional>\n+            </repeat>\n+            <repeat name="methods">\n+                <conditional name="methods_conditional">\n                     <param name="preprocessing_method" value="Data_reduction"/>\n                     <conditional name="methods_for_reduction">\n                         <param name="reduction_method" value="bin"/>\n@@ -761,7 +833,7 @@\n                     <param name="preprocessing_method" value="Baseline_reduction"/>\n                 </conditional>\n             </repeat>\n-            <output name="QC_overview" file="preprocessing_results5.pdf" compare="sim_size"/>\n+            <output name="QC_overview" file="preprocessing_results5.pdf" compare="sim_size" delta="13000"/>\n             <output name="outfile_imzml" ftype="imzml" file="preprocessing_results5.imzml.txt" compare="sim_size">\n                 <extra_files type="file" file="preprocessing_results5.imzml" name="imzml" lines_diff="6"/>\n                 <extra_files type="file" file="preprocessing_results5.ibd" name="ibd" compare="sim_size"/>\n'
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/QC_analyze75.pdf
b
Binary file test-data/QC_analyze75.pdf has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/QC_empty_spectra.pdf
b
Binary file test-data/QC_empty_spectra.pdf has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/QC_imzml.pdf
b
Binary file test-data/QC_imzml.pdf has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/QC_rdata.pdf
b
Binary file test-data/QC_rdata.pdf has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results1.ibd
b
Binary file test-data/preprocessing_results1.ibd has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results1.imzml
--- a/test-data/preprocessing_results1.imzml Thu Apr 23 08:07:20 2020 -0400
+++ b/test-data/preprocessing_results1.imzml Wed May 13 14:21:48 2020 -0400
b
@@ -9,8 +9,8 @@
  <fileContent>
  <cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" />
  <cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum" value="" />
- <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="722d404b-4188-40b4-a3b2-3764ebbdecad" />
- <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="c5aded0bab57fd7317901ff7709f2395fc91152e" />
+ <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="25fb4349-d529-4b12-8523-a6aa0306ecf4" />
+ <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="7f41f9f5efcb31248caefc91b7d6edce87d7f42c" />
  <cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" />
  </fileContent>
  </fileDescription>
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results1.imzml.txt
--- a/test-data/preprocessing_results1.imzml.txt Thu Apr 23 08:07:20 2020 -0400
+++ b/test-data/preprocessing_results1.imzml.txt Wed May 13 14:21:48 2020 -0400
b
@@ -1,4 +1,4 @@
 imzML file:
 total 24
--rw-r--r-- 1 meli meli   216 Mär 24 10:39 ibd
--rw-r--r-- 1 meli meli 18090 Mär 24 10:39 imzml
+-rw-r--r-- 1 meli meli   216 Mai 10 17:37 ibd
+-rw-r--r-- 1 meli meli 18090 Mai 10 17:37 imzml
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results1.pdf
b
Binary file test-data/preprocessing_results1.pdf has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results2.ibd
b
Binary file test-data/preprocessing_results2.ibd has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results2.imzml
--- a/test-data/preprocessing_results2.imzml Thu Apr 23 08:07:20 2020 -0400
+++ b/test-data/preprocessing_results2.imzml Wed May 13 14:21:48 2020 -0400
b
@@ -9,8 +9,8 @@
  <fileContent>
  <cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" />
  <cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum" value="" />
- <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="e536d1e2-427b-4c5b-9743-8210ae52a564" />
- <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="7cea783e9d345946b874fc1f25d40ce90bffd2f9" />
+ <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="fa59b434-12e0-47fe-b338-814c92daa7d6" />
+ <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="5764be27b51a23d8c23e4c93befb9d8e57161bd9" />
  <cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" />
  </fileContent>
  </fileDescription>
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results2.imzml.txt
--- a/test-data/preprocessing_results2.imzml.txt Thu Apr 23 08:07:20 2020 -0400
+++ b/test-data/preprocessing_results2.imzml.txt Wed May 13 14:21:48 2020 -0400
b
@@ -1,4 +1,4 @@
 imzML file:
 total 64
--rw-r--r-- 1 meli meli 37404 Mär 24 10:40 ibd
--rw-r--r-- 1 meli meli 22796 Mär 24 10:40 imzml
+-rw-r--r-- 1 meli meli 37404 Mai 10 17:38 ibd
+-rw-r--r-- 1 meli meli 22796 Mai 10 17:38 imzml
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results2.pdf
b
Binary file test-data/preprocessing_results2.pdf has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results3.ibd
b
Binary file test-data/preprocessing_results3.ibd has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results3.imzml
--- a/test-data/preprocessing_results3.imzml Thu Apr 23 08:07:20 2020 -0400
+++ b/test-data/preprocessing_results3.imzml Wed May 13 14:21:48 2020 -0400
b
@@ -9,8 +9,8 @@
  <fileContent>
  <cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" />
  <cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum" value="" />
- <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="df9dd256-6485-4954-8338-ddb0c760d4dc" />
- <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="ea9ad44f2615ef4d24b92d3ceb38dfa8ec47a978" />
+ <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="d11b7693-3397-4d1f-9e67-29d952701100" />
+ <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="94906879d47bbdcf97126d50c906dfd76e6681e4" />
  <cvParam cvRef="IMS" accession="IMS:1000031" name="processed" value="" />
  </fileContent>
  </fileDescription>
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results3.imzml.txt
--- a/test-data/preprocessing_results3.imzml.txt Thu Apr 23 08:07:20 2020 -0400
+++ b/test-data/preprocessing_results3.imzml.txt Wed May 13 14:21:48 2020 -0400
b
@@ -1,4 +1,4 @@
 imzML file:
 total 24
--rw-r--r-- 1 meli meli   960 Apr 22 15:36 ibd
--rw-r--r-- 1 meli meli 18112 Apr 22 15:36 imzml
+-rw-r--r-- 1 meli meli   960 Mai 10 17:39 ibd
+-rw-r--r-- 1 meli meli 18112 Mai 10 17:39 imzml
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results3.pdf
b
Binary file test-data/preprocessing_results3.pdf has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results4.ibd
b
Binary file test-data/preprocessing_results4.ibd has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results4.imzml
--- a/test-data/preprocessing_results4.imzml Thu Apr 23 08:07:20 2020 -0400
+++ b/test-data/preprocessing_results4.imzml Wed May 13 14:21:48 2020 -0400
b
@@ -9,8 +9,8 @@
  <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="db79298c-8368-42d7-84fc-18cad6ef1924" />
- <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="18bae3cc87b4c9aab2577cffe2fbc7425a93270b" />
+ <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="c6122884-ceb5-46b6-9160-5d28e8862946" />
+ <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="03e4b58b8e63517605164e90b85fe93a851a9c5b" />
  <cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" />
  </fileContent>
  </fileDescription>
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results4.imzml.txt
--- a/test-data/preprocessing_results4.imzml.txt Thu Apr 23 08:07:20 2020 -0400
+++ b/test-data/preprocessing_results4.imzml.txt Wed May 13 14:21:48 2020 -0400
b
@@ -1,4 +1,4 @@
 imzML file:
 total 84
--rw-r--r-- 1 meli meli 63256 Mär 24 11:35 ibd
--rw-r--r-- 1 meli meli 18199 Mär 24 11:35 imzml
+-rw-r--r-- 1 meli meli 63256 Mai 10 17:40 ibd
+-rw-r--r-- 1 meli meli 18199 Mai 10 17:40 imzml
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results4.pdf
b
Binary file test-data/preprocessing_results4.pdf has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results5.ibd
b
Binary file test-data/preprocessing_results5.ibd has changed
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results5.imzml
--- a/test-data/preprocessing_results5.imzml Thu Apr 23 08:07:20 2020 -0400
+++ b/test-data/preprocessing_results5.imzml Wed May 13 14:21:48 2020 -0400
b
@@ -9,8 +9,8 @@
  <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="1cb5b7df-bc82-4588-9a14-1dd58a3983a7" />
- <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="a16bf7a9d9d4064ce94821e3e7df2681725a497b" />
+ <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="3aff713c-00ec-422d-b63d-efd45fbdd7cc" />
+ <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="9316138c1e7484662943bb206c79c2d074121530" />
  <cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" />
  </fileContent>
  </fileDescription>
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results5.imzml.txt
--- a/test-data/preprocessing_results5.imzml.txt Thu Apr 23 08:07:20 2020 -0400
+++ b/test-data/preprocessing_results5.imzml.txt Wed May 13 14:21:48 2020 -0400
b
@@ -1,4 +1,4 @@
 imzML file:
 total 428
--rw-r--r-- 1 meli meli 415936 Apr 19 21:07 ibd
--rw-r--r-- 1 meli meli  18569 Apr 19 21:07 imzml
+-rw-r--r-- 1 meli meli 415936 Mai 10 17:40 ibd
+-rw-r--r-- 1 meli meli  18569 Mai 10 17:40 imzml
b
diff -r 44a4b31fcbf3 -r 87bb011a4ee8 test-data/preprocessing_results5.pdf
b
Binary file test-data/preprocessing_results5.pdf has changed