Mercurial > repos > galaxyp > msi_spectra_plot
changeset 9:ebca696cb024 draft default tip
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_spectra_plots commit e87eea03505ab1ba067e192bbbcdc6197dc4b42e
author | galaxyp |
---|---|
date | Tue, 04 Sep 2018 13:42:04 -0400 |
parents | d0e13a160a6c |
children | |
files | msi_spectra_plots.xml test-data/Plot_analyze75.pdf test-data/Plot_analyze75_allpixels.pdf test-data/Plot_empty_spectra.pdf test-data/Plot_imzml.pdf test-data/Plot_rdata.pdf |
diffstat | 6 files changed, 13 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/msi_spectra_plots.xml Wed Aug 22 13:44:57 2018 -0400 +++ b/msi_spectra_plots.xml Tue Sep 04 13:42:04 2018 -0400 @@ -1,4 +1,4 @@ -<tool id="mass_spectrometry_imaging_mzplots" name="MSI plot spectra" version="1.10.0.6"> +<tool id="mass_spectrometry_imaging_mzplots" name="MSI plot spectra" version="1.10.0.7"> <description> mass spectrometry imaging mass spectra plots </description> @@ -120,7 +120,7 @@ "Range of intensities", "Median of intensities", "Intensities > 0", - "Number of zero TICs", + "Number of empty spectra", "Preprocessing", "Normalization", "Smoothing", @@ -265,19 +265,26 @@ legend_size = 6 } - position_df = cbind(coord(msidata)[,1:2], msidata\$annotation) + position_df = cbind(coord(msidata)[,1:2], as.factor(msidata\$annotation)) colnames(position_df)[3] = "sample_name" combine_plot = ggplot(position_df, aes(x=x, y=y, fill=sample_name))+ - geom_tile() + + geom_tile(height = 1, width=1)+ coord_fixed()+ ggtitle("Spatial orientation of pixel annotations")+ theme_bw()+ theme(plot.title = element_text(hjust = 0.5))+ theme(text=element_text(family="ArialMT", face="bold", size=12))+ theme(legend.position="bottom",legend.direction="vertical")+ - theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+ - guides(fill=guide_legend(ncol=5,byrow=TRUE)) + theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = 6))+ + guides(fill=guide_legend(ncol=4,byrow=TRUE)) + + coord_labels = aggregate(cbind(x,y)~sample_name, data=position_df, mean, na.rm=TRUE, na.action="na.pass") + coord_labels\$file_number = 1:length(levels(position_df\$sample_name)) + + for(file_count in 1:nrow(coord_labels)) + {combine_plot = combine_plot + annotate("text",x=coord_labels[file_count,"x"], + y=coord_labels[file_count,"y"],label=toString(coord_labels[file_count,4]))} print(combine_plot)