Running a python script from inside a plugin
I am creating a plugin that allows a user to select sequences from Geneious, pass them through a python script to assess certain characteristics about them, and then displays the results inside Geneious under custom document fields. I was able to get this process to work with no issues inside the IDE development environment, but when I try to package the project for deployment it seems that I am no longer able to communicate with the python script. My main question is where can I find the file path that Geneious uses to run plugins and store files when run outside the IDE? I also wanted to confirm that it is possible for Geneious to use a system call outside the IDE.
Apologies for the delay in getting back to you. What you are attempting definitely seems possible, system calls from outside the IDE should work. A very common problem is that the path to the python script gets changed when you package your code into a .jar file.
Plugins generally get stored in each user's home directory which is in a different location depending on the Operating System:
I'm not quite sure what the file structure of your plugin looks like but you should be able to find it in that folder and investigate. You can rename a .jar file into a .zip file and extract it if you want to investigate the file structure more closely.
Any further questions, let me know,
Would you happen to know what the equivalent of the "GeneiousFiles" folder would be for the deployed version of Geneious. Many of my commands in the plugin rely on that folder but it seems that I can only find that folder in the development version of Geneious when it is launched from the IDE. Let me know if you have any suggestions on finding where the default folder for files generated from the sequence documents.0
Which operating system are you using? Geneious can use pretty much any system call your application is allowed to make, but MacOS requires extra configuration to use the system Python from within Geneious.
What is the exact error you are getting - e.g., is it along the lines of `python: command unknown`, or is failing to find the data files?
How are you invoking the external call? Are you manually making the call via a Process or ProcessBuilder, or using Geneious Prime's `Execution` API?
If you are packaging for deployment, is this intended to be given to users who may have their own various system setups? Do you have specific OS targets in mind?
Geneious Prime Developer0
Please sign in to leave a comment.