I’m trying to get knime to execute a python script (or java, or perl) from the EMBL-EBI github repository. In my case emboss_needle.py and the latest knime version (SeqAn is therefore not available right now)
Let’s say this is my command: “python emboss_needle.py --email ilove@knime.com --stype protein --asequence KNIME --bsequence KNIMD” to compare two sequences. On the cmd line in my conda environment it works, for the life of me I just don’t find a solution that lets me port this to knime.
Hi
the script needs to be remote?
In that case i could only think of downloading the script with KNIME and then excecute it via bash or sth like that.
Out of the box idea nothing more
br
The script can be local, but as I understood the bash node is gone. Furthermore, I couldn’t find the Execute Shell node, even though I have the full Knime installation.
Since the script is acutally a call to a REST API, I also try the POST node, but it’s more of a guessing game how to post the parameters to the server, since there is no documentation (they want you to use the python/java/perl scripts instead)
Here is how I did for people want to interface EMBL-EBI tools:
POST node set URL to: “https://www.ebi.ac.uk/Tools/services/rest/TOOL_NAME/run”
Request Headers add Header Key “Content-Type” and Header value “application/x-www-form-urlencoded”
For the request body use the parameters that the tool offers, e.g. for emboss_needle: “email=your_mail@example.com&stype=protein&asequence=KNIME&bsequence=KNIMD”
Your body column will contain the requested result type and you can continue your analysis. Use your correct email to comply with the terms of EMBL and don’t spam jobs. Please refer to the EMBL guidelines on how many concurrent jobs are okay.
Further to @Daniel_Weikert 's comment, you can build a script in KNIME and write it to a command file / shell script file, and use the Execute Shell Script node (from @AnotherFraudUser 's AF Utilities)
This is an excellent how to. For the moment I go with my solution with POST and GET nodes. Just a further question to the Exec Shell Script node. In the field Script to execute, can we also pass parameters?
e.g. “runsomestuff.cmd --variable1=1 --variable2=2”