diff mutational_patterns.xml @ 18:8d9f31389f33 draft

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/mutational_patterns commit 1cb9c8fd0c74943a8e6de4c63ac5e4a84ef27430"
author artbio
date Sun, 17 Oct 2021 15:51:05 +0000
parents 8c6ee1c2248f
children 69f09dff98f9
line wrap: on
line diff
--- a/mutational_patterns.xml	Tue Oct 05 22:28:34 2021 +0000
+++ b/mutational_patterns.xml	Sun Oct 17 15:51:05 2021 +0000
@@ -1,7 +1,9 @@
-<tool id="mutational_patterns" name="Analyse Mutational Patterns/Signatures" version="3.2.0+galaxy2">
+<tool id="mutational_patterns" name="Analyse Mutational Patterns/Signatures" version="3.2.0+galaxy3">
     <description>from genomic variations in vcf files</description>
     <requirements>
         <requirement type="package" version="3.2.0=r41hdfd78af_0">bioconductor-mutationalpatterns</requirement>
+        <requirement type="package" version="1.1.1l=h7f98852_0">openssl</requirement>
+        <requirement type="package" version="3.3.5=r41hc72bb7e_0">r-ggplot2</requirement>
         <requirement type="package" version="1.6.6=r41hc72bb7e_1">r-optparse</requirement>
         <requirement type="package" version="0.2.20=r41h03ef668_1002">r-rjson</requirement>
         <requirement type="package" version="0.21.0=r41h03ef668_1004">r-nmf</requirement>
@@ -9,10 +11,6 @@
         <requirement type="package" version="1.4.3=r41hdfd78af_3">bioconductor-bsgenome.hsapiens.ucsc.hg19</requirement>
         <requirement type="package" version="1.4.3=r41hdfd78af_3">bioconductor-bsgenome.hsapiens.ucsc.hg38</requirement>
 <!--
-        <requirement type="package" version="1.3.1000=r40_4">bioconductor-bsgenome.hsapiens.ncbi.grch38</requirement>
-        <requirement type="package" version="0.99.1=r40_4">bioconductor-bsgenome.hsapiens.1000genomes.hs37d5</requirement>
--->
-<!--
 install more bioconda genomes
 bioconductor-bsgenome.mmusculus.ucsc.mm9
 bioconductor-bsgenome.mmusculus.ucsc.mm10
@@ -50,13 +48,23 @@
         --sigmatrix $sigmatrix
     #end if
 
-    #if $set_cosmic.choices == 'yes':
-        --cosmic_version '$set_cosmic.cosmic_version'
-        --signum '$set_cosmic.signum'
-        --output_cosmic $cosmic
-        #if $set_cosmic.contrib_matrix_out == 'yes'
+    #if $set_preset.choices == 'yes':
+
+        #if $set_preset.set_signature_input.input_signature_choices == 'cosmic'
+            --cosmic_version '$set_preset.set_signature_input.cosmic_version'
+        #end if
+
+        #if $set_preset.set_signature_input.input_signature_choices == 'user_signatures'
+            --own_signatures '$set_preset.set_signature_input.own_matrix'
+        #end if
+       
+        --signum '$set_preset.signum'
+        --output_sigpattern $sig_contrib
+
+        #if $set_preset.contrib_matrix_out == 'yes'
             --sig_contrib_matrix $sig_contrib_matrix
         #end if
+
     #end if
             
     #if $rdata_out
@@ -69,12 +77,8 @@
     <inputs>
         <param name="vcfs" type="data_collection" format="vcf" label="VCF file(s) collection" multiple="true"/>
         <param name="genome" type="select" label="Reference Genome">
-            <!-- <option value="BSgenome.Hsapiens.1000genomes.hs37d5">BSgenome.Hsapiens.1000genomes.hs37d5</option> -->
-            <!-- <option value="BSgenome.Hsapiens.NCBI.GRCh38">BSgenome.Hsapiens.NCBI.GRCh38</option> -->
             <option value="BSgenome.Hsapiens.UCSC.hg19">BSgenome.Hsapiens.UCSC.hg19</option>
             <option value="BSgenome.Hsapiens.UCSC.hg38" selected="true">BSgenome.Hsapiens.UCSC.hg38</option>
