galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.39k stars 1k forks source link

Tool input's path in command possible ? #8043

Closed mhabsaoui closed 5 years ago

mhabsaoui commented 5 years ago

Hi,

I need to inject in the command tag, the tool's input data's path. My Tool is expecting a path (Directory to corpus containing a list of .txt documents) as parameter.

Using the following doesn't make it, as it provides a path including the name of the current processed file. It only needs the file path :

<tool id='termsuite' name='Termsuite' version='3.0.10'>
  <description>Termsuite</description>
  <command>java -cp $__tool_directory__/termsuite-core-3.0.10.jar fr.univnantes.termsuite.tools.TerminologyExtractorCLI 
                -t $__tool_directory__/treetagger 
                -c $corpus 
                -l $lng 
                --json $outfile
  </command>
  <inputs>
    <param name="corpus" type="data" format="text" label="Input corpus"/>
    <param name="lng" type="select" label="Corpus language">
        <option value="en">EN</option>
        <option value="fr">FR</option>
    </param>
  </inputs>
  <outputs>
    <data name='outfile' type="data" format='json' label="Output terminology"/>
  </outputs>
</tool>

I also tried uploading the data set (txt files) as a collection in order to test and check if any effect on the path but no text data collection detected...

image

The error triggered by my Tool => Caused by: java.lang.IllegalArgumentException: Not a directory: [/home/user/projects/galaxy/database/files/000/dataset_82.dat]

So is there any reserved variable or way to make this possible ?

Thanks.

bernt-matthias commented 5 years ago

Would be helpful to see the tool sources. But I guess you need to loop over to content of $corpus as described here https://docs.galaxyproject.org/en/master/dev/schema.html#id146

nsoranzo commented 5 years ago

Please ask support questions at https://help.galaxyproject.org/ , thanks!