Mercurial > repos > galaxyp > mass_spectrometry_imaging_segmentations
comparison segmentation_tool.xml @ 1:d4158c9955ea draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_segmentation commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a
author | galaxyp |
---|---|
date | Thu, 01 Mar 2018 08:26:19 -0500 |
parents | 0c1a9b68f436 |
children | f66c5789deac |
comparison
equal
deleted
inserted
replaced
0:0c1a9b68f436 | 1:d4158c9955ea |
---|---|
1 <tool id="mass_spectrometry_imaging_segmentations" name="MSI segmentation" version="1.7.0"> | 1 <tool id="mass_spectrometry_imaging_segmentations" name="MSI segmentation" version="1.7.0.1"> |
2 <description>tool for spatial clustering</description> | 2 <description>tool for spatial clustering</description> |
3 <requirements> | 3 <requirements> |
4 <requirement type="package" version="1.7.0">bioconductor-cardinal</requirement> | 4 <requirement type="package" version="1.7.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.23-15">r-kernsmooth</requirement> | 6 <requirement type="package" version="2.23-15">r-kernsmooth</requirement> |
38 library(lattice) | 38 library(lattice) |
39 | 39 |
40 ## Read MALDI Imaging dataset | 40 ## Read MALDI Imaging dataset |
41 | 41 |
42 #if $infile.ext == 'imzml' | 42 #if $infile.ext == 'imzml' |
43 msidata <- readMSIData('infile.imzML') | 43 msidata = readMSIData('infile.imzML') |
44 #elif $infile.ext == 'analyze75' | 44 #elif $infile.ext == 'analyze75' |
45 msidata <- readMSIData('infile.hdr') | 45 msidata = readMSIData('infile.hdr') |
46 #else | 46 #else |
47 load('infile.RData') | 47 load('infile.RData') |
48 #end if | 48 #end if |
49 | 49 |
50 ###################################### file properties in numbers ###################### | 50 ###################################### file properties in numbers ###################### |
175 ##pca | 175 ##pca |
176 | 176 |
177 component_vector = character() | 177 component_vector = character() |
178 for (numberofcomponents in 1:$segm_cond.pca_ncomp) | 178 for (numberofcomponents in 1:$segm_cond.pca_ncomp) |
179 {component_vector[numberofcomponents]= paste0("PC", numberofcomponents)} | 179 {component_vector[numberofcomponents]= paste0("PC", numberofcomponents)} |
180 pca <- PCA(msidata, ncomp=$segm_cond.pca_ncomp, column = component_vector, superpose = FALSE, | 180 pca = PCA(msidata, ncomp=$segm_cond.pca_ncomp, column = component_vector, superpose = FALSE, |
181 method = "$segm_cond.pca_method", scale = $segm_cond.pca_scale, layout = c(ncomp, 1)) | 181 method = "$segm_cond.pca_method", scale = $segm_cond.pca_scale, layout = c(ncomp, 1)) |
182 | 182 |
183 print(image(pca, main="PCA image", lattice=TRUE, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), contrast.enhance = "$segm_cond.pca_imagecontrast", smooth.image = "$segm_cond.pca_imagesmoothing", col=colourvector)) | 183 print(image(pca, main="PCA image", lattice=TRUE, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), contrast.enhance = "$segm_cond.pca_imagecontrast", smooth.image = "$segm_cond.pca_imagesmoothing", col=colourvector, ylim=c(maximumy+2, 0))) |
184 print(plot(pca, main="PCA plot", lattice=TRUE, col= colourvector, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)))) | 184 print(plot(pca, main="PCA plot", lattice=TRUE, col= colourvector, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)))) |
185 | 185 |
186 | 186 |
187 pcaloadings = (pca@resultData\$ncomp\$loadings) ### loading for each mz value | 187 pcaloadings = (pca@resultData\$ncomp\$loadings) ### loading for each mz value |
188 pcascores = (pca@resultData\$ncomp\$scores) ### scores for each pixel | 188 pcascores = (pca@resultData\$ncomp\$scores) ### scores for each pixel |
192 | 192 |
193 #elif str( $segm_cond.segmentationtool ) == 'kmeans': | 193 #elif str( $segm_cond.segmentationtool ) == 'kmeans': |
194 print('kmeans') | 194 print('kmeans') |
195 ##k-means | 195 ##k-means |
196 | 196 |
197 skm <- spatialKMeans(msidata, r=$segm_cond.kmeans_r, k=$segm_cond.kmeans_k, method="$segm_cond.kmeans_method") | 197 skm = spatialKMeans(msidata, r=$segm_cond.kmeans_r, k=$segm_cond.kmeans_k, method="$segm_cond.kmeans_method") |
198 print(image(skm, key=TRUE, main="K-means clustering", lattice=TRUE, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), contrast.enhance = "$segm_cond.kmeans_imagecontrast", col= colourvector, smooth.image = "$segm_cond.kmeans_imagesmoothing")) | 198 print(image(skm, key=TRUE, main="K-means clustering", lattice=TRUE, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), contrast.enhance = "$segm_cond.kmeans_imagecontrast", col= colourvector, smooth.image = "$segm_cond.kmeans_imagesmoothing", ylim=c(maximumy+2, 0))) |
199 print(plot(skm, main="K-means plot", lattice=TRUE, col= colourvector, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)))) | 199 print(plot(skm, main="K-means plot", lattice=TRUE, col= colourvector, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)))) |
200 | 200 |
201 | 201 |
202 skm_clusters = (skm@resultData\$r\$cluster) | 202 skm_clusters = (skm@resultData\$r\$cluster) |
203 skm_toplabels = topLabels(skm, n=500) | 203 skm_toplabels = topLabels(skm, n=500) |
208 | 208 |
209 #elif str( $segm_cond.segmentationtool ) == 'centroids': | 209 #elif str( $segm_cond.segmentationtool ) == 'centroids': |
210 print('centroids') | 210 print('centroids') |
211 ##centroids | 211 ##centroids |
212 | 212 |
213 ssc <- spatialShrunkenCentroids(msidata, r=$segm_cond.centroids_r, k=$segm_cond.centroids_k, s=$segm_cond.centroids_s, method="$segm_cond.centroids_method") | 213 ssc = spatialShrunkenCentroids(msidata, r=$segm_cond.centroids_r, k=$segm_cond.centroids_k, s=$segm_cond.centroids_s, method="$segm_cond.centroids_method") |
214 print(image(ssc, key=TRUE, main="Spatial shrunken centroids", lattice=TRUE, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), contrast.enhance = "$segm_cond.centroids_imagecontrast", col= colourvector, smooth.image = "$segm_cond.centroids_imagesmoothing")) | 214 print(image(ssc, key=TRUE, main="Spatial shrunken centroids", lattice=TRUE, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), contrast.enhance = "$segm_cond.centroids_imagecontrast", col= colourvector, smooth.image = "$segm_cond.centroids_imagesmoothing", ylim=c(maximumy+2, 0))) |
215 print(plot(ssc, main="Spatial shrunken centroids plot", lattice=TRUE, col= colourvector, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)))) | 215 print(plot(ssc, main="Spatial shrunken centroids plot", lattice=TRUE, col= colourvector, strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)))) |
216 | 216 |
217 ssc_classes = (ssc@resultData\$r\$classes) | 217 ssc_classes = (ssc@resultData\$r\$classes) |
218 ssc_toplabels = topLabels(ssc, n=500) | 218 ssc_toplabels = topLabels(ssc, n=500) |
219 | 219 |
340 </repeat> | 340 </repeat> |
341 <repeat name="colours"> | 341 <repeat name="colours"> |
342 <param name="feature_color" value="#0000FF"/> | 342 <param name="feature_color" value="#0000FF"/> |
343 </repeat> | 343 </repeat> |
344 <output name="segmentationimages" file="pca_imzml.pdf" compare="sim_size" delta="20000"/> | 344 <output name="segmentationimages" file="pca_imzml.pdf" compare="sim_size" delta="20000"/> |
345 <output name="mzfeatures" file="pcaloadings_results1.txt" compare="sim_size"/> | 345 <output name="mzfeatures" file="loadings_pca.tabular" compare="sim_size"/> |
346 <output name="pixeloutput" file="pcascores_results1.txt" compare="sim_size"/> | 346 <output name="pixeloutput" file="scores_pca.tabular" compare="sim_size"/> |
347 </test> | 347 </test> |
348 <test> | 348 <test> |
349 <param name="infile" value="" ftype="analyze75"> | 349 <param name="infile" value="" ftype="analyze75"> |
350 <composite_data value="Analyze75.hdr" /> | 350 <composite_data value="Analyze75.hdr" /> |
351 <composite_data value="Analyze75.img" /> | 351 <composite_data value="Analyze75.img" /> |
360 </repeat> | 360 </repeat> |
361 <repeat name="colours"> | 361 <repeat name="colours"> |
362 <param name="feature_color" value="#00C957"/> | 362 <param name="feature_color" value="#00C957"/> |
363 </repeat> | 363 </repeat> |
364 <output name="segmentationimages" file="kmeans_imzml.pdf" compare="sim_size" delta="20000"/> | 364 <output name="segmentationimages" file="kmeans_imzml.pdf" compare="sim_size" delta="20000"/> |
365 <output name="mzfeatures" file="toplabels_results1.txt" compare="sim_size"/> | 365 <output name="mzfeatures" file="toplabels_skm.tabular" compare="sim_size"/> |
366 <output name="pixeloutput" file="cluster_results1.txt" compare="sim_size"/> | 366 <output name="pixeloutput" file="cluster_skm.tabular" compare="sim_size"/> |
367 </test> | 367 </test> |
368 <test> | 368 <test> |
369 <param name="infile" value="preprocessing_results1.RData" ftype="rdata"/> | 369 <param name="infile" value="preprocessing_results1.RData" ftype="rdata"/> |
370 <param name="segmentationtool" value="centroids"/> | 370 <param name="segmentationtool" value="centroids"/> |
371 <repeat name="colours"> | 371 <repeat name="colours"> |
382 </repeat> | 382 </repeat> |
383 <repeat name="colours"> | 383 <repeat name="colours"> |
384 <param name="feature_color" value="#848484"/> | 384 <param name="feature_color" value="#848484"/> |
385 </repeat> | 385 </repeat> |
386 <output name="segmentationimages" file="centroids_imzml.pdf" compare="sim_size" delta="20000"/> | 386 <output name="segmentationimages" file="centroids_imzml.pdf" compare="sim_size" delta="20000"/> |
387 <output name="mzfeatures" file="toplabels_results1.txt" compare="sim_size"/> | 387 <output name="mzfeatures" file="toplabels_ssc.tabular" compare="sim_size"/> |
388 <output name="pixeloutput" file="classes_results1.txt" compare="sim_size"/> | 388 <output name="pixeloutput" file="classes_ssc.tabular" compare="sim_size"/> |
389 </test> | 389 </test> |
390 </tests> | 390 </tests> |
391 <help> | 391 <help> |
392 <![CDATA[ | 392 <![CDATA[ |
393 | 393 |