Mercurial > repos > galaxyp > msi_qualitycontrol
comparison msi_qualitycontrol.xml @ 16:f56166082222 draft default tip
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 5feaf3d0e0da8cef1241fecc1f4d6f81324594e6
| author | galaxyp |
|---|---|
| date | Wed, 22 Aug 2018 13:34:45 -0400 |
| parents | 898dec99d9fc |
| children |
comparison
equal
deleted
inserted
replaced
| 15:898dec99d9fc | 16:f56166082222 |
|---|---|
| 1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.10.0.6"> | 1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.10.0.7"> |
| 2 <description> | 2 <description> |
| 3 mass spectrometry imaging QC | 3 mass spectrometry imaging QC |
| 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> |
| 46 msidata <- readImzML('infile') | 46 msidata <- readImzML('infile') |
| 47 #end if | 47 #end if |
| 48 #elif $infile.ext == 'analyze75' | 48 #elif $infile.ext == 'analyze75' |
| 49 msidata = readAnalyze('infile') | 49 msidata = readAnalyze('infile') |
| 50 #else | 50 #else |
| 51 load('infile.RData') | 51 loadRData <- function(fileName){ |
| 52 load(fileName) | |
| 53 get(ls()[ls() != "fileName"]) | |
| 54 } | |
| 55 msidata = loadRData('infile.RData') | |
| 52 #end if | 56 #end if |
| 53 | |
| 54 ## create full matrix to make processed imzML files compatible with segmentation and other steps | |
| 55 iData(msidata) <- iData(msidata)[] | |
| 56 | 57 |
| 57 ## remove duplicated coordinates | 58 ## remove duplicated coordinates |
| 58 print(paste0(sum(duplicated(coord(msidata))), " duplicated coordinates were removed")) | 59 print(paste0(sum(duplicated(coord(msidata))), " duplicated coordinates were removed")) |
| 59 msidata <- msidata[,!duplicated(coord(msidata))] | 60 msidata <- msidata[,!duplicated(coord(msidata))] |
| 61 | |
| 62 ## create full matrix to make processed imzML files compatible with segmentation and other steps | |
| 63 iData(msidata) <- iData(msidata)[] | |
| 60 | 64 |
| 61 ## optional annotation from tabular file to obtain pixel groups (otherwise all pixels are considered to be one sample) | 65 ## optional annotation from tabular file to obtain pixel groups (otherwise all pixels are considered to be one sample) |
| 62 | 66 |
| 63 #if str($tabular_annotation.load_annotation) == 'yes_annotation': | 67 #if str($tabular_annotation.load_annotation) == 'yes_annotation': |
| 64 | 68 |
| 286 spectrum_list[[list_count]] = position_df | 290 spectrum_list[[list_count]] = position_df |
| 287 list_count = list_count+1 | 291 list_count = list_count+1 |
| 288 | 292 |
| 289 colnames(position_df)[3] = "annotation" | 293 colnames(position_df)[3] = "annotation" |
| 290 | 294 |
| 291 print(position_df) | |
| 292 print(class(position_df\$x)) | |
| 293 print(class(position_df\$annotation)) | |
| 294 | |
| 295 combine_plot = ggplot(position_df, aes(x=x, y=y, fill=annotation))+ | 295 combine_plot = ggplot(position_df, aes(x=x, y=y, fill=annotation))+ |
| 296 geom_tile() + | 296 geom_tile() + |
| 297 coord_fixed()+ | 297 coord_fixed()+ |
| 298 ggtitle("Spatial orientation of pixel annotations")+ | 298 ggtitle("Spatial orientation of pixel annotations")+ |
| 299 theme_bw()+ | 299 theme_bw()+ |
| 300 theme(plot.title = element_text(hjust = 0.5))+ | 300 theme(plot.title = element_text(hjust = 0.5))+ |
| 301 theme(text=element_text(family="ArialMT", face="bold", size=12))+ | 301 theme(text=element_text(family="ArialMT", face="bold", size=12))+ |
| 302 theme(legend.position="bottom",legend.direction="vertical")+ | 302 theme(legend.position="bottom",legend.direction="vertical")+ |
| 303 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+ | 303 theme(legend.key.size = unit(0.2, "line"), legend.text = element_text(size = legend_size))+ |
| 304 guides(fill=guide_legend(ncol=5,byrow=TRUE)) | 304 guides(fill=guide_legend(ncol=4,byrow=TRUE)) |
| 305 | 305 |
| 306 print(combine_plot) | 306 print(combine_plot) |
| 307 | 307 |
| 308 ### order pixels according to annotation - this gives a new pixel/spectra index order according to the annotation groups | 308 ### order pixels according to annotation - this gives a new pixel/spectra index order according to the annotation groups |
| 309 pixel_name_df = data.frame(pixels(msidata), msidata\$annotation) | 309 pixel_name_df = data.frame(pixels(msidata), msidata\$annotation) |
| 1081 <