Previous changeset 4:cb0f5beef55f (2022-12-01) |
Commit message:
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 5c080b1e2b99f1c88f4557e9fec8c45c9d23b906 |
modified:
RNAMassCalculator.xml macros.xml prepare_test_data_manual.sh readme.md test-data.sh |
added:
get_tests.py |
removed:
fill_ctd_clargs.py generate-foo.sh |
b |
diff -r cb0f5beef55f -r 148c000ea2ec RNAMassCalculator.xml --- a/RNAMassCalculator.xml Thu Dec 01 19:20:12 2022 +0000 +++ b/RNAMassCalculator.xml Fri Jun 14 21:33:05 2024 +0000 |
[ |
@@ -1,6 +1,5 @@ -<?xml version='1.0' encoding='UTF-8'?> <!--This is a configuration file for the integration of a tools into Galaxy (https://galaxyproject.org/). This file was automatically generated using CTDConverter.--> -<!--Proposed Tool Section: [Utilities]--> +<!--Proposed Tool Section: [RNA]--> <tool id="RNAMassCalculator" name="RNAMassCalculator" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05"> <description>Calculates masses, mass-to-charge ratios and sum formulas of RNA sequences</description> <macros> @@ -16,7 +15,7 @@ ## Preprocessing #if $in: mkdir in && - ln -s '$in' 'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)' && + cp '$in' 'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)' && #end if #if "out_FLAG" in str($OPTIONAL_OUTPUTS).split(',') mkdir out && @@ -57,10 +56,10 @@ <expand macro="list_string_val" name="in_seq"/> <expand macro="list_string_san" name="in_seq"/> </param> - <param argument="-charge" type="text" optional="true" value="0" label="List of charge states; required if 'in_seq' is given" help=" (space separated list, in order to allow for spaces in list items surround them by single quotes)"> + <param argument="-charge" type="text" value="0" label="List of charge states; required if 'in_seq' is given" help=" (space separated list, in order to allow for spaces in list items surround them by single quotes)"> <expand macro="list_integer_valsan" name="charge"/> </param> - <param argument="-format" type="select" optional="true" label="Output format ('list': human-readable list, 'table': CSV-like table, 'mass_only': mass values only, 'mz_only': m/z values only, 'formula_only': sum formula only)" help=""> + <param argument="-format" type="select" label="Output format ('list': human-readable list, 'table': CSV-like table, 'mass_only': mass values only, 'mz_only': m/z values only, 'formula_only': sum formula only)" help=""> <option value="list" selected="true">list</option> <option value="table">table</option> <option value="mass_only">mass_only</option> @@ -69,7 +68,7 @@ <expand macro="list_string_san" name="format"/> </param> <param argument="-average_mass" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Compute average (instead of monoisotopic) oligonucleotide masses" help=""/> - <param argument="-fragment_type" type="select" optional="true" label="For what type of sequence/fragment the mass should be computed" help=""> + <param argument="-fragment_type" type="select" label="For what type of sequence/fragment the mass should be computed" help=""> <option value="full" selected="true">full</option> <option value="internal">internal</option> <option value="5-prime">5-prime</option> @@ -90,7 +89,7 @@ </param> <expand macro="adv_opts_macro"> <param argument="-force" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Overrides tool-specific checks" help=""/> - <param argument="-test" type="hidden" optional="true" value="False" label="Enables the test mode (needed for internal use only)" help=""> + <param argument="-test" type="hidden" value="False" label="Enables the test mode (needed for internal use only)" help="" optional="true"> <expand macro="list_string_san" name="test"/> </param> </expand> @@ -110,14 +109,15 @@ <filter>OPTIONAL_OUTPUTS is not None and "ctd_out_FLAG" in OPTIONAL_OUTPUTS</filter> </data> </outputs> - <tests><!-- UTILS_RNAMassCalculator_1 --> + <tests> + <!-- TOPP_RNAMassCalculator_1 --> <test expect_num_outputs="2"> <section name="adv_opts"> <param name="force" value="false"/> <param name="test" value="true"/> </section> <param name="in_seq" value=""AUCGGC""/> - <output name="out" file="RNAMassCalculator_1.txt" compare="sim_size" delta_frac="0.7" ftype="txt"/> + <output name="out" value="RNAMassCalculator_1.txt" compare="sim_size" delta_frac="0.7" ftype="txt"/> <param name="charge" value="-1 -2"/> <param name="format" value="list"/> <param name="average_mass" value="false"/> @@ -129,11 +129,14 @@ <is_valid_xml/> </assert_contents> </output> + <assert_stdout> + <has_text_matching expression="@EXECUTABLE@ took .* \(wall\), .* \(CPU\), .* \(system\), .* \(user\)(; Peak Memory Usage: 32 MB)?."/> + </assert_stdout> </test> </tests> <help><![CDATA[Calculates masses, mass-to-charge ratios and sum formulas of RNA sequences -For more information, visit http://www.openms.de/doxygen/release/2.8.0/html/UTILS_RNAMassCalculator.html]]></help> +For more information, visit https://openms.de/doxygen/release/3.1.0/html/TOPP_RNAMassCalculator.html]]></help> <expand macro="references"/> </tool> |
b |
diff -r cb0f5beef55f -r 148c000ea2ec fill_ctd_clargs.py --- a/fill_ctd_clargs.py Thu Dec 01 19:20:12 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,70 +0,0 @@ -#!/usr/bin/env python3 - -import operator -from argparse import ArgumentParser -from functools import reduce # forward compatibility for Python 3 -from io import StringIO - -from CTDopts.CTDopts import ( - _Null, - CTDModel, - ModelTypeError, - Parameters -) - - -def getFromDict(dataDict, mapList): - return reduce(operator.getitem, mapList, dataDict) - - -def setInDict(dataDict, mapList, value): - getFromDict(dataDict, mapList[:-1])[mapList[-1]] = value - - -if __name__ == "__main__": - # note add_help=False since otherwise arguments starting with -h will - # trigger an error (despite allow_abbreviate) - parser = ArgumentParser(prog="fill_ctd_clargs", - description="fill command line arguments" - "into a CTD file and write the CTD file to stdout", - add_help=False, allow_abbrev=False) - parser.add_argument("--ini_file", dest="ini_file", help="input ini file", - metavar='INI', default=None, required=True) - parser.add_argument("--ctd_file", dest="ctd_file", help="input ctd file" - "if given then optional parameters from the ini file" - "will be filled with the defaults from this CTD file", - metavar='CTD', default=None, required=False) - args, cliargs = parser.parse_known_args() - - # load CTDModel - ini_model = None - try: - ini_model = CTDModel(from_file=args.ini_file) - except ModelTypeError: - pass - try: - ini_model = Parameters(from_file=args.ini_file) - except ModelTypeError: - pass - assert ini_model is not None, "Could not parse %s, seems to be no CTD/PARAMS" % (args.ini_file) - - # get a dictionary of the ctd arguments where the values of the parameters - # given on the command line are overwritten - ini_values = ini_model.parse_cl_args(cl_args=cliargs, ignore_required=True) - - if args.ctd_file: - ctd_model = CTDModel(from_file=args.ctd_file) - ctd_values = ctd_model.get_defaults() - for param in ini_model.get_parameters(): - if not param.required and (param.default is None or type(param.default) is _Null): - lineage = param.get_lineage(name_only=True) - try: - default = getFromDict(ctd_values, lineage) - except KeyError: - continue - setInDict(ini_values, lineage, default) - - # write the ctd with the values taken from the dictionary - out = StringIO() - ctd_tree = ini_model.write_ctd(out, ini_values) - print(out.getvalue()) |
b |
diff -r cb0f5beef55f -r 148c000ea2ec generate-foo.sh --- a/generate-foo.sh Thu Dec 01 19:20:12 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,215 +0,0 @@\n-#!/usr/bin/env bash\n-\n-# parse test definitions from OpenMS sources for a tool with a given id\n-function get_tests2 {\n- id=$1\n- >&2 echo "generate tests for $id"\n- echo \'<xml name="autotest_\'"$id"\'">\'\n-\n- # get the tests from the CMakeLists.txt\n- # 1st remove some tests\n- # - OpenSwathMzMLFileCacher with -convert_back argument https://github.com/OpenMS/OpenMS/issues/4399\n- # - IDRipper PATH gets empty causing problems. TODO But overall the option needs to be handled differentlt\n- # - several tools with duplicated input (leads to conflict when linking)\n- # - MaRaCluster with -consensus_out (parameter blacklister: https://github.com/OpenMS/OpenMS/issues/4456)\n- # - FileMerger with mixed dta dta2d input (ftype can not be specified in the test, dta can not be sniffed)\n- # - some input files are originally in a subdir (degenerated cases/), but not in test-data\n- # - OpenSwathAnalyzer 9/10: cachedMzML (not supported yet)\n- # - SiriusAdapter_4 depends on online service which may timeout .. so keep disabled https://github.com/OpenMS/OpenMS/pull/5010\n- # - SiriusAdapter_10 should work in >2.8 https://github.com/OpenMS/OpenMS/issues/5869\n- CMAKE=$(cat $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake |\n- sed \'s@${DATA_DIR_SHARE}/@@g\' |\n- grep -v \'OpenSwathMzMLFileCacher .*-convert_back\' |\n- sed \'s/${TMP_RIP_PATH}/""/\' |\n- grep -v "MaRaClusterAdapter.*-consensus_out"|\n- grep -v "FileMerger_1_input1.dta2d.*FileMerger_1_input2.dta " |\n- sed \'s@degenerate_cases/@@g\' |\n- egrep -v \'TOPP_OpenSwathAnalyzer_test_3"|TOPP_OpenSwathAnalyzer_test_4"\' |\n- sed \'s/\\("TOPP_SiriusAdapter_4".*\\)-sirius:database all\\(.*\\)/\\1-sirius:database pubchem\\2/\' |\n- grep -v \'"TOPP_SiriusAdapter_10"\')\n-\n- # 1st part is a dirty hack to join lines containing a single function call, e.g.\n- # addtest(....\n- # ....)\n- echo "$CMAKE" | sed \'s/#.*//; s/^\\s*//; s/\\s*$//\' | grep -v "^#" | grep -v "^$" | awk \'{printf("%s@NEWLINE@", $0)}\' | sed \'s/)@NEWLINE@/)\\n/g\' | sed \'s/@NEWLINE@/ /g\' | \n- grep -iE "add_test\\(\\"(TOPP|UTILS)_.*/$id " | egrep -v "_prepare\\"|_convert|WRITEINI|WRITECTD|INVALIDVALUE" | while read -r line\n- do\n- line=$(echo "$line" | sed \'s/add_test("\\([^"]\\+\\)"/\\1/; s/)$//; s/\\${TOPP_BIN_PATH}\\///g;s/\\${DATA_DIR_TOPP}\\///g; s#THIRDPARTY/##g\')\n- # >&2 echo $line\n- test_id=$(echo "$line" | cut -d" " -f 1)\n- tool_id=$(echo "$line" | cut -d" " -f 2)\n- # >&2 echo "test_id $test_id"\n- if [[ $test_id =~ _out_?[0-9]? ]]; then\n- >&2 echo " skip $test_id $line"\n- continue\n- fi\n- if [[ ${id,,} != ${tool_id,,} ]]; then\n- >&2 echo " skip $test_id ($id != $tool_id) $line"\n- continue\n- fi\n-\n- #remove tests with set_tests_properties(....PROPERTIES WILL_FAIL 1)\n- if grep -lq "$test_id"\'\\".* PROPERTIES WILL_FAIL 1\' $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake; then\n- >&2 echo " skip failing "$test_id\n- continue\n- fi\n- tes=" <test>\\n"\n- line=$(fix_tmp_files "$line")\n- line=$(unique_files "$line")\n- # >&2 echo LINE $line\n- #if there is an ini file then we use this to generate the test\n- #otherwise the ctd file is used\n- #other command line parameters are inserted later into this xml\n- if grep -lq "\\-ini" <<<"$line"; then\n- ini=$(echo $line | sed \'s/.*-ini \\([^ ]\\+\\).*/\\1/\')\n- ini="test-data/$ini"\n- else\n- ini="ctd/$tool_id.ctd"\n- fi\n- # >&2 echo "========================================================"\n- # >&2 echo "USING ini $ini"\n- cli=$(echo $line |cut -d" " -f3- | sed \'s/-ini [^ ]\\+//\')\n-\n- ctdtmp=$(mktemp)\n- # using eva'..b'/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake | awk \'{printf("%s@NEWLINE@", $0)}\' | sed \'s/)@NEWLINE@/)\\n/g\' | sed \'s/@NEWLINE@/ /g\' | grep \'\\${DIFF}.*\'"$a")\n- # >&2 echo " diff_line "$diff_line\n- in1=$(sed \'s/.*-in1 \\([^ ]\\+\\).*/\\1/\' <<<$diff_line)\n- # >&2 echo " in1 "$in1\n- if [[ "$a" != "$in1" ]]; then\n- ret="$ret $a"\n- continue\n- fi\n- in2=$(sed \'s/.*-in2 \\([^ ]\\+\\).*/\\1/\' <<<$diff_line)\n- in2=$(basename $in2 | sed \'s/)$//\')\n- # >&2 echo " in2 "$in2\n- if [[ -f "test-data/$in2" ]]; then\n- ln -fs "$in1" "test-data/$in2"\n- ret="$ret $in2"\n- else\n- ret="$ret $a"\n- fi\n- done\n-# >&2 echo "--> $ret"\n- echo "$ret"\n-}\n-\n-function link_tmp_files {\n- # note this also considers commented lines (starting with a #)\n- # because of tests where the diff command is commented and we\n- # still want to use the extension of these files\n- cat $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake | sed \'s/^\\s*//; s/\\s*$//\' | grep -v "^$" | awk \'{printf("%s@NEWLINE@", $0)}\' | sed \'s/)@NEWLINE@/)\\n/g\' | sed \'s/@NEWLINE@/ /g\' | grep "\\${DIFF}" | while read -r line\n- do\n- in1=$(sed \'s/.*-in1 \\([^ ]\\+\\).*/\\1/\' <<<$line)\n- in1=$(basename $in1 | sed \'s/)$//\')\n- in2=$(sed \'s/.*-in2 \\([^ ]\\+\\).*/\\1/\' <<<$line)\n- in2=$(basename $in2 | sed \'s/)$//\')\n- if [[ "$in1" == "$in2" ]]; then\n- >&2 echo "not linking equal $in1 $in2"\n- continue\n- fi\n- ln -f -s $in1 test-data/$in2\n- done\n- \n- find test-data/ -name "*.tmp" -print0 | \n- while IFS= read -r -d \'\' i; do \n- if [ ! -e test-data/$(basename $i .tmp) ]; then\n- ln -s $(basename $i) test-data/$(basename $i .tmp)\n- else\n- ln -fs $(basename $i) test-data/$(basename $i .tmp)\n- fi\n- done\n-}\n-\n-\n-\n-# parse data preparation calls from OpenMS sources for a tool with a given id\n-function prepare_test_data {\n-# id=$1\n-# | egrep -i "$id\\_.*[0-9]+(_prepare\\"|_convert)?"\n-\n- # TODO SiriusAdapter depends on online service which may timeout .. so keep disabled https://github.com/OpenMS/OpenMS/pull/5010\n- cat $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake | sed \'s/#.*$//\'| sed \'s/^\\s*//; s/\\s*$//\' | grep -v "^$" | awk \'{printf("%s@NEWLINE@", $0)}\' | sed \'s/)@NEWLINE@/)\\n/g\' | sed \'s/@NEWLINE@/ /g\' | \n- sed \'s/degenerate_cases\\///\' | \n- egrep -v "WRITEINI|WRITECTD|INVALIDVALUE|DIFF" | \n- grep add_test | \n- egrep "TOPP|UTILS" |\n- sed \'s@${DATA_DIR_SHARE}/@@g;\'|\n- sed \'s@${TMP_RIP_PATH}@./@g\'|\n- sed \'s@TOFCalibration_ref_masses @TOFCalibration_ref_masses.txt @g; s@TOFCalibration_const @TOFCalibration_const.csv @\'| \n-\tsed \'s/\\("TOPP_SiriusAdapter_4".*\\)-sirius:database all\\(.*\\)/\\1-sirius:database pubchem\\2/\' |\n- while read line\n- do\n- test_id=$(echo "$line" | sed \'s/add_test(//; s/"//g; s/)[^)]*$//; s/\\${TOPP_BIN_PATH}\\///g;s/\\${DATA_DIR_TOPP}\\///g; s#THIRDPARTY/##g\' | cut -d" " -f1)\n-\n- if grep -lq "$test_id"\'\\".* PROPERTIES WILL_FAIL 1\' $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake; then\n- >&2 echo " skip failing "$test_id\n- continue\n- fi\n-\n- line=$(echo "$line" | sed \'s/add_test("//; s/)[^)]*$//; s/\\${TOPP_BIN_PATH}\\///g;s/\\${DATA_DIR_TOPP}\\///g; s#THIRDPARTY/##g\' | cut -d" " -f2-)\n- # line="$(fix_tmp_files $line)"\n- echo \'echo executing "\'$test_id\'"\'\n-\techo "$line > $test_id.stdout 2> $test_id.stderr"\n- echo "if [[ \\"\\$?\\" -ne \\"0\\" ]]; then >&2 echo \'$test_id failed\'; >&2 echo -e \\"stderr:\\n\\$(cat $test_id.stderr | sed \'s/^/ /\')\\"; echo -e \\"stdout:\\n\\$(cat $test_id.stdout)\\";fi" \n- done\n-}\n' |
b |
diff -r cb0f5beef55f -r 148c000ea2ec get_tests.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get_tests.py Fri Jun 14 21:33:05 2024 +0000 |
[ |
b'@@ -0,0 +1,344 @@\n+#!/usr/bin/env python\n+\n+import argparse\n+import os.path\n+import re\n+import shlex\n+import sys\n+import tempfile\n+from typing import (\n+ Dict,\n+ List,\n+ Optional,\n+ TextIO,\n+ Tuple,\n+)\n+\n+from ctdconverter.common.utils import (\n+ ParameterHardcoder,\n+ parse_hardcoded_parameters,\n+ parse_input_ctds,\n+)\n+from ctdconverter.galaxy.converter import convert_models\n+from CTDopts.CTDopts import (\n+ CTDModel,\n+ ModelTypeError,\n+ Parameters,\n+)\n+\n+SKIP_LIST = [\n+ r"_prepare\\"",\n+ r"_convert",\n+ r"WRITEINI",\n+ r"WRITECTD",\n+ r"INVALIDVALUE",\n+ r"\\.ini\\.json",\n+ r"OpenSwathMzMLFileCacher .*-convert_back", # - OpenSwathMzMLFileCacher with -convert_back argument https://github.com/OpenMS/OpenMS/issues/4399\n+ r"MaRaClusterAdapter.*-consensus_out", # - MaRaCluster with -consensus_out (parameter blacklister: https://github.com/OpenMS/OpenMS/issues/4456)\n+ r"FileMerger_1_input1.dta2d.*FileMerger_1_input2.dta ", # - FileMerger with mixed dta dta2d input (ftype can not be specified in the test, dta can not be sniffed)\n+ r\'^(TOPP_OpenSwathAnalyzer_test_3|TOPP_OpenSwathAnalyzer_test_4)$\', # no suppert for cached mzML\n+ r\'TOPP_SiriusAdapter_[0-9]+$\', # Do not test SiriusAdapter https://github.com/OpenMS/OpenMS/issues/7000 .. will be removed anyway\n+ r\'TOPP_AssayGeneratorMetabo_(7|8|9|10|11|12|13|14|15|16|17|18)$\' # Skip AssayGeneratorMetabo tests using Sirius https://github.com/OpenMS/OpenMS/issues/7150 (will be replaced by two tools)\n+]\n+\n+\n+def get_failing_tests(cmake: List[str]) -> List[str]:\n+ failing_tests = []\n+ re_fail = re.compile(r"set_tests_properties\\(\\"([^\\"]+)\\" PROPERTIES WILL_FAIL 1\\)")\n+\n+ for cmake in args.cmake:\n+ with open(cmake) as cmake_fh:\n+ for line in cmake_fh:\n+ match = re_fail.search(line)\n+ if match:\n+ failing_tests.append(match.group(1))\n+ return failing_tests\n+\n+\n+def fix_tmp_files(line: str, diff_pairs: Dict[str, str]) -> str:\n+ """\n+ OpenMS tests output to tmp files and compare with FuzzyDiff to the expected file.\n+ problem: the extension of the tmp files is unusable for test generation.\n+ unfortunately the extensions used in the DIFF lines are not always usable for the CLI\n+ (e.g. for prepare_test_data, e.g. CLI expects csv but test file is txt)\n+ this function replaces the tmp file by the expected file.\n+ """\n+ cmd = shlex.split(line)\n+ for i, e in enumerate(cmd):\n+ if e in diff_pairs:\n+ dst = os.path.join("test-data", diff_pairs[e])\n+ if os.path.exists(dst):\n+ os.unlink(dst)\n+ sys.stderr.write(f"symlink {e} {dst}\\n")\n+ os.symlink(e, dst)\n+ cmd[i] = diff_pairs[e]\n+ return shlex.join(cmd)\n+\n+\n+def get_ini(line: str, tool_id: str) -> Tuple[str, str]:\n+ """\n+ if there is an ini file then we use this to generate the test\n+ otherwise the ctd file is used\n+ other command line parameters are inserted later into this xml\n+ """\n+ cmd = shlex.split(line)\n+ ini = None\n+ for i, e in enumerate(cmd):\n+ if e == "-ini":\n+ ini = cmd[i + 1]\n+ cmd = cmd[:i] + cmd[i + 2:]\n+ if ini:\n+ return os.path.join("test-data", ini), shlex.join(cmd)\n+ else:\n+ return os.path.join("ctd", f"{tool_id}.ctd"), line\n+\n+\n+def unique_files(line: str):\n+ """\n+ some tests use the same file twice which does not work in planemo tests\n+ hence we create symlinks for each file used twice\n+ """\n+ cmd = shlex.split(line)\n+ # print(f"{cmd}")\n+ files = {}\n+ # determine the list of indexes where each file argument (anything appearing in test-data/) appears\n+ for idx, e in enumerate(cmd):\n+ p = os.path.join("test-data", e)\n+ if not os.path.exists(p) and not os.path.islink(p):\n+ continue\n+ try:\n+ files[e].append(idx)\n+ except KeyError:\n+ '..b'tr]] = field(default_factory=list)\n+ test_test: bool = False\n+ test_only: bool = False\n+ test_unsniffable: Optional[List[str]] = field(default_factory=list)\n+ test_condition: Optional[List[str]] = ("compare=sim_size", "delta_frac=0.05")\n+ tool_version: str = None\n+ tool_profile: str = None\n+ bump_file: str = None\n+\n+ # create an ini/ctd file where the values are equal to the arguments from the command line\n+ # and transform it to xml\n+ test = [f"<!-- {test_id} -->\\n"]\n+ with tempfile.NamedTemporaryFile(\n+ mode="w+", delete_on_close=False\n+ ) as ctd_tmp, tempfile.NamedTemporaryFile(\n+ mode="w+", delete_on_close=False\n+ ) as xml_tmp:\n+ fill_ctd_clargs(ini, line, ctd_tmp)\n+ ctd_tmp.close()\n+ xml_tmp.close()\n+ parsed_ctd = parse_input_ctds(None, [ctd_tmp.name], xml_tmp.name, "xml")\n+ ctd_args = CTDConverterArgs(\n+ input_files=[ctd_tmp.name],\n+ output_destination=xml_tmp.name,\n+ macros_files=["macros.xml"],\n+ skip_tools_file="aux/tools_blacklist.txt",\n+ formats_file="aux/filetypes.txt",\n+ # tool_conf_destination = "tool.conf",\n+ hardcoded_parameters="aux/hardcoded_params.json",\n+ tool_version="3.1",\n+ test_only=True,\n+ test_unsniffable=[\n+ "csv",\n+ "tsv",\n+ "txt",\n+ "dta",\n+ "dta2d",\n+ "edta",\n+ "mrm",\n+ "splib",\n+ ],\n+ test_condition=["compare=sim_size", "delta_frac=0.7"],\n+ )\n+ ctd_args.parameter_hardcoder = parse_hardcoded_parameters(\n+ ctd_args.hardcoded_parameters\n+ )\n+ convert_models(ctd_args, parsed_ctd)\n+ xml_tmp = open(xml_tmp.name, "r")\n+ for l in xml_tmp:\n+ test.append(l)\n+\n+ return "".join(test)\n+\n+\n+parser = argparse.ArgumentParser(description="Create Galaxy tests for a OpenMS tools")\n+parser.add_argument("--id", dest="id", help="tool id")\n+parser.add_argument("--cmake", nargs="+", help="OpenMS test CMake files")\n+args = parser.parse_args()\n+sys.stderr.write(f"generate tests for {args.id}\\n")\n+\n+re_comment = re.compile("#.*")\n+re_empty_prefix = re.compile(r"^\\s*")\n+re_empty_suffix = re.compile(r"\\s*$")\n+re_add_test = re.compile(r"add_test\\(\\"(TOPP|UTILS)_.*/" + args.id)\n+re_diff = re.compile(r"\\$\\{DIFF\\}.* -in1 ([^ ]+) -in2 ([^ ]+)")\n+failing_tests = get_failing_tests(args.cmake)\n+tests = []\n+\n+# process the given CMake files and compile lists of\n+# - test lines .. essentially add_test(...)\n+# - and pairs of files that are diffed\n+jline = ""\n+test_lines = []\n+diff_pairs = {}\n+for cmake in args.cmake:\n+ with open(cmake) as cmake_fh:\n+ for line in cmake_fh:\n+ # remove comments, empty prefixes and suffixes\n+ line = re_comment.sub("", line)\n+ line = re_empty_prefix.sub("", line)\n+ line = re_empty_suffix.sub("", line)\n+ # skip empty lines\n+ if line == "":\n+ continue\n+\n+ # join test statements that are split over multiple lines\n+ if line.endswith(")"):\n+ jline += " " + line[:-1]\n+ else:\n+ jline = line\n+ continue\n+ line, jline = jline.strip(), ""\n+ match = re_diff.search(line)\n+ if match:\n+ in1 = match.group(1).split("/")[-1]\n+ in2 = match.group(2).split("/")[-1]\n+ if in1 != in2:\n+ diff_pairs[in1] = in2\n+ elif re_add_test.match(line):\n+ test_lines.append(line)\n+\n+for line in test_lines:\n+ test = process_test_line(args.id, line, failing_tests, SKIP_LIST, diff_pairs)\n+ if test:\n+ tests.append(test)\n+\n+tests = "\\n".join(tests)\n+print(\n+ f"""\n+<xml name="autotest_{args.id}">\n+{tests}\n+</xml>\n+"""\n+)\n' |
b |
diff -r cb0f5beef55f -r 148c000ea2ec macros.xml --- a/macros.xml Thu Dec 01 19:20:12 2022 +0000 +++ b/macros.xml Fri Jun 14 21:33:05 2024 +0000 |
[ |
@@ -3,19 +3,19 @@ You can edit this file to add your own macros, if you so desire, or you can add additional macro files using the m/macros parameter --> <macros> - <token name="@TOOL_VERSION@">2.8</token> + <token name="@TOOL_VERSION@">3.1</token> <token name="@VERSION_SUFFIX@">0</token> + <token name="@TEST_DATA_LOCATION@"/> <xml name="requirements"> <requirements> <requirement type="package" version="@TOOL_VERSION@">openms</requirement> <requirement type="package" version="@TOOL_VERSION@">openms-thirdparty</requirement> <!-- omssa (which has been excluded from 3rdparty) and makeblastdb for OMSSAAdapter --> - <requirement type="package" version="2.1.9">omssa</requirement> - <requirement type="package" version="2.13.0">blast</requirement> + <requirement type="package" version="2.14.1">blast</requirement> <!--<requirement type="package" version="5.0.0">tpp</requirement>--> <!-- for realpath (used e.g. in LuciphorAdapter) --> <!--<requirement type="package" version="8.25">coreutils</requirement>--> - <requirement type="package" version="1.4">ctdopts</requirement> + <requirement type="package" version="1.5">ctdopts</requirement> <yield/> </requirements> </xml> @@ -26,6 +26,8 @@ <regex match="Could not allocate metaspace" level="fatal_oom" description="Java memory Exception"/> <regex match="Cannot create VM thread" level="fatal_oom" description="Java memory Exception"/> <regex match="qUncompress: could not allocate enough memory to uncompress data" level="fatal_oom" description="Java memory Exception"/> + <regex match="OMSSA ran out of RAM" level="fatal_oom" description="Could not allocate memory"/> + <regex match="comet' crashed hard (segfault-like). Please check the log." level="fatal_oom" description="Could not allocate memory"/> </stdio> </xml> <xml name="references"> @@ -113,11 +115,11 @@ </token> <token name="@EXT_FOO@"><![CDATA[#def oms2gxyext(o) - #set m={'txt': 'txt', 'tsv': 'tabular', 'bioml': 'xml', 'consensusXML': 'consensusxml', 'csv': 'csv', 'dta': 'dta', 'dta2d': 'dta2d', 'edta': 'edta', 'fa': 'fasta', 'fas': 'fasta', 'fasta': 'fasta', 'FASTA': 'fasta', 'featureXML': 'featurexml', 'featurexml': 'featurexml', 'html': 'html', 'HTML': 'html', 'idXML': 'idxml', 'json': 'json', 'kroenik': 'kroenik', 'mascotXML': 'mascotxml', 'mgf': 'mgf', 'mrm': 'mrm', 'ms': 'sirius.ms', 'ms2': 'ms2', 'msp': 'msp', 'mzData': 'mzdata', 'mzid': 'mzid', 'mzML': 'mzml', 'mzml': 'mzml', 'mzq': 'mzq', 'mzQC': 'mzqc', 'mzTab': 'mztab', 'mzXML': 'mzxml', 'novor': 'txt', 'obo': 'obo', 'oms': 'sqlite', 'omssaXML': 'idxml', 'osw': 'osw', 'OSW': 'osw', 'params': 'txt', 'paramXML': 'paramxml', 'peplist': 'peplist', 'pep.xml': 'pepxml', 'pepXML': 'pepxml', 'png': 'png', 'PNG': 'png', 'protXML': 'protxml', 'psms': 'psms', 'pqp': 'pqp', 'qcML': 'qcml', 'spec.xml': 'spec.xml', 'splib': 'splib', 'sqMass': 'sqmass', 'tandem.xml': 'tandem', 'trafoXML': 'trafoxml', 'traML': 'traml', 'TraML': 'traml', 'tab': 'tabular', 'raw': 'thermo.raw', 'xls': 'tsv', 'XML': 'xml', 'xml': 'xml', 'xquest.xml': 'xquest.xml', 'xsd': 'xml'} + #set m={'txt': 'txt', 'tsv': 'tabular', 'bioml': 'xml', 'consensusXML': 'consensusxml', 'csv': 'csv', 'dta': 'dta', 'dta2d': 'dta2d', 'edta': 'edta', 'fa': 'fasta', 'fas': 'fasta', 'fasta': 'fasta', 'FASTA': 'fasta', 'featureXML': 'featurexml', 'featurexml': 'featurexml', 'html': 'html', 'HTML': 'html', 'idXML': 'idxml', 'json': 'json', 'kroenik': 'kroenik', 'mascotXML': 'mascotxml', 'mgf': 'mgf', 'mrm': 'mrm', 'ms': 'sirius.ms', 'ms2': 'ms2', 'msp': 'msp', 'mzData': 'mzdata', 'mzid': 'mzid', 'mzML': 'mzml', 'mzml': 'mzml', 'mzq': 'mzq', 'mzQC': 'mzqc', 'mzTab': 'mztab', 'mzXML': 'mzxml', 'novor': 'txt', 'obo': 'obo', 'oms': 'sqlite', 'omssaXML': 'idxml', 'osw': 'osw', 'OSW': 'osw', 'params': 'txt', 'paramXML': 'paramxml', 'peplist': 'peplist', 'pep.xml': 'pepxml', 'pepXML': 'pepxml', 'png': 'png', 'PNG': 'png', 'protXML': 'protxml', 'psms': 'psms', 'pqp': 'pqp', 'qcML': 'qcml', 'spec.xml': 'spec.xml', 'splib': 'splib', 'sqMass': 'sqmass', 'tandem.xml': 'tandem', 'trafoXML': 'trafoxml', 'traML': 'traml', 'TraML': 'traml', 'tab': 'tabular', 'raw': 'thermo.raw', 'xls': 'tsv', 'XML': 'xml', 'xml': 'xml', 'xquest.xml': 'xquest.xml', 'xsd': 'xsd', 'zip': 'zip'} #return m[o] #end def #def gxy2omsext(g) - #set m={'txt': 'txt', 'tabular': 'tsv', 'xml': 'bioml', 'consensusxml': 'consensusXML', 'csv': 'csv', 'dta': 'dta', 'dta2d': 'dta2d', 'edta': 'edta', 'fasta': 'fa', 'featurexml': 'featureXML', 'html': 'html', 'idxml': 'idXML', 'json': 'json', 'kroenik': 'kroenik', 'mascotxml': 'mascotXML', 'mgf': 'mgf', 'mrm': 'mrm', 'sirius.ms': 'ms', 'ms2': 'ms2', 'msp': 'msp', 'mzdata': 'mzData', 'mzid': 'mzid', 'mzml': 'mzML', 'mzq': 'mzq', 'mzqc': 'mzQC', 'mztab': 'mzTab', 'mzxml': 'mzXML', 'obo': 'obo', 'sqlite': 'oms', 'osw': 'osw', 'paramxml': 'paramXML', 'peff': 'fasta', 'peplist': 'peplist', 'pepxml': 'pep.xml', 'png': 'png', 'protxml': 'protXML', 'psms': 'psms', 'pqp': 'pqp', 'qcml': 'qcML', 'spec.xml': 'spec.xml', 'splib': 'splib', 'sqmass': 'sqMass', 'tandem': 'tandem.xml', 'trafoxml': 'trafoXML', 'traml': 'traML', 'thermo.raw': 'raw', 'tsv': 'xls', 'xquest.xml': 'xquest.xml'} + #set m={'txt': 'txt', 'tabular': 'tsv', 'xml': 'bioml', 'consensusxml': 'consensusXML', 'csv': 'csv', 'dta': 'dta', 'dta2d': 'dta2d', 'edta': 'edta', 'fasta': 'fa', 'featurexml': 'featureXML', 'html': 'html', 'idxml': 'idXML', 'json': 'json', 'kroenik': 'kroenik', 'mascotxml': 'mascotXML', 'mgf': 'mgf', 'mrm': 'mrm', 'sirius.ms': 'ms', 'ms2': 'ms2', 'msp': 'msp', 'mzdata': 'mzData', 'mzid': 'mzid', 'mzml': 'mzML', 'mzq': 'mzq', 'mzqc': 'mzQC', 'mztab': 'mzTab', 'mzxml': 'mzXML', 'obo': 'obo', 'sqlite': 'oms', 'osw': 'osw', 'paramxml': 'paramXML', 'peff': 'fasta', 'peplist': 'peplist', 'pepxml': 'pep.xml', 'png': 'png', 'protxml': 'protXML', 'psms': 'psms', 'pqp': 'pqp', 'qcml': 'qcML', 'spec.xml': 'spec.xml', 'splib': 'splib', 'sqmass': 'sqMass', 'tandem': 'tandem.xml', 'trafoxml': 'trafoXML', 'traml': 'traML', 'thermo.raw': 'raw', 'tsv': 'xls', 'xquest.xml': 'xquest.xml', 'xsd': 'xsd', 'zip': 'zip'} #return m[g] #end def ]]></token></macros> |
b |
diff -r cb0f5beef55f -r 148c000ea2ec prepare_test_data_manual.sh --- a/prepare_test_data_manual.sh Thu Dec 01 19:20:12 2022 +0000 +++ b/prepare_test_data_manual.sh Fri Jun 14 21:33:05 2024 +0000 |
[ |
@@ -1,8 +1,3 @@ -MSSimulator -test -in DecoyDatabase_1.fasta -out MSsimulator.mzml -algorithm:RandomNumberGenerators:biological reproducible -algorithm:RandomNumberGenerators:technical reproducible > MSSimulator_1.stdout 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'MSSimulator_1 failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi - -MSSimulator -test -in DecoyDatabase_1.fasta -out MSsimulator_MALDI.mzml -algorithm:RandomNumberGenerators:biological reproducible -algorithm:RandomNumberGenerators:technical reproducible -algorithm:MSSim:Global:ionization_type MALDI > MSSimulator_2.stdout 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'MSSimulator_2 failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi ClusterMassTracesByPrecursor -test -in_ms1 ConsensusMapNormalizer_input.consensusXML -in_swath ConsensusMapNormalizer_input.consensusXML -out ClusterMassTracesByPrecursor.mzml > ClusterMassTracesByPrecursor.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'ClusterMassTracesByPrecursor failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi @@ -13,8 +8,7 @@ CVInspector -test -cv_files CHEMISTRY/XLMOD.obo -cv_names XLMOD -mapping_file MAPPING/ms-mapping.xml -html CVInspector.html > CVInspector.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'CVInspector failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi -DeMeanderize -test -in MSsimulator_MALDI.mzml -out DeMeanderize.mzml > DeMeanderize.stdout 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'DeMeanderize failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi +# TODO DeMeanderize # TODO DigestorMotif @@ -30,26 +24,17 @@ if [[ "$?" -ne "0" ]]; then >&2 echo 'FeatureFinderIsotopeWavelet failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi -FFEval -test -in FeatureFinderCentroided_1_output.featureXML -truth FeatureFinderCentroided_1_output.featureXML -out FFEval.featureXML -out_roc FFEval_roc.csv > FFEval.stdout 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'FFEval failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi - # TODO? deprecated IDDecoyProbability IDExtractor -test -in MSGFPlusAdapter_1_out.idXML -best_hits -number_of_peptides 1 -out IDExtractor.idXML > IDExtractor.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'IDExtractor failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi -LabeledEval -test -in FeatureLinkerLabeled_1_input.featureXML -truth FeatureLinkerLabeled_1_output.consensusXML> LabeledEval.txt > LabeledEval.stdout 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'LabeledEval failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi - MapStatistics -test -in SiriusAdapter_3_input.featureXML -out MapStatistics.txt > MapStatistics_1.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'MapStatistics_1 failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi MapStatistics -test -in ConsensusXMLFile_1.consensusXML -out MapStatistics2.txt > MapStatistics_2.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'MapStatistics_2 failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi -MetaboliteAdductDecharger -test -in Decharger_input.featureXML -out_cm MetaboliteAdductDecharger_cm.consensusXML -out_fm MetaboliteAdductDecharger_fm.featureXML -outpairs MetaboliteAdductDecharger_pairs.consensusXML > MetaboliteAdductDecharger.stdout 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'MetaboliteAdductDecharger failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi - MetaboliteSpectralMatcher -test -in spectra.mzML -database MetaboliteSpectralDB.mzML -out MetaboliteSpectralMatcher.mzTab > MetaboliteSpectralMatcher.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'MetaboliteSpectralMatcher failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi @@ -68,20 +53,6 @@ OpenSwathRewriteToFeatureXML -featureXML OpenSwathFeatureXMLToTSV_input.featureXML -out OpenSwathRewriteToFeatureXML.featureXML > OpenSwathRewriteToFeatureXML.stdout 2> stderr # if [[ "$?" -ne "0" ]]; then >&2 echo 'OpenSwathRewriteToFeatureXML failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi -# adapted from the commented tests in OpenMS TODO may be removed later https://github.com/OpenMS/OpenMS/issues/4719 -FileConverter -in PepNovo.mzXML -out PepNovo_1.mzML > /dev/null 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'FileConverter failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi - -PepNovoAdapter -ini PepNovoAdapter_1_parameters.ini -in PepNovo_1.mzML -out PepNovoAdapter_3_output.idXML -model_directory pepnovo_models/ -pepnovo_executable pepnovo > PepNovo_1.stdout 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'PhosphoScoring failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi - -FileConverter -in PepNovo.mzData -out PepNovo_4.mzML > /dev/null 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'FileConverter failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi -PepNovoAdapter -ini PepNovoAdapter_1_parameters.ini -in PepNovo_4.mzML -out PepNovoAdapter_4_output.idXML -model_directory pepnovo_models/ -pepnovo_executable pepnovo > PepNovo_1.stdout 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'PhosphoScoring failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi - -#PepNovoAdapter -ini PepNovoAdapter_5_parameters.ini -in PepNovoAdapter_5_output.pepnovo_out -out PepNovoAdapter_5_output.idXML -model_directory pepnovo_models/ - # TODO PhosphoScoring PhosphoScoring -in spectra.mzML -id MSGFPlusAdapter_1_out1.tmp -out PhosphoScoring.idxml > PhosphoScoring.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'PhosphoScoring failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi @@ -118,9 +89,6 @@ RNPxlXICFilter -test -control FileFilter_1_input.mzML -treatment FileFilter_1_input.mzML -out RNPxlXICFilter.mzML > RNPxlXICFilter.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'RNPxlXICFilter failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi -RTEvaluation -in PeptideIndexer_1.idXML -out RTEvaluation.tsv > RTEvaluation.stdout 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'RTEvaluation failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi - SemanticValidator -test -in FileFilter_1_input.mzML -mapping_file MAPPING/ms-mapping.xml > SemanticValidator.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'SemanticValidator failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi @@ -152,13 +120,8 @@ SpectraFilterThresholdMower -test -in SpectraFilterSqrtMower_1_input.mzML -out SpectraFilterThresholdMower.mzML > SpectraFilterThresholdMower.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'SpectraFilterThresholdMower failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi -SpectraMerger -test -in NovorAdapter_in.mzML -out SpectraMerger_1.mzML > SpectraMerger.stdout 2> stderr +SpectraMerger -test -in NovorAdapter_in.mzML -out SpectraMerger_1.mzML -algorithm:average_gaussian:ms_level 2 > SpectraMerger.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'SpectraMerger failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi -# TODO SvmTheoreticalSpectrumGeneratorTrainer - -TransformationEvaluation -test -in FileInfo_16_input.trafoXML -out TransformationEvaluation.trafoXML > TransformationEvaluation.stdout 2> stderr -if [[ "$?" -ne "0" ]]; then >&2 echo 'TransformationEvaluation failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi - XMLValidator -test -in FileFilter_1_input.mzML > XMLValidator.stdout 2> stderr if [[ "$?" -ne "0" ]]; then >&2 echo 'XMLValidator failed'; >&2 echo -e "stderr:\n$(cat stderr | sed 's/^/ /')"; fi |
b |
diff -r cb0f5beef55f -r 148c000ea2ec readme.md --- a/readme.md Thu Dec 01 19:20:12 2022 +0000 +++ b/readme.md Fri Jun 14 21:33:05 2024 +0000 |
b |
@@ -11,7 +11,7 @@ * https://www.openms.de/ The wrappers for these tools and most of their tests are automatically -generated using the `generate.sh` script. The generation of the tools is +generated using the `./aux/generate.sh` script. The generation of the tools is based on the CTDConverter (https://github.com/WorkflowConversion/CTDConverter) which can be fine tuned via the `hardcoded_params.json` file. This file allows to blacklist and hardcode parameters and to modify or set arbitrary @@ -129,15 +129,6 @@ Open problems ============= -Some tools stall in CI testing using `--biocontainers` which is why the OpenMS -tools are currently listed in `.tt_biocontainer_skip`. This is - -- AssayGeneratorMetabo and SiriusAdapter (both depend on sirius) -- OMSSAAdapter - -Using `docker -t` seems to solve the problem (see -https://github.com/galaxyproject/galaxy/issues/10153). - Licence (MIT) ============= |
b |
diff -r cb0f5beef55f -r 148c000ea2ec test-data.sh --- a/test-data.sh Thu Dec 01 19:20:12 2022 +0000 +++ b/test-data.sh Fri Jun 14 21:33:05 2024 +0000 |
[ |
b'@@ -1,11 +1,10 @@\n #!/usr/bin/env bash\n \n-VERSION=2.8\n+# set -x\n+\n+VERSION=3.1\n FILETYPES="aux/filetypes.txt"\n-CONDAPKG="https://anaconda.org/bioconda/openms/2.8.0/download/linux-64/openms-2.8.0-h7ca0330_0.tar.bz2"\n-\n-# import the magic\n-. ./generate-foo.sh\n+CONDAPKG="https://anaconda.org/bioconda/openms/3.1.0/download/linux-64/openms-3.1.0-h8964181_1.tar.bz2"\n \n # install conda\n if [ -z "$tmp" ]; then\n@@ -45,17 +44,20 @@\n \n echo "Clone OpenMS $VERSION sources"\n if [[ ! -d $OPENMSGIT ]]; then\n- # TODO >2.8 reenable original release branch .. also in else branch\n- # the plus branch contains commits from https://github.com/OpenMS/OpenMS/pull/5920 and https://github.com/OpenMS/OpenMS/pull/5917\n- # git clone -b release/$VERSION.0 https://github.com/OpenMS/OpenMS.git $OPENMSGIT\n- git clone -b release/$VERSION.0-plus https://github.com/bernt-matthias/OpenMS.git $OPENMSGIT\n- cd $OPENMSGIT\n- git submodule init\n- git submodule update\n- cd -\n+ if [[ "$created" == "yes" ]]; then\n+ GIT_DIR=$(mktemp -d --dry-run)\n+ GIT_EXTRA_OPTS="--separate-git-dir=$GIT_DIR"\n+ fi\n+ git clone -b release/$VERSION.0 --depth 1 --recurse-submodules=THIRDPARTY --shallow-submodules $GIT_EXTRA_OPTS https://github.com/OpenMS/OpenMS.git $OPENMSGIT\n+ ## save some space by just keeping the needed binaries\n+ find $OPENMSGIT/THIRDPARTY/ -type f -not \\( -name maracluster -o -name spectrast \\) -delete\n+ find $OPENMSGIT/THIRDPARTY/ -empty -type d -delete\n+ if [[ "$created" == "yes" ]]; then\n+ rm -rf $GIT_DIR\n+ fi\n else\n cd $OPENMSGIT\n- git pull origin release/$VERSION.0-plus\n+ git pull origin release/$VERSION.0\n cd -\n fi\n \n@@ -65,7 +67,7 @@\n if conda env list | grep "$OPENMSENV"; then\n true\n else\n- conda create -y --quiet --override-channels --channel iuc --channel conda-forge --channel bioconda --channel defaults -n $OPENMSENV openms=$VERSION openms-thirdparty=$VERSION omssa=2.1.9 ctdopts=1.5 lxml\n+ conda create -y --quiet --solver libmamba --override-channels --strict-channel-priority --channel conda-forge --channel bioconda -n $OPENMSENV openms=$VERSION openms-thirdparty=$VERSION ctdopts=1.5 lxml\n # chmod -R u-w $OPENMSENV \n fi\n ###############################################################################\n@@ -101,33 +103,34 @@\n conda deactivate\n \n \n-# ###############################################################################\n-# ## copy all the test data files to test-data\n-# ## most of it (outputs) will be overwritten later, but its needed for\n-# ## prepare_test_data\n-# ###############################################################################\n+# # ###############################################################################\n+# # ## copy all the test data files to test-data\n+# # ## most of it (outputs) will be overwritten later, but its needed for\n+# # ## prepare_test_data\n+# # ###############################################################################\n echo "Get test data"\n-find test-data -type f,l,d ! -name "*fa" ! -name "*loc" ! -name "test-data" -delete\n+find test-data -type f,l,d ! -name "*fa" ! -name "*loc" ! -name "test-data" ! -name MetaboliteSpectralDB.mzML -delete\n \n cp $(find $OPENMSGIT/src/tests/topp/ -type f | grep -Ev "third_party_tests.cmake|CMakeLists.txt|check_ini") test-data/\n cp -r $OPENMSGIT/share/OpenMS/MAPPING/ test-data/\n cp -r $OPENMSGIT/share/OpenMS/CHEMISTRY test-data/\n cp -r $OPENMSGIT/share/OpenMS/examples/ test-data/\n if [ ! -f test-data/MetaboliteSpectralDB.mzML ]; then \n- wget -nc https://abibuilder.cs.uni-tuebingen.de/archive/openms/Tutorials/Data/latest/Example_Data/Metabolomics/databases/MetaboliteSpectralDB.mzML\n+ wget -nc https://raw.githubusercontent.com/sneumann/OpenMS/master/share/OpenMS/CHEMISTRY/MetaboliteSpectralDB.mzML\n+ # wget -nc https://abibuilder.cs.uni-tuebingen.de/archive/openms/Tutorials/Data/latest/Example_Data/Metabolomics/databases/MetaboliteSpectralDB.mzML\n mv MetaboliteSpectralDB.mzML test-da'..b'\'s/add_test(//; s/"//g; s/)[^)]*$//; s/\\${TOPP_BIN_PATH}\\///g;s/\\${DATA_DIR_TOPP}\\///g; s#THIRDPARTY/##g\' | cut -d" " -f1)\n+\n+ if grep -lq "$test_id"\'\\".* PROPERTIES WILL_FAIL 1\' $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake; then\n+ >&2 echo " skip failing "$test_id\n+ continue\n+ fi\n+\n+ line=$(echo "$line" | sed \'s/add_test("//; s/)[^)]*$//; s/\\${TOPP_BIN_PATH}\\///g;s/\\${DATA_DIR_TOPP}\\///g; s#THIRDPARTY/##g\' | cut -d" " -f2-)\n+ # line="$(fix_tmp_files $line)"\n+ echo \'echo executing "\'$test_id\'"\'\n+ echo "$line > $test_id.stdout 2> $test_id.stderr"\n+ echo "if [[ \\"\\$?\\" -ne \\"0\\" ]]; then >&2 echo \'$test_id failed\'; >&2 echo -e \\"stderr:\\n\\$(cat $test_id.stderr | sed \'s/^/ /\')\\"; echo -e \\"stdout:\\n\\$(cat $test_id.stdout)\\";fi" \n+ done\n+}\n+\n echo "Create test shell script"\n \n echo -n "" > prepare_test_data.sh\n@@ -180,31 +224,19 @@\n echo \'export LUCIPHOR_BINARY="$(dirname $(realpath $(which luciphor2)))/luciphor2.jar"\' >> prepare_test_data.sh\n \n echo \'export MARACLUSTER_BINARY="\'"$OPENMSGIT"\'/THIRDPARTY/Linux/64bit/MaRaCluster/maracluster"\'>> prepare_test_data.sh\n-echo \'export MSFRAGGER_BINARY="/home/berntm/Downloads/MSFragger-20171106/MSFragger-20171106.jar"\'>> prepare_test_data.sh\n+echo \'export MSFRAGGER_BINARY="/home/berntm/Downloads/MSFragger-3.5/MSFragger-3.5.jar"\'>> prepare_test_data.sh\n echo \'export MSGFPLUS_BINARY="$(msgf_plus -get_jar_path)"\' >> prepare_test_data.sh\n echo \'export MYRIMATCH_BINARY="myrimatch"\'>> prepare_test_data.sh\n echo \'export NOVOR_BINARY="/home/berntm/Downloads/novor/lib/novor.jar"\' >> prepare_test_data.sh\n-echo \'export OMSSA_BINARY="$(dirname $(realpath $(which omssacl)))/omssacl"\'>> prepare_test_data.sh\n echo \'export PERCOLATOR_BINARY="percolator"\'>> prepare_test_data.sh\n echo \'export SIRIUS_BINARY="$(which sirius)"\' >> prepare_test_data.sh\n echo \'export SPECTRAST_BINARY="\'"$OPENMSGIT"\'/THIRDPARTY/Linux/64bit/SpectraST/spectrast"\' >> prepare_test_data.sh\n echo \'export XTANDEM_BINARY="xtandem"\' >> prepare_test_data.sh\n echo \'export THERMORAWFILEPARSER_BINARY="ThermoRawFileParser.exe"\' >> prepare_test_data.sh\n+echo \'export SAGE_BINARY=sage\' >> prepare_test_data.sh\n \n prepare_test_data >> prepare_test_data.sh #tmp_test_data.sh\n \n-## prepare_test_data > tmp_test_data.sh\n-## # remove calls not needed for the tools listed in any .list file\n-## echo LIST $LIST\n-## if [ ! -z "$LIST" ]; then\n-## REX=$(echo $LIST | sed \'s/ /\\n/g\' | sed \'s@.*/\\([^/]\\+\\).xml$@\\1@\' | tr \'\\n\' \'|\' | sed \'s/|$//\')\n-## else\n-## REX=".*"\n-## fi\n-## echo REX $REX\n-## cat tmp_test_data.sh | egrep "($REX)" >> prepare_test_data.sh\n-## rm tmp_test_data.sh\n-\n echo "Execute test shell script"\n chmod u+x prepare_test_data.sh\n cd ./test-data || exit\n@@ -234,14 +266,11 @@\n for i in $(ls ctd/*ctd)\n do\n b=$(basename "$i" .ctd)\n- get_tests2 "$b" >> "$autotests"\n+ ./get_tests.py --id "$b" --cmake "$OPENMSGIT"/src/tests/topp/CMakeLists.txt "$OPENMSGIT"/src/tests/topp/THIRDPARTY/third_party_tests.cmake >> "$autotests"\n+ wc -l "$autotests"\n done\n echo "</macros>" >> "$autotests"\n \n-# echo "Create test data links"\n-# Breaks DecoyDatabase\n-# link_tmp_files\n-\n # tests for tools using output_prefix parameters can not be auto generated\n # hence we output the tests for manual curation in macros_test.xml\n # and remove them from the autotests\n@@ -255,6 +284,7 @@\n #\n # not able to specify composite test data \n # -> SpectraSTSearchAdapter \n+echo "Discard some tests"\n if [[ ! -z "$1" ]]; then\n echo "" > macros_discarded_auto.xml\n for i in OpenSwathFileSplitter IDRipper MzMLSplitter SeedListGenerator MSFraggerAdapter MaRaClusterAdapter NovorAdapter SpectraSTSearchAdapter\n@@ -272,7 +302,7 @@\n ## remove broken symlinks in test-data\n find test-data/ -xtype l -delete\n \n-if [ ! -z "$created" ]; then\n+if [[ "$created" == "yes" ]]; then\n echo "Removing temporary directory"\n rm -rf "$tmp"\n fi\n' |