diff nmr_annotation2d/annotationRmn2D_xml.xml @ 1:a4d2b1926e13 draft

Uploaded
author marie-tremblay-metatoul
date Tue, 04 Feb 2020 04:05:38 -0500
parents 8035235e46c7
children
line wrap: on
line diff
--- a/nmr_annotation2d/annotationRmn2D_xml.xml	Mon Dec 23 09:26:20 2019 -0500
+++ b/nmr_annotation2d/annotationRmn2D_xml.xml	Tue Feb 04 04:05:38 2020 -0500
@@ -1,172 +1,188 @@
 <tool id="2DNmrAnnotation" name="2DNMR_Annotation" version="1.0.0">
-		
-	<description> Annotation of complex mixture bidimensional NMR spectra </description>
+
+    <description> Annotation of complex mixture bidimensional NMR spectra </description>
+
+    <requirements>
+        <requirement type="package" version="1.1_5">r-batch</requirement>
+        <requirement type="package" version="0.8.3">r-dplyr</requirement>
+        <requirement type="package" version="3.2.1">r-ggplot2</requirement>
+        <requirement type="package" version="4.0.17">r-openxlsx</requirement>
+        <requirement type="package" version="1.4.0">r-stringr</requirement>
+        <requirement type="package" version="1.0.2">r-tidyr</requirement>
+    </requirements>
 
     <stdio>
         <exit_code range="1:" level="fatal" />
-    </stdio> 
+    </stdio>
+
+    <command>
+        ## Wrapper + Libraries of 2D-NMR sequences for reference compounds
+        Rscript '$__tool_directory__/annotationRmn2DWrapper.R'
+
+
+        ## XLS file
+        xlsfile '$zip_xlsfile'
+
+        ## 2D-NMR sequences to annotate
+        cosy_2dsequences $cosy_2dsequences
+        jres_2dsequences $jres_2dsequences
+        hmbc_2dsequences $hmbc_2dsequences
+        hsqc_2dsequences $hsqc_2dsequences
+        tocsy_2dsequences $tocsy_2dsequences
 
-	<command>
-		## Wrapper + Libraries of 2D-NMR sequences for reference compounds
-		Rscript '$__tool_directory__/annotationRmn2DWrapper.R'
+        ## In-house databases
+        inHouse_DB_choices.choice ${inHouse_DB_choices.choice}
+        #if str($inHouse_DB_choices.choice) == 'yes':
+            inHouse_DB_cosy.choice ${inHouse_DB_choices.inHouse_DB_cosy.choice}
+            #if str($inHouse_DB_choices.inHouse_DB_cosy.choice) == 'yes':
+                cosyDB $inHouse_DB_choices.inHouse_DB_cosy.cosyDB
+            #end if
+            inHouse_DB_hmbc.choice ${inHouse_DB_choices.inHouse_DB_hmbc.choice}
+            #if str($inHouse_DB_choices.inHouse_DB_hmbc.choice) == 'yes':
+                hmbcDB $inHouse_DB_choices.inHouse_DB_hmbc.hmbcDB
+            #end if
+            inHouse_DB_hsqc.choice ${inHouse_DB_choices.inHouse_DB_hsqc.choice}
+            #if str($inHouse_DB_choices.inHouse_DB_hsqc.choice) == 'yes':
+                hsqcDB $inHouse_DB_choices.inHouse_DB_hsqc.hsqcDB
+            #end if
+            inHouse_DB_jres.choice ${inHouse_DB_choices.inHouse_DB_jres.choice}
+            #if str($inHouse_DB_choices.inHouse_DB_jres.choice) == 'yes':
+                jresDB $inHouse_DB_choices.inHouse_DB_jres.jresDB
+            #end if
+            inHouse_DB_tocsy.choice ${inHouse_DB_choices.inHouse_DB_tocsy.choice}
+            #if str($inHouse_DB_choices.inHouse_DB_tocsy.choice) == 'yes':
+                tocsyDB $inHouse_DB_choices.inHouse_DB_tocsy.tocsyDB
+            #end if
+        #end if
+
+        ## Tolerances
+        tolppm1 $tolppm1
+        tolppm2 $tolppm2
+        tolppmJRES $tolppmJRES
 
 
-		## XLS file
-		xlsfile $zip_xlsfile
+        ## Treshold (probability score)
+        threshold $threshold
+
+        ## Unicity
+        unicity $unicity
+
+        ## Outputs
+        logOut '$logOut'
+        annotationCOSY '$annotationCOSY'
+        ppmCommunCOSY '$ppmCommunCOSY'
+        annotationJRES '$annotationJRES'
+        ppmCommunJRES '$ppmCommunJRES'
+        annotationHMBC '$annotationHMBC'
+        ppmCommunHMBC '$ppmCommunHMBC'
+        annotationHSQC '$annotationHSQC'
+        ppmCommunHSQC '$ppmCommunHSQC'
+        annotationTOCSY '$annotationTOCSY'
+        ppmCommunTOCSY '$ppmCommunTOCSY'
+        annotationCombination '$annotationCombination'
+        AnnotationGraph '$AnnotationGraph'
+
+    </command>
 
