comparison metagenomeseq_normalization.xml @ 0:d16f7cc26516 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/metagenomeseq commit c7e28b83e8636a5d11010bea9997a449be1d48e0
author iuc
date Wed, 12 Apr 2017 17:19:48 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d16f7cc26516
1 <tool id="metagenomeseq_normalizaton" name="metagenomeSeq Normalization" version="1.16.0-0.0.1">
2 <description>Cumulative sum scaling</description>
3 <requirements>
4 <requirement type="package" version="1.16.0">bioconductor-metagenomeseq</requirement>
5 <requirement type="package" version="1.2.0">bioconductor-biomformat</requirement>
6 </requirements>
7 <version_command><![CDATA[Rscript -e 'suppressMessages(library("metagenomeSeq"));cat(toString(packageVersion("metagenomeSeq")))']]></version_command>
8 <command detect_errors="exit_code"><![CDATA[
9 #if "output_r_script" in str( $include_outputs ).split( "," ):
10 cp '${metagenomeseq_normalization_script}' '${output_r_script}' &&
11 #end if
12 Rscript '${metagenomeseq_normalization_script}'
13 ]]>
14 </command>
15 <configfiles>
16 <configfile name="metagenomeseq_normalization_script"><![CDATA[#!/usr/bin/env RScript
17 #set $include_files = str( $include_outputs ).split( "," )
18 library(metagenomeSeq)
19 library(biomformat)
20
21 #if $input_abundance_file.is_of_type( 'biom1' ):
22 inputMRe = biom2MRexperiment( biomformat::read_biom( "${input_abundance_file}" ) )
23 #else:
24 ##inputMRe = newMRexperiment( counts, phenoData = NULL, featureData = NULL, libSize = NULL, normFactors = NULL)
25 #raise "Not yet implemented"
26 #end if
27
28 #if str( $percentile_type.percentile_type_selector ) == 'cumNormStat':
29 p = cumNormStat( inputMRe, qFlag = ${percentile_type.qFlag}, rel = ${percentile_type.rel} )
30 #elif str( $percentile_type.percentile_type_selector ) == 'cumNormStatFast':
31 p = cumNormStatFast( inputMRe, rel = ${percentile_type.rel} )
32 #else:
33 p = ${percentile_type.raw_value}
34 #end if
35
36 inputMRe = cumNorm(inputMRe, p = p )
37
38 #if "output_tabular" in $include_files:
39 mat = MRcounts(inputMRe, norm = TRUE, log = ${log2}, sl = ${sl})
40 exportMat(mat, file = "${output_tabular_dataset}")
41 #end if
42
43 #if "output_biom" in $include_files:
44 biomformat::write_biom( MRexperiment2biom(inputMRe, id = NULL, norm = TRUE, log = ${log2}, sl = ${sl}, qiimeVersion = TRUE), "${output_biom_dataset}" )
45 #end if
46
47 #if "output_stats" in $include_files:
48 exportStats(inputMRe, p = p, file = "${output_stats}")
49 #end if
50 ]]>
51 </configfile>
52 </configfiles>
53 <inputs>
54 <param name="input_abundance_file" type="data" format="biom1" label="Input Matrix" help="BIOM format"/>
55
56 <conditional name="percentile_type">
57 <param name="percentile_type_selector" type="select" label="Percentile for which to scale data">
58 <option value="cumNormStat" selected="True">cumNormStat</option>
59 <option value="cumNormStatFast" selected="False">cumNormStatFast</option>
60 <option value="raw" selected="False">Raw</option>
61 </param>
62 <when value="cumNormStat">
63 <param name="qFlag" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="qFlag" help="Flag to either calculate the proper percentile using R's step-wise quantile function or approximate function."/>
64 <param name="rel" type="float" value="0.1" label="rel" help="Cutoff for the relative difference from one median difference from the reference to the next"/>
65 </when>
66 <when value="cumNormStatFast">
67 <param name="rel" type="float" value="0.1" label="rel" help="Cutoff for the relative difference from one median difference from the reference to the next"/>
68 </when>
69 <when value="raw">
70 <param name="raw_value" type="float" value=".80" label="Percentile" help="Manual Percentile"/>
71 </when>
72 </conditional>
73
74 <param name="log2" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="False" label="Log2 transform scaling" help=""/>
75 <param name="sl" type="integer" value="1000" label="The value to scale by." help="(default=1000)"/>
76
77 <param name="include_outputs" type="select" multiple="True" label="Datasets to create">
78 <option value="output_tabular" selected="True">Normalized Tabular Matrix</option>
79 <!-- <option value="output_biom" selected="True">Normalized BIOM</option> -->
80 <option value="output_stats" selected="True">Simple Statistics</option>
81 <option value="output_r_script" selected="False">R script</option>
82 </param>
83 </inputs>
84 <outputs>
85 <!-- <data format="biom1" name="output_biom_dataset" label="${tool.name} on ${on_string} (BIOM1)">
86 <filter>"output_biom" in include_outputs</filter>
87 </data> -->
88 <data format="tabular" name="output_tabular_dataset" label="${tool.name} on ${on_string} (Tabular)">
89 <filter>"output_tabular" in include_outputs</filter>
90 </data>
91 <data format="tabular" name="output_stats" label="${tool.name} on ${on_string} (Simple Statistics)">
92 <filter>"output_stats" in include_outputs</filter>
93 </data>
94 <data format="txt" name="output_r_script" label="${tool.name} on ${on_string} (Rscript)">
95 <filter>"output_r_script" in include_outputs</filter>
96 </data>
97 </outputs>
98 <tests>
99 <test>
100 <param name="input_abundance_file" value="input_1.biom1" ftype="biom1"/>
101 <conditional name="percentile_type">
102 <param name="percentile_type_selector" value="cumNormStat"/>
103 <param name="qFlag" value="TRUE"/>
104 <param name="rel" value=".1"/>
105 </conditional>
106 <param name="log2" value="FALSE"/>
107 <param name="sl" value="1000"/>
108 <output name="output_tabular_dataset">
109 <assert_contents>
110 <has_text_matching expression="SAMPLE_2" />
111 </assert_contents>
112 </output>
113 </test>
114 </tests>
115 <help><![CDATA[
116 metagenomeSeq Cumulative sum scaling
117 ====================================
118
119 Info
120 ----
121
122 ::
123
124 Cumulative sum scaling based upon percentile selection. You can manually specificy the percentile or calculate it using cumNormStat or cumNormStatFast.
125
126 Inputs
127 ------
128
129 ::
130
131 Requires a BIOM formatted file for input.
132
133 Outputs
134 -------
135
136 ::
137
138 Creates a normalized and scaled output abundance matrix in Tabular format. Additionally can create simple statistics and the RScript.
139
140 ]]></help>
141 <citations>
142 <citation type="doi">10.1038/nmeth.2658</citation>
143 </citations>
144 </tool>