# HG changeset patch # User ufz # Date 1734612668 0 # Node ID 8956e949d466101b89fdec0da4bdb2ec4eeb7311 planemo upload for repository https://github.com/Helmholtz-UFZ/galaxy-tools/tree/main/tools/dfpl commit 66c6acfeff5441c36fba97787ddc5ee3d6a4a6ec diff -r 000000000000 -r 8956e949d466 dfpl_predict.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dfpl_predict.xml Thu Dec 19 12:51:08 2024 +0000 @@ -0,0 +1,116 @@ + + association of molecular structures to biological targets + + + + + macros.xml + + + config.json && + dfpl predict --configFile config.json && + cp predictions.csv '$outputFile' + ]]> + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + +
+
+ `_. + It's equivalent to running ``dfpl predict`` from the command line. + + The predict mode uses a model that was trained with ``dfpl train`` to predict + the association of molecular structures to a biological target. + + The input file should be a CSV file with a header. + + The tool will output the given CSV file with an additional column containing the predicted values. + ]]> + +
diff -r 000000000000 -r 8956e949d466 json_flatten.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/json_flatten.py Thu Dec 19 12:51:08 2024 +0000 @@ -0,0 +1,21 @@ +import json +from sys import stdin + +d = json.load(stdin) + + +def flatten(o: dict): + d_flat = {} + for key, value in o.items(): + if type(value) is dict: + value = flatten(value) + for k, v in value.items(): + d_flat[k] = v + else: + d_flat[key] = value + return d_flat + + +d = flatten(d) + +print(json.dumps(d)) diff -r 000000000000 -r 8956e949d466 json_predict.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/json_predict.py Thu Dec 19 12:51:08 2024 +0000 @@ -0,0 +1,22 @@ +import json +from sys import stdin + +d = json.load(stdin) + +# The directory where the full model of the fnn is loaded from. +d["fnnModelDir"] = "" # 'dfpl predict' looks for "model_weights.h5" in this directory +del d["fnn_weights"] + +d["compressFeatures"] = bool(d["compressFeatures"] == "true") + +# The encoder file where it is loaded from, to compress the fingerprints. +d["ecModelDir"] = "" +d["ecWeightsFile"] = "encoder_weights.h5" + +# Output csv file name which will contain one prediction per input line. +# Default: prefix of input file name. +d["outputFile"] = "predictions.csv" + +d["py/object"] = "dfpl.options.Options" + +print(json.dumps(d)) diff -r 000000000000 -r 8956e949d466 json_train.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/json_train.py Thu Dec 19 12:51:08 2024 +0000 @@ -0,0 +1,14 @@ +import json +from sys import stdin + +d = json.load(stdin) + +d["py/object"] = "dfpl.options.Options" +d["outputDir"] = "./model/" +d["ecModelDir"] = "./autoencoder/" + +#