comparison combine.xml @ 7:392b2dfd261d draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit f986c51abe33c7f622d429a3c4a79ee24b33c1f3"
author galaxyp
date Thu, 23 Apr 2020 08:04:25 -0400
parents bb1ac6b47a6c
children 525f201b86c1
comparison
equal deleted inserted replaced
6:bb1ac6b47a6c 7:392b2dfd261d
1 <tool id="cardinal_combine" name="MSI combine" version="2.2.6.1"> 1 <tool id="cardinal_combine" name="MSI combine" version="@VERSION@.0">
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>
7 </macros> 7 </macros>
8 <requirements> 8 <expand macro="requirements">
9 <requirement type="package" version="2.2.6">bioconductor-cardinal</requirement>
10 <requirement type="package" version="3.6.1">r-base</requirement>
11 <requirement type="package" version="3.2.1">r-ggplot2</requirement> 9 <requirement type="package" version="3.2.1">r-ggplot2</requirement>
12 <requirement type="package" version="0.12">r-maldiquantforeign</requirement> 10 <requirement type="package" version="0.12">r-maldiquantforeign</requirement>
13 <requirement type="package" version="1.19.3">r-maldiquant</requirement> 11 <requirement type="package" version="1.19.3">r-maldiquant</requirement>
14 </requirements> 12 </expand>
15 <command detect_errors="exit_code"> 13 <command detect_errors="exit_code">
16 <![CDATA[ 14 <![CDATA[
17 #for $i, $infile in enumerate($infiles): 15 #for $i, $infile in enumerate($infiles):
18 #if $infile.ext == 'imzml' 16 #if $infile.ext == 'imzml'
19 ln -s '${infile.extra_files_path}/imzml' infile_${i}.imzML && 17 ln -s '${infile.extra_files_path}/imzml' infile_${i}.imzML &&
52 library(Cardinal) 50 library(Cardinal)
53 library(ggplot2) 51 library(ggplot2)
54 library(MALDIquantForeign) 52 library(MALDIquantForeign)
55 library(MALDIquant) 53 library(MALDIquant)
56 54
55
57 ## read tabular file for xy_shift option 56 ## read tabular file for xy_shift option
58 #if str( $combine_conditional.combine_method ) == 'xy_shifts': 57 #if str( $combine_conditional.combine_method ) == 'xy_shifts':
59 input_list = read.delim("$combine_conditional.coordinates_file", header = $combine_conditional.xy_header, 58 input_list = read.delim("$combine_conditional.coordinates_file", header = $combine_conditional.xy_header,
60 stringsAsFactors = FALSE) 59 stringsAsFactors = FALSE)
61 #end if 60 #end if
83 82
84 #for $i, $infile in enumerate($infiles): 83 #for $i, $infile in enumerate($infiles):
85 84
86 ## read and manipulate MSI data 85 ## read and manipulate MSI data
87 86
88 #if $infile.ext == 'imzml' 87 #if $infile.ext == 'imzml'
89 #if str($processed_cond.processed_file) == "processed": 88 #if str($processed_cond.processed_file) == "processed":
90 msidata_$i <- readImzML('infile_${i}', resolution=$processed_cond.accuracy, units = "$processed_cond.units", attach.only=TRUE, as = c("MSImageSet")) 89 msidata_$i <- readImzML('infile_${i}', resolution=$processed_cond.accuracy, units = "$processed_cond.units", attach.only=TRUE, as="MSImageSet")
90 ##msidata_$i = collect(msidata_$i, as.matrix=TRUE) ##coercion to continuous
91 centroided(msidata_$i) = $centroids
92 #else
93 msidata_$i <- readImzML('infile_${i}', attach.only=TRUE, as="MSImageSet")
94 centroided(msidata_$i) = $centroids
95 #end if
96 #elif $infile.ext == 'analyze75'
97 msidata_$i = readAnalyze('infile_${i}', attach.only=TRUE, as="MSImageSet")
91 centroided(msidata_$i) = $centroids 98 centroided(msidata_$i) = $centroids
92 #else 99 #else
93 msidata_$i <- readImzML('infile_${i}', attach.only=TRUE, as = c("MSImageSet")) 100 ## function to read RData files independent of filename
94 centroided(msidata_$i) = $centroids 101 loadRData <- function(fileName){
95 #end if 102 load(fileName)
96 #elif $infile.ext == 'analyze75' 103 get(ls()[ls() != "fileName"])
97 msidata_$i <- readAnalyze('infile_${i}', attach.only=TRUE, as = c("MSImageSet")) 104 }
98 centroided(msidata_$i) = $centroids
99 #else
100 msidata_$i = loadRData('infile_${i}.RData') 105 msidata_$i = loadRData('infile_${i}.RData')
101 ## keep compatibility with old .RData files: 106 ## keep compatibility with old .RData files:
102 msidata_$i\$column1 = NULL 107 msidata_$i\$column1 = NULL
103 msidata_$i\$column2 = NULL 108 msidata_$i\$column2 = NULL
104 msidata_$i\$column3 = NULL 109 msidata_$i\$column3 = NULL
105 msidata_$i\$column4 = NULL 110 msidata_$i\$column4 = NULL
106 msidata_$i\$column5 = NULL 111 msidata_$i\$column5 = NULL
107 msidata_$i\$combined_sample = NULL 112 msidata_$i\$combined_sample = NULL
108 113 #end if
109 #end if
110 114
111 ## remove duplicated coordinates, otherwise combine will fail 115 ## remove duplicated coordinates, otherwise combine will fail
112 print(paste0(sum(duplicated(coord(msidata_$i))), " duplicated coordinates were removed from input file")) 116 print(paste0(sum(duplicated(coord(msidata_$i))), " duplicated coordinates were removed from input file"))
113 msidata_${i} <- msidata_${i}[,!duplicated(coord(msidata_${i}))] 117 msidata_${i} <- msidata_${i}[,!duplicated(coord(msidata_${i}))]
114 118
561 ]]> 565 ]]>
562 </help> 566 </help>
563 <citations> 567 <citations>
564 <citation type="doi">10.1093/bioinformatics/btv146</citation> 568 <citation type="doi">10.1093/bioinformatics/btv146</citation>
565 <citation type="doi">10.1007/978-3-319-45809-0_6</citation> 569 <citation type="doi">10.1007/978-3-319-45809-0_6</citation>
570 <citation type="doi">10.1093/gigascience/giz143</citation>
566 </citations> 571 </citations>
567 </tool> 572 </tool>