-            <!--<option value="BSgenome.Mmusculus.UCSC.mm10">BSgenome.Mmusculus.UCSC.mm10</option>
-            <option value="BSgenome.Mmusculus.UCSC.mm9">BSgenome.Mmusculus.UCSC.mm9</option>-->
         </param>
         <conditional name="set_levels">
             <param name="choices" type="select" label="samples have levels/labels for grouping them in the analysis" display="radio"
@@ -108,8 +112,8 @@
 
         <conditional name="set_denovo">
             <param name="choices" type="select" label="Extract de novo signatures with MutationalPatterns" display="radio">
-                <option value="yes" selected="true">Yes</option>
-                <option value="no">No</option>
+                <option value="yes">Yes</option>
+                <option value="no" selected="true">No</option>
             </param>
             <when value="yes">
                 <param name="nrun" type="integer" value="10" min="10" max="200"
@@ -125,28 +129,41 @@
             <when value="no" />
         </conditional>
 
-        <conditional name="set_cosmic">
-            <param name="choices" type="select" label="Decompose with Cosmic signatures" display="radio">
+        <conditional name="set_preset">
+            <param name="choices" type="select" label="Decompose with preset signatures" display="radio">
                 <option value="yes" selected="true">Yes</option>
                 <option value="no">No</option>
             </param>
             <when value="yes">
+                <conditional name="set_signature_input">
+                    <param name="input_signature_choices" type="select" label="type of signatures" display="radio">
+                        <option value="cosmic" selected="true">COSMIC signatures</option>
+                        <option value="user_signatures">Use your own signature matrix</option>
+                    </param>
+                    <when value="cosmic">
+                        <param name="cosmic_version" type="select" label="Version of the Cosmic signature set">
+                            <option value="v2" selected="true">Cosmic v2, March 2015</option>
+                            <option value="v3">Cosmic v3, May 2019</option>
+                            <option value="v3.1">Cosmic v3.1, June 2020</option>
+                            <option value="v3.2">Cosmic v3.2, March 2021</option>
+                        </param>
+                    </when>
+                    <when value="user_signatures">
+                        <param name="own_matrix" type="data" format="tabular"
+                               label="A tab-separated matrix describing elementary signatures"
+                               help="see https://cancer.sanger.ac.uk/signatures/documents/453/COSMIC_v3.2_SBS_GRCh38.txt for the required format" />
+                    </when>
+                </conditional>
                 <param name="signum" type="integer" value="3" min="2" max="30"
                        label="selects the N most significant signatures in samples to express mutational patterns"
-                       help="an integer between 2 and 30 signature types from cosmic"/>
-                <param name="cosmic_version" type="select" label="Version of the Cosmic signature set">
-                    <option value="v2" selected="true">Cosmic v2, March 2015</option>
-                    <option value="v3">Cosmic v3, May 2019</option>
-                    <option value="v3.1">Cosmic v3.1, June 2020</option>
-                    <option value="v3.2">Cosmic v3.2, March 2021</option>
-                </param>
+                       help="an integer between 2 and the number of elementary signatures in your signature matrix"/>
                 <param name="contrib_matrix_out" type="select" label="Output Signature Contribution table ?"
                        help="Output the normalized signatures contributions for further visualization" >
                     <option value="no" selected="true">No</option>
                     <option value="yes">Yes</option>
                 </param>
             </when>
-             <when value="no" />
+            <when value="no" />
         </conditional>
         <param name="rdata_out" type="boolean" checked="false" label="Output RData file?" help="Output all the data used by R to construct the tables and plots, can be loaded into R" />
     </inputs>
@@ -160,11 +177,11 @@
         <data name="sigmatrix" format="tabular" label="De novo signatures probability matrix">
             <filter>set_denovo['choices'] == "yes"</filter>
         </data>
-        <data name="cosmic" format="pdf" label="Cosmic signatures">
-            <filter>set_cosmic['choices'] == "yes"</filter>
+        <data name="sig_contrib" format="pdf" label="Signature contributions">
+            <filter>set_preset['choices'] == "yes"</filter>
         </data>
         <data name="sig_contrib_matrix" format="tabular" label="${tool.name}: Signature contribution table">
