Problem with custom tool outputs, refusing to overwrite?

So I’m trying to wrap tools into galaxy using planemo, however I’m getting variations of this error: “Fatal error: Exit code 1 ()
FATAL(lofreq_call.c|main_call:1293): Cowardly refusing to overwrite file ‘/mnt/galaxy/files/000/208/dataset_208081.dat’. Exiting…”

the .dat is the output eg “lofreq call --ref “/mnt/galaxy/files/000/208/dataset_208056.dat” “/mnt/galaxy/files/000/208/dataset_208052.dat” -o “/mnt/galaxy/files/000/208/dataset_208081.dat””

here is the XML

Is there something about handling outputs that I’m missing?

I’ve found the error code in Lofreq_call
" if (vcf_out && 0 != strcmp(vcf_out, “-”)) {
if (file_exists(vcf_out)) {
if (! force_overwrite) {
LOG_FATAL(“Cowardly refusing to overwrite file ‘%s’. Exiting…\n”, vcf_out);
return 1;
} else {
/* filter will fail if we don’t remove now */

Is it normal for a tool to overwrite an empty output that galaxy has generated?

i know it’s a work-around but have you tried to give a name to the output and say to galaxy to take it from the working dir? for example:

as command :

<![CDATA[ lofreq indelqual --dindel --ref "$input1" "$input2" --out foo_bar.bam ]]>

 in the output block
 <data  format="bam" name="output" from_work_dir="foo_bar.bam"/>
1 Like

Thanks I did not know you could do this!

I solved it by using “–out tooloutput.bam && mv tooloutput.bam $output1”

lofreq indelqual and lofreq call have overwrite checks that cause fatal errors, lofreq call has an --over-write option to avoid this but this is not available in lofreq indelqual!

Does galaxy create empty outputs that it assumes a tool can overwrite?

you can avoid to do the mv if you specify the from_work_dir=“foo_bar.bam” in the output xml galaxy moves automatically the output in the database … i think the overwrite is a problem only for the files inside database and not for files in the working dir

1 Like