Skip to content

GARD codon jobs fail: genetic --code not passed to HyPhy #143

Description

@stevenweaver

Summary

GARD analyses on codon alignments fail deterministically because app/gard/gard.sh never passes --code to the HyPhy GARD invocation. HyPhy's codon model setup (models.codon.MG_REV.ModelDescription) requires a genetic code argument; without it the function is called with one argument instead of two and HyPhy aborts at load time:

Error: User-defined function 'models.codon.MG_REV.ModelDescription' needs 2 parameters, but 1 were supplied.

Nucleotide/protein GARD jobs are unaffected (that path does not require a genetic code). Every other codon-capable method in this repo already passes --code on its invocation; gard.sh is the only one that does not.

Root cause

In app/gard/gard.sh, the genetic code is resolved into GENETIC_CODE (and correctly defaults to Universal), and is even echoed to the log — but it is omitted from every GARD command line. The invocation passes --type … --alignment … --tree … --model … --mode … --rv … --rate-classes … --max-breakpoints … with no --code.

Fix

Always pass --code, keeping the existing Universal default:

GENETIC_CODE="${genetic_code:-Universal}"     # already present
# add --code to every $GARD invocation line:
$GARD --type $DATATYPE --code $GENETIC_CODE --alignment $FN --tree $TREE_FN --model $MODEL ...

Reproduction

Submit any in-frame codon alignment (DNA, equal-length sequences, length divisible by 3, no premature stop codons) to GARD with datatype = codon. The job fails within seconds with the arity error above. Adding --code Universal to the HyPhy invocation resolves it; the identical alignment run as --type nucleotide succeeds. Confirmed node-independent and fully deterministic.

Scope

  • Confirmed & reproduced: GARD.
  • Not affected: fade (FADE is a protein/amino-acid method) and hivtrace (distance-based) legitimately take no genetic code.
  • Worth a quick audit (not confirmed here): any other codon-based analysis to ensure --code is always supplied with a sane default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions