Holiday Notice:
The Frontline Support team will be slow to respond December 17-18 due to an institute-wide retreat and offline December 22- January 1, while the institute is closed. Thank you for your patience during these next few weeks. Happy Holidays!

Exit codes in GATK 4.0

RMuletRMulet BarcelonaMember

Hi,

In my BASH scripts I often use "$?" to monitor the exit status of a process and normally stop if there is an error. However, I am using the latest version of GATK (4.0.0.0) and some tools return 0 exit status even if they fail. Instead, they display the following message to STDOUT:

Tool returned:
1

Though inconvenient for error handling in BASH scripts, this might be an intended behaviour, but not all tools exhibit it. To mention a few, MarkDuplicates, CollectMultipleMetrics, CollectGcBiasMetrics always have a 0 exit status, whereas VariantsToTable or CountVariants do return 1 if they encounter an error.

A similar issue had been reported in the past for previous versions of GATK (https://gatkforums.broadinstitute.org/gatk/discussion/8618/error-handling-end-exit-codes-in-gatk).

Best regards,

Roger

Issue · Github
by Sheila

Issue Number
4433
State
closed
Last Updated
Assignee
Array
Closed By
cmnbroad

Best Answers

Answers

  • SheilaSheila Broad InstituteMember, Broadie, Moderator admin

    @RMulet
    Hi Roger,

    So, the Picard tools all return 0, but if GATK4 tools error, they return 1?

    If so, I can put in a request to have this changed in Picard tools.

    Thanks,
    Sheila

  • RMuletRMulet BarcelonaMember

    @Sheila,

    I haven't exhaustively tried all the Picard tools, but this seems to be the case. However, when using Picard tools as a standalone jar file it returns exit codes as expected (i.e. 1 if there is an error).

    It would be very appreciated if you could put in a request, thanks.

    Best regards,

    Roger

  • SheilaSheila Broad InstituteMember, Broadie, Moderator admin
    Accepted Answer

    @RMulet
    Hi Roger,

    Thanks for the easy to understand explanation in your first post. I just made an issue which you can keep track of here :smile:

    -Sheila

  • SheilaSheila Broad InstituteMember, Broadie, Moderator admin
    Accepted Answer

    @RMulet
    Hi again Roger,

    It seems this has been fixed and will be in the next release.

    -Sheila

Sign In or Register to comment.