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

Changeset 7:1a3d477bc54a (2018-07-06)
Previous changeset 6:d3fd539f477e (2018-06-21) Next changeset 8:d77c5228fd1a (2018-07-24)
Commit message:
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_preprocessing commit 8087490eb4dcaf4ead0f03eae4126780d21e5503
modified:
msi_preprocessing.xml
test-data/preprocessing_results1.RData
test-data/preprocessing_results1.pdf
test-data/preprocessing_results1.txt
test-data/preprocessing_results2.pdf
test-data/preprocessing_results3.RData
test-data/preprocessing_results3.pdf
test-data/preprocessing_results4.RData
test-data/preprocessing_results4.pdf
test-data/preprocessing_results4.txt
test-data/preprocessing_results5.RData
test-data/preprocessing_results5.pdf
b
diff -r d3fd539f477e -r 1a3d477bc54a msi_preprocessing.xml
--- a/msi_preprocessing.xml Thu Jun 21 16:45:55 2018 -0400
+++ b/msi_preprocessing.xml Fri Jul 06 14:13:48 2018 -0400
[
b'@@ -1,4 +1,4 @@\n-<tool id="mass_spectrometry_imaging_preprocessing" name="MSI preprocessing" version="1.10.0.3">\n+<tool id="mass_spectrometry_imaging_preprocessing" name="MSI preprocessing" version="1.10.0.4">\n     <description>\n         mass spectrometry imaging preprocessing\n     </description>\n@@ -38,14 +38,16 @@\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+        msidata <- readImzML(\'infile\', attach.only=TRUE)\n     #end if\n #elif $infile.ext == \'analyze75\'\n-    msidata = readAnalyze(\'infile\')\n+    msidata = readAnalyze(\'infile\', attach.only=TRUE)\n #else\n     load(\'infile.RData\')\n #end if\n \n+print(paste0("Number of NA in input file: ",sum(is.na(spectra(msidata)[]))))\n+\n ## function to later read RData reference files in\n \n loadRData <- function(fileName){\n@@ -54,357 +56,358 @@\n get(ls()[ls() != "fileName"])\n }\n \n-######################### preparations for QC report #################\n-\n-    maxfeatures = length(features(msidata))\n-    medianpeaks = median(colSums(spectra(msidata)[]>0))\n-    medint = round(median(spectra(msidata)[]), digits=2)\n-    TICs = round(mean(colSums(spectra(msidata)[])), digits=1)\n-    QC_numbers= data.frame(inputdata = c(maxfeatures, medianpeaks, medint, TICs))\n-    vectorofactions = "inputdata"\n-\n-############################### Preprocessing steps ###########################\n-###############################################################################\n+if (sum(spectra(msidata)[]>0, na.rm=TRUE)> 0){\n+    ######################### preparations for QC report #################\n \n-#for $method in $methods:\n-\n-############################### Normalization ###########################\n+        maxfeatures = length(features(msidata))\n+        medianpeaks = median(colSums(spectra(msidata)[]>0, na.rm=TRUE))\n+        medint = round(median(spectra(msidata)[],na.rm=TRUE), digits=2)\n+        TICs = round(mean(colSums(spectra(msidata)[], na.rm=TRUE)), digits=1)\n+        QC_numbers= data.frame(inputdata = c(maxfeatures, medianpeaks, medint, TICs))\n+        vectorofactions = "inputdata"\n \n-    #if str( $method.methods_conditional.preprocessing_method ) == \'Normalization\':\n-        print(\'Normalization\')\n-        ##normalization\n+    ############################### Preprocessing steps ###########################\n+    ###############################################################################\n \n-        msidata = normalize(msidata, method="tic")\n+    #for $method in $methods:\n \n-        ############################### QC ###########################\n+    ############################### Normalization ###########################\n \n-            maxfeatures = length(features(msidata))\n-            medianpeaks = median(colSums(spectra(msidata)[]>0))\n-            medint = round(median(spectra(msidata)[]), digits=2)\n-            TICs = round(mean(colSums(spectra(msidata)[])), digits=1)\n-            normalized = c(maxfeatures, medianpeaks, medint, TICs)\n-            QC_numbers= cbind(QC_numbers, normalized)\n-            vectorofactions = append(vectorofactions, "normalized")\n+        #if str( $method.methods_conditional.preprocessing_method ) == \'Normalization\':\n+            print(\'Normalization\')\n+            ##normalization\n \n-############################### Baseline reduction ###########################\n+            msidata = normalize(msidata, method="tic")\n+\n+            ############################### QC ###########################\n \n-    #elif str( $method.methods_conditional.preprocessing_method ) == \'Baseline_reduction\':\n-        print(\'Baseline_reduction\')\n-        ##baseline reduction\n-\n-        msidata = reduceBaseline(msidata, method="median", blocks=$method.methods_conditional.blocks_baseline)\n-\n-        ############################### QC ###########################\n+                maxfeatures = length(features(msid'..b'QC report\n \n     pdf("Preprocessing.pdf", fonts = "Times", pointsize = 12)\n     plot(0,type=\'n\',axes=FALSE,ann=FALSE)\n@@ -413,10 +416,14 @@\n     grid.table(t(QC_numbers))\n     dev.off()\n \n+}else{\n+    print("inputfile has no intensities > 0")\n+}\n+\n     ]]></configfile>\n     </configfiles>\n     <inputs>\n-        <param name="infile" type="data" format="imzml,rdata,danalyze75"\n+        <param name="infile" type="data" format="imzml,rdata,analyze75"\n             label="MSI data as imzml, analyze7.5 or Cardinal MSImageSet saved as RData"\n             help="load imzml and ibd file by uploading composite datatype imzml"/>\n         <conditional name="processed_cond">\n@@ -610,7 +617,7 @@\n     </inputs>\n     <outputs>\n         <data format="rdata" name="msidata_preprocessed" label="$infile.display_name preprocessed"/>\n-        <data format="pdf" name="QC_plots" from_work_dir="Preprocessing.pdf" label = "$infile.display_name preprocessed_QC"/>\n+        <data format="pdf" name="QC_overview" from_work_dir="Preprocessing.pdf" label = "$infile.display_name preprocessed_QC"/>\n         <data format="tabular" name="summarized_output_mean" label="$infile.display_name mean_matrix">\n             <filter>summary_type and "mean" in summary_type</filter>\n         </data>\n@@ -678,7 +685,7 @@\n             <param name="output_matrix" value="True"/>\n             <output name="msidata_preprocessed" file="preprocessing_results1.RData" compare="sim_size"/>\n             <output name="matrixasoutput" file="preprocessing_results1.txt"/>\n-            <output name="QC_plots" file="preprocessing_results1.pdf" compare="sim_size"/>\n+            <output name="QC_overview" file="preprocessing_results1.pdf" compare="sim_size"/>\n         </test>\n         <test expect_num_outputs="4">\n             <param name="infile" value="123_combined.RData" ftype="rdata"/>\n@@ -705,7 +712,7 @@\n             <output name="msidata_preprocessed" file="preprocessing_results2.RData" compare="sim_size"/>\n             <output name="summarized_output_median" file="preprocessing_median2.txt" lines_diff="2"/>\n             <output name="summarized_output_sd" file="preprocessing_sd2.txt" lines_diff="2"/>\n-            <output name="QC_plots" file="preprocessing_results2.pdf" compare="sim_size"/>\n+            <output name="QC_overview" file="preprocessing_results2.pdf" compare="sim_size"/>\n         </test>\n         <test expect_num_outputs="3">\n             <param name="infile" value="" ftype="analyze75">\n@@ -736,7 +743,7 @@\n             </repeat>\n             <param name="summary_type" value="mean"/>\n             <output name="msidata_preprocessed" file="preprocessing_results3.RData" compare="sim_size"/>\n-            <output name="QC_plots" file="preprocessing_results3.pdf" compare="sim_size"/>\n+            <output name="QC_overview" file="preprocessing_results3.pdf" compare="sim_size"/>\n             <output name="summarized_output_mean" file="preprocessing_mean3.txt" lines_diff="2"/>\n         </test>\n         <test expect_num_outputs="3">\n@@ -759,7 +766,7 @@\n             <param name="output_matrix" value="True"/>\n             <output name="msidata_preprocessed" file="preprocessing_results4.RData" compare="sim_size"/>\n             <output name="matrixasoutput" file="preprocessing_results4.txt"/>\n-            <output name="QC_plots" file="preprocessing_results4.pdf" compare="sim_size"/>\n+            <output name="QC_overview" file="preprocessing_results4.pdf" compare="sim_size"/>\n         </test>\n         <test expect_num_outputs="2">\n             <param name="infile" value="" ftype="imzml">\n@@ -776,7 +783,7 @@\n                 </conditional>\n             </repeat>\n              <output name="msidata_preprocessed" file="preprocessing_results5.RData" compare="sim_size"/>\n-            <output name="QC_plots" file="preprocessing_results5.pdf" compare="sim_size"/>\n+            <output name="QC_overview" file="preprocessing_results5.pdf" compare="sim_size"/>\n         </test>\n     </tests>\n     <help>\n'
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results1.RData
b
Binary file test-data/preprocessing_results1.RData has changed
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results1.pdf
b
Binary file test-data/preprocessing_results1.pdf has changed
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results1.txt
--- a/test-data/preprocessing_results1.txt Thu Jun 21 16:45:55 2018 -0400
+++ b/test-data/preprocessing_results1.txt Fri Jul 06 14:13:48 2018 -0400
b
@@ -1,3 +1,3 @@
- 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
 329 8.48069807321137 6.00276368862812 0 0 7.22240715797167 6.68463797360356 0 0 0
 345 0 0 4.70593890744759 0 0 0 5.23000350586712 4.17949067812964 5.08555910047608
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results2.pdf
b
Binary file test-data/preprocessing_results2.pdf has changed
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results3.RData
b
Binary file test-data/preprocessing_results3.RData has changed
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results3.pdf
b
Binary file test-data/preprocessing_results3.pdf has changed
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results4.RData
b
Binary file test-data/preprocessing_results4.RData has changed
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results4.pdf
b
Binary file test-data/preprocessing_results4.pdf has changed
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results4.txt
--- a/test-data/preprocessing_results4.txt Thu Jun 21 16:45:55 2018 -0400
+++ b/test-data/preprocessing_results4.txt Fri Jul 06 14:13:48 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
 1199 1.90173968313755 1.13259535967648 2.08382650993109 2.34349737625869 1.33087314662273 2.14468085106383 3.43161925601751 1.32706902782797 2.22480967308554
 1200 1.39388874502695 0.970046951574763 1.52152411836238 1.35619061126081 1.10906095551895 1.66382978723404 2.22846006564551 1.19804842790025 1.7089117778773
 1201 1.13095882671438 0.99102093971692 1.23623834616944 1.19344773790952 1.05864909390445 1.31063829787234 1.67396061269147 1.07824358511023 1.28168383340797
@@ -157,4 +157,4 @@
 1354 1.06362120618167 1.11618093417392 1.04838476586595 1.07551811953901 1.02051142468305 1.08344125809436 1.09535248786985 1.11069907763863 1.07245078759322
 1355 1.17876426640757 1.01819178799199 1.08701772487747 1.1007336161215 1.0558993559982 1.09555125725338 1.09948776606326 1.05059631369714 1.03765826649839
 1356 1.25341933661339 1.11461765555463 1.12696739822804 1.128350588569 1.02840197693575 1.09422492401216 1.08807439824945 1.10589085652331 0.953489859893801
-1357 NA NA NA NA NA NA NA NA NA
+1357 NaN NaN NaN NaN NaN NaN NaN NaN NaN
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results5.RData
b
Binary file test-data/preprocessing_results5.RData has changed
b
diff -r d3fd539f477e -r 1a3d477bc54a test-data/preprocessing_results5.pdf
b
Binary file test-data/preprocessing_results5.pdf has changed