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 "IFILE"
    type        file
    label       "choose any genome index file (eg. .ht2)"
    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         $BL_CORES_MAX
    default     $BL_CORES_DEFAULT

var "OUTDIR"
    type        text
    label       "    dir. for output .bam files"
    default     "../bamfiles"

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     "$BL_EMAIL"


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

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

    var "Hints"
        type        button
        label       "Hints"
        shell       "$BIRCH/script/chooseviewer.py $BIRCH/doc/bioLegato/blreads/hisat2.hints.html"
        close       false
