import(methods)
import(S4Vectors)
import(IRanges)
import(GenomicRanges)
import(AnnotationHub)
import(OrganismDbi)
import(GenomicFeatures)
import(RCurl)
import(BiocManager)
import(Biostrings)

importFrom(biocViews, recommendPackages, guessPackageType)
importMethodsFrom(AnnotationDbi, exists, get, saveDb)
importMethodsFrom(BiocGenerics, mapply, Map)
importMethodsFrom(DBI, dbDriver, dbGetQuery)
importMethodsFrom(Rsamtools, indexFa)
importMethodsFrom(RSQLite, dbConnect, dbDisconnect)
importMethodsFrom(rtracklayer,
    browserSession, "genome<-", getTable,
    import, "tableName<-", tableNames, track,
    "trackName<-", trackNames, ucscTableQuery, export
)
importFrom(Biobase, AnnotatedDataFrame, ExpressionSet)
importFrom(Seqinfo, Seqinfo)
importFrom(GenomeInfoDb, loadTaxonomyDb)
importFrom(rtracklayer, GRangesForUCSCGenome, ucscGenomes)
importFrom(Rsamtools, bgzip)
importFrom(AnnotationForge, makeInpDb, makeOrgPackageFromNCBI)
importFrom(AnnotationDbi, loadDb)
importFrom(tools, file_ext)
importFrom(futile.logger,
    ERROR, INFO, TRACE, appender.file,
    flog.appender, flog.threshold, flog.info
)
importFrom(jsonlite, fromJSON, toJSON)
importFrom(parallel, detectCores)
importFrom(stats, setNames)
importFrom(XML, readHTMLTable, xmlParse, xmlValue, getNodeSet, htmlParse)
importFrom(RSQLite, SQLite, sqliteCopyDatabase)
importFrom(graphics, title)
importFrom(utils,
    capture.output, data, download.file,
    read.delim, read.table, str, read.csv
    )

import(BiocCheck)
import(biocViews)
importFrom(graph, nodes)

### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S4 classes
###

exportClasses(
    HubMetadata,
    AnnotationHubMetadata,
    ImportPreparer,
    UCSCTrackImportPreparer,
    UCSCChainPreparer,
    Grasp2ImportPreparer,
    EnsemblGtfImportPreparer,
    EnsemblFastaImportPreparer,
    Inparanoid8ImportPreparer,
    NCBIImportPreparer
)

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

export(
    AnnotationHubMetadata, makeAnnotationHubMetadata,
    UCSCTrackImportPreparer,
    #postProcessMetadata,
    flog,
    upload_to_S3,
    upload_to_azure,
    getImportPreparerClasses,
    makeAnnotationHubResource,
    HubMetadataFromJson,
    toJson,
    constructSeqInfo,
    makeEnsemblFastaToAHM, makeEnsemblTwoBitToAHM,
    ensemblFastaToFaFile,
    ensemblFastaToTwoBitFile,
    ahmToJson,
    newResources, updateResources, deleteResources,
    pushMetadata, pushResources,
    makeGencodeFastaToAHM, gencodeFastaToFaFile,
    makeStandardOrgDbsToAHM, makeStandardTxDbsToAHM,
    makeNCBIToOrgDbsToAHM,
    getSpeciesList, validSpecies, suggestSpecies, getValidSourceTypes,
    checkSpeciesTaxId, validDispatchClass
)

### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S4 generics defined in AnnotationHubData + export corresponding
### methods
###

export(
    recipeName, run, runRecipes,
    hubError, "hubError<-",
    inputFiles, outputFile,
    metadata, "metadata<-",
    metadataList, metadataTable,
    annotationHubRoot,
    sourceUrls
)

exportMethods(
    recipeName, run, runRecipes,
    hubError, "hubError<-",
    inputFiles, outputFile,
    metadata, "metadata<-",
    metadataList, metadataTable,
    annotationHubRoot,
    sourceUrls
)

### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Export S4 methods for generics not defined in AnnotationHubData
###

exportMethods(
    show
)