-		## 2D-NMR sequences to annotate
-		cosy_2dsequences $cosy_2dsequences
-		jres_2dsequences $jres_2dsequences
-		hmbc_2dsequences $hmbc_2dsequences
-		hsqc_2dsequences $hsqc_2dsequences
-		tocsy_2dsequences $tocsy_2dsequences
-		
-		## In-house databases
-		inHouse_DB_choices.choice ${inHouse_DB_choices.choice}
-		#if str($inHouse_DB_choices.choice) == 'yes':
-			inHouse_DB_cosy.choice ${inHouse_DB_cosy.choice}
-			#if str($inHouse_DB_cosy.choice) == 'yes':
-				cosyDB $cosyDB
-			#end if
-			inHouse_DB_hmbc.choice ${inHouse_DB_hmbc.choice}
-			#if str($inHouse_DB_hmbc.choice) == 'yes':
-				hmbcDB $hmbcDB
-			#end if
-			inHouse_DB_hsqc.choice ${inHouse_DB_hsqc.choice}
-			#if str($inHouse_DB_hsqc.choice) == 'yes':
-				hsqcDB $hsqcDB
-			#end if
-			inHouse_DB_jres.choice ${inHouse_DB_jres.choice}
-			#if str($inHouse_DB_jres.choice) == 'yes':
-				jresDB $jresDB
-			#end if
-			inHouse_DB_tocsy.choice ${inHouse_DB_tocsy.choice}
-			#if str($inHouse_DB_tocsy.choice) == 'yes':
-				tocsyDB $tocsyDB
-			#end if
-		#end if
+    <inputs>
+        <param name="zip_xlsfile" type="data" format="xlsx" label="File to annotate in xlsx format" />
 
-		## Tolerances
-		tolppm1 $tolppm1
-		tolppm2 $tolppm2
-		tolppmJRES $tolppmJRES
-		
-		
-		## Treshold (probability score)
-		threshold $threshold
-
-		## Unicity
-		unicity $unicity
-
-		## Outputs
-		logOut $logOut
-        annotationCOSY $annotationCOSY
-        ppmCommunCOSY $ppmCommunCOSY
-        annotationJRES $annotationJRES
-        ppmCommunJRES $ppmCommunJRES
-        annotationHMBC $annotationHMBC
-        ppmCommunHMBC $ppmCommunHMBC
-        annotationHSQC $annotationHSQC
-        ppmCommunHSQC $ppmCommunHSQC
-        annotationTOCSY $annotationTOCSY
-        ppmCommunTOCSY $ppmCommunTOCSY
-        annotationCombination $annotationCombination
-        AnnotationGraph $AnnotationGraph
-		
-	</command>
-		
-	<inputs>
-		<param name="zip_xlsfile" type="data" format="xlsx" label="File to annotate in xlsx format" />
+        <param name="cosy_2dsequences" type="select" label="2D-NMR COSY sequence">
+            <option value="yes" > yes </option>
+            <option value="no" selected="true"> no </option>
+        </param>
+        <param name="jres_2dsequences" type="select" label="2D-NMR JRES sequence">
+            <option value="yes" > yes </option>
+            <option value="no" selected="true"> no </option>
+        </param>
+        <param name="hmbc_2dsequences" type="select" label="2D-NMR HMBC sequence">
+            <option value="yes" > yes </option>
+            <option value="no" selected="true"> no </option>
+        </param>
+        <param name="hsqc_2dsequences" type="select" label="2D-NMR HSQC sequence">
+            <option value="yes" > yes </option>
+            <option value="no" selected="true"> no </option>
+        </param>
+        <param name="tocsy_2dsequences" type="select" label="2D-NMR TOCSY sequence">
+            <option value="yes" > yes </option>
+            <option value="no" selected="true"> no </option>
+        </param>
 
