diff matchms_metadata_export.xml @ 15:48c7b584032a draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/matchms commit 4b8a43b863ff8a0ff1d5a08e516068853adf358d
author recetox
date Tue, 16 Apr 2024 11:26:55 +0000
parents c01868645f1b
children e337075d0aaa
line wrap: on
line diff
--- a/matchms_metadata_export.xml	Wed Mar 13 10:18:57 2024 +0000
+++ b/matchms_metadata_export.xml	Tue Apr 16 11:26:55 2024 +0000
@@ -1,4 +1,4 @@
-<tool id="matchms_metadata_export" name="matchms metadata export" version="@TOOL_VERSION@+galaxy1" profile="21.09">
+<tool id="matchms_metadata_export" name="matchms metadata export" version="@TOOL_VERSION@+galaxy2" profile="21.09">
     <description>extract all metadata from mass spectra file to tabular format</description>
     <macros>
         <import>macros.xml</import>
@@ -18,6 +18,7 @@
 <configfiles>
 <configfile name="matchms_python_cli">
 import matchms
+import pandas as pd
 from matchms.importing import load_from_msp, load_from_mgf
 from matchms.exporting.metadata_export import export_metadata_as_csv
 
@@ -28,6 +29,10 @@
 spectra_list = list(load_from_${input_file.ext}("${input_file}", $harmonize_metadata))
 
 export_metadata_as_csv(spectra_list, "${output_file}")
+
+data = pd.read_csv("${output_file}")
+
+data.to_csv("${output_file}", sep='\t', index=False)
 </configfile>
 </configfiles>
 
@@ -38,19 +43,19 @@
     </inputs>
 
     <outputs>
-        <data label="matchms extract metadata on ${on_string}" name="output_file" format="csv"/>
+        <data label="matchms extract metadata on ${on_string}" name="output_file" format="tsv"/>
     </outputs>
 
     <tests>
         <test>
             <param name="input_file" value="convert/mgf_out.mgf" ftype="mgf"/>
             <param name="harmonize_metadata" value="True"/>
-            <output name="output_file" file="convert/metadata.csv" ftype="csv" compare="sim_size" delta="0"/>
+            <output name="output_file" file="convert/metadata.tsv" ftype="tsv" compare="sim_size" delta="0"/>
         </test>
         <test>
             <param name="input_file" value="similarity/RECETOX_Exposome_pesticides_HR_MS_20220323.msp" ftype="msp"/>
             <param name="harmonize_metadata" value="True"/>
-            <output name="output_file" file="convert/metadata.csv" ftype="csv" compare="sim_size" delta="0"/>
+            <output name="output_file" file="convert/metadata.tsv" ftype="tsv" compare="sim_size" delta="0"/>
         </test>
     </tests>