name        "fastq_pair - remove non-paired reads from left or right read files"
tip    "For both left and right read files, create two files, one containing paired reads, the other with singletons."
       
var "in1"
    type        tempfile
    direction   in
    format      tsv
    save        false

var "hashsize"
    type        number
    label       "Size of hashtable to use (-t)"
    min         100000
    max         1000000000
    default     100000

var "buckets"
    type        chooser
    label       "Print no. of sequences per bucket (-p)?"
    default     1
    choices
        "Yes" "--buckets"
        "No" ""

var "outdir"
    type        text
    label       "Name for output directory"
    default     "../reads.trimmed.corrected.fastq_pair"

# Enclose %ADDRESS% in single quotes, which prevents
# an error if no custom adaptor sequence is specified.
var "email"
    type        chooser
    label       "Notify of completion by email"
    default     1
    choices
        "Yes" "bl_email.py --recipient %ADDRESS% --subject 'fastq_pair completed' --message bl_fastq_pair.log;"
        "No" "chooseviewer.py bl_fastq_pair.log;"

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

panel
    var "Run"
        type        button
        label       "Run"
        shell       "nice bl_fastq_pair.py --tsv %in1% --hashsize %HASHSIZE% %BUCKETS% --outdir %OUTDIR%; cd %OUTDIR%; %EMAIL% blreads "
        close       true
    var "Hints"
        type        button
        label       "Hints"
        shell       "$BIRCH/script/chooseviewer.py $BIRCH/doc/bioLegato/blreads/fastq_pair.hints.html"
        close       false
    var "Guide"
        type        button
        label       "Guide"
        shell       "chooseviewer.py $BIRCH/doc/fastq-pair.html"
        close       false