-		<param name="cosy_2dsequences" type="select" label="2D-NMR COSY sequence">
-			<option value="yes" > yes </option>
-			<option value="no" selected="true"> no </option>
-		</param>
-		<param name="jres_2dsequences" type="select" label="2D-NMR JRES sequence">
-			<option value="yes" > yes </option>
-			<option value="no" selected="true"> no </option>
-		</param>		
-		<param name="hmbc_2dsequences" type="select" label="2D-NMR HMBC sequence">
-			<option value="yes" > yes </option>
-			<option value="no" selected="true"> no </option>
-		</param>		
-		<param name="hsqc_2dsequences" type="select" label="2D-NMR HSQC sequence">
-			<option value="yes" > yes </option>
-			<option value="no" selected="true"> no </option>
-		</param>
-		<param name="tocsy_2dsequences" type="select" label="2D-NMR TOCSY sequence">
-			<option value="yes" > yes </option>
-			<option value="no" selected="true"> no </option>
-		</param>
-		
-		<conditional name="inHouse_DB_choices">
-			<param name="choice" type="select" label="In-house database" help="Choose if you want to use use in-house database to annotate" >
-				<option value="yes" > yes </option>
-				<option value="no" selected="true"> no </option>
-			</param>
-			<when value="yes">
-				<conditional name="inHouse_DB_cosy">
-					<param name="choice" type="select" label="COSY In-house database" help="Choose if you want to use use in-house database to annotate COSY sequence" >
-						<option value="yes" > yes </option>
-						<option value="no" selected="true"> no </option>
-					</param>
-						<when value="yes">
-							<param name="cosyDB" type="data" format="no_unzip.zip" label="Zip file of the COSY RData object" />
-						</when>
-				</conditional>
-				<conditional name="inHouse_DB_hmbc">
-					<param name="choice" type="select" label="HMBC In-house database" help="Choose if you want to use use in-house database to annotate HMBC sequence" >
-						<option value="yes" > yes </option>
-						<option value="no" selected="true"> no </option>
-					</param>
-						<when value="yes">
-							<param name="hmbcDB" type="data" format="no_unzip.zip" label="Zip file of the HMBC RData object" />
-						</when>
-				</conditional>			<conditional name="inHouse_DB_hsqc">
-					<param name="choice" type="select" label="HSQC In-house database" help="Choose if you want to use use in-house database to annotate HSQC sequence" >
-						<option value="yes" > yes </option>
-						<option value="no" selected="true"> no </option>
-					</param>
-						<when value="yes">
-							<param name="hsqcDB" type="data" format="no_unzip.zip" label="Zip file of the HSQC RData object" />
-						</when>
-				</conditional>			<conditional name="inHouse_DB_jres">
-					<param name="choice" type="select" label="JRES In-house database" help="Choose if you want to use use in-house database to annotate JRES sequence" >
-						<option value="yes" > yes </option>
-						<option value="no" selected="true"> no </option>
-					</param>
-						<when value="yes">
-							<param name="jresDB" type="data" format="no_unzip.zip" label="Zip file of the JRES RData object" />
-						</when>
-				</conditional>			
-				<conditional name="inHouse_DB_tocsy">
-					<param name="choice" type="select" label="TOCSY In-house database" help="Choose if you want to use use in-house database to annotate TOCSY sequence" >
-						<option value="yes" > yes </option>
-						<option value="no" selected="true"> no </option>
-					</param>
-						<when value="yes">
-							<param name="tocsyDB" type="data" format="no_unzip.zip" label="Zip file of the TOCSY RData object" />
-						</when>
-				</conditional>			
-				</when>
-			<when value="no" />
-	</conditional>
-	
-	<param name="tolppm1" type="float" value="0.01" help="Tolerance on chemical shift for the x-axis (H). Default value is 0.01ppm" />
-	<param name="tolppm2" type="float" value="0.5" help="Tolerance on chemical shift for the y-axis (C). Default value is 0.01ppm" />
-	<param name="tolppmJRES" type="float" value="0.002" help="Tolerance on chemical shift for the y-axis for the JRES sequence. Default value is 0.002 (Hz)" />
+        <conditional name="inHouse_DB_choices">
+            <param name="choice" type="select" label="In-house database" help="Choose if you want to use use in-house database to annotate" >
+                <option value="yes" > yes </option>
+                <option value="no" selected="true"> no </option>
+            </param>
+            <when value="yes">
+                <conditional name="inHouse_DB_cosy">
+                    <param name="choice" type="select" label="COSY In-house database" help="Choose if you want to use use in-house database to annotate COSY sequence" >
+                        <option value="yes" > yes </option>
+                        <option value="no" selected="true"> no </option>
+                    </param>
+                    <when value="yes">
+                        <param name="cosyDB" type="data" format="no_unzip.zip" label="Zip file of the COSY RData object" />
+                    </when>
+                    <when value="no" />
+                </conditional>
+                <conditional name="inHouse_DB_hmbc">
+                    <param name="choice" type="select" label="HMBC In-house database" help="Choose if you want to use use in-house database to annotate HMBC sequence" >
+                        <option value="yes" > yes </option>
+                        <option value="no" selected="true"> no </option>
+                    </param>
+                    <when value="yes">
+                        <param name="hmbcDB" type="data" format="no_unzip.zip" label="Zip file of the HMBC RData object" />
+                    </when>
+                    <when value="no" />
+                </conditional>
+                <conditional name="inHouse_DB_hsqc">
+                    <param name="choice" type="select" label="HSQC In-house database" help="Choose if you want to use use in-house database to annotate HSQC sequence" >
+                        <option value="yes" > yes </option>
+                        <option value="no" selected="true"> no </option>
+                    </param>
+                    <when value="yes">
+                        <param name="hsqcDB" type="data" format="no_unzip.zip" label="Zip file of the HSQC RData object" />
+                    </when>
+                    <when value="no" />
+                </conditional>
+                <conditional name="inHouse_DB_jres">
+                    <param name="choice" type="select" label="JRES In-house database" help="Choose if you want to use use in-house database to annotate JRES sequence" >
+                        <option value="yes" > yes </option>
+                        <option value="no" selected="true"> no </option>
+                    </param>
+                    <when value="yes">
+                        <param name="jresDB" type="data" format="no_unzip.zip" label="Zip file of the JRES RData object" />
+                    </when>
+                    <when value="no" />
+                </conditional>
+                <conditional name="inHouse_DB_tocsy">
+                    <param name="choice" type="select" label="TOCSY In-house database" help="Choose if you want to use use in-house database to annotate TOCSY sequence" >
+                        <option value="yes" > yes </option>
+                        <option value="no" selected="true"> no </option>
+                    </param>
+                    <when value="yes">
+                        <param name="tocsyDB" type="data" format="no_unzip.zip" label="Zip file of the TOCSY RData object" />
+                    </when>
+                    <when value="no" />
+                </conditional>
+            </when>
+            <when value="no" />
+        </conditional>
 
