name        "hisat2 - map RNAseq reads to a genome"
icon    "$BIRCH/dat/blreads/CCBlogo.png"
tip    "Maps reads to a reference genome indexed by hisat2-build."

var "in1"
    type        tempfile
    direction   in
    format      tsv
    save        false

var "BNAME"
    type        text
    label       "base name for index files"
    default     ""

var "newsummary"
    type        chooser
    label       "format for Summary file"
    default     0
    choices
        "default" ""
        "machine-friendly format" "--new-summary"

var "threads"
    type        number
    label       "Number of threads to use"
    min         1
    max         16
    default     8

var "email"
    type        chooser
    label       "Notify of completion by email"
    default     1
    choices
        "Yes" "bl_email.py --recipient %ADDRESS% --subject 'hisat2 completed' --message hisat2.log;"
        "No" ""

var "address"
    type        text
    label       "    email address"
    default     ""


panel
    var "Run"
        type        button
        label       "Run"
        shell       "echo 'Start: '`date` > hisat2.log;  nice bl_hisat2.py %in1% %THREADS% -x %BNAME%  --time --dta --summary-file hisat2-summary.txt %NEWSUMMARY%  --met-file hisat2-metrics.txt >> hisat2.log; echo 'Finish: '`date` >> hisat2.log; %EMAIL% blreads "
        close       true

    var "Help"
        type        button
        label       "Help"
        shell       "$BIRCH/script/chooseviewer.py $BIRCH/doc/ccb/hisat2.man"
        close       false
