On Thu, Feb 26, 2015 at 10:59 AM, Pierre Lindenbaum <pierre.lindenbaum@univ-nantes.fr> wrote:
Hi Galaxy,
I'm trying to put one of my java tool in galaxy.
I've copied the required files in my tool directory under /tools/jvarkit (I can see it galaxy)
$ ls commons-jexl-2.1.1.jar commons-logging-1.1.1.jar htsjdk-1.129.jar snappy-java-1.0.3-rc3.jar vcffilterjs.jar vcffilterjs.xml
Here is the content of vcffilterjs.xml
<?xml version="1.0"?> <tool hidden="false" id="com.github.lindenb.jvarkit.tools.vcffilterjs.VCFFilterJS" version="1.0.0" name="vcffilterjs"> <requirements> <requirement type="binary">java</requirement> </requirements> <command><![CDATA[java -cp $INSTALL_DIR/commons-jexl-2.1.1.jar:$INSTALL_DIR/commons-logging-1.1.1.jar:$INSTALL_DIR/htsjdk-1.129.jar:$INSTALL_DIR/snappy-java-1.0.3-rc3.jar:$INSTALL_DIR/vcffilterjs.jar com.github.lindenb.jvarkit.tools.vcffilterjs.VCFFilterJS -e '${expression}' -o ${output} ${input} 2> /tmp/error ]]></command> <inputs> <param format="vcf" name="input" type="data" label="VCF input"/> <param name="expression" type="text" label="javascript expression"/> </inputs> <outputs> <data format="vcf" name="output"/> </outputs> <stdio> <exit_code range="1:"/> <exit_code range=":-1"/> </stdio> <help>(...)</help> </tool>
When I run this tool, the log says:
NotFound: cannot find 'INSTALL_DIR'
If I replace $INSTALL_DIR with \$INSTALL_DIR ,
Yes, you need to escape the dollar sign.
the error on stderr is :
Error: Could not find or load main class com.github.lindenb.jvarkit.tools.vcffilterjs.VCFFilterJS
How can I make this work ?
Try inserting something like this into the command as a diagnostic: echo "\$INSTALL_DIR" && Where do you define $INSTALL_DIR? Is this environment variable done at system level, or are you trying to do this within a Galaxy defined package. If the later, you need a <requirements type="package" ...> tag, which cross references a package defined within a tool_dependencies.xml file. See for example: https://github.com/peterjc/pico_galaxy/tree/master/tools/clinod
Bonus question: is there a way to catch the error file to display it in galaxy when a process fails ?
Which error file? Do you mean stderr? That is captured and visible via the "eye" icon when the dataset is expanded in the history pane. Peter