import(methods)
import(DelayedMatrixStats)
import(BiocGenerics)
importMethodsFrom(Biobase, exprs, fData,
                  featureNames, "featureNames<-",
                  pData, "pData<-",
                  sampleNames, "sampleNames<-")
import(Biostrings, except = c(type))
importMethodsFrom(Seqinfo, seqlevels, "seqlevels<-", genome, "genome<-", seqlengths, "seqlengths<-")
importClassesFrom(Seqinfo, Seqinfo)
import(GenomicRanges)
import(SummarizedExperiment)
import(S4Vectors)
import(IRanges)
import(DelayedArray)
import(BiocParallel)
import(HDF5Array) # TODO: Remove once DelayedArray_utils.R are moved to DelayedArray
importFrom(Biobase, assayDataElementNames, assayDataElementReplace,
           assayDataElement, "assayDataElement<-", validMsg, assayDataValidMembers)

## The following should not be necessary, but Hadley does not use S3export in reshape
importFrom(reshape, melt, melt.array, melt.data.frame, melt.list, melt.matrix, melt.table)
importFrom(mclust, Mclust)
importFrom(RColorBrewer, brewer.pal)
importFrom(beanplot, beanplot)
importFrom(nor1mix, norMix, pnorMix, qnorMix)
importFrom(siggenes, pi0.est, qvalue.cal)
importFrom(limma, squeezeVar, lmFit, eBayes, contrasts.fit, normexp.signal)
importFrom(preprocessCore, normalize.quantiles, normalize.quantiles.use.target)
importFrom(illuminaio, readIDAT)
importFrom(genefilter, rowFtests, rowttests)
importFrom(utils, packageVersion, read.csv, read.table, data)
importFrom(bumphunter, bumphunter, bumphunterEngine, locfitByCluster,
           clusterMaker, boundedClusterMaker)
importMethodsFrom(bumphunter, bumphunter)
importFrom(lattice, panel.abline, panel.stripplot, xyplot)
importFrom(nlme, lme, getVarCov)
importFrom(MASS, huber)
importFrom(quadprog, solve.QP)
importFrom(GEOquery,getGEO)
importFrom(data.table, fread)
importFrom("grDevices", "dev.off")
importFrom("graphics", "abline", "axis", "legend", "lines", "par",
           "plot", "plot.new", "stripchart", "text")
importFrom("stats", "approx", "as.formula", "cmdscale", "contrasts",
           "dist", "fitted", "kmeans", "lm", "lm.fit", "model.matrix",
           "pchisq", "pf", "prcomp", "pt", "rnorm", "runif",
           "vcov")

export(getManifest, getProbeInfo, getManifestInfo,
       IlluminaMethylationManifest, IlluminaMethylationAnnotation,
       getControlAddress,
       getRed, getGreen, getNBeads, getMeth, getUnmeth,
       getBeta, getM, getCN, getMethSignal,
       getOOB, getSnpBeta,
       dropMethylationLoci, getLocations, getAnnotation,
       getAnnotationObject,
       mapToGenome, subsetByLoci,
       getIslandStatus, getProbeType, getSnpInfo, addSnpInfo, dropLociWithSnps,
       normalize.illumina.control, bgcorrect.illumina,
       preprocessRaw, preprocessIllumina,
       preprocessSWAN, preprocessQuantile,
       preprocessFunnorm, preprocessNoob,
       RGChannelSet, RGChannelSetExtended,
       MethylSet, RatioSet,
       GenomicMethylSet, GenomicRatioSet,
       read.450k, read.450k.sheet, read.450k.exp,
       read.metharray, read.metharray.sheet, read.metharray.exp,
       getGenomicRatioSetFromGEO, makeGenomicRatioSetFromMatrix,
       readGEORawFile, readTCGA,
       logit2, ilogit2,
       dmpFinder, mdsPlot, plotCpg, plotBetasByType,
       detectionP, qcReport, controlStripPlot, densityBeanPlot, densityPlot,
       getQC, plotQC, addQC, minfiQC, fixMethOutliers,
       getSex, plotSex, addSex, bumphunter,
       blockFinder, cpgCollapse,
       estimateCellCounts, gaphunter,
       compartments, createCorMatrix, extractAB,
       convertArray, combineArrays)

exportClasses(RGChannelSet, RGChannelSetExtended,
              MethylSet, RatioSet,
              GenomicMethylSet, GenomicRatioSet,
              IlluminaMethylationManifest, IlluminaMethylationAnnotation)

exportMethods(show, initialize, getBeta, getM, getCN, getMeth, getUnmeth,
              getManifest, annotation, "annotation<-", preprocessMethod,
              combine, mapToGenome, ratioConvert, bumphunter,
              pData, "pData<-", sampleNames, "sampleNames<-",
              featureNames, "featureNames<-", coerce)

