Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tools/ampvis2/alpha_diversity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<inputs>
<expand macro="rds_input_macro"/>
<param argument="measure" type="select" multiple="true" optional="false" label="Alpha-diversity measure(s) to be included">
<option value="observed" selected="true">observed</option>
<option value="uniqueotus" selected="true">unique OTUs</option>
<option value="shannon" selected="true">shannon</option>
<option value="simpson" selected="true">simpson</option>
<option value="invsimpson" selected="true">invsimpson</option>
Expand Down Expand Up @@ -79,18 +79,18 @@
</test>
<test>
<param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/>
<param name="measure" value="observed,shannon"/>
<param name="measure" value="uniqueotus,shannon"/>
<param name="richness" value="true"/>
<param name="rarefy" value="500"/>
<param name="group_by" value="Plant"/>
<param name="plot_scatter" value="true"/>
<output name="alphadiv">
<assert_contents>
<has_line line="SampleID&#9;Plant&#9;Date&#9;Year&#9;Period&#9;RawReads&#9;Reads&#9;uniqueOTUs&#9;Shannon&#9;Simpson&#9;invSimpson&#9;Chao1&#9;ACE"/>
<has_line line="SampleID&#9;Plant&#9;Date&#9;Year&#9;Period&#9;RawReads&#9;Reads&#9;uniqueOTUs&#9;Shannon&#9;Chao1&#9;ACE"/>
<has_text text="16SAMP-536&#9;"/>
<has_text text="&#9;Aalborg West&#9;"/>
<has_n_lines n="68"/>
<has_n_columns n="13"/>
<has_n_columns n="11"/>
<has_text text="&#9;500&#9;"/>
</assert_contents>
</output>
Expand Down
20 changes: 17 additions & 3 deletions tools/ampvis2/heatmap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@
showRemainingTaxa = $showRemainingTaxa,
## tax_class = NULL,
tax_empty = "$tax_empty",
## TODO giving the order of the columns is difficult but "cluster" would be nice I guess
## order_x_by = NULL,
## order_y_by = NULL,
## TODO giving the order of the columns is difficult, currently only "cluster"
#if $order_x_by
order_x_by = "$order_x_by",
#end if
#if $order_y_by
order_y_by = "$order_y_by",
#end if
plot_values = $plot_values_cond.plot_values,
#if $plot_values_cond.plot_values == "TRUE"
plot_values_size = $plot_values_cond.plot_values_size,
Expand Down Expand Up @@ -99,6 +103,8 @@
<expand macro="tax_show_macro" value="10"/>
<param argument="showRemainingTaxa" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Display sum of remaining taxa" help="Add an additional row at the bottom displaying the sum of all remaining taxa that are not part of the top tax_show most abundant taxa."/>
<expand macro="tax_empty_macro"/>
<param argument="order_x_by" type="boolean" truevalue="cluster" falsevalue="" checked="false" label="hierarchical clustering of X axis"/>
<param argument="order_y_by" type="boolean" truevalue="cluster" falsevalue="" checked="false" label="hierarchical clustering of Y axis"/>
<conditional name="plot_values_cond">
<param argument="plot_values" type="select" label="Plot the values on the heatmap">
<option value="TRUE">Yes</option>
Expand Down Expand Up @@ -221,6 +227,14 @@
<param name="out_format" value="tabular"/>
<output name="plot_raw" value="AalborgWWTPs-heatmap-group-facet.tsv" ftype="tabular"/>
</test>
<!-- order_*_by: cluster -->
<test expect_num_outputs="1">
<param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/>
<param name="order_x_by" value="true"/>
<param name="order_y_by" value="true"/>
<output name="plot" value="AalborgWWTPs-heatmap-order-by-cluster.pdf" ftype="pdf" compare="sim_size"/>
</test>

<!-- normalise -->
<test expect_num_outputs="1">
<param name="data" value="AalborgWWTPs.rds" ftype="ampvis2"/>
Expand Down
47 changes: 43 additions & 4 deletions tools/ampvis2/load.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
#if $otutable.is_of_type("biom1") or $otutable.is_of_type("biom2")
ln -s '$otutable' otutable.biom &&
#else if not $otutable.is_of_type("phyloseq")
## asv/otu column can not be specified so set the needed name
## if empty https://github.com/KasperSkytte/ampvis2/issues/166
## also done in taxonomy.tsv
#if $asv_otu_col_empty
sed -e '1 s/^\t/ASV\t/' '$otutable' > otutable.tsv &&
#else
Expand Down Expand Up @@ -71,6 +68,12 @@
#if $tree
tree = "$tree",
#end if
#if $otutable_OTUcolname
otutable_OTUcolname = c("$otutable_OTUcolname"),
#end if
#if $taxonomy_OTUcolname
taxonomy_OTUcolname = c("$taxonomy_OTUcolname"),
#end if
pruneSingletons = $pruneSingletons
)

