Mercurial > repos > devteam > vegan_diversity
diff vegan_diversity.xml @ 0:8620a6ba883a draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/vegan_diversity commit 37144be811dd587897dd9dcb652de0854f049b9a
author | devteam |
---|---|
date | Wed, 26 Aug 2015 17:11:15 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vegan_diversity.xml Wed Aug 26 17:11:15 2015 -0400 @@ -0,0 +1,88 @@ +<tool id="vegan_diversity" name="Vegan Diversity" version="0.0.1"> + <description> + index + </description> + <requirements> + <requirement type="package" version="3.2.1">R</requirement> + <requirement type="package" version="2.3-0">vegan</requirement> + </requirements> + <stdio> + <exit_code range="1:" /> + <exit_code range=":-1" /> + </stdio> + <command><![CDATA[ + Rscript "${vegan_diversity_script}" + ]]> + </command> + <configfiles> + <configfile name="vegan_diversity_script"><![CDATA[ +#set $int_species_column = int( str( $species_column ) ) +#set $fixed_sample_columns = [] +#for $sample_col in map( int, str( $sample_columns ).split( "," ) ): +#assert $sample_col != $int_species_column, "Sample label column and sample count columns must not be the same." +#silent $fixed_sample_columns.append( str( $sample_col if $sample_col < $int_species_column else $sample_col-1 ) ) +#end for +library(vegan) +input_abundance <- read.table("${input_abundance}", sep="\t", row.names=${ species_column }, header=${header} ) +input_abundance <- t( input_abundance[ c( ${ ",".join( $fixed_sample_columns ) } )] ) + +write.table( diversity(input_abundance, index = "${index_type.index_type_selector}", MARGIN = ${index_type.margin}, base = ${index_type.base}), "${output_diversity_index}", col.names=NA, sep = "\t") + ]]> + </configfile> + </configfiles> + <inputs> + <param name="input_abundance" type="data" format="tabular" label="File with abundance values for community" help="Rows are samples; columns are species/phyla/community classifier"/> + <param name="species_column" label="Group name column" type="data_column" data_ref="input_abundance" value="6" help="Species, phylum, etc"/> + <param name="sample_columns" label="Sample count columns" type="data_column" multiple="True" value="2" data_ref="input_abundance" help="Select each column that contains counts"/> + <param name="header" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="False" label="Input has a header line"/> + <conditional name="index_type"> + <param name="index_type_selector" type="select" label="Diversity index to use"> + <option value="shannon" selected="True">shannon</option> + <option value="simpson">simpson</option> + <option value="invsimpson">invsimpson</option> + </param> + <when value="shannon"> + <param name="margin" type="integer" value="1" label="Margin for which the index is computed"/> + <param name="base" type="select" label="The logarithm base used in shannon"> + <option value="exp(1)" selected="True">exp(1)</option> + <option value="2" selected="False">2</option> + </param> + </when> + <when value="simpson"> + <param name="margin" type="integer" value="1" label="Margin for which the index is computed"/> + <param name="base" type="select" label="The logarithm base used in shannon"> + <option value="exp(1)" selected="True">exp(1)</option> + <option value="2" selected="False">2</option> + </param> + </when> + <when value="invsimpson"> + <param name="margin" type="integer" value="1" label="Margin for which the index is computed"/> + <param name="base" type="select" label="The logarithm base used in shannon"> + <option value="exp(1)" selected="True">exp(1)</option> + <option value="2" selected="False">2</option> + </param> + </when> + </conditional> + </inputs> + <outputs> + <data format="tabular" name="output_diversity_index" /> + </outputs> + <tests> + <test> + <param name="input_abundance" ftype="tabular" value="vegan_in.tabular"/> + <param name="species_column" value="6"/> + <param name="sample_columns" value="2"/> + <param name="index_type_selector" value="shannon"/> + <param name="margin" value="1"/> + <param name="base" value="exp(1)"/> + <output name="output_slope" ftype="tabular" file="output_diversity_index.tabular" /> + </test> + </tests> + <help> + <![CDATA[ +Calculate Diversity index using vegan and selected method. + ]]> + </help> + <citations> + </citations> +</tool> \ No newline at end of file