| Previous changeset 8:262db9893c6f (2018-08-22) |
|
Commit message:
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_filtering commit e87eea03505ab1ba067e192bbbcdc6197dc4b42e |
|
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.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 test-data/rdata_notfiltered.pdf |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 msi_filtering.xml --- a/msi_filtering.xml Wed Aug 22 13:42:05 2018 -0400 +++ b/msi_filtering.xml Tue Sep 04 13:42:37 2018 -0400 |
| [ |
| b'@@ -1,4 +1,4 @@\n-<tool id="mass_spectrometry_imaging_filtering" name="MSI filtering" version="1.10.0.6">\n+<tool id="mass_spectrometry_imaging_filtering" name="MSI filtering" version="1.10.0.7">\n <description>tool for filtering mass spectrometry imaging data</description>\n <requirements>\n <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>\n@@ -134,27 +134,27 @@\n #elif str($pixels_cond.pixel_filtering) == "two_columns":\n print("two columns")\n \n- ## read tabular file, count number of rows (= number of pixels), extract dataframe with x,y,annotation (for QC), count number of valid pixels\n+ ## read tabular file\n input_list = read.delim("$pixels_cond.two_columns_pixel", header = FALSE, \n stringsAsFactors = FALSE)\n startingrow = $pixels_cond.pixel_header+1\n numberpixels = length(startingrow:nrow(input_list))\n inputpixels = input_list[startingrow:nrow(input_list),c($pixels_cond.pixel_column_x, $pixels_cond.pixel_column_y, $pixels_cond.annotation_column_xy)]\n+\n+ ## rewrite into x = 1, y = 1 format and filter msidata, count validpixels\n+ pixelvector = character()\n+ for (pixel in 1:nrow(inputpixels)){\n+ pixelvector[pixel] = paste0("x = ", inputpixels[pixel,1],", ", "y = ", inputpixels[pixel,2])}\n+ pixelsofinterest= pixels(msidata)[names(pixels(msidata)) %in% pixelvector]\n+ msidata = msidata[,pixelsofinterest]\n+ validpixels=ncol(msidata)\n+\n+ ## in case some pixels are left print annotation plot\n colnames(inputpixels) = c("x", "y", "annotation")\n position_df = merge(coord(msidata)[,1:2], inputpixels, by=c("x", "y"), all.x=TRUE)\n- validpixels = nrow(position_df)\n colnames(position_df)[3] = "annotation"\n position_df\\$annotation = factor(position_df\\$annotation)\n \n- ## for valid pixels: filter file for pixels\n- if (validpixels != 0){\n- pixelvector = character()\n- for (pixel in 1:nrow(position_df)){\n- pixelvector[pixel] = paste0("x = ", position_df[pixel,1],", ", "y = ", position_df[pixel,2])}\n- pixelsofinterest= pixels(msidata)[names(pixels(msidata)) %in% pixelvector]\n- msidata = msidata[,pixelsofinterest]\n- }else{\n- validpixels=0}\n \n ########### Pixels wihin x and y minima and maxima are kept ###################\n \n@@ -199,7 +199,6 @@\n npeaks_before_filtering= sum(spectra(msidata)[]>0, na.rm=TRUE)\n \n \n-\n if (npeaks_before_filtering > 0)\n \n {\n@@ -314,11 +313,14 @@\n \n ## save msidata as Rfile\n save(msidata, file="$msidata_filtered")\n-\n+ ## Number of empty TICs\n+ TICs2 = colSums(spectra(msidata)[], na.rm=TRUE)\n }else{\n print("Inputfile or file filtered for pixels has no intensities > 0")\n numberfeatures = NA\n validmz = NA\n+ ## Number of empty TICs\n+ TICs2 = NA\n }\n \n #################### QC numbers #######################\n@@ -344,7 +346,6 @@\n ## Percentage of intensities > 0\n percpeaks2 = round(npeaks2/numpeaks2*100, digits=2)\n ## Number of empty TICs\n- TICs2 = colSums(spectra(msidata)[], na.rm=TRUE) \n NumemptyTIC2 = sum(TICs2 == 0)\n ## median TIC\n medint2 = round(median(TICs2), digits=2)\n@@ -356,7 +357,7 @@\n "Range of y coordinates",\n "Intensities > 0",\n "Median TIC per pixel",\n- "Number of zero TICs", \n+ "Number of empty spectra", \n "pixel overview", \n "feature overview")\n \n@@ -439,8 +440,8 @@\n \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 '..b'matrix3.tabular"/>\n </test>\n <test expect_num_outputs="2">\n <param name="infile" value="" ftype="imzml">\n@@ -596,7 +597,7 @@\n <param name="pixel_column_x" value="1"/>\n <param name="pixel_column_y" value="3"/>\n <param name="annotation_column_xy" value="2"/>\n- <output name="filtering_qc" file="imzml_filtered4.pdf" compare="sim_size" delta="20000"/>\n+ <output name="QC_overview" file="imzml_filtered4.pdf" compare="sim_size" delta="20000"/>\n <output name="msidata_filtered" file="imzml_filtered4.RData" compare="sim_size"/>\n </test>\n <test expect_num_outputs="2">\n@@ -613,7 +614,7 @@\n <param name="inputfeatures" ftype="tabular" value = "featuresofinterest5.tabular"/>\n <param name="feature_column" value="1"/>\n <param name="feature_header" value="0"/>\n- <output name="filtering_qc" file="imzml_filtered5.pdf" compare="sim_size" delta="20000"/>\n+ <output name="QC_overview" file="imzml_filtered5.pdf" compare="sim_size" delta="20000"/>\n <output name="msidata_filtered" file="imzml_filtered5.RData" compare="sim_size" />\n </test>\n <test expect_num_outputs="3">\n@@ -629,9 +630,9 @@\n <param name="inputfeatures" ftype="tabular" value = "featuresofinterest2.tabular"/>\n <param name="feature_column" value="1"/>\n <param name="output_matrix" value="True"/>\n- <output name="filtering_qc" file="analyze_filtered.pdf" compare="sim_size" delta="20000"/>\n+ <output name="QC_overview" file="analyze_filtered.pdf" compare="sim_size" delta="20000"/>\n <output name="msidata_filtered" file="analyze_filtered.RData" compare="sim_size" />\n- <output name="matrixasoutput" file="analyze_matrix.tabular"/>\n+ <output name="intensity_matrix" file="analyze_matrix.tabular"/>\n </test>\n <test expect_num_outputs="2">\n <param name="infile" value="" ftype="analyze75">\n@@ -639,7 +640,7 @@\n <composite_data value="Analyze75.img"/>\n <composite_data value="Analyze75.t2m"/>\n </param>\n- <output name="filtering_qc" file="analyze75_filtered2.pdf" compare="sim_size" delta="20000"/>\n+ <output name="QC_overview" file="analyze75_filtered2.pdf" compare="sim_size" delta="20000"/>\n <output name="msidata_filtered" file="analyze_filteredoutside.RData" compare="sim_size" />\n </test>\n <test expect_num_outputs="3">\n@@ -648,9 +649,9 @@\n <param name="outputs_select" value="no_quality_control"/>\n </conditional>\n <param name="output_matrix" value="True"/>\n- <output name="matrixasoutput" file="rdata_matrix.tabular"/>\n+ <output name="intensity_matrix" file="rdata_matrix.tabular"/>\n <output name="msidata_filtered" file="rdata_notfiltered.RData" compare="sim_size" />\n- <output name="filtering_qc" file="rdata_notfiltered.pdf" compare="sim_size" />\n+ <output name="QC_overview" file="rdata_notfiltered.pdf" compare="sim_size" />\n </test>\n </tests>\n <help>\n@@ -683,7 +684,7 @@\n \n Tip: \n \n-- It is recommended to use the filtering tool only for m/z which have been extracted from the same dataset. If you have m/z from dataset A and you want to use them to filter dataset B, first find the corresponding (closest) features in dataset B by using the tool "Join two files on column allowing a small difference". Afterwards use the corresponding feature m/z from dataset A to filter dataset B. \n+- It is recommended to use the filtering tool only for m/z which have been extracted from the same dataset. If the m/z values are from a different dataset, the tool "Join two files on column allowing a small difference" should be used to find corresponding m/z values, which can then be used for filtering. \n \n \n ]]>\n' |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/analyze75_filtered2.pdf |
| b |
| Binary file test-data/analyze75_filtered2.pdf has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/analyze_filtered.RData |
| b |
| Binary file test-data/analyze_filtered.RData has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/analyze_filtered.pdf |
| b |
| Binary file test-data/analyze_filtered.pdf has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/analyze_filteredoutside.RData |
| b |
| Binary file test-data/analyze_filteredoutside.RData has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/analyze_matrix.tabular --- a/test-data/analyze_matrix.tabular Wed Aug 22 13:42:05 2018 -0400 +++ b/test-data/analyze_matrix.tabular Tue Sep 04 13:42:37 2018 -0400 |
| b |
| @@ -1,4 +1,4 @@ -mz | spectra x = 1, y = 1 x = 1, y = 2 x = 3, y = 2 x = 1, y = 3 +mz 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 262db9893c6f -r 28ac8199d4d5 test-data/imzml_filtered.RData |
| b |
| Binary file test-data/imzml_filtered.RData has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/imzml_filtered.pdf |
| b |
| Binary file test-data/imzml_filtered.pdf has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/imzml_filtered2.pdf |
| b |
| Binary file test-data/imzml_filtered2.pdf has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/imzml_filtered3.RData |
| b |
| Binary file test-data/imzml_filtered3.RData has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/imzml_filtered3.pdf |
| b |
| Binary file test-data/imzml_filtered3.pdf has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/imzml_filtered4.RData |
| b |
| Binary file test-data/imzml_filtered4.RData has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/imzml_filtered4.pdf |
| b |
| Binary file test-data/imzml_filtered4.pdf has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/imzml_filtered5.RData |
| b |
| Binary file test-data/imzml_filtered5.RData has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/imzml_filtered5.pdf |
| b |
| Binary file test-data/imzml_filtered5.pdf has changed |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/imzml_matrix3.tabular --- a/test-data/imzml_matrix3.tabular Wed Aug 22 13:42:05 2018 -0400 +++ b/test-data/imzml_matrix3.tabular Tue Sep 04 13:42:37 2018 -0400 |
| b |
| @@ -1,4 +1,4 @@ -mz | spectra x = 1, y = 2 x = 2, y = 2 x = 3, y = 2 +mz 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 262db9893c6f -r 28ac8199d4d5 test-data/rdata_matrix.tabular --- a/test-data/rdata_matrix.tabular Wed Aug 22 13:42:05 2018 -0400 +++ b/test-data/rdata_matrix.tabular Tue Sep 04 13:42:37 2018 -0400 |
| b |
| @@ -1,4 +1,4 @@ -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 +mz 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 |
| b |
| diff -r 262db9893c6f -r 28ac8199d4d5 test-data/rdata_notfiltered.pdf |
| b |
| Binary file test-data/rdata_notfiltered.pdf has changed |