Commit message:
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3 |
added:
TriqlerConverter.xml fill_ctd.py fill_ctd_clargs.py generate-foo.sh macros.xml prepare_test_data_manual.sh readme.md test-data.sh test-data/pepnovo_models.loc test-data/random.fa test-data/random_RNA.fa tool-data/pepnovo_models.loc.sample tool_data_table_conf.xml.sample tool_data_table_conf.xml.test |
b |
diff -r 000000000000 -r fb0ebc6f97f3 TriqlerConverter.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TriqlerConverter.xml Thu Dec 01 19:22:27 2022 +0000 |
[ |
@@ -0,0 +1,102 @@ +<?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]--> +<tool id="TriqlerConverter" name="TriqlerConverter" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05"> + <description>Converter to input for Triqler</description> + <macros> + <token name="@EXECUTABLE@">TriqlerConverter</token> + <import>macros.xml</import> + </macros> + <expand macro="requirements"/> + <expand macro="stdio"/> + <command detect_errors="exit_code"><![CDATA[@QUOTE_FOO@ +@EXT_FOO@ +#import re + +## Preprocessing +mkdir in && +ln -s '$in' 'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)' && +mkdir in_design && +ln -s '$in_design' 'in_design/${re.sub("[^\w\-_]", "_", $in_design.element_identifier)}.$gxy2omsext($in_design.ext)' && +mkdir out && + #if $adv_opts.reannotate_filenames_cond.reannotate_filenames: + mkdir adv_opts.reannotate_filenames_cond.reannotate_filenames && + #if $adv_opts.reannotate_filenames_cond.reannotate_filenames_select == "no" + mkdir ${' '.join(["'adv_opts.reannotate_filenames_cond.reannotate_filenames/%s'" % (i) for i, f in enumerate($adv_opts.reannotate_filenames_cond.reannotate_filenames) if f])} && + ${' '.join(["ln -s '%s' 'adv_opts.reannotate_filenames_cond.reannotate_filenames/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.reannotate_filenames_cond.reannotate_filenames) if f])} + #else + ln -s '$adv_opts.reannotate_filenames_cond.reannotate_filenames' 'adv_opts.reannotate_filenames_cond.reannotate_filenames/${re.sub("[^\w\-_]", "_", $adv_opts.reannotate_filenames_cond.reannotate_filenames.element_identifier)}.$gxy2omsext($adv_opts.reannotate_filenames_cond.reannotate_filenames.ext)' && + #end if + #end if + +## Main program call + +set -o pipefail && +@EXECUTABLE@ -write_ctd ./ && +python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hardcoded_json' && +@EXECUTABLE@ -ini @EXECUTABLE@.ctd +-in +'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)' +-in_design +'in_design/${re.sub("[^\w\-_]", "_", $in_design.element_identifier)}.$gxy2omsext($in_design.ext)' +-out +'out/output.${gxy2omsext("csv")}' + #if $adv_opts.reannotate_filenames_cond.reannotate_filenames: + -reannotate_filenames + #if $adv_opts.reannotate_filenames_cond.reannotate_filenames_select == "no" + ${' '.join(["'adv_opts.reannotate_filenames_cond.reannotate_filenames/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($adv_opts.reannotate_filenames_cond.reannotate_filenames) if f])} + #else + 'adv_opts.reannotate_filenames_cond.reannotate_filenames/${re.sub("[^\w\-_]", "_", $adv_opts.reannotate_filenames_cond.reannotate_filenames.element_identifier)}.$gxy2omsext($adv_opts.reannotate_filenames_cond.reannotate_filenames.ext)' + #end if + #end if + +## Postprocessing +&& mv 'out/output.${gxy2omsext("csv")}' '$out' +#if "ctd_out_FLAG" in $OPTIONAL_OUTPUTS + && mv '@EXECUTABLE@.ctd' '$ctd_out' +#end if]]></command> + <configfiles> + <inputs name="args_json" data_style="paths"/> + <configfile name="hardcoded_json"><![CDATA[{"log": "log.txt", "threads": "\${GALAXY_SLOTS:-1}", "no_progress": true}]]></configfile> + </configfiles> + <inputs> + <param argument="-in" type="data" format="consensusxml" optional="false" label="Input consensusXML with peptide intensities" help=" select consensusxml data sets(s)"/> + <param argument="-in_design" type="data" format="tabular" optional="false" label="Experimental Design file" help=" select tabular data sets(s)"/> + <param argument="-Triqler_condition" type="text" optional="true" value="Triqler_Condition" label="Which column in the condition table should be used for Triqler 'Condition'" help=""> + <expand macro="list_string_san" name="Triqler_condition"/> + </param> + <expand macro="adv_opts_macro"> + <conditional name="reannotate_filenames_cond"> + <param name="reannotate_filenames_select" type="select" label="Run tool in batch mode for -reannotate_filenames"> + <option value="no">No: process all datasets jointly</option> + <option value="yes">Yes: process each dataset in an independent job</option> + </param> + <when value="no"> + <param argument="-reannotate_filenames" type="data" format="mzml" multiple="true" optional="true" label="Overwrite MS file names in consensusXML" help=" select mzml data sets(s)"/> + </when> + <when value="yes"> + <param argument="-reannotate_filenames" type="data" format="mzml" multiple="false" optional="true" label="Overwrite MS file names in consensusXML" help=" select mzml data sets(s)"/> + </when> + </conditional> + <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=""> + <expand macro="list_string_san" name="test"/> + </param> + </expand> + <param name="OPTIONAL_OUTPUTS" type="select" optional="true" multiple="true" label="Optional outputs"> + <option value="ctd_out_FLAG">Output used ctd (ini) configuration file</option> + </param> + </inputs> + <outputs> + <data name="out" label="${tool.name} on ${on_string}: out" format="csv"/> + <data name="ctd_out" format="xml" label="${tool.name} on ${on_string}: ctd"> + <filter>OPTIONAL_OUTPUTS is not None and "ctd_out_FLAG" in OPTIONAL_OUTPUTS</filter> + </data> + </outputs> + <tests/> + <help><![CDATA[Converter to input for Triqler + + +For more information, visit http://www.openms.de/doxygen/release/2.8.0/html/UTILS_TriqlerConverter.html]]></help> + <expand macro="references"/> +</tool> |
b |
diff -r 000000000000 -r fb0ebc6f97f3 fill_ctd.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fill_ctd.py Thu Dec 01 19:22:27 2022 +0000 |
[ |
@@ -0,0 +1,197 @@ +import collections +import json +import operator +import os +import re +import subprocess +import sys +from functools import reduce # forward compatibility for Python 3 + +from CTDopts.CTDopts import ( + _Choices, + _InFile, + _Null, + _NumericRange, + CTDModel +) + + +def getFromDict(dataDict, mapList): + return reduce(operator.getitem, mapList, dataDict) + + +def setInDict(dataDict, mapList, value): + getFromDict(dataDict, mapList[:-1])[mapList[-1]] = value + + +def mergeDicts(d, e): + """ + insert values from the dict e into dict d + no values of d are overwritten + """ + for k, v in e.items(): + if (k in d and isinstance(d[k], dict) and isinstance(e[k], collections.abc.Mapping)): + mergeDicts(d[k], e[k]) + elif k not in d: + d[k] = e[k] + else: + sys.stderr.write("fill_ctd.py: could not merge key %s for %s in %s" % (k, d, e)) + sys.exit(1) + + +def _json_object_hook_noenvlookup(d): + return _json_object_hook(d, envlookup=False) + + +def _json_object_hook(d, envlookup=True): + """ + wee helper to transform the json written by galaxy + while loading + - True/False (bool objects) -> "true"/"false" (lowercase string) + - data inputs with multiple and optional true give [None] if no file is given -> [] + - None -> "" (empty string) + - replace bash expressions (if envlookup is True): + - environment variables (need to consist capital letters and _) by their value + - expressions + """ + for k in d.keys(): + # if type(d[k]) is bool: + # d[k] = str(d[k]).lower() + # else + if type(d[k]) is list and len(d[k]) == 1 and d[k][0] is None: + d[k] = [] + elif d[k] is None: + d[k] = "" + elif envlookup and type(d[k]) is str and d[k].startswith("$"): + m = re.fullmatch(r"\$([A-Z_]+)", d[k]) + if m: + d[k] = os.environ.get(m.group(1), "") + continue + m = re.fullmatch(r"\$(\{[A-Z_]+):-(.*)\}", d[k]) + if m: + d[k] = os.environ.get(m.group(1), m.group(2)) + continue + + try: + p = subprocess.run("echo %s" % d[k], shell=True, check=True, stdout=subprocess.PIPE, encoding="utf8") + d[k] = p.stdout.strip() + except subprocess.CalledProcessError: + sys.stderr.write("fill_ctd error: Could not evaluate %s" % d[k]) + continue + return d + + +def qstring2list(qs): + """ + transform a space separated string that is quoted by " into a list + """ + lst = list() + qs = qs.split(" ") + quoted = False + for p in qs: + if p == "": + continue + if p.startswith('"') and p.endswith('"'): + lst.append(p[1:-1]) + elif p.startswith('"'): + quoted = True + lst.append(p[1:] + " ") + elif p.endswith('"'): + quoted = False + lst[-1] += p[:-1] + else: + if quoted: + lst[-1] += p + " " + else: + lst.append(p) + return lst + + +def fix_underscores(args): + if type(args) is dict: + for k in list(args.keys()): + v = args[k] + if type(v) is dict: + fix_underscores(args[k]) + if k.startswith("_"): + args[k[1:]] = v + del args[k] + elif type(args) is list: + for i, v in enumerate(args): + if type(v) is dict: + fix_underscores(args[i]) + + +input_ctd = sys.argv[1] + +# load user specified parameters from json +with open(sys.argv[2]) as fh: + args = json.load(fh, object_hook=_json_object_hook_noenvlookup) + +# load hardcoded parameters from json +with open(sys.argv[3]) as fh: + hc_args = json.load(fh, object_hook=_json_object_hook) + +# insert the hc_args into the args +mergeDicts(args, hc_args) + +# put the contents of the advanced options section into the main dict +if "adv_opts" in args: + args.update(args["adv_opts"]) + del args["adv_opts"] + +# IDMapper has in and spectra:in params, in is used in out as format_source", +# which does not work in Galaxy: https://github.com/galaxyproject/galaxy/pull/9493" +# therefore hardcoded params change the name of spectra:in to spectra:_in +# which is corrected here again +# TODO remove once PR is in and adapt profile accordingly +fix_underscores(args) + +model = CTDModel(from_file=input_ctd) + +# 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 +# value is given -> overwritte with the default +for p in model.get_parameters(): + + # check if the parameter is in the arguments from the galaxy tool + # (from the json file(s)), since advanced parameters are absent + # if the conditional is set to basic parameters + try: + getFromDict(args, p.get_lineage(name_only=True)) + 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 (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)] + val = getFromDict(args, lineage) + except KeyError: + continue + else: + 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: + setInDict(args, p.get_lineage(name_only=True), qstring2list(v)) + elif p.type is _InFile and not (p.default is None or type(p.default) is _Null): + v = getFromDict(args, p.get_lineage(name_only=True)) + if v in [[], ""]: + setInDict(args, p.get_lineage(name_only=True), p.default) + +model.write_ctd(input_ctd, arg_dict=args) |
b |
diff -r 000000000000 -r fb0ebc6f97f3 fill_ctd_clargs.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fill_ctd_clargs.py Thu Dec 01 19:22:27 2022 +0000 |
[ |
@@ -0,0 +1,70 @@ +#!/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 000000000000 -r fb0ebc6f97f3 generate-foo.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/generate-foo.sh Thu Dec 01 19:22:27 2022 +0000 |
[ |
b'@@ -0,0 +1,215 @@\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 000000000000 -r fb0ebc6f97f3 macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Thu Dec 01 19:22:27 2022 +0000 |
[ |
@@ -0,0 +1,123 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- CTD2Galaxy depends on this file and on the stdio, advanced_options macros! + 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="@VERSION_SUFFIX@">0</token> + <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="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> + <yield/> + </requirements> + </xml> + <xml name="stdio"> + <stdio> + <regex match="std::bad_alloc" level="fatal_oom" description="Could not allocate memory"/> + <regex match="OutOfMemoryError" level="fatal_oom" description="Could not allocate memory"/> + <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"/> + </stdio> + </xml> + <xml name="references"> + <citations> + <citation type="doi">doi:10.1186/1471-2105-9-163</citation> + </citations> + </xml> + <xml name="adv_opts_macro"> + <section name="adv_opts" title="Advanced Options" expanded="false"> + <yield/> + </section> + </xml> + + <!-- sanitizers and validators --> + <xml name="list_string_val" token_name=""> + <validator type="regex" message="parameter @NAME@: must not start with $">^[^$]</validator> + <validator type="regex" message="parameter @NAME@: a space separated list of string is needed (strings that contain spaces can be quoted with ")">^ *((?:\"[^\"]*\" +)|(?:[^ \"]+ +))*((?:\"[^\"]*\")|(?:[^ \"]+)) *$</validator> + </xml> + <xml name="list_string_san"> + <sanitizer> + <valid initial="string.printable"> +<!-- <remove value="'"/>--> +<!-- <remove value="\"/>--><!-- otherwise the user could quote the final quote --> +<!-- <remove value="`"/>--> +<!-- <remove value="$"/>--> +<!-- <remove value="<"/>--> + <!--<remove value="&"/> removed for MascotAdapterOnline -Mascot_server:export_params which is a URL POST string which can contain & .. could be mapped to & but there is still a & --> + <!--<remove value=";"/>--> +<!-- <remove value="#"/>--> + </valid> + </sanitizer> + </xml> + <xml name="list_float_valsan" token_name=""> + <validator type="regex" message="parameter @NAME@: a space separated list of float values is required">^ *[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?( *[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)* *$</validator> + <yield/> + <sanitizer> + <valid initial="string.digits"> + <add value=" "/> + <add value="."/> + <add value="E"/> + <add value="e"/> + <add value="+"/> + <add value="-"/> + </valid> + </sanitizer> + </xml> + <xml name="list_integer_valsan" token_name=""> + <validator type="regex" message="parameter @NAME@: a space separated list of integer values is required">^ *[+-]?[0-9]+( *[+-]?[0-9]+)* *$</validator> + <yield/> + <sanitizer> + <valid initial="string.digits"> + <add value=" "/> + <add value="+"/> + <add value="-"/> + </valid> + </sanitizer> + </xml> + + <!-- helper function to quote space separated strings --> + <token name="@QUOTE_FOO@"> +#def quote(s): + #set $s = [ _ for _ in $s.split(" ") if _ != "" ] + #set $q = False + #for $i, $p in enumerate($s): + #if $p == "": + #continue + #end if + #if $p.startswith('"'): + #set $q = True + #end if +## #if p.startswith('-'): +## #set p = "\\" + p +## #elif p.startswith('"-'): +## #set p = "\\" + p[1:] +## #end if + #if not $q: + #set $s[i] = '"%s"' % p + #end if + #if $p.endswith('"'): + #set $q = False + #end if + #end for + #return " ".join($s) +#end def + </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'} + #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'} + #return m[g] +#end def +]]></token></macros> |
b |
diff -r 000000000000 -r fb0ebc6f97f3 prepare_test_data_manual.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/prepare_test_data_manual.sh Thu Dec 01 19:22:27 2022 +0000 |
[ |
b'@@ -0,0 +1,164 @@\n+MSSimulator -test -in DecoyDatabase_1.fasta -out MSsimulator.mzml -algorithm:RandomNumberGenerators:biological reproducible -algorithm:RandomNumberGenerators:technical reproducible > MSSimulator_1.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'MSSimulator_1 failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+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\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'MSSimulator_2 failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+ClusterMassTracesByPrecursor -test -in_ms1 ConsensusMapNormalizer_input.consensusXML -in_swath ConsensusMapNormalizer_input.consensusXML -out ClusterMassTracesByPrecursor.mzml > ClusterMassTracesByPrecursor.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'ClusterMassTracesByPrecursor failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+ClusterMassTraces -test -in ConsensusMapNormalizer_input.consensusXML -out ClusterMassTraces.mzml > ClusterMassTraces.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'ClusterMassTraces failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+CVInspector -test -cv_files CHEMISTRY/XLMOD.obo -cv_names XLMOD -mapping_file MAPPING/ms-mapping.xml -html CVInspector.html > CVInspector.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'CVInspector failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+DeMeanderize -test -in MSsimulator_MALDI.mzml -out DeMeanderize.mzml > DeMeanderize.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'DeMeanderize failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+# TODO DigestorMotif\n+\n+Digestor -test -in random.fa -out Digestor.fasta -out_type fasta > Digestor.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'Digestor failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+EICExtractor -test -in spectra.mzML -pos FileConverter_10_input.edta -out EICExtractor.csv > EICExtractor.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'EICExtractor failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+#TODO ERPairFinder\n+\n+FeatureFinderIsotopeWavelet -test -in FeatureFinderCentroided_1_input.mzML -out FeatureFinderIsotopeWavelet.featureXML > FeatureFinderIsotopeWavelet.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'FeatureFinderIsotopeWavelet failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+\n+FFEval -test -in FeatureFinderCentroided_1_output.featureXML -truth FeatureFinderCentroided_1_output.featureXML -out FFEval.featureXML -out_roc FFEval_roc.csv > FFEval.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'FFEval failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+# TODO? deprecated IDDecoyProbability\n+\n+IDExtractor -test -in MSGFPlusAdapter_1_out.idXML -best_hits -number_of_peptides 1 -out IDExtractor.idXML > IDExtractor.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'IDExtractor failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+LabeledEval -test -in FeatureLinkerLabeled_1_input.featureXML -truth FeatureLinkerLabeled_1_output.consensusXML> LabeledEval.txt > LabeledEval.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'LabeledEval failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+MapStatistics -test -in SiriusAdapter_3_input.featureXML -out MapStatistics.txt > MapStatistics_1.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'MapStatistics_1 failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+MapStatistics -test -in ConsensusXMLFile_1.consensusXML -out MapStatistics2.txt > MapStatistics_2.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'MapStatistics_2 failed\'; '..b'-out RNPxlXICFilter.mzML > RNPxlXICFilter.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'RNPxlXICFilter failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+RTEvaluation -in PeptideIndexer_1.idXML -out RTEvaluation.tsv > RTEvaluation.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'RTEvaluation failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+SemanticValidator -test -in FileFilter_1_input.mzML -mapping_file MAPPING/ms-mapping.xml > SemanticValidator.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'SemanticValidator failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+IDFilter -in PeptideIndexer_1.idXML -best:strict -out SequenceCoverageCalculator_1.idXML > IDFilter.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'IDFilter failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+SequenceCoverageCalculator -test -in_database PeptideIndexer_1.fasta -in_peptides SequenceCoverageCalculator_1.idXML -out SequenceCoverageCalculator.txt > SequenceCoverageCalculator.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'SequenceCoverageCalculator failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+# TODO SpecLibCreator\n+\n+SpectraFilterBernNorm -test -in SpectraFilterSqrtMower_1_input.mzML -out SpectraFilterBernNorm.mzML > SpectraFilterBernNorm.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'SpectraFilterBernNorm failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+SpectraFilterMarkerMower -test -in SpectraFilterSqrtMower_1_input.mzML -out SpectraFilterMarkerMower.mzML > SpectraFilterMarkerMower.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'SpectraFilterMarkerMower failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+SpectraFilterNLargest -test -in SpectraFilterSqrtMower_1_input.mzML -out SpectraFilterNLargest.mzML > SpectraFilterNLargest.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'SpectraFilterNLargest failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+SpectraFilterNormalizer -test -in SpectraFilterSqrtMower_1_input.mzML -out SpectraFilterNormalizer.mzML > SpectraFilterNormalizer.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'SpectraFilterNormalizer failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+SpectraFilterParentPeakMower -test -in SpectraFilterSqrtMower_1_input.mzML -out SpectraFilterParentPeakMower.mzML > SpectraFilterParentPeakMower.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'SpectraFilterParentPeakMower failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+SpectraFilterScaler -test -in SpectraFilterSqrtMower_1_input.mzML -out SpectraFilterScaler.mzML > SpectraFilterScaler.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'SpectraFilterScaler failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+SpectraFilterThresholdMower -test -in SpectraFilterSqrtMower_1_input.mzML -out SpectraFilterThresholdMower.mzML > SpectraFilterThresholdMower.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'SpectraFilterThresholdMower failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+SpectraMerger -test -in NovorAdapter_in.mzML -out SpectraMerger_1.mzML > SpectraMerger.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'SpectraMerger failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+# TODO SvmTheoreticalSpectrumGeneratorTrainer\n+\n+TransformationEvaluation -test -in FileInfo_16_input.trafoXML -out TransformationEvaluation.trafoXML > TransformationEvaluation.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'TransformationEvaluation failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n+\n+XMLValidator -test -in FileFilter_1_input.mzML > XMLValidator.stdout 2> stderr\n+if [[ "$?" -ne "0" ]]; then >&2 echo \'XMLValidator failed\'; >&2 echo -e "stderr:\\n$(cat stderr | sed \'s/^/ /\')"; fi\n' |
b |
diff -r 000000000000 -r fb0ebc6f97f3 readme.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/readme.md Thu Dec 01 19:22:27 2022 +0000 |
b |
@@ -0,0 +1,161 @@ +Galaxy wrapper for OpenMS +========================= + +OpenMS is an open-source software C++ library for LC/MS data management and analyses. +It offers an infrastructure for the rapid development of mass spectrometry related software. +OpenMS is free software available under the three clause BSD license and runs under Windows, MacOSX and Linux. + +More informations are available at: + + * https://github.com/OpenMS/OpenMS + * 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 +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 +CTD/XML attributes. + +Note that, due to its size, the test data is excluded from this repository. In +order to generate the test data on call `test-data.sh`. + +Manual updates should only be done to + +- and the manually contributed tests in `macros_test.xml` (The goal is that all + tools that do not have an automatically generated test are covered here) +- the `hardcoded_params.json` files + +Wrapper versions are managed in `bump.json`. For tools listed in the file +the wrapper version will be set accordingly and otherwise `0` is used. +For a major update of the tool version the bump file should be reset (to `{}`). + +In a few cases patches may be acceptable. + +Installation +============ + +The Galaxy OpenMS tools can be installed from the toolshed. While most tools +will work out of the box some need attention since requirements can not be +fulfilled via Conda: + +Not yet in Conda are: + +- SpectraST (http://tools.proteomecenter.org/wiki/index.php?title=SpectraST) +- MaRaCluster (https://github.com/statisticalbiotechnology/maracluster) + +Binaries for these tools can easily be obtained via: + +``` +VERSION=.... +git git clone -b release/$VERSION.0 https://github.com/OpenMS/OpenMS.git OpenMS$VERSION.0-git +git submodule init OpenMS$VERSION.0-git +git submodule update OpenMS$VERSION.0-git +``` + +They are located in `OpenMS$VERSION-git/THIRDPARTY/`. + +Not in Conda due to licencing restrictions: + +- Mascot http://www.matrixscience.com/ +- MSFragger https://github.com/Nesvilab/MSFragger +- Novor http://www.rapidnovor.org/novor + +There are multiple ways to enable the Galaxy tools to use these binaries. + +- Just copy them to the `bin` path within Galaxy's conda environment +- Put them in any other path that that is included in PATH +- Edit the corresponding tools: In the command line part search for the parameters `-executable`, `-maracluster_executable`, or `-mascot_directory` and edit them appropriately. + +Working +======= + +The tools work by: + +Preprocessing: + +- For input data set parameters the links to the actual location of the data + sets are created, the link names are `element_identifier`.`EXT`, where `EXT` + is an extension that is known by OpenMS +- In order to avoid name collisions for the created links each is placed in a + unique directory: `PARAM_NAME/DATASET_ID`, where `PARAM_NAME` is the name + of the parameter and `DATASET_ID` is the id of the Galaxy dataset +- the same happens for output parameters that are in 1:1 correspondence with + an input parameter + + +Main: + +- The galaxy wrapper create two json config files: one containing the + parameters and the values chosen by the user and the other the values of + hardcoded parameters. +- With `OpenMSTool -write_ctd ./` a CTD (names OpenMSTool.ctd) file is + generated that contains the default values. +- A call to `fill_ctd.py` fills in the values from the json config files into + the CTD file +- The actual tool is called `OpenMSTool -ini OpenMSTool.ctd` and also all input + and output parameters are given on the command line. + +Postprocessing: + +- output data sets are moved to the final locations + +Note: The reason for handling data sets on the command line (and not specifying +them in the CTD file) is mainly that all files in Galaxy have the extension +`.dat` and OpenMS tools require an appropriate extension. But this may change +in the future. + +Generating OpenMS wrappers +========================== + +1. remove old test data: `rm -rf $(ls -d test-data/* | egrep -v "random|\.loc")` +2. `./generate.sh` + +Whats happening: + +1. The binaries of the OpenMS package can generate a CTD file that describes + the parameters. These CTD files are converted to xml Galaxy tool descriptions + using the `CTDConverter`. + +2. The CI testing framework of OpenMS contains command lines and test data + (https://github.com/OpenMS/OpenMS/tree/develop/src/tests/topp). These tests + are described in two CMake files. + + - From these CMake files Galaxy tests are auto generated and stored in `macros_autotest.xml` + - The command lines are stored in `prepare_test_data.sh` for regeneration of test data + +More details can be found in the comments of the shell script. + +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) +============= + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + |
b |
diff -r 000000000000 -r fb0ebc6f97f3 test-data.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data.sh Thu Dec 01 19:22:27 2022 +0000 |
[ |
b'@@ -0,0 +1,278 @@\n+#!/usr/bin/env bash\n+\n+VERSION=2.8\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+\n+# install conda\n+if [ -z "$tmp" ]; then\n+ tmp=$(mktemp -d)\n+ created="yes"\n+fi\n+\n+export OPENMSGIT="$tmp/OpenMS$VERSION.0-git"\n+export OPENMSPKG="$tmp/OpenMS$VERSION-pkg/"\n+export OPENMSENV="OpenMS$VERSION-env"\n+\n+if [ -z "$CTDCONVERTER" ]; then\n+ export CTDCONVERTER="$tmp/CTDConverter"\n+fi\n+\n+if [[ -z "$1" ]]; then\n+\tautotests="/dev/null"\n+else\n+\tautotests="$1"\n+fi\n+\n+if type conda > /dev/null; then \n+ true\n+else\n+ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\n+ bash Miniconda3-latest-Linux-x86_64.sh -b -p "$tmp/miniconda"\n+ source "$tmp/miniconda/bin/activate"\n+fi\n+eval "$(conda shell.bash hook)"\n+\n+\n+###############################################################################\n+## get \n+## - conda environment (for executing the binaries) and \n+## - the git clone of OpenMS (for generating the tests)\n+###############################################################################\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+else\n+ cd $OPENMSGIT\n+ git pull origin release/$VERSION.0-plus\n+ cd -\n+fi\n+\n+echo "Create OpenMS $VERSION conda env"\n+# TODO currently add lxml (needed by CTDConverter)\n+# TODO for some reason a to recent openjdk is used\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+# chmod -R u-w $OPENMSENV \n+fi\n+###############################################################################\n+## get the \n+## - conda package (for easy access and listing of the OpenMS binaries), \n+###############################################################################\n+echo "Download OpenMS $VERSION package $CONDAPKG"\n+\n+if [[ ! -d $OPENMSPKG ]]; then\n+ mkdir $OPENMSPKG\n+ wget -q -P $OPENMSPKG/ "$CONDAPKG"\n+ tar -xf $OPENMSPKG/"$(basename $CONDAPKG)" -C $OPENMSPKG/\n+ rm $OPENMSPKG/"$(basename $CONDAPKG)"\n+fi\n+\n+###############################################################################\n+## Get python libaries for CTD -> Galaxy conversion\n+## TODO fix to main repo OR conda packkage if PRs are merged \n+###############################################################################\n+echo "Clone CTDConverter"\n+if [[ ! -d $CTDCONVERTER ]]; then\n+ #git clone https://github.com/WorkflowConversion/CTDConverter.git CTDConverter\n+ git clone -b topic/fix-selects2 https://github.com/bernt-matthias/CTDConverter.git $CTDCONVERTER\n+else\n+ cd $CTDCONVERTER\n+ git pull origin topic/fix-selects2\n+ cd -\n+fi\n+conda activate $OPENMSENV\n+cd $CTDCONVERTER\n+python -m pip install . --no-deps\n+cd -\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+echo "Get test data"\n+find test-data -type f,l,d ! -name "*fa" ! -name "*loc" ! -name "test-data" -delete\n+\n+cp $(find $OPENMSGIT/src/tests/topp/ -type f | grep -Ev "third_party_tests.cmake|CMakeLists.t'..b'RDPARTY/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 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+\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+../prepare_test_data.sh\n+cd - || exit\n+\n+\n+# ###############################################################################\n+# ## create/update test data for the manually generated tests\n+# ## - run convert once with the manual tests only and \n+# ## - update test-data (needs to run 2x)\n+# ###############################################################################\n+echo "Execute test shell script for manually curated tests"\n+chmod u+x prepare_test_data_manual.sh\n+cd ./test-data || exit\n+../prepare_test_data_manual.sh\n+cd - || exit\n+\n+\n+###############################################################################\n+## auto generate tests\n+###############################################################################\n+\n+echo "Write test macros to $autotests"\n+echo "<macros>" > "$autotests"\n+\n+for i in $(ls ctd/*ctd)\n+do\n+ b=$(basename "$i" .ctd)\n+ get_tests2 "$b" >> "$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+# -> OpenSwathFileSplitter IDRipper MzMLSplitter SeedListGenerator\n+# TODO reevaluate in >2.8 \n+# - https://github.com/OpenMS/OpenMS/pull/5873\n+# - https://github.com/OpenMS/OpenMS/pull/5912\n+#\n+# Furthermore we remove tests for tools without binaries in conda\n+# -> MSFragger MaRaClusterAdapter NovorAdapter \n+#\n+# not able to specify composite test data \n+# -> SpectraSTSearchAdapter \n+if [[ ! -z "$1" ]]; then\n+ echo "" > macros_discarded_auto.xml\n+ for i in OpenSwathFileSplitter IDRipper MzMLSplitter SeedListGenerator MSFraggerAdapter MaRaClusterAdapter NovorAdapter SpectraSTSearchAdapter\n+ do\n+ echo "<xml name=\\"manutest_$i\\">" >> macros_discarded_auto.xml\n+ xmlstarlet sel -t -c "/macros/xml[@name=\'autotest_$i\']/test" macros_autotest.xml >> macros_discarded_auto.xml\n+ echo "</xml>" >> macros_discarded_auto.xml\n+ xmlstarlet ed -d "/macros/xml[@name=\'autotest_$i\']/test" macros_autotest.xml > tmp\n+ mv tmp macros_autotest.xml\n+ done\n+ >&2 echo "discarded autogenerated macros for curation in macros_discarded_auto.xml"\n+fi\n+conda deactivate\n+\n+## remove broken symlinks in test-data\n+find test-data/ -xtype l -delete\n+\n+if [ ! -z "$created" ]; then\n+ echo "Removing temporary directory"\n+ rm -rf "$tmp"\n+fi\n' |
b |
diff -r 000000000000 -r fb0ebc6f97f3 test-data/pepnovo_models.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/pepnovo_models.loc Thu Dec 01 19:22:27 2022 +0000 |
b |
@@ -0,0 +1,13 @@ +#name value path +default_models CID_IT_TRYP ${__HERE__}/pepnovo_models/ +default_models LTQ_COMP ${__HERE__}/pepnovo_models/ +default_models DBC4_PEAK ${__HERE__}/pepnovo_models/ +default_models CID_IT_TRYP_TAG5 ${__HERE__}/pepnovo_models/ +default_models CID_IT_TRYP_TAG6 ${__HERE__}/pepnovo_models/ +default_models ITDNV_PEAK ${__HERE__}/pepnovo_models/ +default_models CID_IT_TRYP_SCORE ${__HERE__}/pepnovo_models/ +default_models CID_IT_TRYP_TAG3 ${__HERE__}/pepnovo_models/ +default_models CID_IT_TRYP_DNVPART ${__HERE__}/pepnovo_models/ +default_models CID_IT_TRYP_TAG4 ${__HERE__}/pepnovo_models/ +default_models CID_IT_TRYP_DB ${__HERE__}/pepnovo_models/ +default_models CID_IT_TRYP_CSP ${__HERE__}/pepnovo_models/ |
b |
diff -r 000000000000 -r fb0ebc6f97f3 test-data/random.fa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/random.fa Thu Dec 01 19:22:27 2022 +0000 |
b |
@@ -0,0 +1,18 @@ +>RND24402 Randomly generated sequence, created by ExPASy tool RandSeq, using average amino acid composition +LALLTDKYSVTKSIKGYAGQQQKCTDDEGLAEDSAAMSLVPIRAAWTISVSVDLFYLGIV +TNVTKDSVEHLVGIPLVTHEFMASRCEMRGQVVSATFGSWQKAESKAYRIPLKATPLDEF +VESAVYLFGGSSNEYECVLIGNSHPVLIFLDIDAVPGARKPRTGFFMAEGFHSKGETRAL +VGKSPPLGEYRKGAFHFTFPIKEAIRLGPPKKRIMGYRDALEGGLNHYVQTQVLVLLPMI +QVARRWENGLGLLVGKFLKLPTHPLDLNQVTLCWSEAVTEDNKRFLLTIKTSAQGKSAPT +SHINYVPQHNSMELMAINGSPFAAQHKSNDEIESMRDLSKLYADAETLESHGERGVRHQA +TETKISKVTNLRRKLPQLLDLNVVDNACNWESVGAHVLEYVLVNLYLKELQEPKVELQPR +LNETTMKAGASSLGVESGASAHSFYKGGVSEAKLRFRHVATPAAARIWWCVVMFRINRRY +DGITYNSVGEQLSGVHEYVRAAQLFGLTTGKNLRSTGIVIIKLSTAIDLECLVQAKPKEA +YVLANDYIGAKPHPARLETGPALVLFIVETINNDTLNAAILITALGGKFLNVRPDLLFGV +QALFGCVRMFRHADCTIGREKFVQTEISHKAKFLYEINEFFLERILQFEEAKSPVGAPAY +DIPIGRGLVMDSSTDLWNIYVVELISGQEKRTGIDPDTPMGTSHNLYMTDARLDERDQRS +FLNSEFVKPSKLANGSEWADPYVEPDKTEVIAFFPATLIVIMADGSALNGQVCIQPAKDN +SKMADDLATVHIGQDRPCDWGISASHEYDEVNRPARINGVMMQQLMAEDNQGPGASPRDQ +MGDADDLKEIKWNKYVIDNEIIGRERGISAERVKIFLGDTLTARGLLDSPPGQTKVFDLR +PRQSDKNQSGMFKRDQNAMYFPLEYDRIGAQTDTGSLYSTLITKFASISIDLVKLSMPRE +KQIDEERLHSEFIENQKRSALPAVQKNLACISCVEACRGT |
b |
diff -r 000000000000 -r fb0ebc6f97f3 test-data/random_RNA.fa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/random_RNA.fa Thu Dec 01 19:22:27 2022 +0000 |
b |
@@ -0,0 +1,2 @@ +> random RNA +GUGUUACUGCCACGAAACAAAAUGUUCAAGACACCGGGCGCCAUCUGUAUAUUACUCGCCAAUCAGACGGUCUGCAACGCUACAGACAUGGAGCUCAGCGCUGACGAUGUCGCCGGACCAAGUACGAUCACUUUGCUCGUGCAAAUGUUCGUCCGCAUUGGGCACUAUAACUCGAAUUGUCGAAUCCGGGUGGCGAGCCGCCACUUAUAGGAUAAAUAUUCAAACUAACAUUAUGGCGCCAAAUCUGCAAUCUCUACUUUAGACAUUAUAUACCCACAUUUACAAUUAGAGUUAUUAUUAGUUAACGUGUGCCAGAGCAGGGAUGGCUCUUGUCAGCCAUAGUUGUGUGAACGGGCUGUAUUUCCUUCCUAAUUAUAGAGCGGCACCGGAAAGCAAUGCACGAUCCACGAGGGCACUUCACAUGGUCACAAACAGUCAUUCUGGUACCCUGAUUCGUUCCCGAAAGGGAAGUAUAUACACGGCCCCCGUGUAUAUCGCCAGUCACACGGCAGGAGCGAGAGUUCGUUUGUAUACAUGCCCAGGAGCCUUCUCUAACUUUUGAAGCUGUGCAACUUUGUUGGCGCGUCACCACUAAGUCAGCUUAAUAGACAGCAGAUGGGAGAAUUUACCAUUUCAUUUUGUCCGAGCUGAUACCGGUAGGUCAUCUCUAAUCACCCGUUAUCCUCUCGUAAUAUAAUCGCUACUAAGGUAUGAAGGUGUCUGCGAAAGGUAACGUAAAUCAUUCUCGGCUCCUUGCAAAGUACGACUAGGAUCCAUCGUACACAUCCGGACGAAGAUGUAAAAUUGACGCCCCUGUAGGCCGUGAGACAGACGUGAGCCAAACCAUCUGCUCUACUUCUGGAGGCCUUGAAUAGUGGCGCGUUGUGUAAUCUUAAGAGAGAUUUUACUUGGAAUUACAGCCUACUUUGACCAGUAGCGCAUUGUGAACAAAUAUUCCCGUACGCGUCCAAUUGCAGCAAAACGUGGGCCUGUGUCCAGU |
b |
diff -r 000000000000 -r fb0ebc6f97f3 tool-data/pepnovo_models.loc.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool-data/pepnovo_models.loc.sample Thu Dec 01 19:22:27 2022 +0000 |
b |
@@ -0,0 +1,23 @@ +# This is a sample file distributed with Galaxy that enables tools +# to use pepnovo models +# The file has three tab separated columns: name, value, and path. +# The idea is that there are a number of models in a directory: +# - each model directory has a unique name (columns 2 and 0) +# - each model can contain a set of models (column 1) +# +# The following example works fo the default models from +# http://proteomics.ucsd.edu/Software/PepNovo.html (just remove the comment +# chars and replace DIR_TO_PEPNOVO_MODELS) + +#default_models CID_IT_TRYP DIR_TO_PEPNOVO_MODELS +#default_models LTQ_COMP DIR_TO_PEPNOVO_MODELS +#default_models DBC4_PEAK DIR_TO_PEPNOVO_MODELS +#default_models CID_IT_TRYP_TAG5 DIR_TO_PEPNOVO_MODELS +#default_models CID_IT_TRYP_TAG6 DIR_TO_PEPNOVO_MODELS +#default_models ITDNV_PEAK DIR_TO_PEPNOVO_MODELS +#default_models CID_IT_TRYP_SCORE DIR_TO_PEPNOVO_MODELS +#default_models CID_IT_TRYP_TAG3 DIR_TO_PEPNOVO_MODELS +#default_models CID_IT_TRYP_DNVPART DIR_TO_PEPNOVO_MODELS +#default_models CID_IT_TRYP_TAG4 DIR_TO_PEPNOVO_MODELS +#default_models CID_IT_TRYP_DB DIR_TO_PEPNOVO_MODELS +#default_models CID_IT_TRYP_CSP DIR_TO_PEPNOVO_MODELS |
b |
diff -r 000000000000 -r fb0ebc6f97f3 tool_data_table_conf.xml.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_data_table_conf.xml.sample Thu Dec 01 19:22:27 2022 +0000 |
b |
@@ -0,0 +1,7 @@ +<tables> + <!-- Locations of pepnovo models --> + <table name="pepnovo_models" comment_char="#" allow_duplicate_entries="False"> + <columns>name,value,path</columns> + <file path="tool-data/pepnovo_models.loc" /> + </table> +</tables> |
b |
diff -r 000000000000 -r fb0ebc6f97f3 tool_data_table_conf.xml.test --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_data_table_conf.xml.test Thu Dec 01 19:22:27 2022 +0000 |
b |
@@ -0,0 +1,7 @@ +<tables> + <!-- Locations of all eggnog_mapper data --> + <table name="pepnovo_models" comment_char="#"> + <columns>name,value,path</columns> + <file path="${__HERE__}/test-data/pepnovo_models.loc" /> + </table> +</tables> |