Skip to content

Commit

Permalink
Dada2 add output (galaxyproject#6024)
Browse files Browse the repository at this point in the history
* add some outputs for dada and merge

* bump

* fix bump

seems that tag 1.30 does not exist at biocontainers
  • Loading branch information
bernt-matthias authored May 24, 2024
1 parent 30f1030 commit 9bbc089
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
13 changes: 13 additions & 0 deletions tools/dada2/dada2_dada.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,18 @@ dada_result <- dada(derep, err,
#if $batch_cond.batch_select == "no":
#if len($batch_cond.derep) > 1:
for( id in names(dada_result) ){
print(id)
print(dada_result[[id]])
saveRDS(dada_result[[id]], file=file.path("output" ,paste(id, "dada2_dada", sep=".")))
}
#else
#for $d in $batch_cond.derep:
print(dada_result)
saveRDS(dada_result, file=file.path("output" ,paste('$d.element_identifier', "dada2_dada", sep=".")))
#end for
#end if
#else
print(dada_result)
saveRDS(dada_result, file='$dada')
#end if
]]></configfile>
Expand Down Expand Up @@ -116,13 +120,19 @@ dada_result <- dada(derep, err,
<element name="filterAndTrim_F3D0_R1.fq.gz" file="dada_F3D0_S188_L001_R1.Rdata" ftype="dada2_dada" compare="sim_size" delta="10000"/>
<element name="filterAndTrim_F3D141_R1.fq.gz" file="dada_F3D141_S207_L001_R1.Rdata" ftype="dada2_dada" compare="sim_size" delta="10000"/>
</output_collection>
<assert_stdout>
<has_line line="43 sequence variants were inferred from 379 input unique sequences."/>
</assert_stdout>
</test>
<!-- default, batch -->
<test expect_num_outputs="1">
<param name="batch_cond|batch_select" value="yes"/>
<param name="batch_cond|derep" value="filterAndTrim_F3D0_R1.fq.gz" ftype="fastq.gz" />
<param name="err" value="learnErrors_R1.Rdata" ftype="dada2_errorrates" />
<output name="dada" value="dada_F3D0_S188_L001_R1.Rdata" ftype="dada2_dada" compare="sim_size" delta="10000"/>
<assert_stdout>
<has_line line="43 sequence variants were inferred from 379 input unique sequences."/>
</assert_stdout>
</test>
<!-- test non-default options -->
<test expect_num_outputs="1">
Expand All @@ -133,6 +143,9 @@ dada_result <- dada(derep, err,
<output_collection name="data_collection" type="list">
<element name="filterAndTrim_F3D0_R1.fq.gz" file="dada_F3D0_S188_L001_R1.Rdata" ftype="dada2_dada" compare="sim_size" delta="10000"/>
</output_collection>
<assert_stdout>
<has_line line="43 sequence variants were inferred from 379 input unique sequences."/>
</assert_stdout>
</test>
</tests>
<help><![CDATA[
Expand Down
23 changes: 18 additions & 5 deletions tools/dada2/dada2_mergePairs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ dadaR <- readRDS('$dadaR')
merged <- mergePairs(dadaF, '$derepF', dadaR, '$derepR', minOverlap = $minOverlap, maxMismatch = $maxMismatch,
## currently not accessible by the wrapper returnRejects = FALSE, propagateCol = character(0),
justConcatenate = $justConcatenate, trimOverhang = $trimOverhang)
saveRDS(merged, file='$merged')
##For display in Galaxy this could be transposed (..but the user could also do it herself)
##write.table(merged, "$merged", quote=F, sep="\t", row.names = F, col.names = T)
#if $output_details
##For display in Galaxy this could be transposed (..but the user could also do it herself)
merged <- apply(merged, 2, as.character)
write.table(merged, "$merged_details", quote=F, sep="\t", row.names = F, col.names = T)
#end if
]]></configfile>
</configfiles>
<inputs>
Expand All @@ -35,20 +37,24 @@ saveRDS(merged, file='$merged')
<param argument="maxMismatch" type="integer" value="0" min="0" label="Maximum number of mismatches"/>
<param argument="justConcatenate" type="boolean" checked="false" truevalue="TRUE" falsevalue="FALSE" label="Concatenated rather than merge" help="The forward and reverse-complemented reverse read are concatenated rather than merged, with a 10 Ns spacer inserted between them"/>
<param argument="trimOverhang" type="boolean" checked="false" truevalue="TRUE" falsevalue="FALSE" label="Trim overhangs" help="Overhangs are when the reverse read extends past the start of the forward read, and vice-versa, as can happen when reads are longer than the amplicon and read into the other-direction primer region"/>
<param name="output_details" type="boolean" label="Output detailed table" help="Contains detailed information on the merged sequences, e.g. number of matched/mismatches"/>
</inputs>
<outputs>
<data name="merged" format="dada2_mergepairs" label="${tool.name} on ${on_string}"/>
<data name="merged_details" format="tabular" label="${tool.name} on ${on_string}: details">
<filter>output_details</filter>
</data>
</outputs>
<tests>
<test>
<test expect_num_outputs="1">
<param name="dadaF" ftype="dada2_dada" value="dada_F3D0_S188_L001_R1.Rdata"/>
<param name="derepF" ftype="fastq.gz" value="filterAndTrim_F3D0_R1.fq.gz"/>
<param name="dadaR" ftype="dada2_dada" value="dada_F3D0_S188_L001_R2.Rdata"/>
<param name="derepR" ftype="fastq.gz" value="filterAndTrim_F3D0_R2.fq.gz"/>
<output name="merged" value="mergePairs_F3D0_S188_L001.Rdata" ftype="dada2_mergepairs" compare="sim_size" delta="400" />
</test>
<!-- test non-default options -->
<test>
<test expect_num_outputs="2">
<param name="dadaF" ftype="dada2_dada" value="dada_F3D0_S188_L001_R1.Rdata"/>
<param name="derepF" ftype="fastq.gz" value="filterAndTrim_F3D0_R1.fq.gz"/>
<param name="dadaR" ftype="dada2_dada" value="dada_F3D0_S188_L001_R2.Rdata"/>
Expand All @@ -58,6 +64,13 @@ saveRDS(merged, file='$merged')
<param name="maxMismatch" value="1"/>
<param name="justConcatenate" value="TRUE" />
<param name="trimOverhang" value="TRUE" />
<param name="output_details" value="true"/>
<output name="merged_details">
<assert_contents>
<has_n_lines n="50"/>
<has_n_columns n="9"/>
</assert_contents>
</output>
</test>
</tests>
<help><![CDATA[
Expand Down
4 changes: 2 additions & 2 deletions tools/dada2/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<xref type="bioconductor">dada2</xref>
</xrefs>
</xml>
<token name="@DADA2_VERSION@">1.28</token>
<token name="@WRAPPER_VERSION@">1</token>
<token name="@DADA2_VERSION@">1.30.0</token>
<token name="@WRAPPER_VERSION@">0</token>

<xml name="version_command">
<version_command><![CDATA[
Expand Down

0 comments on commit 9bbc089

Please sign in to comment.