#----------------------#
# CUSTOM HELP MESSAGES #
#----------------------#

help_main='''
Usage:
    charlie <command> [options]
        
Commands:
    info            Show basic properties and statistics
    search          Search for records containing a sequence
    filter          Filter records by search sequence or repeat size
    repeats         Measure repeat tract sizes 
    inter           Interruption tools
        
General Options:
    -h, --help      Show this help message (use 'charlie <command> -h' to see 
                    how use a specific command)
    -V, --version   Show version
'''

help_info='''
Usage:
    charlie info <input_file> [options]
    
Description:
    Displays properties of an input FASTX file. Shows basic file information,
    sequence length statistics, and quality/error statistics (FASTQ only).
    
    It is assumed that FASTQ files are Sanger style using PHRED scores and an
    ASCII offset of 33. 
    
Required Arguments:
    <input_file>    Path to input FASTX file 
    
General Options:
    -h, --help      Show this help message
    -V, --version   Show version
'''

help_search='''
Usage:
    charlie search <input_file> <sequence> [options]

Description:
    Search sequences in records of an input FASTX file for an input sequence. 
    Outputs total no. times the sequences appears (including multiple 
    appearances in a single record), no. records in which the sequence appears,
    and the frequency of records containing the sequence.
    
    By default the search method does not allow overlaps, meaning searching for
    'CCC' in 'CCCCCC' would return 2 appearances. With overlaps optionally 
    enabled this same seach would return 4 appearances. Searching with overlaps
    will increase runtime.

Required Arguments:
    <input_file>    Path to input FASTX file 
    <sequence>      Input search query sequence 
    
Optional Arguments:
    -r, --revcomp   Include reverse complement
    -o, --overlap   Allow overlaps
    -q, --quiet     Show only the number and frequency of records containing the
                    sequence, displayed as NUMBER (FREQUENCY)

General Options:
    -h, --help      Show this help message
    -V, --version   Show version
'''

help_filter='''
Usage:
    charlie filter <input_file> [options]
    
Description:
    Filter records of an input FASTX file by a query search sequence or repeat 
    size. Filtering by repeat size only considers pure, uninterrupted repeat 
    tracts. 
    
    Filtering by minimum and maximum repeat size simulatenously can be used to
    obtain a range. Sequence filtering can be performed simultaneously to 
    repeat size filtering. If no filtering criteria options are selected, all 
    records will be output (this can be used alter the formatting of a file).
     
Required Arguments:
    <input_file>    Path to input FASTX file
    
Optional Arguments:
    -s, --sequence <seq>        Filter by input sequence 
    -min, --minimum <min>       Filter by min. repeat size 
    -max, --maximum <max>       Filter by max. repeat size 
    -m, --motif <repeat_motif>  Repeat motif (required if using -min or -max)
    -r, --revcomp               Include reverse complement 
    -w, --wrap <width>          Wrap sequence line width in output
    -o, --output <filename>     Write output to new file (silences CLI output)
    
General Options:
    -h, --help      Show this help message
    -V, --version   Show version
'''

help_repeats='''
Usage:
    charlie repeats <input_file> <repeat_motif> [options]
    
Description:
    Measure repeat tracts containing an input repeat motif (e.g. CAG) in records
    of an input FASTX file. Results are output to a csv and graph in the input 
    file directory, and to command line interface (CLI) as a tab-delimited 
    table.
    
    Measurement assumes repeat tracts are pure and uninterrupted.  Interrupted 
    repeat tracts will show as additional peaks in the graph. If an 
    interruption is of high frequency (near 1.0), the full repeat tract size 
    may be obscured. 
    
    For greater accuracy, or to measure interrupted repeat tracts, use:
    https://github.com/DionLab/RepeatDetector
    
Required Arguments:
    <input_file>    Path to input FASTX file
    <repeat_motif>  Repeat motif/unit to search for (e.g. CAG)
    
Optional Arguments:
    -r, --revcomp   Include reverse complement
    -s, --sort      Sort results by no. records (descending)
    -q, --quiet     Output to csv and graph only, no CLI output
    -c, --cli       Output to CLI only, no csv or graph
    
General Options:
    -h, --help      Show this help message
    -V, --version   Show version
'''

help_inter='''
Usage:
    charlie inter <command> [options]
    
Description:
    The tools below are designed for the discovery and analysis of 
    interruptions in repeat tracts. 
    
Commands:
    find            Search repeat tracts for possible interruptions 
    position        Determine modal position of a known interruption
    pattern         [in development]
    correlation     [in development]
        
General Options:
    -h, --help      Show this help message (use 'charlie inter <command> -h' 
                    to see how use a specific command)
    -V, --version   Show version
'''