-	<param name="threshold" type="float" value="0" help="Treshold on score of presence. Default value is 0" />
+        <param name="tolppm1" type="float" value="0.01" help="Tolerance on chemical shift for the x-axis (H). Default value is 0.01ppm" />
+        <param name="tolppm2" type="float" value="0.5" help="Tolerance on chemical shift for the y-axis (C). Default value is 0.01ppm" />
+        <param name="tolppmJRES" type="float" value="0.002" help="Tolerance on chemical shift for the y-axis for the JRES sequence. Default value is 0.002 (Hz)" />
+
+        <param name="threshold" type="float" value="0" help="Treshold on score of presence. Default value is 0" />
 
-    <param name="unicity" label="Unicity of annotation" type="select" display="radio" help="">
-      <option value="no">No</option>
-      <option value="yes"></option>
-    </param>
+        <param name="unicity" label="Unicity of annotation" type="select" display="radio" help="">
+            <option value="no">No</option>
+            <option value="yes"></option>
+        </param>
 
-	</inputs>
+    </inputs>
 
-	<outputs>
-		<data format="txt" name="logOut" label="${tool.name}_log" />
+    <outputs>
+        <data format="txt" name="logOut" label="${tool.name}_log" />
         <data format="tabular" name="annotationCOSY" label="annotationCosy" >
             <filter> cosy_2dsequences != "no" </filter>
         </data>
