changeset 10:6950572aae5a draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 6e9568c650259d95b230d1a243e90f73a19564c2"
author galaxyp
date Thu, 24 Sep 2020 09:57:35 +0000
parents 7b5df538705e
children d8503d5dd2ba
files 404-urls.patch fill_ctd.py generate.sh hardcoded_params.json macros_autotest.xml macros_discarded_auto.xml macros_test.xml test-data.sh
diffstat 8 files changed, 105 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/404-urls.patch	Thu Sep 24 09:57:35 2020 +0000
@@ -0,0 +1,65 @@
+diff -ruN ClusterMassTracesByPrecursor.xml ClusterMassTracesByPrecursor.xml
+--- ClusterMassTracesByPrecursor.xml	2020-09-21 17:02:36.060104555 +0200
++++ ClusterMassTracesByPrecursor.xml	2020-09-21 17:00:02.864815223 +0200
+@@ -75,8 +75,6 @@
+     <expand macro="manutest_ClusterMassTracesByPrecursor"/>
+   </tests>
+   <help><![CDATA[Correlate precursor masstraces with fragment ion masstraces in SWATH maps based on their elution profile.
+-
+-
+-For more information, visit http://www.openms.de/documentation/UTILS_ClusterMassTracesByPrecursor.html]]></help>
++]]></help>
+   <expand macro="references"/>
+ </tool>
+diff -ruN ClusterMassTraces.xml ClusterMassTraces.xml
+--- ClusterMassTraces.xml	2020-09-21 17:02:36.060104555 +0200
++++ ClusterMassTraces.xml	2020-09-21 17:00:22.192722036 +0200
+@@ -69,8 +69,6 @@
+     <expand macro="manutest_ClusterMassTraces"/>
+   </tests>
+   <help><![CDATA[Creates pseudo spectra.
+-
+-
+-For more information, visit http://www.openms.de/documentation/UTILS_ClusterMassTraces.html]]></help>
++]]></help>
+   <expand macro="references"/>
+ </tool>
+diff -ruN FeatureFinderSuperHirn.xml FeatureFinderSuperHirn.xml
+--- FeatureFinderSuperHirn.xml	2020-09-21 17:02:36.060104555 +0200
++++ FeatureFinderSuperHirn.xml	2020-09-21 17:00:42.372625907 +0200
+@@ -103,8 +103,6 @@
+     <expand macro="manutest_FeatureFinderSuperHirn"/>
+   </tests>
+   <help><![CDATA[Finds mass spectrometric features in mass spectra.
+-
+-
+-For more information, visit http://www.openms.de/documentation/TOPP_FeatureFinderSuperHirn.html]]></help>
++]]></help>
+   <expand macro="references"/>
+ </tool>
+diff -ruN MSFraggerAdapter.xml MSFraggerAdapter.xml
+--- MSFraggerAdapter.xml	2020-09-21 17:02:36.060104555 +0200
++++ MSFraggerAdapter.xml	2020-09-21 17:01:04.892519985 +0200
+@@ -250,8 +250,6 @@
+     <expand macro="manutest_MSFraggerAdapter"/>
+   </tests>
+   <help><![CDATA[Peptide Identification with MSFragger
+-
+-
+-For more information, visit http://www.openms.de/documentation/UTILS_MSFraggerAdapter.html]]></help>
++]]></help>
+   <expand macro="references"/>
+ </tool>
+diff -ruN SimpleSearchEngine.xml SimpleSearchEngine.xml
+--- SimpleSearchEngine.xml	2020-09-21 17:02:36.060104555 +0200
++++ SimpleSearchEngine.xml	2020-09-21 17:01:33.020389600 +0200
+@@ -5373,8 +5373,6 @@
+     <expand macro="manutest_SimpleSearchEngine"/>
+   </tests>
+   <help><![CDATA[Annotates MS/MS spectra using SimpleSearchEngine.
+-
+-
+-For more information, visit http://www.openms.de/documentation/UTILS_SimpleSearchEngine.html]]></help>
++]]></help>
+   <expand macro="references"/>
+ </tool>
--- a/fill_ctd.py	Thu Sep 03 16:24:57 2020 +0000
+++ b/fill_ctd.py	Thu Sep 24 09:57:35 2020 +0000
@@ -150,6 +150,8 @@
 
 # transform values from json that correspond to
 # - old style booleans (string + restrictions) -> transformed to a str
+# - new style booleans that get a string (happens for hidden parameters [-test])
+#   are transformed to a bool
 # - unrestricted ITEMLIST which are represented as strings
 #   ("=quoted and space separated) in Galaxy -> transform to lists
 # - optional data input parameters that have defaults and for which no
@@ -164,7 +166,7 @@
     except KeyError:
         # few tools use dashes in parameters which are automatically replaced
         # by underscores by Galaxy. in these cases the dictionary needs to be
