import(methods)

importFrom(utils, download.file, untar, unzip, read.table, browseURL, URLencode)
importFrom(stats, setNames)
importFrom(tools, R_user_dir, file_path_as_absolute)

importFrom(R.utils, gunzip)
importFrom(curl, has_internet)
importFrom(httr, GET, HEAD, config, user_agent, content, stop_for_status)
importFrom(xml2, read_html)
importFrom(rvest, html_elements, html_text)
importFrom(xtable, xtable)
importFrom(jsonlite, fromJSON)
import(tibble)

import(S4Vectors)
import(IRanges)
import(GenomeInfoDb)
import(Biostrings)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S3 methods for S3 generics not defined in igblastr
###

S3method(print, alignment_summary)
S3method(print, c_region_dbs_df)
S3method(print, fmt7footer)
S3method(print, fmt7record)
S3method(print, outfmt7_specifiers)
S3method(print, germline_dbs_df)
S3method(print, hit_table)
S3method(print, igblast_info)
S3method(print, igblastn_raw_output)
S3method(print, query_details)
S3method(print, subregion_sequence_details)
S3method(print, VDJ_junction_details)
S3method(print, VDJ_rearrangement_summary)

S3method(summary, query_details)

### We also export them thru the export() directive so that (a) they can be
### called directly, (b) tab-completion on the name of the generic shows them,
### and (c) methods() doesn't asterisk them.

export(
    print.alignment_summary,
    print.c_region_dbs_df,
    print.fmt7footer,
    print.fmt7record,
    print.outfmt7_specifiers,
    print.germline_dbs_df,
    print.hit_table,
    print.igblast_info,
    print.igblastn_raw_output,
    print.query_details,
    print.subregion_sequence_details,
    print.VDJ_junction_details,
    print.VDJ_rearrangement_summary,

    summary.query_details
)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export non-generic functions
###

export(
    ## get_igblast_root.R:
    get_igblast_root, set_igblast_root,

    ## igblast_info.R:
    has_igblast,
    list_igblast_organisms,
    igblastn_version, makeblastdb_version, igblast_build, igblast_info,

    ## auxiliary-data-utils.R:
    get_igblast_auxiliary_data,
    load_igblast_auxiliary_data,

    ## install_igblast.R:
    install_igblast,

    ## list_germline_dbs.R:
    list_germline_dbs,
    use_germline_db,
    load_germline_db,
    rm_germline_db,

    ## list_c_region_dbs.R:
    list_c_region_dbs,
    use_c_region_db,
    load_c_region_db,

    ## install_IMGT_germline_db.R:
    IMGT_is_up,
    list_IMGT_releases,
    list_IMGT_organisms,
    install_IMGT_germline_db,

    ## install_AIRR_germline_db.R:
    #install_AIRR_germline_db,

    ## augment_germline_db.R:
    augment_germline_db_V,
    augment_germline_db_D,
    augment_germline_db_J,

    ## outfmt7-utils.R:
    list_outfmt7_specifiers,
    parse_outfmt7,

    ## igblastn.R:
    igblastn, igblastn_help,

    ## igbrowser.R:
    igbrowser, bcr_browser,

    ## summarizeMismatches.R:
    tabulate_mismatches,
    tabulate_insertions,
    tabulate_deletions,

    ## OAS-utils.R:
    read_OAS_csv_metadata,
    read_OAS_csv,
    extract_sequences_from_paired_OAS_df,
    list_paired_OAS_studies,
    list_paired_OAS_units,
    download_paired_OAS_units,
    extract_metadata_from_OAS_units,
    extract_sequences_from_paired_OAS_units
)


### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S3 generics defined in igblastr and their methods
###

export(
    # outfmt7-utils.R:
    qseqid
)

S3method(qseqid, fmt7record)
S3method(qseqid, query_details)

### We also export them thru the export() directive so that (a) they can be
### called directly, (b) tab-completion on the name of the generic shows them,
### and (c) methods() doesn't asterisk them.

export(
    qseqid.fmt7record,
    qseqid.query_details
)

