#compdef rastair

autoload -U is-at-least

_rastair() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_rastair_commands" \
"*::: :->rastair" \
&& ret=0
    case $state in
    (rastair)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rastair-command-$line[1]:"
        case $line[1] in
            (call)
_arguments "${_arguments_options[@]}" : \
'-r+[Path to sorted and indexed (via samtools faidx) FASTA file. Can be bgzip compressed, but requires both a gzi index and a fai index]:FASTA_FILE:_files' \
'--fasta-file=[Path to sorted and indexed (via samtools faidx) FASTA file. Can be bgzip compressed, but requires both a gzi index and a fai index]:FASTA_FILE:_files' \
'-l+[Restrict to a specific chromosome or region of a chromosome. Format is "chr", "chr\:start" or "chr\:start-end", where start is 1-based and end is inclusive]:REGION:_default' \
'--region=[Restrict to a specific chromosome or region of a chromosome. Format is "chr", "chr\:start" or "chr\:start-end", where start is 1-based and end is inclusive]:REGION:_default' \
'--segment-max-length=[Maximum length of a segment in bases]:SEGMENT_MAX_LENGTH:_default' \
'--segment-overlap=[Number of bases to overlap between segments]:SEGMENT_OVERLAP:_default' \
'--error-model=[The error model to use]:ERROR_MODEL:((miseq\:"MiSeq <https\://support.illumina.com/sequencing/sequencing_instruments/miseq.html>"
miniseq\:"MiniSeq <https\://support.illumina.com/sequencing/sequencing_instruments/miniseq.html>"
nextseq500\:"NextSeq500 <https\://support.illumina.com/sequencing/sequencing_instruments/nextseq-500.html>"
nextseq550\:"NextSeq550 <https\://support.illumina.com/sequencing/sequencing_instruments/nextseq-550.html>"
hiseq2500\:"HiSeq2500 <https\://support.illumina.com/sequencing/sequencing_instruments/hiseq_2500.html>"
novaseq6000\:"NovaSeq6000 <https\://support.illumina.com/sequencing/sequencing_instruments/novaseq-6000.html>"
hiseqxten\:"HiSeq X Ten <https\://support.illumina.com/sequencing/sequencing_instruments/hiseq-x.html>"))' \
'--v-min-depth=[]:V_MIN_DEPTH:_default' \
'--max-coverage=[]:MAX_COVERAGE:_default' \
'-q+[Minimum mapping quality to consider a read]:MIN_MAPQ:_default' \
'--min-mapq=[Minimum mapping quality to consider a read]:MIN_MAPQ:_default' \
'-Q+[Minimum base quality to consider a base]:MIN_BASEQ:_default' \
'--min-baseq=[Minimum base quality to consider a base]:MIN_BASEQ:_default' \
'--nOT=[For OT reads, exclude \`\[r1_start, r1_end, r2_start, r2_end\]\` bases from counting]:N_OT:_default' \
'--nOB=[For OB reads, exclude \`\[r1_start, r1_end, r2_start, r2_end\]\` bases from counting]:N_OB:_default' \
'-f+[Include reads that match all of these bit-flags]:INCLUDE_FLAGS:_default' \
'--include-flags=[Include reads that match all of these bit-flags]:INCLUDE_FLAGS:_default' \
'-F+[Exclude reads that match any of these bit-flags]:EXCLUDE_FLAGS:_default' \
'--exclude-flags=[Exclude reads that match any of these bit-flags]:EXCLUDE_FLAGS:_default' \
'--cpg-novo-min-depth=[Minimum reads needed in support of de-novo CpG]:CPG_NOVO_MIN_DEPTH:_default' \
'--cpg-novo-min-baseq=[Minimum base quality for de-novo CpGs]:CPG_NOVO_MIN_BASEQ:_default' \
'--cpg-novo-min-mapq=[Minimum mapping quality for de-novo CpGs]:CPG_NOVO_MIN_MAPQ:_default' \
'--cpg-novo-min-vaf=[Minimum variant allele frequency for de-novo CpGs]:CPG_NOVO_MIN_VAF:_default' \
'--m-vaf-min=[The minimum variant allele frequency]:M_VAF_MIN:_default' \
'--m-min-depth=[The minimum number of reads to call a position as methylated]:M_MIN_DEPTH:_default' \
'--m-bq-ratio-min=[The minimum quality ratio \`(ad_alt*bq_alt + 1) / (ad_ref*bq_ref + 1)\`]:M_BQ_RATIO_MIN:_default' \
'--m-read-position-min=[The minimum relative position in read for alt allele evidence]:M_READ_POSITION_MIN:_default' \
'--m-read-position-max=[The maximum relative position in read for alt allele evidence]:M_READ_POSITION_MAX:_default' \
'--m-max-coverage=[The maximum coverage depth for methylation calling]:M_MAX_COVERAGE:_default' \
'--ml=[Use machine learning model with this threshold value to call variants and methylation events]::ML:_default' \
'--model=[Path to the combined model file containing CpG, denovo, and others models]:MODEL:_default' \
'-o+[VCF/BCF output file path (use - to write to stdout)]::VCF:_default' \
'--vcf=[VCF/BCF output file path (use - to write to stdout)]::VCF:_default' \
'--vcf-threads=[Number of threads to use for writing (and compressing) VCF files]:VCF_THREADS:_default' \
'*--vcf-info-fields=[Additional INFO fields to include in VCF output (comma-separated VCF field IDs)]:VCF_INFO_FIELDS:(AD BQ DP MQ MQ0 NS AS_SB SC5 AF ABQ AMQ AS_SS_BQ AS_SS_MQ PIR ENT100 NAB NOI M5mC_Strands CPG CPGnovo)' \
'*--vcf-format-fields=[Additional FORMAT fields to include in VCF output (comma-separated VCF field IDs)]:VCF_FORMAT_FIELDS:(GT GL GC DP M5mC ML)' \
'--bed=[Output BED file with the called methylated positions]::BED:_default' \
'--bed-format=[Format of the output BED file]:BED_FORMAT:((bed-gz\:"BGZIP compressed file, usually \`.bed.gz\`"
bed\:"Regular BED file, usually \`.bed\`"))' \
'-@+[Number of threads to use for processing the BAM file. Will use all available threads when not specified]:TOTAL_THREADS:_default' \
'--threads=[Number of threads to use for processing the BAM file. Will use all available threads when not specified]:TOTAL_THREADS:_default' \
'--keep-overlapping-reads[Whether to keep overlapping reads]' \
'--no-ml[Only use hard thresholds to call variants and methylation events]' \
'--all[Output all positions, even if they do not pass filters]' \
'-c[Report CpGs only and default to BED output]' \
'--cpgs-only[Report CpGs only and default to BED output]' \
'--bed-include-empty[Include CpG positions with zero coverage]' \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':bam_file -- Path to sorted and indexed BAM file:_files' \
&& ret=0
;;
(per-read)
_arguments "${_arguments_options[@]}" : \
'-r+[Path to sorted and indexed (via samtools faidx) FASTA file. Can be bgzip compressed, but requires both a gzi index and a fai index]:FASTA_FILE:_files' \
'--fasta-file=[Path to sorted and indexed (via samtools faidx) FASTA file. Can be bgzip compressed, but requires both a gzi index and a fai index]:FASTA_FILE:_files' \
'-l+[Restrict to a specific chromosome or region of a chromosome. Format is "chr", "chr\:start" or "chr\:start-end", where start is 1-based and end is inclusive]:REGION:_default' \
'--region=[Restrict to a specific chromosome or region of a chromosome. Format is "chr", "chr\:start" or "chr\:start-end", where start is 1-based and end is inclusive]:REGION:_default' \
'--segment-max-length=[Maximum length of a segment in bases]:SEGMENT_MAX_LENGTH:_default' \
'--segment-overlap=[Number of bases to overlap between segments]:SEGMENT_OVERLAP:_default' \
'--calls=[BED file Rastair wrote with methylation calls per position]:CALLS:_files' \
'-f+[Include reads that match all of these bit-flags]:INCLUDE_FLAGS:_default' \
'--include-flags=[Include reads that match all of these bit-flags]:INCLUDE_FLAGS:_default' \
'-F+[Exclude reads that match any of these bit-flags]:EXCLUDE_FLAGS:_default' \
'--exclude-flags=[Exclude reads that match any of these bit-flags]:EXCLUDE_FLAGS:_default' \
'-w+[expected maximum read length. If set too short, some read positions might not get counted. Safest to set this a bit higher than the actual read length, to allow for indels in reads]:MAX_READ_LENGTH:_default' \
'--max-read-length=[expected maximum read length. If set too short, some read positions might not get counted. Safest to set this a bit higher than the actual read length, to allow for indels in reads]:MAX_READ_LENGTH:_default' \
'-q+[Minimum mapping quality per aligned read]:MIN_MAPQ:_default' \
'--min-mapq=[Minimum mapping quality per aligned read]:MIN_MAPQ:_default' \
'--bed=[Output BED file with all reads]::BED:_default' \
'--bed-format=[Format of the output BED reads file]:BED_FORMAT:((bed-gz\:"BGZIP compressed file, usually \`.bed.gz\`"
bed\:"Regular BED file, usually \`.bed\`"))' \
'-@+[Number of threads to use for processing the BAM file. Will use all available threads when not specified]:TOTAL_THREADS:_default' \
'--threads=[Number of threads to use for processing the BAM file. Will use all available threads when not specified]:TOTAL_THREADS:_default' \
'-A[Report reads with no CpGs in them]' \
'--all-reads[Report reads with no CpGs in them]' \
'--exclude-ambiguous[Exclude reads where the orientation cannot be unambiguously determined]' \
'--count-clipped[Count clipped positions]' \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':bam_file -- Path to sorted and indexed BAM file:_files' \
&& ret=0
;;
(bam)
_arguments "${_arguments_options[@]}" : \
'-r+[Path to sorted and indexed (via samtools faidx) FASTA file. Can be bgzip compressed, but requires both a gzi index and a fai index]:FASTA_FILE:_files' \
'--fasta-file=[Path to sorted and indexed (via samtools faidx) FASTA file. Can be bgzip compressed, but requires both a gzi index and a fai index]:FASTA_FILE:_files' \
'-l+[Restrict to a specific chromosome or region of a chromosome. Format is "chr", "chr\:start" or "chr\:start-end", where start is 1-based and end is inclusive]:REGION:_default' \
'--region=[Restrict to a specific chromosome or region of a chromosome. Format is "chr", "chr\:start" or "chr\:start-end", where start is 1-based and end is inclusive]:REGION:_default' \
'--segment-max-length=[Maximum length of a segment in bases]:SEGMENT_MAX_LENGTH:_default' \
'-o+[Output file]:OUTPUT:_default' \
'--output=[Output file]:OUTPUT:_default' \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':bam_file -- Path to sorted and indexed BAM file:_files' \
':calls_file -- Rastair'\''s calls to determine methylation:_files' \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
'-i+[Input file]:INPUT:_files' \
'--input=[Input file]:INPUT:_files' \
'-f+[Input file format, guessed from file extension if not specified]:INPUT_FORMAT:((vcf\:"Text-based VCF format (.vcf)"
bcf\:"Binary VCF format (.bcf)"
vcf-compressed\:"Compressed text-based VCF format (.vcf.gz)"
mpk.lz4\:""))' \
'--input-format=[Input file format, guessed from file extension if not specified]:INPUT_FORMAT:((vcf\:"Text-based VCF format (.vcf)"
bcf\:"Binary VCF format (.bcf)"
vcf-compressed\:"Compressed text-based VCF format (.vcf.gz)"
mpk.lz4\:""))' \
'-o+[Output file]:OUTPUT:_default' \
'--output=[Output file]:OUTPUT:_default' \
'-F+[Output file format, guessed from file extension if not specified]:OUTPUT_FORMAT:((vcf\:"Text-based VCF format (.vcf)"
bcf\:"Binary VCF format (.bcf)"
vcf-compressed\:"Compressed text-based VCF format (.vcf.gz)"
mpk.lz4\:""
bed\:"Regular BED file, usually \`.bed\`"
bed-gz\:"BGZIP compressed file, usually \`.bed.gz\`"))' \
'--output-format=[Output file format, guessed from file extension if not specified]:OUTPUT_FORMAT:((vcf\:"Text-based VCF format (.vcf)"
bcf\:"Binary VCF format (.bcf)"
vcf-compressed\:"Compressed text-based VCF format (.vcf.gz)"
mpk.lz4\:""
bed\:"Regular BED file, usually \`.bed\`"
bed-gz\:"BGZIP compressed file, usually \`.bed.gz\`"))' \
'--error-model=[]:ERROR_MODEL:((miseq\:"MiSeq <https\://support.illumina.com/sequencing/sequencing_instruments/miseq.html>"
miniseq\:"MiniSeq <https\://support.illumina.com/sequencing/sequencing_instruments/miniseq.html>"
nextseq500\:"NextSeq500 <https\://support.illumina.com/sequencing/sequencing_instruments/nextseq-500.html>"
nextseq550\:"NextSeq550 <https\://support.illumina.com/sequencing/sequencing_instruments/nextseq-550.html>"
hiseq2500\:"HiSeq2500 <https\://support.illumina.com/sequencing/sequencing_instruments/hiseq_2500.html>"
novaseq6000\:"NovaSeq6000 <https\://support.illumina.com/sequencing/sequencing_instruments/novaseq-6000.html>"
hiseqxten\:"HiSeq X Ten <https\://support.illumina.com/sequencing/sequencing_instruments/hiseq-x.html>"))' \
'--bed-ml=[Minimum ML score to consider a position as variant]:ML_THRESHOLD:_default' \
'--all[Output all positions, even if they do not pass filters]' \
'-c[Report CpGs only and default to BED output]' \
'--cpgs-only[Report CpGs only and default to BED output]' \
'--bed-include-empty[Include CpG positions with zero coverage]' \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(ml)
_arguments "${_arguments_options[@]}" : \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_rastair__ml_commands" \
"*::: :->ml" \
&& ret=0

    case $state in
    (ml)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rastair-ml-command-$line[1]:"
        case $line[1] in
            (train)
_arguments "${_arguments_options[@]}" : \
'-r+[Path to sorted and indexed (via samtools faidx) FASTA file. Can be bgzip compressed, but requires both a gzi index and a fai index]:FASTA_FILE:_files' \
'--fasta-file=[Path to sorted and indexed (via samtools faidx) FASTA file. Can be bgzip compressed, but requires both a gzi index and a fai index]:FASTA_FILE:_files' \
'-l+[Restrict to a specific chromosome or region of a chromosome. Format is "chr", "chr\:start" or "chr\:start-end", where start is 1-based and end is inclusive]:REGION:_default' \
'--region=[Restrict to a specific chromosome or region of a chromosome. Format is "chr", "chr\:start" or "chr\:start-end", where start is 1-based and end is inclusive]:REGION:_default' \
'-o+[Output directory for trained models]:OUTPUT:_files' \
'--output=[Output directory for trained models]:OUTPUT:_files' \
'--n-trees=[Number of trees in the random forest]:N_TREES:_default' \
'--max-features=[Number of features to consider at each split (mtry parameter)]:MAX_FEATURES:_default' \
'--n-positive=[Number of positive examples (SNPs) to sample for training]:N_POSITIVE:_default' \
'--n-negative=[Number of negative examples (REF positions) to sample for training]:N_NEGATIVE:_default' \
'--ml=[ML threshold for model evaluation (used for reporting metrics)]::ML:_default' \
'--ml-features=[]:ML_FEATURES:(standard simple)' \
'-@+[Number of threads to use]:THREADS:_default' \
'--threads=[Number of threads to use]:THREADS:_default' \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':bam_file -- Path to sorted and indexed BAM file:_files' \
':truth -- Path to the ground truth file (VCF) to train with:_files' \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
'-l+[Region to analyze (e.g., chr16)]:REGION:_default' \
'--region=[Region to analyze (e.g., chr16)]:REGION:_default' \
'--ml-threshold=[ML score threshold for calling variants]:ML_THRESHOLD:_default' \
'-@+[Number of threads to use]:THREADS:_default' \
'--threads=[Number of threads to use]:THREADS:_default' \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':predictions -- Path to predictions VCF file (output from rastair2 call):_files' \
':truth -- Path to ground truth VCF file:_files' \
&& ret=0
;;
(pack)
_arguments "${_arguments_options[@]}" : \
'-o+[Output combined model file (.mpk.lz4)]:OUTPUT:_files' \
'--output=[Output combined model file (.mpk.lz4)]:OUTPUT:_files' \
'--ml-features=[Feature set used to train the input models]:ML_FEATURES:(standard simple)' \
'--cpg-platt-a=[Platt scaling parameter A for CpG model]:CPG_PLATT_A:_default' \
'--cpg-platt-b=[Platt scaling parameter B for CpG model]:CPG_PLATT_B:_default' \
'--denovo-platt-a=[Platt scaling parameter A for de-novo CpG model]:DENOVO_PLATT_A:_default' \
'--denovo-platt-b=[Platt scaling parameter B for de-novo CpG model]:DENOVO_PLATT_B:_default' \
'--others-platt-a=[Platt scaling parameter A for others model]:OTHERS_PLATT_A:_default' \
'--others-platt-b=[Platt scaling parameter B for others model]:OTHERS_PLATT_B:_default' \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':cpg -- CpG random forest model (.mpk.lz4):_default' \
':denovo -- De-novo CpG random forest model (.mpk.lz4):_default' \
':others -- Other positions random forest model (.mpk.lz4):_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_rastair__ml__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rastair-ml-help-command-$line[1]:"
        case $line[1] in
            (train)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(pack)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(view)
_arguments "${_arguments_options[@]}" : \
'-o+[Message Pack file to view]:OUTPUT:_default' \
'--output=[Message Pack file to view]:OUTPUT:_default' \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':input -- Message Pack file to view:_default' \
&& ret=0
;;
(mbias)
_arguments "${_arguments_options[@]}" : \
'--region=[Genomic region]:REGION:_default' \
'--include-flag=[Include bitflag as integer]:INCLUDE_FLAG:_default' \
'--exclude-flag=[Exclude bitflag as integer]:EXCLUDE_FLAG:_default' \
'--read-length=[Read length as integer]:READ_LENGTH:_default' \
'--tabix-path=[Path to tabix executable]:TABIX_PATH:_default' \
'--output-prefix=[Output path prefix]:OUTPUT_PREFIX:_default' \
'--r-script-dir=[Override directory to find R scripts]:R_SCRIPT_DIR:_files -/' \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':bed_file -- Input per-read BED file (can be gzipped):_files' \
&& ret=0
;;
(internal)
_arguments "${_arguments_options[@]}" : \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_rastair__internal_commands" \
"*::: :->internal" \
&& ret=0

    case $state in
    (internal)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rastair-internal-command-$line[1]:"
        case $line[1] in
            (shell-completions)
_arguments "${_arguments_options[@]}" : \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':shell -- The shell to generate the completions for:(bash elvish fish nushell powershell zsh)' \
&& ret=0
;;
(cli-docs)
_arguments "${_arguments_options[@]}" : \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':output -- The output file to write the markdown to:_default' \
&& ret=0
;;
(vcf-docs)
_arguments "${_arguments_options[@]}" : \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':output -- The output file to write the markdown to:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_rastair__internal__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rastair-internal-help-command-$line[1]:"
        case $line[1] in
            (shell-completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(cli-docs)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(vcf-docs)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(license)
_arguments "${_arguments_options[@]}" : \
'-v[Enable more logging]' \
'--verbose[Enable more logging]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_rastair__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rastair-help-command-$line[1]:"
        case $line[1] in
            (call)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(per-read)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(bam)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(ml)
_arguments "${_arguments_options[@]}" : \
":: :_rastair__help__ml_commands" \
"*::: :->ml" \
&& ret=0

    case $state in
    (ml)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rastair-help-ml-command-$line[1]:"
        case $line[1] in
            (train)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(pack)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(view)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(mbias)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(internal)
_arguments "${_arguments_options[@]}" : \
":: :_rastair__help__internal_commands" \
"*::: :->internal" \
&& ret=0

    case $state in
    (internal)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rastair-help-internal-command-$line[1]:"
        case $line[1] in
            (shell-completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(cli-docs)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(vcf-docs)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(license)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_rastair_commands] )) ||
_rastair_commands() {
    local commands; commands=(
'call:Call methylated positions' \
'per-read:Call methylation per-read' \
'bam:Add methylation information to BAM files' \
'convert:Convert between different file formats' \
'ml:Machine learning commands for training and verifying models' \
'view:View internal format as JSON lines' \
'mbias:Calculate conversion per base position in read' \
'internal:' \
'license:Show license -- rastair is licensed under a non-commercial use licence' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rastair commands' commands "$@"
}
(( $+functions[_rastair__bam_commands] )) ||
_rastair__bam_commands() {
    local commands; commands=()
    _describe -t commands 'rastair bam commands' commands "$@"
}
(( $+functions[_rastair__call_commands] )) ||
_rastair__call_commands() {
    local commands; commands=()
    _describe -t commands 'rastair call commands' commands "$@"
}
(( $+functions[_rastair__convert_commands] )) ||
_rastair__convert_commands() {
    local commands; commands=()
    _describe -t commands 'rastair convert commands' commands "$@"
}
(( $+functions[_rastair__help_commands] )) ||
_rastair__help_commands() {
    local commands; commands=(
'call:Call methylated positions' \
'per-read:Call methylation per-read' \
'bam:Add methylation information to BAM files' \
'convert:Convert between different file formats' \
'ml:Machine learning commands for training and verifying models' \
'view:View internal format as JSON lines' \
'mbias:Calculate conversion per base position in read' \
'internal:' \
'license:Show license -- rastair is licensed under a non-commercial use licence' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rastair help commands' commands "$@"
}
(( $+functions[_rastair__help__bam_commands] )) ||
_rastair__help__bam_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help bam commands' commands "$@"
}
(( $+functions[_rastair__help__call_commands] )) ||
_rastair__help__call_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help call commands' commands "$@"
}
(( $+functions[_rastair__help__convert_commands] )) ||
_rastair__help__convert_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help convert commands' commands "$@"
}
(( $+functions[_rastair__help__help_commands] )) ||
_rastair__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help help commands' commands "$@"
}
(( $+functions[_rastair__help__internal_commands] )) ||
_rastair__help__internal_commands() {
    local commands; commands=(
'shell-completions:Write shell completions' \
'cli-docs:Write CLI help as markdown file' \
'vcf-docs:Write VCF fields as markdown file' \
    )
    _describe -t commands 'rastair help internal commands' commands "$@"
}
(( $+functions[_rastair__help__internal__cli-docs_commands] )) ||
_rastair__help__internal__cli-docs_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help internal cli-docs commands' commands "$@"
}
(( $+functions[_rastair__help__internal__shell-completions_commands] )) ||
_rastair__help__internal__shell-completions_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help internal shell-completions commands' commands "$@"
}
(( $+functions[_rastair__help__internal__vcf-docs_commands] )) ||
_rastair__help__internal__vcf-docs_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help internal vcf-docs commands' commands "$@"
}
(( $+functions[_rastair__help__license_commands] )) ||
_rastair__help__license_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help license commands' commands "$@"
}
(( $+functions[_rastair__help__mbias_commands] )) ||
_rastair__help__mbias_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help mbias commands' commands "$@"
}
(( $+functions[_rastair__help__ml_commands] )) ||
_rastair__help__ml_commands() {
    local commands; commands=(
'train:Train machine learning models' \
'verify:Verify trained models against ground truth' \
'pack:Pack three random forest models into a combined model file' \
    )
    _describe -t commands 'rastair help ml commands' commands "$@"
}
(( $+functions[_rastair__help__ml__pack_commands] )) ||
_rastair__help__ml__pack_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help ml pack commands' commands "$@"
}
(( $+functions[_rastair__help__ml__train_commands] )) ||
_rastair__help__ml__train_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help ml train commands' commands "$@"
}
(( $+functions[_rastair__help__ml__verify_commands] )) ||
_rastair__help__ml__verify_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help ml verify commands' commands "$@"
}
(( $+functions[_rastair__help__per-read_commands] )) ||
_rastair__help__per-read_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help per-read commands' commands "$@"
}
(( $+functions[_rastair__help__view_commands] )) ||
_rastair__help__view_commands() {
    local commands; commands=()
    _describe -t commands 'rastair help view commands' commands "$@"
}
(( $+functions[_rastair__internal_commands] )) ||
_rastair__internal_commands() {
    local commands; commands=(
'shell-completions:Write shell completions' \
'cli-docs:Write CLI help as markdown file' \
'vcf-docs:Write VCF fields as markdown file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rastair internal commands' commands "$@"
}
(( $+functions[_rastair__internal__cli-docs_commands] )) ||
_rastair__internal__cli-docs_commands() {
    local commands; commands=()
    _describe -t commands 'rastair internal cli-docs commands' commands "$@"
}
(( $+functions[_rastair__internal__help_commands] )) ||
_rastair__internal__help_commands() {
    local commands; commands=(
'shell-completions:Write shell completions' \
'cli-docs:Write CLI help as markdown file' \
'vcf-docs:Write VCF fields as markdown file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rastair internal help commands' commands "$@"
}
(( $+functions[_rastair__internal__help__cli-docs_commands] )) ||
_rastair__internal__help__cli-docs_commands() {
    local commands; commands=()
    _describe -t commands 'rastair internal help cli-docs commands' commands "$@"
}
(( $+functions[_rastair__internal__help__help_commands] )) ||
_rastair__internal__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'rastair internal help help commands' commands "$@"
}
(( $+functions[_rastair__internal__help__shell-completions_commands] )) ||
_rastair__internal__help__shell-completions_commands() {
    local commands; commands=()
    _describe -t commands 'rastair internal help shell-completions commands' commands "$@"
}
(( $+functions[_rastair__internal__help__vcf-docs_commands] )) ||
_rastair__internal__help__vcf-docs_commands() {
    local commands; commands=()
    _describe -t commands 'rastair internal help vcf-docs commands' commands "$@"
}
(( $+functions[_rastair__internal__shell-completions_commands] )) ||
_rastair__internal__shell-completions_commands() {
    local commands; commands=()
    _describe -t commands 'rastair internal shell-completions commands' commands "$@"
}
(( $+functions[_rastair__internal__vcf-docs_commands] )) ||
_rastair__internal__vcf-docs_commands() {
    local commands; commands=()
    _describe -t commands 'rastair internal vcf-docs commands' commands "$@"
}
(( $+functions[_rastair__license_commands] )) ||
_rastair__license_commands() {
    local commands; commands=()
    _describe -t commands 'rastair license commands' commands "$@"
}
(( $+functions[_rastair__mbias_commands] )) ||
_rastair__mbias_commands() {
    local commands; commands=()
    _describe -t commands 'rastair mbias commands' commands "$@"
}
(( $+functions[_rastair__ml_commands] )) ||
_rastair__ml_commands() {
    local commands; commands=(
'train:Train machine learning models' \
'verify:Verify trained models against ground truth' \
'pack:Pack three random forest models into a combined model file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rastair ml commands' commands "$@"
}
(( $+functions[_rastair__ml__help_commands] )) ||
_rastair__ml__help_commands() {
    local commands; commands=(
'train:Train machine learning models' \
'verify:Verify trained models against ground truth' \
'pack:Pack three random forest models into a combined model file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rastair ml help commands' commands "$@"
}
(( $+functions[_rastair__ml__help__help_commands] )) ||
_rastair__ml__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'rastair ml help help commands' commands "$@"
}
(( $+functions[_rastair__ml__help__pack_commands] )) ||
_rastair__ml__help__pack_commands() {
    local commands; commands=()
    _describe -t commands 'rastair ml help pack commands' commands "$@"
}
(( $+functions[_rastair__ml__help__train_commands] )) ||
_rastair__ml__help__train_commands() {
    local commands; commands=()
    _describe -t commands 'rastair ml help train commands' commands "$@"
}
(( $+functions[_rastair__ml__help__verify_commands] )) ||
_rastair__ml__help__verify_commands() {
    local commands; commands=()
    _describe -t commands 'rastair ml help verify commands' commands "$@"
}
(( $+functions[_rastair__ml__pack_commands] )) ||
_rastair__ml__pack_commands() {
    local commands; commands=()
    _describe -t commands 'rastair ml pack commands' commands "$@"
}
(( $+functions[_rastair__ml__train_commands] )) ||
_rastair__ml__train_commands() {
    local commands; commands=()
    _describe -t commands 'rastair ml train commands' commands "$@"
}
(( $+functions[_rastair__ml__verify_commands] )) ||
_rastair__ml__verify_commands() {
    local commands; commands=()
    _describe -t commands 'rastair ml verify commands' commands "$@"
}
(( $+functions[_rastair__per-read_commands] )) ||
_rastair__per-read_commands() {
    local commands; commands=()
    _describe -t commands 'rastair per-read commands' commands "$@"
}
(( $+functions[_rastair__view_commands] )) ||
_rastair__view_commands() {
    local commands; commands=()
    _describe -t commands 'rastair view commands' commands "$@"
}

if [ "$funcstack[1]" = "_rastair" ]; then
    _rastair "$@"
else
    compdef _rastair rastair
fi
