Hi Peter,

i wrote the tool_dependencies.xml


   <?xml version="1.0"?>
   <tool_dependency>
        <package name="jvarkit" version="1.0.0">
            <install version="1.0.0">
                <actions>
                    <action type="set_environment">
                        <environment_variable name="JVARKITDIR"
   action="set_to">$INSTALL_DIR</environment_variable>
                    </action>
                </actions>
            </install>
            <readme></readme>
        </package>
   </tool_dependency>




and updated 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="package" version="1.0.0">jvarkit</requirement>
        <requirement type="binary">java</requirement>
      </requirements>


      <command><![CDATA[java -cp
   
\$JVARKITDIR/commons-jexl-2.1.1.jar:\$JVARKITDIR/commons-logging-1.1.1.jar:\$JVARKITDIR/htsjdk-1.129.jar:\$JVARKITDIR/snappy-java-1.0.3-rc3.jar:\$JVARKITDIR/vcffilterjs.jar
   com.github.lindenb.jvarkit.tools.vcffilterjs.VCFFilterJS -e
   '${expression}' -o ${output} ${input}  ]]></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>



I still get an error:

(...)

:24,289 (31) command is: java -cp $JVARKITDIR/commons-jexl-2.1.1.jar:$JVARKITDIR/commons-logging-1.1.1.jar:$JVARKITDIR/htsjdk-1.129.jar:$JVARKITDIR/snappy-java-1.0.3-rc3.jar:$JVARKITDIR/vcffilterjs.jar com.github.lindenb.jvarkit.tools.vcffilterjs.VCFFilterJS -e 'variant!=nullX' -o /home/lindenb/tmp/GALAXY/galaxy-galaxy-dist-32e4527bab2d/database/files/000/dataset_27.dat /home/lindenb/tmp/GALAXY/galaxy-galaxy-dist-32e4527bab2d/database/files/000/dataset_1.dat; return_code=$?; c
(...)
galaxy.jobs DEBUG 2015-02-26 13:31:24,333 (31) Persisting job destination (destination id: local:///) galaxy.jobs.runners.local DEBUG 2015-02-26 13:31:25,689 execution finished: /home/lindenb/tmp/GALAXY/galaxy-galaxy-dist-32e4527bab2d/database/job_working_directory/000/31/galaxy_31.sh galaxy.jobs.output_checker INFO 2015-02-26 13:31:25,717 Job 31: Fatal error: Exit code 1 ()
galaxy.jobs DEBUG 2015-02-26 13:31:25,784 setting dataset state to ERROR

The error displayed in galaxy is just an empty VCF header (that why I asked about the error log)

Thank you for your help

PS: By the way, my argument was -e 'variant!=null;' , why do I see '-e 'variant!=nullX' in the log ?


Pierre

On Thu, Feb 26, 2015 at 10:59 AM, Pierre Lindenbaum
<pierre.lindenb...@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" &amp;&amp;

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


___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
 https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
 http://galaxyproject.org/search/mailinglists/

Reply via email to