-        # updated
+        # updated (better: then dash and the underscore variant are in the dict)
         # TODO might be removed later https://github.com/OpenMS/OpenMS/pull/4529
         try:
             lineage = [_.replace("-", "_") for _ in p.get_lineage(name_only=True)]
@@ -172,12 +174,16 @@
         except KeyError:
             continue
         else:
-            setInDict(args, lineage, val)
+            setInDict(args, p.get_lineage(name_only=True), val)
 
     if p.type is str and type(p.restrictions) is _Choices and set(p.restrictions.choices) == set(["true", "false"]):
         v = getFromDict(args, p.get_lineage(name_only=True))
         setInDict(args, p.get_lineage(name_only=True), str(v).lower())
-
+    elif p.type is bool:
+        v = getFromDict(args, p.get_lineage(name_only=True))
+        if isinstance(v, str):
+            v = (v.lower() == "true")
+            setInDict(args, p.get_lineage(name_only=True), v)
     elif p.is_list and (p.restrictions is None or type(p.restrictions) is _NumericRange):
         v = getFromDict(args, p.get_lineage(name_only=True))
         if type(v) is str:
--- a/generate.sh	Thu Sep 03 16:24:57 2020 +0000
+++ b/generate.sh	Thu Sep 24 09:57:35 2020 +0000
@@ -67,6 +67,7 @@
 
 patch PepNovoAdapter.xml < PepNovoAdapter.patch
 patch OMSSAAdapter.xml < OMSSAAdapter.patch
+patch -p0 <404-urls.patch
 
 # #-b version log debug test in_type executable pepnovo_executable param_model_directory rt_concat_trafo_out param_id_pool
 