@@ -203,9 +219,30 @@
         </data>
 
         <data format="tabular" name="annotationCombination" label="${tool.name}_annotationCombination" />
-		<data format="pdf" name="AnnotationGraph" label="${tool.name}_graph" />
-	</outputs>
-
+        <data format="pdf" name="AnnotationGraph" label="${tool.name}_graph" />
+    </outputs>
+    <tests>
+    	<test>
+    		<param name="zip_xlsfile" value="Template_melange.xlsm" ftype="xlsx"/>
+    		<param name="cosy_2dsequences" value="no"/>
+    		<param name="jres_2dsequences" value="yes"/>
+    		<param name="hmbc_2dsequences" value="no"/>
+    		<param name="hsqc_2dsequences" value="yes"/>
+    		<param name="tocsy_2dsequences" value="no"/>
+    		<param name="tocsy_2dsequences" value="no"/>
+    		<param name="inHouse_DB_choices.choice" value="no"/>
+    		<param name="tolppm1" value="0.01"/>
+    		<param name="tolppm2" value="0.5"/>
+    		<param name="tolppmJRES" value="0.002"/>
+    		<param name="threshold" value="0.3"/>
+    		<param name="unicity" value="no"/>
+    		<output name="annotationJRES" file="annotationJres.tabular"/>
+    		<output name="ppmCommunJRES" file="duplicateJres.tabular"/>
+    		<output name="annotationHSQC" file="annotationHsqc.tabular"/>
+    		<output name="ppmCommunHSQC" file="duplicateHsqc.tabular"/>
+    		<output name="annotationCombination" file="2DNMR_Annotation_annotationCombination.tabular"/>
+    	</test>
+	</tests>
 <help>
 
 .. class:: infomark
@@ -226,7 +263,7 @@
 -----------
 
 BARSA is an automatic algorithm for bi-dimensional NMR spectra annotation
- 
+
 -----------------
 Workflow position
 -----------------
@@ -236,7 +273,7 @@
 ========================= ================= ======= =========
 Name                      output file       format  parameter
 ========================= ================= ======= =========
-NA                        NA                NA      NA      
+NA                        NA                NA      NA
 ========================= ================= ======= =========
 
 
@@ -245,7 +282,7 @@
 ========================= ================= ======= =========
 Name                      output file       format  parameter
 ========================= ================= ======= =========
-NA                        NA                NA      NA      
+NA                        NA                NA      NA
 ========================= ================= ======= =========
 
 
@@ -263,13 +300,13 @@
 **Choose your inputs**
     | xlsx file can include several peak lists, coming from several 2D NMR sequences
     |
-	
+
 .. image:: ./static/images/2DNmr_FileToAnnotate_xlsxFormat.png
 
 ----------
 Parameters
 ----------
-	
+
 Bi-dimensional NMR peak list(s) to annotate; select one or more sequence(s)
     | COSY: yes/no
     | JRES: yes/no
@@ -283,14 +320,14 @@
     | Use of your own databases to annotate peak list(s)
     | If YES: parameters **COSY In-house database**, **JRES In-house database**, ** HMBC In-house database**, **HSQC In-house database** and **TOCSY In-house database** are visible
     | Select one or more in-house database
-	|
+    |
 
 
 Tolerances
     | tolppm1: Maximum variation of the chemical shift (due to experimental conditions) of a peak along the x-axis
     | tolppm2: Maximum variation of the chemical shift (due to experimental conditions) of a peak along the y-axis
     | tolppmJRES: Maximum variation of the chemical shift (due to experimental conditions) of a peak for the JRES sequence
-    | Default values: 0.01 and 0.01 ppm; 0.002 Hz 
+    | Default values: 0.01 and 0.01 ppm; 0.002 Hz
     |
 
 
@@ -358,7 +395,7 @@
 AnnotationGraph.pdf
     | pdf output
     | Bi-dimensional graphical chart of real pairs of chemical shifts, with name of identified metabolites
- 
+
 
 
 ---------------------------------------------------
@@ -370,7 +407,10 @@
 
 .. image:: ./static/images/OutputsExampleMix.png
         :width: 500
-		
-   </help>
-    
+
+    </help>
+    <citations>
+        <citation type="doi">10.1093/bioinformatics/btu813</citation>
+    </citations>
+
 </tool>