help_inter_find='''
Usage:
    charlie inter find <input_file> <repeat_motif> [options]
    
Description:
    Search for possible interruptions of repeat tracts in an input FASTX file. 
    Results are given as the number of records containing the interruption and 
    the corresponding frequency.
    
    Generates every possible interruption within a range (default 1-3 bases) 
    and searches record sequences for the interruption. In order to target the 
    repeat tract the search query is flanked with the repeat motif. For example,
    to search for a CCG interruption in a CAG repeat tract, the search query 
    would be CAGCCGCAG. 
    
    If records contain sequences flanking the repeat tract sequences, some 
    queries may be present at high frequencies outisde the repeat tract. In 
    order to exclude these, specificity can be increased to increase the number
    of repeat motifs in the search query. For example, at specificity 2 the 
    search query mentioned above would become CAGCAGCCGCAGCAG. 
    
    If records do not contain flanking sequences, specificity can be set to 0 to
    increase accuracy. 
    
    This tool is optimised for shorter interruptions (<10 bases), increasing 
    maximum interruption size will increase runtime exponentially. The repeats 
    tool can be used to identify longer interruptions, see the repeats help for
    more details. The filter tool can then be used to isolate long interruptions
    for further review via the search tool or manually. 
    
Required Arguments:
    <input_file>    Path to input FASTX file
    <repeat_motif>  Repeat motif/unit of repeat tract to be searched

Optional Arguments:
    -r, --revcomp                   Include reverse complement 
    -t, --threshold <freq>          Only show results above input record 
                                    frequency (default: 0.05)
    -s, --specificity <num_motifs>  Number of motifs either side of potential
                                    interruptions in search queries (default: 1)
    -min, --minimum <min>           Minimum interruption size (default: 1)
    -max, --maximum <max>           Maximum interruption size (default: 3)
    -v, --verbose                   Show full search queries in output 
    -a, --appearances               Also count the total appearances of 
                                    interruptions within records (slower)
    -o, --output                    Export results to csv
    -q, --quiet                     (with --output enabled) csv output only, no
                                    CLI output
    
General Options:
    -h, --help      Show this help message
    -V, --version   Show version
'''

help_inter_position='''
Usage:
    charlie inter position <input_file> <repeat_motif> <interruption> [options]
    
Description:
    Determine the most common (modal) position of a known interruption within 
    repeat tracts of an input FASTX file. 
    
    Generates histograms for the number of repeat motifs preceding and 
    following the interruption. The histograms are output to csv's and graphs. 
    Also determined and output to CLI:
        - Percentage of records containing the interruption (greater than 0 
          preceding/following motifs)
        - Modal number of preceding/following motifs
        - Percentage of records with the modal numbers of motifs (of records
          that contain the interruption)
        - Modal interruption pattern, in format: (motif)P(inter)(motif)F
        - Percentage of records with the modal interruption pattern (of records)
          that contain the interruption)
    
    One motif is placed on the opposite side of the interruption in all search
    queries to ensure searches remain within the repeat tract. 
    
    Measurement assumes that the repeat tract either side of the interruption 
    is pure and contains no further interruptions. If multiple interruptions 
    are present, the full sequence spanning all interruptions must be given. 
    For example, if two CCG interruptions are present in a CAG repeat tract 
    with three CAG trinucleotides between them, the interruption sequence 
    should be input as CCGCAGCAGCAGCCG.
    
    Keep in consideration that due to the assumption of pure repeat tracts,
    each time the number of preceding or following motifs is increased, some
    records may be omitted due to sequencing errors. 
    
Required Arguments:
    <input_file>    Path to input FASTX file
    <repeat_motif>  Repeat motif/unit of repeat tract containing interruption
    <interruption>  Sequence of interruption to be positioned 
    
Optional Arguments:
    -r, --revcomp   Include reverse complement 
    -v, --verbose   Show top 10 result tables for preceding and following
    -g, --graphcrop Exclude the peak at 0 motifs from graphs (makes smaller 
                    peaks more visible)
    -q, --quiet     Output to csv and graph only, no CLI output
    -c, --cli       Output to CLI only, no csv or graph

General Options:
    -h, --help      Show this help message
    -V, --version   Show version
'''

help_inter_pattern='''
Usage:
    charlie inter pattern <input_file> <interruption> [options]
    
Description:
    [in development]
    
Required Arguments:
    [in developement]
    
General Options:
    -h, --help      Show this help message
    -V, --version   Show version
'''

help_inter_correlation='''
Usage:
    charlie inter correlation <input_file> <interruption> [options]
    
Description:
    [in development]
    
Required Arguments:
    [in developement]
    
General Options:
    -h, --help      Show this help message
    -V, --version   Show version
'''