--- a/hardcoded_params.json	Thu Sep 03 16:24:57 2020 +0000
+++ b/hardcoded_params.json	Thu Sep 24 09:57:35 2020 +0000
@@ -164,7 +164,7 @@
 		"tools": ["PhosphoScoring"]	
 	}, {
 		"CTD:type": "output-prefix", 
-		"CTD:required": "true",
+		"CTD:required": true,
 		"CTD:restrictions": "mzml",
 		"tools": ["MzMLSplitter"]
 	}, {
@@ -234,13 +234,14 @@
 	"#": "output-prefix",
 	"out_path": [{
 		"CTD:type": "output-prefix", 
-		"CTD:required": "true",
+		"CTD:required": true,
 		"CTD:restrictions": "idXML",
 		"tools": ["IDRipper"]
 	}],
 	"outputDirectory": [{
 		"CTD:type": "output-prefix", 
-		"CTD:required": "true",
+		"CTD:advanced": false,
+		"CTD:required": true,
 		"CTD:restrictions": "mzml",
 		"tools": ["OpenSwathFileSplitter"]
 	}]
--- a/macros_autotest.xml	Thu Sep 03 16:24:57 2020 +0000
+++ b/macros_autotest.xml	Thu Sep 24 09:57:35 2020 +0000
@@ -1475,6 +1475,8 @@
   </xml>
   <xml name="autotest_DeMeanderize">
 </xml>
+  <xml name="autotest_Digestor">
+</xml>
   <xml name="autotest_DTAExtractor">
     <test expect_num_outputs="1">
       <conditional name="adv_opts_cond">
@@ -26315,4 +26317,4 @@
       </output>
     </test>
   </xml>
-<xml name="autotest_IDDecoyProbability"/><xml name="autotest_PTPredict"/><xml name="autotest_OpenSwathDIAPreScoring"/><xml name="autotest_Digestor"/><xml name="autotest_InclusionExclusionListCreator"/><xml name="autotest_InspectAdapter"/><xml name="autotest_DigestorMotif"/><xml name="autotest_RTPredict"/><xml name="autotest_ProteomicsLFQ"/></macros>
+<xml name="autotest_InspectAdapter"/><xml name="autotest_ProteomicsLFQ"/><xml name="autotest_InclusionExclusionListCreator"/><xml name="autotest_IDDecoyProbability"/><xml name="autotest_RTPredict"/><xml name="autotest_OpenSwathDIAPreScoring"/><xml name="autotest_DigestorMotif"/><xml name="autotest_PTPredict"/></macros>
--- a/macros_discarded_auto.xml	Thu Sep 03 16:24:57 2020 +0000
+++ b/macros_discarded_auto.xml	Thu Sep 24 09:57:35 2020 +0000
@@ -7,7 +7,7 @@
     <param name="test" value="true"/>
   </conditional>
   <param name="in" value="OpenSwathWorkflow_1_input.mzML"/>
-  <output_collection name="adv_opts_cond.outputDirectory" count=""/>
+  <output_collection name="outputDirectory" count=""/>
   <output name="out_qc" file="OpenSwathFileSplitter_1.json" compare="sim_size" delta="5700" ftype="json"/>
   <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG,out_qc_FLAG"/>
   <output name="ctd_out" ftype="xml">
--- a/macros_test.xml	Thu Sep 03 16:24:57 2020 +0000
+++ b/macros_test.xml	Thu Sep 24 09:57:35 2020 +0000
@@ -293,7 +293,7 @@
   </conditional>
   <param name="in" value="OpenSwathWorkflow_1_input.mzML"/>
   <param name="OPTIONAL_OUTPUTS" value="out_qc_FLAG,ctd_out_FLAG"/>
-  <output_collection name="adv_opts_cond.outputDirectory" count="6">
+  <output_collection name="outputDirectory" count="6">
     <element name="OpenSwathWorkflow_1_input_mzML_4" file="openswath_tmpfile_4.mzML" ftype="mzml"/>
     <element name="OpenSwathWorkflow_1_input_mzML_ms1" file="openswath_tmpfile_ms1.mzML" ftype="mzml"/>
   </output_collection>
--- a/test-data.sh	Thu Sep 03 16:24:57 2020 +0000
+++ b/test-data.sh	Thu Sep 24 09:57:35 2020 +0000
@@ -18,6 +18,11 @@
 export OPENMSENV="$tmp/OpenMS$VERSION-env"
 export CTDCONVERTER="$tmp/CTDConverter"
 
+if [[ -z "$1" ]]; then
+	autotests="/dev/null"
+else
+	autotests="$1"
+fi
 
 if type conda > /dev/null; then  
 	true
@@ -28,11 +33,6 @@
 fi
 eval "$(conda shell.bash hook)"
 
-if [[ -z "$1" ]]; then
-	autotests="/dev/null"
-else
-	autotests="$1"
-fi
 
 ###############################################################################
 ## get 
@@ -88,7 +88,7 @@
 	git pull origin topic/cdata
 	cd -
 fi
-export PYTHONPATH=$(pwd)/CTDopts
+# export PYTHONPATH=$(pwd)/CTDopts
 
 ###############################################################################
 ## copy all the test data files to test-data
@@ -96,6 +96,8 @@
 ## prepare_test_data
 ###############################################################################
 echo "Get test data"
+find test-data -type f,l,d ! -name "*fa"  ! -name "*loc" -delete
+
 cp $(find $OPENMSGIT/src/tests/topp/ -type f | grep -Ev "third_party_tests.cmake|CMakeLists.txt|check_ini") test-data/
 cp -r $OPENMSGIT/share/OpenMS/MAPPING/ test-data/
 cp -r $OPENMSGIT/share/OpenMS/CHEMISTRY test-data/
@@ -211,20 +213,17 @@
 cd - || exit
 
 
-# # # exit
-
 ###############################################################################
 ## auto generate tests
 ###############################################################################
-
-echo "Write test macros to "$autotests
-echo "<macros>" > $autotests
+echo "Write test macros to $autotests"
+echo "<macros>" > "$autotests"
 for i in $(ls *xml |grep -v macros)
 do
 	b=$(basename "$i" .xml)
-	get_tests2 "$b" >> $autotests 
+	get_tests2 "$b" >> "$autotests"
 done
-echo "</macros>" >> $autotests
+echo "</macros>" >> "$autotests"
 
 echo "Create test data links"
 link_tmp_files
@@ -232,9 +231,16 @@
 # tests for tools using output_prefix parameters can not be auto generated
 # hence we output the tests for manual curation in macros_test.xml
 # and remove them from the autotests
+# -> OpenSwathFileSplitter IDRipper MzMLSplitter
+#
+# Furthermore we remove tests for tools without binaries in conda
+# -> MSFragger MaRaClusterAdapter NovorAdapter 
+#
+# not able to specify composite test data  
+# -> SpectraSTSearchAdapter 
 if [[ ! -z "$1" ]]; then
 	echo "" > macros_discarded_auto.xml
-	for i in OpenSwathFileSplitter IDRipper MzMLSplitter
+	for i in OpenSwathFileSplitter IDRipper MzMLSplitter MSFraggerAdapter MaRaClusterAdapter NovorAdapter SpectraSTSearchAdapter
 	do
 		echo "<xml name=\"manutest_$i\">" >>  macros_discarded_auto.xml
 		xmlstarlet sel -t -c "/macros/xml[@name='autotest_$i']/test" macros_autotest.xml >>  macros_discarded_auto.xml
@@ -242,7 +248,7 @@
 		xmlstarlet ed -d "/macros/xml[@name='autotest_$i']/test" macros_autotest.xml > tmp
 		mv tmp macros_autotest.xml
 	done
-	>&2 "discarded autogenerated macros for curation in macros_discarded_auto.xml"
+	>&2 echo "discarded autogenerated macros for curation in macros_discarded_auto.xml"
 fi
 conda deactivate