comparison msi_filtering.xml @ 8:262db9893c6f draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_filtering commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
author galaxyp
date Wed, 22 Aug 2018 13:42:05 -0400
parents 73b5a754f35c
children 28ac8199d4d5
comparison
equal deleted inserted replaced
7:73b5a754f35c 8:262db9893c6f
1 <tool id="mass_spectrometry_imaging_filtering" name="MSI filtering" version="1.10.0.5"> 1 <tool id="mass_spectrometry_imaging_filtering" name="MSI filtering" version="1.10.0.6">
2 <description>tool for filtering mass spectrometry imaging data</description> 2 <description>tool for filtering mass spectrometry imaging data</description>
3 <requirements> 3 <requirements>
4 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement> 4 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>
5 <requirement type="package" version="2.2.1">r-gridextra</requirement> 5 <requirement type="package" version="2.2.1">r-gridextra</requirement>
6 <requirement type="package" version="2.2.1">r-ggplot2</requirement> 6 <requirement type="package" version="2.2.1">r-ggplot2</requirement>
42 msidata <- readImzML('infile') 42 msidata <- readImzML('infile')
43 #end if 43 #end if
44 #elif $infile.ext == 'analyze75' 44 #elif $infile.ext == 'analyze75'
45 msidata = readAnalyze('infile') 45 msidata = readAnalyze('infile')
46 #else 46 #else
47 load('infile.RData') 47 loadRData <- function(fileName){
48 load(fileName)
49 get(ls()[ls() != "fileName"])
50 }
51 msidata = loadRData('infile.RData')
52
48 #end if 53 #end if
49 54
50 55
51 ########################### QC numbers ######################## 56 ########################### QC numbers ########################
52 57
390 ## QC report with more than value-table: only when pixels/features/intensities are left 395 ## QC report with more than value-table: only when pixels/features/intensities are left
391 if (npeaks2 > 0) 396 if (npeaks2 > 0)
392 { 397 {
393 ### visual pixel control 398 ### visual pixel control
394 399
400 levels(position_df\$annotation) = factor(paste(1:length(levels(position_df\$annotation)), levels(position_df\$annotation), sep="_"))
401
395 pixel_image = ggplot(position_df, aes(x=x, y=y, fill=annotation))+ 402 pixel_image = ggplot(position_df, aes(x=x, y=y, fill=annotation))+
396 geom_tile(height = 1, width=1)+ 403 geom_tile(height = 1, width=1)+
397 coord_fixed()+ 404 coord_fixed()+
398 ggtitle("Spatial orientation of filtered pixels")+ 405 ggtitle("Spatial orientation of filtered pixels")+
399 theme_bw()+ 406 theme_bw()+
400 theme(plot.title = element_text(hjust = 0.5))+ 407 theme(plot.title = element_text(hjust = 0.5))+
401 theme(text=element_text(family="ArialMT", face="bold", size=12))+ 408 theme(text=element_text(family="ArialMT", face="bold", size=12))+
402 theme(legend.position="bottom",legend.direction="vertical")+ 409 theme(legend.position="bottom",legend.direction="vertical")+
410 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = 6))+
403 guides(fill=guide_legend(ncol=4,byrow=TRUE)) 411 guides(fill=guide_legend(ncol=4,byrow=TRUE))
412
413 coord_labels = aggregate(cbind(x,y)~annotation, data=position_df, mean, na.rm=TRUE, na.action="na.pass")
414 coord_labels\$file_number = 1:length(levels(position_df\$annotation))
415
416 for(file_count in 1:nrow(coord_labels))
417 {pixel_image = pixel_image + annotate("text",x=coord_labels[file_count,"x"],
418 y=coord_labels[file_count,"y"],label=toString(coord_labels[file_count,4]))}
404 419
405 print(pixel_image) 420 print(pixel_image)
406 421
407 ### control features which are removed 422 ### control features which are removed
408 hist(mz(msidata), xlab="m/z", main="Kept m/z values") 423 hist(mz(msidata), xlab="m/z", main="Kept m/z values")