-            <filter>set_cosmic['choices'] == "yes" and set_cosmic['contrib_matrix_out'] == "yes"</filter>
+            <filter>set_preset['choices'] == "yes" and set_preset['contrib_matrix_out'] == "yes"</filter>
         </data>
 
         <data name="rdata" format="rdata" label="${tool.name}: RData file">
@@ -173,7 +190,7 @@
 
     </outputs>
     <tests>
-         <!-- cosmic signatures with cosmic V3 -->
+         <!-- user defined (v3.2 restricted 30 minus 27) -->
         <test>
             <param name="vcfs">
                 <collection type="list">
@@ -191,17 +208,19 @@
             <conditional name="set_denovo">
                 <param name="choices" value="no"/>
             </conditional>
-            <conditional name="set_cosmic">
+            <conditional name="set_preset">
                 <param name="choices" value="yes"/>
+                <conditional name="set_signature_input">
+                    <param name="input_signature_choices" value="user_signatures" />
+                    <param name="own_matrix" value="user_defined_signature.tsv" ftype="tabular"/>
+                </conditional>
                 <param name="contrib_matrix_out"  value="yes" />
-                <param name="cosmic_version" value="v3"/>
             </conditional>
-            <param name="signum" value="3" />
-            <output name="cosmic" file="cosmic_output_v3.pdf" compare="sim_size"/>
-            <output name="sig_contrib_matrix" file="sig_contrib_table_v3.tsv" compare="sim_size"/>
+            <param name="signum" value="4" />
+            <output name="sig_contrib" file="user_output.pdf" compare="sim_size"/>
+            <output name="sig_contrib_matrix" file="sig_contrib_table_user_defined.tsv" compare="sim_size"/>
         </test>
-
-         <!-- cosmic signatures -->
+         <!-- cosmic v3.2 -->
         <test>
             <param name="vcfs">
                 <collection type="list">
@@ -219,37 +238,49 @@
             <conditional name="set_denovo">
                 <param name="choices" value="no"/>
             </conditional>
-            <conditional name="set_cosmic">
+            <conditional name="set_preset">
                 <param name="choices" value="yes"/>
+                <conditional name="set_signature_input">
+                    <param name="input_signature_choices" value="cosmic" />
+                    <param name="cosmic_version" value="v3.2"/>
+                </conditional>
                 <param name="contrib_matrix_out"  value="yes" />
             </conditional>
             <param name="signum" value="3" />
-            <output name="cosmic" file="cosmic_output1.pdf" compare="sim_size"/>
-            <output name="sig_contrib_matrix" file="sig_contrib_table.tsv" compare="sim_size"/>
+            <output name="sig_contrib" file="cosmic_output_v3.pdf" compare="sim_size"/>
+            <output name="sig_contrib_matrix" file="sig_contrib_table_v3.tsv" compare="sim_size"/>
         </test>
-
-        <!-- cosmic signature on single sample -->
+         <!-- cosmic v2 -->
         <test>
             <param name="vcfs">
                 <collection type="list">
-                    <element name="1" value="G.vcf"/>
+                    <element name="6" value="F.vcf"/>
+                    <element name="7" value="G.vcf"/>
+                    <element name="8" value="H.vcf"/>
+                    <element name="9" value="I.vcf"/>
                 </collection>
             </param>
             <param name="genome" value="BSgenome.Hsapiens.UCSC.hg38"/>
+            <param name="levels" value="FGHI_levels.tab" ftype="tabular"/>
             <conditional name="set_spectrum">
                 <param name="choices" value="no"/>
             </conditional>
             <conditional name="set_denovo">
                 <param name="choices" value="no"/>
             </conditional>
-            <conditional name="set_cosmic">
+            <conditional name="set_preset">
                 <param name="choices" value="yes"/>
+                <conditional name="set_signature_input">
+                    <param name="input_signature_choices" value="cosmic" />
+                    <param name="cosmic_version" value="v2"/>
+                </conditional>
+                <param name="contrib_matrix_out"  value="yes" />
             </conditional>
