# HG changeset patch # User galaxyp # Date 1540466528 14400 # Node ID ac474da4360584d6be70e4d6fd146be7b5206098 # Parent b414378b969f26a5039b4a20b81f3e012e925869 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit d2f311f7fff24e54c565127c40414de708e31b3c diff -r b414378b969f -r ac474da43605 combine.xml --- a/combine.xml Mon Oct 01 01:02:18 2018 -0400 +++ b/combine.xml Thu Oct 25 07:22:08 2018 -0400 @@ -1,4 +1,4 @@ - + combine several mass spectrometry imaging datasets into one @@ -6,7 +6,7 @@ macros.xml - r-ggplot2 + r-ggplot2 $outfile_imzml && + ls -l "$outfile_imzml.files_path" >> $outfile_imzml ]]> @@ -75,15 +83,15 @@ #if $infile.ext == 'imzml' #if str($processed_cond.processed_file) == "processed": - msidata_$i <- readImzML('infile_${i}', mass.accuracy=$processed_cond.accuracy, units.accuracy = "$processed_cond.units") - centroided(msidata) = $centroids + msidata_$i <- readImzML('infile_${i}', mass.accuracy=$processed_cond.accuracy, units.accuracy = "$processed_cond.units", attach.only=TRUE) + centroided(msidata_$i) = $centroids #else - msidata_$i <- readImzML('infile_${i}') - centroided(msidata) = $centroids + msidata_$i <- readImzML('infile_${i}', attach.only=TRUE) + centroided(msidata_$i) = $centroids #end if #elif $infile.ext == 'analyze75' - msidata_$i <- readAnalyze('infile_${i}') - centroided(msidata) = $centroids + msidata_$i <- readAnalyze('infile_${i}', attach.only=TRUE) + centroided(msidata_$i) = $centroids #else msidata_$i = loadRData('infile_${i}.RData') #end if @@ -106,6 +114,7 @@ msidata_$i\$column5 = rep(NA, ncol(msidata_$i)) msidata_$i\$combined_sample = rep(NA, ncol(msidata_$i)) + #if str($annotation_cond.annotation_tabular) == 'annotation' print("annotations") @@ -131,6 +140,7 @@ msidata_$i\$column4 = annotation_df_8_sorted[,7] msidata_$i\$column5 = annotation_df_8_sorted[,8] + ## extract columnnames from (last) annotation tabular (for QC plot names) annotation_colnames = colnames(input_annotation)[-c(1,2)] @@ -142,8 +152,8 @@ #if str( $combine_conditional.combine_method ) == 'xy_shifts': ## shift coordinates according to input tabular file and store file names - coord(msidata_$i)\$x = coord(msidata_$i)\$x + input_list[$i+1,$combine_conditional.column_x] ## shifts x coordinates according to tabular file - coord(msidata_$i)\$y = coord(msidata_$i)\$y + input_list[$i+1,$combine_conditional.column_y] ## shifts y coordinates according to tabular file + coord(msidata_$i)\$x = as.integer(coord(msidata_$i)\$x + input_list[$i+1,$combine_conditional.column_x]) ## shifts x coordinates according to tabular file + coord(msidata_$i)\$y = as.integer(coord(msidata_$i)\$y + input_list[$i+1,$combine_conditional.column_y]) ## shifts y coordinates according to tabular file pixel_vector = append(pixel_vector, rep(paste($i+1, input_list[$i+1,$combine_conditional.column_names], sep="_"),times=ncol(msidata_$i))) ## stores file name for each pixel msidata_$i\$combined_sample = rep(paste($i+1, input_list[$i+1,$combine_conditional.column_names], sep="_"),times=ncol(msidata_$i)) pixelcoords_$i = cbind(coord(msidata_$i)[,1:2], rep($i+1,ncol(msidata_$i))) @@ -167,9 +177,8 @@ } ## Number of input files define grid which is row-wise filled with files - - coord(msidata_$i)\$x = coord(msidata_$i)\$x - (min(coord(msidata_$i)\$x-1)) + x_shifts - coord(msidata_$i)\$y = coord(msidata_$i)\$y - (min(coord(msidata_$i)\$y-1)) + y_shifts + coord(msidata_$i)\$x = as.integer(coord(msidata_$i)\$x - (min(coord(msidata_$i)\$x-1)) + x_shifts) + coord(msidata_$i)\$y = as.integer(coord(msidata_$i)\$y - (min(coord(msidata_$i)\$y-1)) + y_shifts) x_shifts = max(coord(msidata_$i)\$x) + 5 max_y = append(max_y, max(coord(msidata_$i)\$y)) all_files = $num_infiles @@ -209,10 +218,15 @@ colnames(position_df)[3] = "sample_name" ## save as (.RData) - msidata = msidata_combined save(msidata, file="$msidata_combined") + ## save msidata as imzML file + #if $imzml_output: + writeImzML(msidata, "out") + #end if + + ################################## xy shifts ################################### ################################################################################ @@ -242,6 +256,9 @@ msidata = msidata_combined save(msidata, file="$msidata_combined") + ## save msidata as imzML file + writeImzML(msidata, "out") + ## create x,y,sample_name dataframe for QC pdf position_df = cbind(coord(msidata), msidata\$combined_sample) @@ -390,6 +407,8 @@ } + + ]]> @@ -439,11 +458,15 @@ + + + imzml_output + @@ -543,7 +566,9 @@ **Output** -- single imzML file containing all valid input files +- +- MSI data as .RData output (can be read with the Cardinal package in R) +- optional: MSI data as imzML file - pdf that shows the pixel positions and annotations of the combined files - Tabular file with pixel annotations (x,y,column with input file names and up to five annotation columns) diff -r b414378b969f -r ac474da43605 macros.xml --- a/macros.xml Mon Oct 01 01:02:18 2018 -0400 +++ b/macros.xml Thu Oct 25 07:22:08 2018 -0400 @@ -4,10 +4,17 @@ bioconductor-cardinal + r-base + + /dev/null | grep -v -i "WARNING: ") + ]]> + + - + + @@ -198,12 +206,12 @@ - - + - - - + + + diff -r b414378b969f -r ac474da43605 test-data/Heatmaps_LM8_file16.pdf Binary file test-data/Heatmaps_LM8_file16.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/Heatmaps_analyze75.pdf Binary file test-data/Heatmaps_analyze75.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/Heatmaps_imzml.pdf Binary file test-data/Heatmaps_imzml.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/Heatmaps_rdata.pdf Binary file test-data/Heatmaps_rdata.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/Plot_analyze75.pdf Binary file test-data/Plot_analyze75.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/Plot_analyze75_allpixels.pdf Binary file test-data/Plot_analyze75_allpixels.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/Plot_empty_spectra.pdf Binary file test-data/Plot_empty_spectra.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/Plot_imzml.pdf Binary file test-data/Plot_imzml.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/Plot_rdata.pdf Binary file test-data/Plot_rdata.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/QC_analyze75.pdf Binary file test-data/QC_analyze75.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/QC_empty_spectra.pdf Binary file test-data/QC_empty_spectra.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/QC_imzml.pdf Binary file test-data/QC_imzml.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/QC_rdata.pdf Binary file test-data/QC_rdata.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/analyze75.svg --- a/test-data/analyze75.svg Mon Oct 01 01:02:18 2018 -0400 +++ b/test-data/analyze75.svg Thu Oct 25 07:22:08 2018 -0400 @@ -1,15 +1,15 @@ - + - - - - - - - - - - + + + + + + + + + + diff -r b414378b969f -r ac474da43605 test-data/analyze75_filtered2.pdf Binary file test-data/analyze75_filtered2.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/analyze_filteredoutside.RData Binary file test-data/analyze_filteredoutside.RData has changed diff -r b414378b969f -r ac474da43605 test-data/centroids_rdata.pdf Binary file test-data/centroids_rdata.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/cluster_skm.RData Binary file test-data/cluster_skm.RData has changed diff -r b414378b969f -r ac474da43605 test-data/imzml_filtered2.RData diff -r b414378b969f -r ac474da43605 test-data/imzml_filtered2.pdf Binary file test-data/imzml_filtered2.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/imzml_filtered3.RData Binary file test-data/imzml_filtered3.RData has changed diff -r b414378b969f -r ac474da43605 test-data/imzml_filtered3.pdf Binary file test-data/imzml_filtered3.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/imzml_filtered4.RData Binary file test-data/imzml_filtered4.RData has changed diff -r b414378b969f -r ac474da43605 test-data/imzml_filtered4.pdf Binary file test-data/imzml_filtered4.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/imzml_filtered5.RData Binary file test-data/imzml_filtered5.RData has changed diff -r b414378b969f -r ac474da43605 test-data/imzml_filtered5.pdf Binary file test-data/imzml_filtered5.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/kmeans_analyze.pdf Binary file test-data/kmeans_analyze.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/pca_imzml.pdf Binary file test-data/pca_imzml.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/rdata_notfiltered.RData Binary file test-data/rdata_notfiltered.RData has changed diff -r b414378b969f -r ac474da43605 test-data/rdata_notfiltered.pdf Binary file test-data/rdata_notfiltered.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/test1.pdf Binary file test-data/test1.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/test2.pdf Binary file test-data/test2.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/test2.rdata Binary file test-data/test2.rdata has changed diff -r b414378b969f -r ac474da43605 test-data/test3.pdf Binary file test-data/test3.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/test4.pdf Binary file test-data/test4.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/test4.rdata Binary file test-data/test4.rdata has changed diff -r b414378b969f -r ac474da43605 test-data/test5.pdf Binary file test-data/test5.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/test6.pdf Binary file test-data/test6.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/test6.rdata Binary file test-data/test6.rdata has changed diff -r b414378b969f -r ac474da43605 test-data/test7.pdf Binary file test-data/test7.pdf has changed diff -r b414378b969f -r ac474da43605 test-data/test7.rdata Binary file test-data/test7.rdata has changed