diff kegg_pathways_visualization.xml @ 12:9fe4a861601b draft

planemo upload commit 7e2bd28d27e13c402acd46500f64d5c117797aa7-dirty
author proteore
date Fri, 09 Nov 2018 05:11:46 -0500
parents
children c59ec7fce7b3
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kegg_pathways_visualization.xml	Fri Nov 09 05:11:46 2018 -0500
@@ -0,0 +1,305 @@
+<tool id="kegg_pathways_visualization" name="KEGG pathways" version="2018.11.08">
+    <description>map visualisation (PathView)</description>
+    <requirements>
+        <requirement type="package" version="1.18.0">bioconductor-pathview</requirement>
+    </requirements>
+    <command detect_errors="exit_code"><![CDATA[
+        Rscript $__tool_directory__/kegg_pathways_visualization.R 
+        #if $input.ids == "text"
+            --id_list="$input.txt"
+        #else
+            --input="$input.file"
+            --id_column="$input.ncol"
+            --header="$input.header"  
+        #end if
+        #if $species.pathways.pathways_id != "pathways_file"
+            --pathways_id="$species.pathways.pids" 
+        #else 
+            --pathways_input="$species.pathways.file"
+            --header2="$species.pathways.header2"
+            --pathway_col="$species.pathways.ncol2"
+        #end if
+        --id_type="$id_type"  
+        --native_kegg="$native"
+        
+
+        #if $input.ids=="file" and $input.foldchange.fc=="true"
+            --fold_change_data="$input.foldchange.fc"
+            --fold_change_col="$input.foldchange.fc_col"
+        #else 
+            --fold_change_data="false"
+        #end if
+
+        --species=${species.ref_file} 
+        --pathways_list=$__tool_directory__/${ filter( lambda x: str( x[0] ) == str( $species.ref_file ), $__app__.tool_data_tables['kegg_pathways_list_index'].get_fields() )[0][-1] } 
+        --output="$text_output"
+
+    ]]></command>
+    <inputs>
+        <conditional name="species">
+        <param name="ref_file" type="select" label="Select species" >
+            <option value="hsa">Human (H. sapiens)</option>
+            <option value="mmu">Mouse (M. musculus)</option>
+            <option value="rno">Rat (R. norvegicus)</option>
+        </param>
+            <when value="hsa">
+                <conditional name="pathways">
+                <param name="pathways_id" type="select" label="Provide your pathway(s)" help="Enter KEGG pathway name(s) or KEGG pathway id(s)">
+                    <option value="pathways_names">KEGG pathway name(s)</option>
+                    <option value="pathways_ids">KEGG pathway id(s)</option>
+                    <option value="pathways_file">KEGG pathway id(s) from file</option>
+                </param>
+                <when value="pathways_names">
+                    <param name="pids" type="select" label="Select pathway(s)" multiple="true" help='You can select one or several pathway(s), you can write the beginning of your pathways to search using autocomplete'>
+                        <options from_data_table="hsa_pathways">
+                            <filter type="sort_by" column="1"/>
+                            <validator type="no_options" message="No indexes are available for the selected input dataset"/>
+                        </options>
+                    </param>
+                </when>
+                <when value="pathways_ids">
+                    <param name="pids" type="text" label="Copy/paste your pathway id(s)" help='IDs must be separated by tab, space or carriage return into the form field, for example: "hsa00010 hsa05412"'>
+                        <sanitizer invalid_char=''>
+                        <valid initial="string.printable">
+                            <remove value="&apos;"/>
+                        </valid>
+                        <mapping>
+                            <add source="&#x20;" target=""/> 
+                        </mapping>
+                        </sanitizer>
+                    </param>
+                </when>
+                <when value="pathways_file">
+                    <param name="file" type="data" format="txt,tabular" label="Select a file with a column of pathways id" help="Pathway id format : 'path:hsa00010' or 'hsa00010' or '00010'" />
+                    <param name="header2" type="boolean" checked="true" truevalue="true" falsevalue="false" label="Does your input file contains a header?" />
+                    <param name="ncol2" type="text" value="c1" label="The column which contains your pathways ids" help='For example, fill in "c1" if it is the first column, "c2" if it is the second column and so on' />
+                </when>
+                </conditional>
+            </when>
+            <when value="mmu">
+                <conditional name="pathways">
+                <param name="pathways_id" type="select" label="Provide your pathway(s)" help="Enter KEGG pathway name(s) or KEGG pathway id(s)">
+                    <option value="pathways_names">KEGG pathway name(s)</option>
+                    <option value="pathways_ids">KEGG pathway id(s)</option>
+                    <option value="pathways_file">KEGG pathway id(s) from file</option>
+                </param>
+                <when value="pathways_names">
+                    <param name="pids" type="select" label="Select pathway(s)" multiple="true" help='You can select one or several pathway(s), you can write the beginning of your pathways to search using autocomplete'>
+                        <options from_data_table="mmu_pathways">
+                            <filter type="sort_by" column="1"/>
+                            <validator type="no_options" message="No indexes are available for the selected input dataset"/>
+                        </options>
+                    </param>
+                </when>
+                <when value="pathways_ids">
+                    <param name="pids" type="text" label="Copy/paste your pathway id(s)" help='IDs must be separated by tab, space or carriage return into the form field, for example: "mmu00053 mmu00340"'>
+                        <sanitizer invalid_char=''>
+                        <valid initial="string.printable">
+                            <remove value="&apos;"/>
+                        </valid>
+                        <mapping>
+                            <add source="&#x20;" target=""/> 
+                        </mapping>
+                        </sanitizer>
+                    </param>
+                </when>
+                <when value="pathways_file">
+                    <param name="file" type="data" format="txt,tabular" label="Select a file with a column of pathways id " help="Pathway id format : 'path:mmu00053' or 'mmu00053' or '00053'" />
+                    <param name="header2" type="boolean" checked="true" truevalue="true" falsevalue="false" label="Does your input file contain header?" />
+                    <param name="ncol2" type="text" value="c1" label="The column which contains your pathways ids" help='For example, fill in "c1" if it is the first column, "c2" if it is the second column and so on' />
+                </when>
+                </conditional>
+            </when>
+            <when value="rno">
+                <conditional name="pathways">
+                <param name="pathways_id" type="select" label="Enter your pathway(s) name/id" help="Enter KEGG pathway name(s) or KEGG pathway id(s)">
+                    <option value="pathways_names">KEGG pathway name(s)</option>
+                    <option value="pathways_ids">KEGG pathway id(s)</option>
+                    <option value="pathways_file">KEGG pathway id(s) from file</option>
+                </param>
+                <when value="pathways_names">
+                    <param name="pids" type="select" label="Select pathway(s)" multiple="true" help='You can select one or several pathway(s), you can write the beginning of your pathways to search using autocomplete'>
+                        <options from_data_table="rno_pathways">
+                            <filter type="sort_by" column="1"/>
+                            <validator type="no_options" message="No indexes are available for the selected input dataset"/>
+                        </options>
+                    </param>
+                </when>
+                <when value="pathways_ids">
+                    <param name="pids" type="text" label="Copy/paste your pathway id(s)" help='IDs must be separated by tab, space or carriage return into the form field, for example: "hsa00010 hsa05412"'>
+                        <sanitizer invalid_char=''>
+                        <valid initial="string.printable">
+                            <remove value="&apos;"/>
+                        </valid>
+                        <mapping>
+                            <add source="&#x20;" target=""/> 
+                        </mapping>
+                        </sanitizer>
+                    </param>
+                </when>
+                <when value="pathways_file">
+                    <param name="file" type="data" format="txt,tabular" label="Select a file with a column of pathways id" help="Pathway id format : 'path:hsa00010' or 'hsa00010' or '00010'" />
+                    <param name="header2" type="boolean" checked="true" truevalue="true" falsevalue="false" label="Does your input file contains a header?" />
+                    <param name="ncol2" type="text" value="c1" label="The column which contains your pathways ids" help='For example, fill in "c1" if it is the first column, "c2" if it is the second column and so on' />
+                </when>
+                </conditional>
+            </when>
+        </conditional>
+        <param name="id_type" type="select" label="Select your identifiers type :">
+            <option value="uniprotID">Uniprot Accession number</option>
+            <option value="geneID">Entrez gene ID</option>
+            <!--option value="keggid">KEGG genes ID</option-->
+        </param>
+        <conditional name="input" >
+            <param name="ids" type="select" label="Enter your identifiers (Uniprot AC or Entrez gene ID)" help="Copy/paste or ID list from a file (e.g. table)" >
+                <option value="text">Copy/paste your identifiers</option>
+                <option value="file" selected="true">Input file containing your identifiers</option>
+            </param>
+            <when value="text" >
+                <param name="txt" type="text" label="Copy/paste your identifiers" help='IDs must be separated by tab, space or carriage return into the form field, for example: P31946 P62258' >
+                    <sanitizer invalid_char=''>
+                        <valid initial="string.printable">
+                            <remove value="&apos;"/>
+                        </valid>
+                        <mapping initial="none">
+                            <add source="&apos;" target="__sq__"/>
+                        </mapping>
+                    </sanitizer>
+                </param>
+            </when>
+            <when value="file" >
+                <param name="file" type="data" format="txt,tabular" label="Select a file that contains your list of IDs" help="" />
+                <param name="header" type="boolean" checked="true" truevalue="true" falsevalue="false" label="Does your input file contains a header?" />
+                <param name="ncol" type="text" value="c1" label="The column which contains your IDs to map" help='For example, fill in "c1" if it is the first column, "c2" if it is the second column and so on' />
+                <conditional name="foldchange" >
+                <param name="fc" type="boolean" checked="false" truevalue="true" falsevalue="false" label="Do you have fold change values to represent on the graph ?" default="false"/>
+                    <when value="true">
+                        <param name="fc_col" type="text" label="Please enter column(s) number of fold change data separated by ','. 3 columns max" help="For example : c1,c3,c4"/>
+                    </when>
+                    <when value="false"/>
+                </conditional>
+            </when>
+        </conditional>
+        <param name="native" type="select" label="Choose the output graphical format">
+            <option value="true">KEGG map (.png)</option>
+            <option value="false">Graphviz layout engine (.pdf)</option> 
+        </param>
+    </inputs>
+    <outputs>
+        <data name="text_output" format="tsv" label="KEGG pathways visualization text output"/>
+        <collection type="list" label="KEGG pathways map from ${input.file.name}" name="graphviz_output_from_file">
+            <filter>native=="false" and input["ids"] == "file"</filter>
+                <discover_datasets pattern="(?P&lt;designation&gt;.+\..*)\.pdf" ext="pdf" />
+        </collection>
+        <collection type="list" label="KEGG pathways map from ${input.file.name}" name="kegg_graph_output_from_file">
+            <filter>native=="true" and input["ids"] == "file"</filter>
+                <discover_datasets pattern="(?P&lt;designation&gt;.+\..*)\.png" ext="png"/>
+        </collection>
+        <collection type="list" label="KEGG pathways map" name="graphviz_output_from_list">
+            <filter>native=="false" and input["ids"] == "text"</filter>
+                <discover_datasets pattern="(?P&lt;designation&gt;.+\..*)\.pdf" ext="pdf" />
+        </collection>
+        <collection type="list" label="KEGG pathways map" name="kegg_graph_output_from_list">
+            <filter>native=="true" and input["ids"] == "text"</filter>
+                <discover_datasets pattern="(?P&lt;designation&gt;.+\..*)\.png" ext="png" />
+        </collection>
+    </outputs>
+    <tests>
+        <test>
+            <conditional name="input">
+                <param name="ids" value="file"/>
+                <param name="file" value="Lacombe_et_al_2017_OK.txt"/>
+                <param name="header" value="true"/>
+                <param name="ncol" value="c1"/>
+            </conditional>
+            <conditional name="pathways">
+                <param name="pathways_id" value="pathways_ids"/>
+                <param name="pids" value="04514,05167,00010"/>
+            </conditional>
+            <param name="id_type" value="uniprotID"/>
+            <param name="species" value="hsa"/>
+            <param name="native" value="true"/>            
+            <output name="kegg_from_file" file="hsa04514.pathview.png" compare="sim_size"/>
+            <output name="kegg_from_file" file="hsa05167.pathview.png" compare="sim_size"/>
+            <output name="kegg_from_file" file="hsa00010.pathview.png" compare="sim_size"/>
+        </test>
+    </tests>
+    <help><![CDATA[
+This tool map a list of Uniprot Accession number or Entrez gene ID to KEGG pathway with pathview R package.
+
+You can map Entrez gene IDs / Uniprot accession number from three species : human, mouse and rat.
+
+If your input have another type of IDs, please use the ID_Converter tool.
+
+**Input:**
+
+
+- KEGG Pathways IDs to be used for mapping can be set by:
+    - chosing from the KEGG pathways name list 
+    - giving a list (copy/paste)
+    - importing a list from a dataset (column) - output of KEGG pathways identification and coverage can be used (1st column)
+- Genes/proteins ids to map can be either a list of Entrez genes IDs / Uniprot accession number or a file (tabular, tsv, txt) containing at least one column of Entrez genes IDs / Uniprot accession number. 
+- fold change values (up to three columns) from a dataset (same dataset as for Genes/proteins ids to map)
+
+You can see below an example of an input file with identifiers (uniprot_AC) and fold_change values.
+
+.. csv-table:: Simulated data
+   :header: "Uniprot_AC","Protein.name","Number_of_peptides","fc_values 1","fc_values 2","fc_values 3"
+
+   "P15924","Desmoplakin","69","0.172302292051025","-0.757435966487116","0.0411240398990759"
+   "P02538","Keratin, type II cytoskeletal 6A","53","-0.988842456122076","0.654626325100182","-0.219153396366064"
+   "P02768","Serum albumin","44","-0.983493243315454","0.113752002761474","-0.645886132600729"
+   "P08779","Keratin, type I cytoskeletal 16","29","0.552302597284443","-0.329045605110646","2.10616106806788"
+
+|
+
+**Output:**
+
+- a **collection dataset** named 'KEGG pathways map from <dataset>', one file (png or pdf) for each given pathway.
+- a **summary text file** (.tsv) of the mapping(s) with the following columns
+    - **KEGG pathway ID**: KEGG pathway(s) used to map given genes/proteins ids
+    - **pathway name**: name(s) of KEGG pathway(s) used for mapping
+    - **nb of Uniprot_AC used** (only when Uniprot accession number is given): number of Uniprot accession number which will be converted to Entrez genes IDs
+    - **nb of Entrez gene ID used**: number of Entrez gene IDs used for mapping
+    - **nb of Entrez gene ID mapped**: number of Entrez gene IDs mapped on a given pathway
+    - **nb of Entrez gene ID in the pathway**: number total of Entrez gene IDs in a given pathway
+    - **ratio of Entrez gene ID mapped**: number of Entrez gene IDs mapped / number total of Entrez gene IDs
+    - **Entrez gene ID mapped**: list of mapped Entrez gene IDs
+    - **uniprot_AC mapped** (only when Uniprot accession number is given): list of Uniprot accession number corresponding to the mapped Entrez gene IDs
+
+-----
+
+.. class:: infomark
+
+**Database:**
+
+KEGG Pathways names list are from  http://rest.kegg.jp/list/pathway/
+
+User manual / Documentation: http://www.bioconductor.org/packages/release/bioc/html/pathview.html
+
+
+-----
+
+.. class:: infomark
+
+**Authors**
+
+David Christiany, Florence Combes, Yves Vandenbrouck CEA, INSERM, CNRS, Grenoble-Alpes University, BIG Institute, FR
+
+Sandra Dérozier, Olivier Rué, Christophe Caron, Valentin Loux INRA, Paris-Saclay University, MAIAGE Unit, Migale Bioinformatics platform
+
+This work has been partially funded through the French National Agency for Research (ANR) IFB project.
+
+Contact support@proteore.org for any questions or concerns about the Galaxy implementation of this tool.
+    ]]></help>
+    <citations>
+        <citation type="doi">10.1093/nar/gkx372</citation>
+        <citation type="bibtex">
+@misc{renameTODO,
+  author = {Weijun Luo},
+  year = {2013},
+  title = {pathview},
+  url = {https://bioconductor.org/packages/release/bioc/html/pathview.html},
+}</citation>
+    </citations>
+</tool>