Mercurial > repos > galaxyp > msi_spectra_plot
comparison msi_spectra_plots.xml @ 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 |
comparison
equal
deleted
inserted
replaced
8:d0e13a160a6c | 9:ebca696cb024 |
---|---|
1 <tool id="mass_spectrometry_imaging_mzplots" name="MSI plot spectra" version="1.10.0.6"> | 1 <tool id="mass_spectrometry_imaging_mzplots" name="MSI plot spectra" version="1.10.0.7"> |
2 <description> | 2 <description> |
3 mass spectrometry imaging mass spectra plots | 3 mass spectrometry imaging mass spectra plots |
4 </description> | 4 </description> |
5 <requirements> | 5 <requirements> |
6 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement> | 6 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement> |
118 "Range of x coordinates", | 118 "Range of x coordinates", |
119 "Range of y coordinates", | 119 "Range of y coordinates", |
120 "Range of intensities", | 120 "Range of intensities", |
121 "Median of intensities", | 121 "Median of intensities", |
122 "Intensities > 0", | 122 "Intensities > 0", |
123 "Number of zero TICs", | 123 "Number of empty spectra", |
124 "Preprocessing", | 124 "Preprocessing", |
125 "Normalization", | 125 "Normalization", |
126 "Smoothing", | 126 "Smoothing", |
127 "Baseline reduction", | 127 "Baseline reduction", |
128 "Peak picking", | 128 "Peak picking", |
263 legend_size = 7 | 263 legend_size = 7 |
264 }else{ | 264 }else{ |
265 legend_size = 6 | 265 legend_size = 6 |
266 } | 266 } |
267 | 267 |
268 position_df = cbind(coord(msidata)[,1:2], msidata\$annotation) | 268 position_df = cbind(coord(msidata)[,1:2], as.factor(msidata\$annotation)) |
269 colnames(position_df)[3] = "sample_name" | 269 colnames(position_df)[3] = "sample_name" |
270 | 270 |
271 combine_plot = ggplot(position_df, aes(x=x, y=y, fill=sample_name))+ | 271 combine_plot = ggplot(position_df, aes(x=x, y=y, fill=sample_name))+ |
272 geom_tile() + | 272 geom_tile(height = 1, width=1)+ |
273 coord_fixed()+ | 273 coord_fixed()+ |
274 ggtitle("Spatial orientation of pixel annotations")+ | 274 ggtitle("Spatial orientation of pixel annotations")+ |
275 theme_bw()+ | 275 theme_bw()+ |
276 theme(plot.title = element_text(hjust = 0.5))+ | 276 theme(plot.title = element_text(hjust = 0.5))+ |
277 theme(text=element_text(family="ArialMT", face="bold", size=12))+ | 277 theme(text=element_text(family="ArialMT", face="bold", size=12))+ |
278 theme(legend.position="bottom",legend.direction="vertical")+ | 278 theme(legend.position="bottom",legend.direction="vertical")+ |
279 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+ | 279 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = 6))+ |
280 guides(fill=guide_legend(ncol=5,byrow=TRUE)) | 280 guides(fill=guide_legend(ncol=4,byrow=TRUE)) |
281 | |
282 coord_labels = aggregate(cbind(x,y)~sample_name, data=position_df, mean, na.rm=TRUE, na.action="na.pass") | |
283 coord_labels\$file_number = 1:length(levels(position_df\$sample_name)) | |
284 | |
285 for(file_count in 1:nrow(coord_labels)) | |
286 {combine_plot = combine_plot + annotate("text",x=coord_labels[file_count,"x"], | |
287 y=coord_labels[file_count,"y"],label=toString(coord_labels[file_count,4]))} | |
281 | 288 |
282 print(combine_plot) | 289 print(combine_plot) |
283 | 290 |
284 ## print legend only for less than 10 samples | 291 ## print legend only for less than 10 samples |
285 if (length(levels(msidata\$annotation)) < 10){ | 292 if (length(levels(msidata\$annotation)) < 10){ |