import(methods)
import(S4Vectors)
import(IRanges)
import(GenomicRanges)
import(AnnotationHub)
import(OrganismDbi)
import(GenomicFeatures)

importFrom(GEOquery, getGEOSuppFiles)
importMethodsFrom(AnnotationDbi, exists, get, saveDb)
importMethodsFrom(BiocGenerics, mapply, Map)
importMethodsFrom(Biostrings, head, substr)
importMethodsFrom(DBI, dbDriver)
importMethodsFrom(Rsamtools, indexFa)
importMethodsFrom(RSQLite, dbConnect, dbGetQuery)
importMethodsFrom(rtracklayer, 
    browserSession, "genome<-", getTable,
    import, "tableName<-", tableNames, track,
    "trackName<-", trackNames, ucscTableQuery, export
)
importFrom(BiocInstaller, biocLite, biocVersion)
importFrom(Biobase, AnnotatedDataFrame, ExpressionSet)
importFrom(GenomeInfoDb, Seqinfo)
importFrom(rBiopaxParser, readBiopax)
importFrom(rtracklayer, GRangesForUCSCGenome, ucscGenomes)
importFrom(Rsamtools, razip)
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(httr, 
    config, content, DELETE, GET, handle, handle_find,
    HEAD, headers, POST, stop_for_status
)
importFrom(curl, new_handle, curl, handle_setopt)
importFrom(parallel, detectCores)
importFrom(stats, setNames)
importFrom(XML, readHTMLTable, xmlParse, xmlValue)
importFrom(xml2, xml_find_all, xml_contents)
importFrom(RSQLite, SQLite)
importFrom(graphics, title)
importFrom(utils, 
    capture.output, data, download.file, 
    read.delim, read.table, str
)

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

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

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

export(
    readMetadataFromCsv,
    AnnotationHubMetadata, makeAnnotationHubMetadata,
    UCSCTrackImportPreparer,
    constructAnnotationHubMetadataFromSourceFilePath,
    #postProcessMetadata,
    constructMetadataFromJsonPath,
    flog,
    upload_to_S3,
    getImportPreparerClasses,
    makeAnnotationHubResource,
    HubMetadataFromJson,
    jsonPath,
    toJson,
    constructSeqInfo,
    makeEnsemblFastaToAHM, makeEnsemblTwoBitToAHM,
    ensemblFastaToFaFile,
    ensemblFastaToTwoBitFile,
    ahmToJson,
    newResources, updateResources, deleteResources,
    pushMetadata, pushResources,
    makeGencodeFastaToAHM, gencodeFastaToFaFile
)

### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### 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
)