Expand Down Expand Up @@ -103,7 +106,6 @@
</configfiles>
<inputs>
<param argument="otutable" type="data" format="phyloseq,dada2_sequencetable,tabular,biom1,biom2" label="OTU table"/>
<param name="asv_otu_col_empty" type="boolean" checked="false" label="OTU/ASV column has empty header" help="By default ampvis2 expects a column named ASV or OTU containing the ASV or OTU identifiers. By checking this a column with an empty header will be used (as produced by dada2)."/>
<param name="asv_sequences" type="boolean" checked="false" label="ASV identifiers are the ASV sequences" help="By checking this the identifiers will be renamed to ASV1, ASV2, etc and the sequences will be stored in the ampvis2 object." />
<param argument="metadata" type="data" format="tabular,tsv" optional="true" label="Sample metadata">
<validator type="expression" message="Table must have at least 1 column"><![CDATA[value.metadata.columns > 0]]></validator>
Expand All @@ -117,6 +119,9 @@
<option value="tax" selected="true">Taxonomy list</option>
<option value="metadata" selected="true">Metadata list</option>
</param>
<param name="asv_otu_col_empty" type="boolean" checked="false" label="Replace empty OTU/ASV column header by 'ASV'" help="By default ampvis2 expects a column named ASV, OTU, or #OTU ID containing the ASV or OTU identifiers. By checking this a column with an empty header will be set to ASV."/>
<param name="otutable_OTUcolname" type="text" value="" label="Name of the OTU column in the OTU table" help="By default a column named OTU, ASV, and #OTU ID is used"/>
<param name="taxonomy_OTUcolname" type="text" value="" label="Name of the OTU column in the taxonomy table" help="By default a column named OTU, ASV, and #OTU ID is used"/>
</inputs>
<outputs>
<data name="ampvis" format="ampvis2"/>
Expand Down Expand Up @@ -258,6 +263,40 @@
<has_text text="232(100%) 232(100%) 232(100%) 231(99.57%) 209(90.09%) 127(54.74%)"/>
</assert_stdout>
</test>
<!-- load dada2 table with custom header -->
<test expect_num_outputs="3">
<param name="otutable" value="dada2-removeBimeraDenovo_custom.tab" ftype="dada2_sequencetable"/>
<param name="metadata" value="dada2-metadata.tsv" ftype="tsv"/>
<param name="taxonomy" value="dada2-assignTaxonomy_custom.tabular"/>
<param name="otutable_OTUcolname" value="custom"/>
<param name="taxonomy_OTUcolname" value="custom2"/>
<param name="asv_sequences" value="true"/>
<output name="ampvis" ftype="ampvis2">
<assert_contents>
<has_size min="100" delta="2"/>
</assert_contents>
</output>
<output name="metadata_list_out">
<assert_contents>
<has_n_lines n="23"/>
<has_n_columns n="4"/>
<has_text text="Sample"/>
</assert_contents>
</output>
<output name="taxonomy_list_out">
<assert_contents>
<has_n_lines n="370"/>
<has_n_columns n="2"/>
<has_line line="Bacteria&#009;Kingdom"/>
</assert_contents>
</output>
<assert_stdout>
<has_text text="ampvis2 object with 4 elements."/> <!-- this also has fasta, i.e. 4 -->
<has_text text="6212.45"/>
<has_text text="Sample, time"/>
<has_text text="232(100%) 232(100%) 232(100%) 231(99.57%) 209(90.09%) 127(54.74%)"/>
</assert_stdout>
</test>
<!-- load data from phyloseq -->
<test expect_num_outputs="3">
<param name="otutable" value="output.phyloseq" ftype="phyloseq"/>
Expand Down
2 changes: 1 addition & 1 deletion tools/ampvis2/macros.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<macros>
<token name="@TOOL_VERSION@">2.8.11</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@VERSION_SUFFIX@">1</token>
<token name="@PROFILE@">22.01</token>
<xml name="header">
<xrefs>
Expand Down
Binary file not shown.
Loading
Loading