diff tools/attributes/SetIds/SetIds.xml @ 9:0976a6257300 draft

planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy commit 05db35f63cadb9d56dafff594a3507c59cd85273
author metexplore
date Fri, 31 Jan 2025 18:28:53 +0000
parents
children 6a112eaf8f38
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/attributes/SetIds/SetIds.xml	Fri Jan 31 18:28:53 2025 +0000
@@ -0,0 +1,453 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<tool id="met4j_SetIds" name="SetIds" version="develop">
+  <description>Set new ids to network objects in a SBML file from a tabulated file containing the old ids and the new ids</description>
+  <xrefs>
+    <xref type="bio.tools">met4j</xref>
+  </xrefs>
+  <requirements>
+    <container type="singularity">oras://registry.forgemia.inra.fr/metexplore/met4j/met4j-singularity:develop</container>
+  </requirements>
+  <command detect_errors="exit_code"><![CDATA[sh /usr/bin/met4j.sh attributes.SetIds#if str($colname) != 'nan':
+ -cnew "$colname"
+#end if
+#if str($colid):
+ -ci "$colid"
+#end if
+ $p
+ $s
+#if str($o):
+ -t "$o"
+#end if
+#if str($nSkip):
+ -n "$nSkip"
+#end if
+ -i "$sbml"
+#if str($tab) != 'None':
+ -tab "$tab"
+#end if
+#if str($c):
+ -c "$c"
+#end if
+ -o "$out"
+]]></command>
+  <inputs>
+    <param argument="-cnew" label="[2] number of the column where are the new ids" name="colname" optional="true" type="integer" value="2"/>
+    <param argument="-ci" label="[1] number of the column where are the object ids" name="colid" optional="true" type="text" value="1">
+      <sanitizer invalid_char="_">
+        <valid initial="string.printable"/>
+      </sanitizer>
+    </param>
+    <param argument="-p" checked="false" falsevalue="" label="[deactivated] To match the objects in the sbml file, adds the prefix R_ to reactions and M_ to metabolites" name="p" truevalue="-p" type="boolean" value="false"/>
+    <param argument="-s" checked="false" falsevalue="" label="[deactivated] To match the objects in the sbml file, adds the suffix _comparmentID to metabolites" name="s" truevalue="-s" type="boolean" value="false"/>
+    <param argument="-t" label="[REACTION] Object type in the column id : REACTION;METABOLITE;GENE;PATHWAY" name="o" optional="true" type="text" value="REACTION">
+      <sanitizer invalid_char="_">
+        <valid initial="string.printable"/>
+      </sanitizer>
+    </param>
+    <param argument="-n" label="[0] Number of lines to skip at the beginning of the tabulated file" name="nSkip" optional="true" type="text" value="0">
+      <sanitizer invalid_char="_">
+        <valid initial="string.printable"/>
+      </sanitizer>
+    </param>
+    <param argument="-i" format="sbml" label="Original SBML file" name="sbml" optional="false" type="data" value=""/>
+    <param argument="-tab" format="tsv" label="Input Tabulated file" name="tab" optional="true" type="data" value=""/>
+    <param argument="-c" label="[#] Comment String in the tabulated file. The lines beginning by this string won't be read" name="c" optional="true" type="text" value="#">
+      <sanitizer invalid_char="_">
+        <valid initial="string.printable"/>
+      </sanitizer>
+    </param>
+  </inputs>
+  <outputs>
+    <data format="sbml" name="out"/>
+  </outputs>
+  <tests>
+    <test>
+                                    			
+      
+      
+      
+      
+      
+      <param name="sbml" value="toy_model.xml"/>
+                                    			
+      
+      
+      
+      
+      
+      <param name="tab" value="idMetabolites.tsv"/>
+                                    			
+      
+      
+      
+      
+      
+      <param name="o" value="METABOLITE"/>
+                                    			
+      
+      
+      
+      
+      
+      <output ftype="sbml" name="out">
+                                                				
+        
+        
+        
+        
+        
+        <assert_contents>
+                                                            					
+          
+          
+          
+          
+          
+          <is_valid_xml/>
+                                                            					
+          
+          
+          
+          
+          
+          <has_line_matching expression=".*id=.metaboliteA.*" n="1"/>
+                                                            					
+          
+          
+          
+          
+          
+          <has_line_matching expression=".*id=.metaboliteB.*" n="1"/>
+                                                            				
+        
+        
+        
+        
+        
+        </assert_contents>
+                                                			
+      
+      
+      
+      
+      
+      </output>
+                                    		
+    
+    
+    
+    
+    
+    </test>
+    <test>
+                                    			
+      
+      
+      
+      
+      
+      <param name="sbml" value="toy_model.xml"/>
+                                    			
+      
+      
+      
+      
+      
+      <param name="tab" value="idReactions.tsv"/>
+                                    			
+      
+      
+      
+      
+      
+      <output ftype="sbml" name="out">
+                                                				
+        
+        
+        
+        
+        
+        <assert_contents>
+                                                            					
+          
+          
+          
+          
+          
+          <is_valid_xml/>
+                                                            					
+          
+          
+          
+          
+          
+          <has_line_matching expression=".*id=.reaction1.*" n="1"/>
+                                                            					
+          
+          
+          
+          
+          
+          <has_line_matching expression=".*id=.reaction2.*" n="1"/>
+                                                            				
+        
+        
+        
+        
+        
+        </assert_contents>
+                                                			
+      
+      
+      
+      
+      
+      </output>
+                                    		
+    
+    
+    
+    
+    
+    </test>
+    <test>
+                                    			
+      
+      
+      
+      
+      
+      <param name="sbml" value="XF_network.sbml"/>
+                                    			
+      
+      
+      
+      
+      
+      <param name="tab" value="idPathways.tsv"/>
+                                    			
+      
+      
+      
+      
+      
+      <param name="o" value="PATHWAY"/>
+                                    			
+      
+      
+      
+      
+      
+      <output ftype="sbml" name="out">
+                                                				
+        
+        
+        
+        
+        
+        <assert_contents>
+                                                            					
+          
+          
+          
+          
+          
+          <is_valid_xml/>
+                                                            					
+          
+          
+          
+          
+          
+          <has_line_matching expression=".*groups:id=.CEB.*" n="1"/>
+                                                            					
+          
+          
+          
+          
+          
+          <has_line_matching expression=".*groups:id=.NSP.*" n="1"/>
+                                                            				
+        
+        
+        
+        
+        
+        </assert_contents>
+                                                			
+      
+      
+      
+      
+      
+      </output>
+                                    		
+    
+    
+    
+    
+    
+    </test>
+    <test>
+                                    			
+      
+      
+      
+      
+      
+      <param name="sbml" value="XF_network.sbml"/>
+                                    			
+      
+      
+      
+      
+      
+      <param name="tab" value="idGenes.tsv"/>
+                                    			
+      
+      
+      
+      
+      
+      <param name="o" value="GENE"/>
+                                    			
+      
+      
+      
+      
+      
+      <output ftype="sbml" name="out">
+                                                				
+        
+        
+        
+        
+        
+        <assert_contents>
+                                                            					
+          
+          
+          
+          
+          
+          <is_valid_xml/>
+                                                            					
+          
+          
+          
+          
+          
+          <has_line_matching expression=".*fbc:id=.G1.*" n="1"/>
+                                                            					
+          
+          
+          
+          
+          
+          <has_line_matching expression=".*fbc:id=.G2.*" n="1"/>
+                                                            				
+        
+        
+        
+        
+        
+        </assert_contents>
+                                                			
+      
+      
+      
+      
+      
+      </output>
+                                    		
+    
+    
+    
+    
+    
+    </test>
+    <test>
+                                    			
+      
+      
+      
+      
+      
+      <param name="sbml" value="XF_network.sbml"/>
+                                    			
+      
+      
+      
+      
+      
+      <param name="tab" value="idCompartments.tsv"/>
+                                    			
+      
+      
+      
+      
+      
+      <param name="o" value="COMPARTMENT"/>
+                                    			
+      
+      
+      
+      
+      
+      <output ftype="sbml" name="out">
+                                                				
+        
+        
+        
+        
+        
+        <assert_contents>
+                                                            					
+          
+          
+          
+          
+          
+          <is_valid_xml/>
+                                                            					
+          
+          
+          
+          
+          
+          <has_line_matching expression=".*id=.cytosol.*" n="1"/>
+                                                            					
+          
+          
+          
+          
+          
+          <has_line_matching expression=".*id=.extra.*" n="1"/>
+                                                            				
+        
+        
+        
+        
+        
+        </assert_contents>
+                                                			
+      
+      
+      
+      
+      
+      </output>
+                                    		
+    
+    
+    
+    
+    
+    </test>
+  </tests>
+  <help><![CDATA[Set new ids to network objects in a SBML file from a tabulated file containing the old ids and the new ids
+The ids must correspond between the tabulated file and the SBML file.
+If prefix or suffix is different in the SBML file, use the -p or the -s options.
+]]></help>
+  <citations/>
+</tool>