-            <param name="signum" value="5" />
-            <output name="cosmic" file="cosmic_output2.pdf" compare="sim_size" delta="50000"/>
+            <param name="signum" value="3" />
+            <output name="sig_contrib" file="cosmic_output1.pdf" compare="sim_size"/>
+            <output name="sig_contrib_matrix" file="sig_contrib_table.tsv" compare="sim_size"/>
         </test>
-
-        <!-- simple profile -->
+        <!-- simple spectrum -->
         <test>
             <param name="vcfs">
                 <collection type="list">
@@ -268,12 +299,11 @@
             <conditional name="set_denovo">
                 <param name="choices" value="no"/>
             </conditional>
-            <conditional name="set_cosmic">
+            <conditional name="set_preset">
                 <param name="choices" value="no"/>
             </conditional>
             <output name="spectrum" file="spectrum_output1.pdf" compare="sim_size"/>
         </test>
-
          <!-- de novo signatures -->
         <test>
             <param name="vcfs">
@@ -291,7 +321,7 @@
             <conditional name="set_denovo">
                 <param name="choices" value="yes"/>
             </conditional>
-            <conditional name="set_cosmic">
+            <conditional name="set_preset">
                 <param name="choices" value="no"/>
             </conditional>
             <param name="nrun" value="10" />
@@ -307,27 +337,46 @@
 
 **What it does**
 
-Takes as inputs
+This tool implement the R package MutationalPatterns to decompose mutations found in cancers
+in a linear combination of elementary mutational signatures, as first described by
+Alexandrov_ et al (2013) and recently improved in an update_ published in 2020.
+
+.. _Alexandrov: https://www.nature.com/articles/nature12477
+.. _update: https://www.nature.com/articles/s41586-020-1943-3
 
-* a collection of n vcf files corresponding to n samples.
-* a tabular table describing the correspondance of sample names to levels (tissues, ages, sexes, etc.)
-* the number of cosmic signatures to decompose mutational patterns of samples
+Sets of elementary signatures found by analyzing large cohortes of patients are published
+in the COSMIC databases v2_ to v3.2_. You can choose among these COSMIC signature sets to
+analyse your own VCFs.
 
+In addition, you can use your own signature sets (or filtered COSMIC signature sets)
+since MutationalPatterns implements a method to extract elementary signatures from
+user-provided VCFs.
+
+**Inputs**
 
-This tool returns a pdf file with the visualisation :
+* a collection of VCF files with somatic mutations calls from analysis of samples.
+* a tabular table describing the correspondance of sample names to levels of a factor
+(tissues, ages, sexes, etc.)
+
+**Outputs**
+
+This tool returns pdf files with various visualisations of :
 
-* the Cosine similarity of samples when decomposed over the 30 signatures of cosmic_
-* the absolute contribution of the n most contributing cosmic_ signatures in the samples mutational patterns (to be set by the user, between 2 and 30)
-* the relative contribution of the n most contributing cosmic_ signatures in the samples mutational patterns  (to be set by the user, between 2 and 30)
-* a clustering of the samples with respect to the relative contribution of their cosmic_ signatures
-* pie charts of the samples displaying for each sample the relative contribution of the n most contributing cosmic_ signatures to their mutational pattern
+* the spectrum of single nucleotide mutation types
+* the absolute contribution of the elementary signatures in the samples
+* the relative contribution of the elementary signatures in the samples
+* an unrooted hierarchical clustering of the reconstructed samples with respect to the relative contribution of elementary signatures
+* the Cosine similarity between true samples and samples reconstructed with elementary signatures
+* pie charts displaying the relative contribution of the n most contributing elementary signatures in the reconstructed sample profiles
 
-.. _cosmic: https://cancer.sanger.ac.uk/cosmic/signatures_v2.tt
+.. _v2: https://cancer.sanger.ac.uk/signatures/signatures_v2/
+.. _v3.2: https://cancer.sanger.ac.uk/signatures/sbs/
 
     </help>
     <citations>
         <citation type="doi">10.18129/B9.bioc.MutationalPatterns</citation>
         <citation type="doi">10.1186/s13073-018-0539-0</citation>
         <citation type="doi">10.1038/nature12477</citation>
+        <citation type="doi">10.1038/s41586-020-1943-3</citation>
     </citations>
 </tool>