Skip to content

Commit 4095773

Browse files
authored
MultiQC Update: Add functionality to retrieve PNG plots (#7358)
1 parent e5a0f25 commit 4095773

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

tools/multiqc/macros.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<macros>
22
<token name="@TOOL_VERSION@">1.27</token>
3-
<token name="@VERSION_SUFFIX@">3</token>
3+
<token name="@VERSION_SUFFIX@">4</token>
44
<xml name="bio_tools">
55
<xrefs>
66
<xref type="bio.tools">multiqc</xref>
@@ -109,7 +109,7 @@ sp:
109109
</xml>
110110
<xml name="general_tests">
111111
<!--Test 01-->
112-
<test expect_num_outputs="3">
112+
<test expect_num_outputs="4">
113113
<repeat name="results">
114114
<conditional name="software_cond">
115115
<param name="software" value="cutadapt"/>
@@ -159,6 +159,7 @@ sp:
159159
<param name="comment" value="Commment for the report"/>
160160
<param name="flat" value="true"/>
161161
<param name="export" value="true"/>
162+
<param name="png_plots" value="true"/>
162163
<output name="html_report">
163164
<assert_contents>
164165
<has_text text="Title of the report"/>
@@ -187,6 +188,7 @@ sp:
187188
</assert_contents>
188189
</output>
189190
<output_collection name="plots" type="list" count="29"/>
191+
<output_collection name="png_plot" type="list" count="38"/>
190192
</test>
191193
<!--Test 02-->
192194
<test expect_num_outputs="2">
@@ -537,7 +539,7 @@ sp:
537539
</output-->
538540
</test>
539541
<!--Test 05-->
540-
<test expect_num_outputs="3">
542+
<test expect_num_outputs="4">
541543
<repeat name="results">
542544
<conditional name="software_cond">
543545
<param name="software" value="fastqc"/>
@@ -551,6 +553,7 @@ sp:
551553
<param name="comment" value="Commment for the report"/>
552554
<param name="flat" value="true"/>
553555
<param name="export" value="true"/>
556+
<param name="png_plots" value="true"/>
554557
<output name="html_report">
555558
<assert_contents>
556559
<has_text text="Title of the report"/>
@@ -573,6 +576,8 @@ sp:
573576
</assert_contents>
574577
</element>
575578
</output_collection>
579+
<output_collection name="png_plot" type="list" count="11"/>
580+
576581
</test>
577582
<!--Test 06-->
578583
<test expect_num_outputs="2">

tools/multiqc/multiqc.xml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ multiqc multiqc_WDir
212212
213213
$flat
214214
$export
215-
215+
216216
#if $configfile == "T"
217217
--config '$multiqc_config'
218218
#end if
@@ -223,6 +223,11 @@ ls -l ./report_data/ &&
223223
##cat ./report_data/multiqc_busco.txt &&
224224
cp ./report_data/*plot*.txt ./plots/ | true ## don't fail if no plot files are generated
225225
226+
#if $png_plots == "true"
227+
&& mkdir -p ./png_plots
228+
&& cp ./report_plots/png/*.png ./png_plots/ | true ## don't fail if no png plots are generated
229+
#end if
230+
226231
]]></command>
227232
<expand macro="configfile"/>
228233
<inputs>
@@ -498,6 +503,7 @@ cp ./report_data/*plot*.txt ./plots/ | true ## don't fail if no plot files are g
498503
</param>
499504
<param argument="--flat" type="boolean" truevalue="--flat" falsevalue="" checked="false" label="Use only flat plots (non-interactive images)" help="To consume less disk space and resources to display. Used by default when there are 100 or more samples."/>
500505
<param argument="--export" type="boolean" truevalue="--export" falsevalue="" checked="false" label="Output the multiQC plots raw data?" help="This will output a file for each plot containing the raw data used to generate the plot"/>
506+
<param name="png_plots" type="boolean" truevalue="true" falsevalue="false" label="Output PNG plots?" help="Choose if you want PNG plots in an output collection"/>
501507
</inputs>
502508
<outputs>
503509
<data name="html_report" format="html" from_work_dir="report.html" label="${tool.name} on ${on_string}: Webpage"/>
@@ -506,14 +512,18 @@ cp ./report_data/*plot*.txt ./plots/ | true ## don't fail if no plot files are g
506512
<discover_datasets pattern="(?P&lt;designation&gt;.+)\.txt" format="tabular" directory="plots"/>
507513
<filter>export</filter>
508514
</collection>
515+
<collection name="png_plot" type="list" label="${tool.name} on ${on_string}: PNG Plots">
516+
<discover_datasets pattern="(?P&lt;designation&gt;.+)\.png" format="png" directory="png_plots"/>
517+
<filter>png_plots</filter>
518+
</collection>
509519
</outputs>
510520
<tests>
511521
<expand macro="general_tests"/>
512522
<expand macro="bcftools_test"/>
513523
<expand macro="bowtie2_test"/>
514524
<expand macro="fastqc_test"/>
515525
<expand macro="trimmomatic_test"/>
516-
<!-- Test 10 -->
526+
<!-- Test 10 -->
517527
<expand macro="flexbar_test"/>
518528
<expand macro="fastp_test"/>
519529
<expand macro="bismark_test"/>
@@ -544,7 +554,7 @@ cp ./report_data/*plot*.txt ./plots/ | true ## don't fail if no plot files are g
544554
<expand macro="gtdbtk_test"/>
545555
<expand macro="sambamba_test"/>
546556
<!--expand macro="vcftools_test"/> Does not work, did it ever worked? -->
547-
557+
548558
</tests>
549559
<help><![CDATA[
550560
**What it does**

0 commit comments

Comments
 (0)