comparison combine.xml @ 6:bb1ac6b47a6c draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit 15e24b1f0143679647906bc427654f66b417a45c"
author galaxyp
date Wed, 25 Mar 2020 07:02:41 -0400
parents b41107d8fe89
children 392b2dfd261d
comparison
equal deleted inserted replaced
5:b41107d8fe89 6:bb1ac6b47a6c
1 <tool id="cardinal_combine" name="MSI combine" version="2.2.6.0"> 1 <tool id="cardinal_combine" name="MSI combine" version="2.2.6.1">
2 <description> 2 <description>
3 combine several mass spectrometry imaging datasets into one 3 combine several mass spectrometry imaging datasets into one
4 </description> 4 </description>
5 <macros> 5 <macros>
6 <import>macros.xml</import> 6 <import>macros.xml</import>
42 42
43 ]]> 43 ]]>
44 </command> 44 </command>
45 <configfiles> 45 <configfiles>
46 <configfile name="msi_combine"><![CDATA[ 46 <configfile name="msi_combine"><![CDATA[
47
47 #import re 48 #import re
48 49
49 ################ 1) load libraries and do preparations ################# 50 ################ 1) load libraries and do preparations #################
50 51
51 library(Cardinal) 52 library(Cardinal)
84 85
85 ## read and manipulate MSI data 86 ## read and manipulate MSI data
86 87
87 #if $infile.ext == 'imzml' 88 #if $infile.ext == 'imzml'
88 #if str($processed_cond.processed_file) == "processed": 89 #if str($processed_cond.processed_file) == "processed":
89 msidata_$i <- readImzML('infile_${i}', mass.accuracy=$processed_cond.accuracy, units.accuracy = "$processed_cond.units", attach.only=TRUE, as = c("MSImageSet")) 90 msidata_$i <- readImzML('infile_${i}', resolution=$processed_cond.accuracy, units = "$processed_cond.units", attach.only=TRUE, as = c("MSImageSet"))
90 centroided(msidata_$i) = $centroids 91 centroided(msidata_$i) = $centroids
91 #else 92 #else
92 msidata_$i <- readImzML('infile_${i}', attach.only=TRUE, as = c("MSImageSet")) 93 msidata_$i <- readImzML('infile_${i}', attach.only=TRUE, as = c("MSImageSet"))
93 centroided(msidata_$i) = $centroids 94 centroided(msidata_$i) = $centroids
94 #end if 95 #end if
233 coordinates_combined = rbind(coordinates_combined, cardinal_coordinates_$i) 234 coordinates_combined = rbind(coordinates_combined, cardinal_coordinates_$i)
234 235
235 #end for 236 #end for
236 237
237 238
238 ######################### 6a) combination same mz axis ################### 239 ######################### 6b) combination same mz axis ###################
239 240
240 #if str( $combine_conditional.combine_method ) == 'automatic_combine': 241 #if str( $combine_conditional.combine_method ) == 'automatic_combine':
241 print("automatic combine") 242 print("automatic combine")
242 243
243 #if not $processed_true: 244 #if not $processed_true:
292 coordinates_matrix = as.matrix(unique_coordinates[,1:2]) 293 coordinates_matrix = as.matrix(unique_coordinates[,1:2])
293 294
294 ## save msidata as imzML file MALDIquant 295 ## save msidata as imzML file MALDIquant
295 MALDIquantForeign::exportImzMl(filtered_dataset, file="out.imzML", processed=TRUE, coordinates=coordinates_matrix) 296 MALDIquantForeign::exportImzMl(filtered_dataset, file="out.imzML", processed=TRUE, coordinates=coordinates_matrix)
296 297
297 ## create x,y,sample_name dataframe for QC pdf
298 ## position_df = unique_coordinates ### ! anders
299 ## colnames(position_df)[3] = "sample_name"
300 ##coordinates_combined = coordinates_combined[pixelsofinterest,] ###! anders
301 coordinates_combined = unique_coordinates 298 coordinates_combined = unique_coordinates
302 ##TODO: hier aufräumen kann alles weg?!
303 299
304 #end if 300 #end if
305 301
306 #end if 302 #end if
307 303
321 theme(text=element_text(family="ArialMT", face="bold", size=15))+ 317 theme(text=element_text(family="ArialMT", face="bold", size=15))+
322 theme(legend.position="bottom",legend.direction="vertical")+ 318 theme(legend.position="bottom",legend.direction="vertical")+
323 guides(fill=guide_legend(ncol=4,byrow=TRUE)) 319 guides(fill=guide_legend(ncol=4,byrow=TRUE))
324 coord_labels = aggregate(cbind(x,y)~sample_name, data=coordinates_combined[,1:3], mean) 320 coord_labels = aggregate(cbind(x,y)~sample_name, data=coordinates_combined[,1:3], mean)
325 coord_labels\$file_number = gsub( "_.*$", "", coord_labels\$sample_name) 321 coord_labels\$file_number = gsub( "_.*$", "", coord_labels\$sample_name)
326
327 print(combine_plot) 322 print(combine_plot)
328 323
329 #if str($annotation_cond.annotation_tabular) == 'annotation' 324 #if str($annotation_cond.annotation_tabular) == 'annotation'
330 ## annotation plots 325 ## annotation plots
331 for (inputcolumns in 4:ncol(coordinates_combined)){ 326 for (inputcolumns in 4:ncol(coordinates_combined)){
429 <param name="column_names" value="3"/> 424 <param name="column_names" value="3"/>
430 <param name="processed_true" value="FALSE"/> 425 <param name="processed_true" value="FALSE"/>
431 <output name="pixel_annotations" file="123_annotation_output.tabular"/> 426 <output name="pixel_annotations" file="123_annotation_output.tabular"/>
432 <output name="QC_overview" file="123_combined_QC.pdf" compare="sim_size"/> 427 <output name="QC_overview" file="123_combined_QC.pdf" compare="sim_size"/>
433 <output name="outfile_imzml" ftype="imzml" file="123_combined.imzml.txt" compare="sim_size"> 428 <output name="outfile_imzml" ftype="imzml" file="123_combined.imzml.txt" compare="sim_size">
434 <extra_files type="file" file="123_combined.imzml" name="imzml" lines_diff="4"/> 429 <extra_files type="file" file="123_combined.imzml" name="imzml" lines_diff="12"/>
435 <extra_files type="file" file="123_combined.ibd" name="ibd" compare="sim_size"/> 430 <extra_files type="file" file="123_combined.ibd" name="ibd" compare="sim_size"/>
436 </output> 431 </output>
437 </test> 432 </test>
438 <test> 433 <test>
439 <param name="infiles" value="123_combined_picked.rdata,123_combined_picked2.rdata" ftype="rdata"/> 434 <param name="infiles" value="123_combined_picked.rdata,123_combined_picked2.rdata" ftype="rdata"/>
445 <param name="column_names" value="3"/> 440 <param name="column_names" value="3"/>
446 <param name="processed_true" value="TRUE"/> 441 <param name="processed_true" value="TRUE"/>
447 <output name="pixel_annotations" file="picked.tabular"/> 442 <output name="pixel_annotations" file="picked.tabular"/>
448 <output name="QC_overview" file="picked_QC.pdf" compare="sim_size"/> 443 <output name="QC_overview" file="picked_QC.pdf" compare="sim_size"/>
449 <output name="outfile_imzml" ftype="imzml" file="picked.imzml.txt" compare="sim_size"> 444 <output name="outfile_imzml" ftype="imzml" file="picked.imzml.txt" compare="sim_size">
450 <extra_files type="file" file="picked.imzml" name="imzml" lines_diff="6"/> 445 <extra_files type="file" file="picked.imzml" name="imzml" lines_diff="12"/>
451 <extra_files type="file" file="picked.ibd" name="ibd" compare="sim_size"/> 446 <extra_files type="file" file="picked.ibd" name="ibd" compare="sim_size"/>
452 </output> 447 </output>
453 </test> 448 </test>
454 <test> 449 <test>
455 <param name="infiles" value="msidata_1.RData,msidata_2.RData,msidata_3.RData" ftype="rdata"/> 450 <param name="infiles" value="msidata_1.RData,msidata_2.RData,msidata_3.RData" ftype="rdata"/>
459 <param name="combine_method" value="automatic_combine"/> 454 <param name="combine_method" value="automatic_combine"/>
460 <param name="processed_true" value="FALSE"/> 455 <param name="processed_true" value="FALSE"/>
461 <output name="QC_overview" file="123_combined_auto.pdf" compare="sim_size"/> 456 <output name="QC_overview" file="123_combined_auto.pdf" compare="sim_size"/>
462 <output name="pixel_annotations" file="123_combined_auto.tabular"/> 457 <output name="pixel_annotations" file="123_combined_auto.tabular"/>
463 <output name="outfile_imzml" ftype="imzml" file="123_combined_auto.imzml.txt" compare="sim_size"> 458 <output name="outfile_imzml" ftype="imzml" file="123_combined_auto.imzml.txt" compare="sim_size">
464 <extra_files type="file" file="123_combined_auto.imzml" name="imzml" lines_diff="4"/> 459 <extra_files type="file" file="123_combined_auto.imzml" name="imzml" lines_diff="12"/>
465 <extra_files type="file" file="123_combined_auto.ibd" name="ibd" compare="sim_size"/> 460 <extra_files type="file" file="123_combined_auto.ibd" name="ibd" compare="sim_size"/>
466 </output> 461 </output>
467 </test> 462 </test>
468 <test> 463 <test>
469 <param name="infiles" value="msidata_1.RData,msidata_2.RData" ftype="rdata"/> 464 <param name="infiles" value="msidata_1.RData,msidata_2.RData" ftype="rdata"/>
475 <param name="combine_method" value="automatic_combine"/> 470 <param name="combine_method" value="automatic_combine"/>
476 <param name="processed_true" value="FALSE"/> 471 <param name="processed_true" value="FALSE"/>
477 <output name="pixel_annotations" file="12_annotation_output.tabular"/> 472 <output name="pixel_annotations" file="12_annotation_output.tabular"/>
478 <output name="QC_overview" file="12_combined_QC.pdf" compare="sim_size"/> 473 <output name="QC_overview" file="12_combined_QC.pdf" compare="sim_size"/>
479 <output name="outfile_imzml" ftype="imzml" file="12_combined.imzml.txt" compare="sim_size"> 474 <output name="outfile_imzml" ftype="imzml" file="12_combined.imzml.txt" compare="sim_size">
480 <extra_files type="file" file="12_combined.imzml" name="imzml" lines_diff="4"/> 475 <extra_files type="file" file="12_combined.imzml" name="imzml" lines_diff="12"/>
481 <extra_files type="file" file="12_combined.ibd" name="ibd" compare="sim_size"/> 476 <extra_files type="file" file="12_combined.ibd" name="ibd" compare="sim_size"/>
482 </output> 477 </output>
483 </test> 478 </test>
484 <test> 479 <test>
485 <param name="infiles" value="msidata_1.RData,123_combined.RData" ftype="rdata"/> 480 <param name="infiles" value="msidata_1.RData,123_combined.RData" ftype="rdata"/>
491 <param name="combine_method" value="automatic_combine"/> 486 <param name="combine_method" value="automatic_combine"/>
492 <param name="processed_true" value="FALSE"/> 487 <param name="processed_true" value="FALSE"/>
493 <output name="pixel_annotations" file="112_annotation_output.tabular"/> 488 <output name="pixel_annotations" file="112_annotation_output.tabular"/>
494 <output name="QC_overview" file="112_auto_combined_QC.pdf" compare="sim_size"/> 489 <output name="QC_overview" file="112_auto_combined_QC.pdf" compare="sim_size"/>
495 <output name="outfile_imzml" ftype="imzml" file="112_auto_combined.imzml.txt" compare="sim_size"> 490 <output name="outfile_imzml" ftype="imzml" file="112_auto_combined.imzml.txt" compare="sim_size">
496 <extra_files type="file" file="112_auto_combined.imzml" name="imzml" lines_diff="4"/> 491 <extra_files type="file" file="112_auto_combined.imzml" name="imzml" lines_diff="12"/>
497 <extra_files type="file" file="112_auto_combined.ibd" name="ibd" compare="sim_size"/> 492 <extra_files type="file" file="112_auto_combined.ibd" name="ibd" compare="sim_size"/>
498 </output> 493 </output>
499 </test> 494 </test>
500 <test> 495 <test>
501 <param name="infiles" value="msidata_2.RData,123_combined.RData" ftype="rdata"/> 496 <param name="infiles" value="msidata_2.RData,123_combined.RData" ftype="rdata"/>
505 <param name="combine_method" value="automatic_combine"/> 500 <param name="combine_method" value="automatic_combine"/>
506 <param name="processed_true" value="FALSE"/> 501 <param name="processed_true" value="FALSE"/>
507 <output name="pixel_annotations" file="2123_annotation_output.tabular"/> 502 <output name="pixel_annotations" file="2123_annotation_output.tabular"/>
508 <output name="QC_overview" file="2123_auto_combined_QC.pdf" compare="sim_size"/> 503 <output name="QC_overview" file="2123_auto_combined_QC.pdf" compare="sim_size"/>
509 <output name="outfile_imzml" ftype="imzml" file="2123_auto_combined.imzml.txt" compare="sim_size"> 504 <output name="outfile_imzml" ftype="imzml" file="2123_auto_combined.imzml.txt" compare="sim_size">
510 <extra_files type="file" file="2123_auto_combined.imzml" name="imzml" lines_diff="4"/> 505 <extra_files type="file" file="2123_auto_combined.imzml" name="imzml" lines_diff="12"/>
511 <extra_files type="file" file="2123_auto_combined.ibd" name="ibd" compare="sim_size"/> 506 <extra_files type="file" file="2123_auto_combined.ibd" name="ibd" compare="sim_size"/>
512 </output> 507 </output>
513 </test> 508 </test>
514 </tests> 509 </tests>
515 <help> 510 <help>
556 - The combine tool puts all samples into a common x-y-grid, therefore pixel coordinates will change. In case the pixels are already annotated, the annotations should be provided as tabular files and the tool will return an annotation file with the new pixel coordinates. This annotation file can then be used together with the combined MSI data for tools in which the annotation is required (e.g. 'MSI classification') or useful (e.g. 'MSI spectra plots'). 551 - The combine tool puts all samples into a common x-y-grid, therefore pixel coordinates will change. In case the pixels are already annotated, the annotations should be provided as tabular files and the tool will return an annotation file with the new pixel coordinates. This annotation file can then be used together with the combined MSI data for tools in which the annotation is required (e.g. 'MSI classification') or useful (e.g. 'MSI spectra plots').
557 552
558 553
559 **Output** 554 **Output**
560 555
561 - MSI data as imzML file (in continous format when m/z axis were the same; in processed format when m/z axis were different) 556 - MSI data as imzML file (in continuous format when m/z axis were the same; in processed format when m/z axis were different)
562 - Pdf with pixel positions and annotations of the combined files 557 - Pdf with pixel positions and annotations of the combined files
563 - Tabular file with pixel annotations (x,y,column with input file names and annotation columns) 558 - Tabular file with pixel annotations (x,y,column with input file names and annotation columns)
564 559
565 560
566 ]]> 561 ]]>