# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# IMPORTS
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
importFrom("R.methodsS3", "throw")
importFrom("R.methodsS3", "setMethodS3")
importFrom("R.oo", "setConstructorS3")
importFrom("R.oo", "extend")
importFrom("R.oo", "uses")

## Importing Class:es
importFrom("R.oo", "Interface")
importFrom("R.oo", "Object")
importFrom("R.oo", "Package")
importFrom("R.utils", "Options")
importFrom("R.utils", "ProgressBar")
importFrom("R.filesets", "GenericDataFile")
importFrom("R.filesets", "GenericDataFileSet")
importFrom("R.filesets", "TabularTextFile")
importFrom("aroma.core", "AromaCellTabularBinaryFile")
importFrom("aroma.core", "AromaMicroarrayDataFile")
importFrom("aroma.core", "AromaMicroarrayDataSet")
importFrom("aroma.core", "AromaMicroarrayDataSetTuple")
importFrom("aroma.core", "AromaPackage")
importFrom("aroma.core", "AromaPlatform")
importFrom("aroma.core", "AromaTransform")
importFrom("aroma.core", "AromaUflFile")
importFrom("aroma.core", "AromaUgpFile")
importFrom("aroma.core", "AromaUnitGenotypeCallFile")
importFrom("aroma.core", "AromaUnitSignalBinaryFile")
importFrom("aroma.core", "AromaUnitSignalBinarySet")
importFrom("aroma.core", "AromaUnitTabularBinaryFile")
importFrom("aroma.core", "ChromosomalModel")
importFrom("aroma.core", "Explorer")

## Importing generics
importFrom("aroma.core", "allocate")
importFrom("aroma.core", "as.CopyNumberDataSetTuple")
importFrom("aroma.core", "byChipType")
importFrom("aroma.core", "exportTotalCnRatioSet")
importFrom("aroma.core", "findByChipType")
importFrom("aroma.core", "findUnitsTodo")
importFrom("aroma.core", "fit")
importFrom("aroma.core", "fixSearchPath")
importFrom("aroma.core", "getAlias")
importFrom("aroma.core", "getAM")
importFrom("aroma.core", "getAromaUflFile")
importFrom("aroma.core", "getAromaUgpFile")
importFrom("aroma.core", "getArraysOfInput")
importFrom("aroma.core", "getAverageFile")
importFrom("aroma.core", "getChipType")
importFrom("aroma.core", "getChromosomes")
importFrom("aroma.core", "getDefaultExtension")
importFrom("aroma.core", "getExpectedOutputFiles")
importFrom("aroma.core", "getExpectedOutputFullnames")
importFrom("aroma.core", "getImage")
importFrom("aroma.core", "getInputDataSet")
importFrom("aroma.core", "getListOfUnitNamesFiles")
importFrom("aroma.core", "getListOfUnitTypesFiles")
importFrom("aroma.core", "getMainPath")
importFrom("aroma.core", "getNameOfInput")
importFrom("aroma.core", "getNumberOfFilesAveraged")
importFrom("aroma.core", "getOutputDataSet")
importFrom("aroma.core", "getOutputFiles")
importFrom("aroma.core", "getParameters")
importFrom("aroma.core", "getPlatform")
importFrom("aroma.core", "getPositions")
importFrom("aroma.core", "getReference")
importFrom("aroma.core", "getRegions")
importFrom("aroma.core", "getRootPath")
importFrom("aroma.core", "getSetTuple")
importFrom("aroma.core", "getTagsOfInput")
importFrom("aroma.core", "getUnitNames")
importFrom("aroma.core", "getUnitNamesFile")
importFrom("aroma.core", "getUnitsOnChromosome")
importFrom("aroma.core", "getUnitsOnChromosomes")
importFrom("aroma.core", "getUnitTypes")
importFrom("aroma.core", "getUnitTypesFile")
importFrom("aroma.core", "getWeights")
importFrom("aroma.core", "getXAM")
importFrom("aroma.core", "hasAlleleBFractions")
importFrom("aroma.core", "hasStrandiness")
importFrom("aroma.core", "importFrom")
importFrom("aroma.core", "importFromGenericTabularFile")
importFrom("aroma.core", "isMissing")
importFrom("aroma.core", "nbrOfArrays")
importFrom("aroma.core", "nbrOfCells")
importFrom("aroma.core", "nbrOfChipTypes")
importFrom("aroma.core", "nbrOfEnzymes")
importFrom("aroma.core", "nbrOfUnits")
importFrom("aroma.core", "patch")
importFrom("aroma.core", "process")
importFrom("aroma.core", "readHeader")
importFrom("aroma.core", "rescale")
importFrom("aroma.core", "setAlias")
importFrom("aroma.core", "setArrays")
importFrom("aroma.core", "setReference")
importFrom("aroma.core", "setup")
importFrom("aroma.core", "stextChipType")
importFrom("aroma.core", "updateSetupExplorerFile")
importFrom("aroma.core", "writeImage")
importFrom("aroma.core", "writeRegions")
importFrom("R.filesets", "byName")
importFrom("R.filesets", "byPath")
importFrom("R.filesets", "extractMatrix")
importFrom("R.filesets", "findByName")
importFrom("R.filesets", "fromFile")
importFrom("R.filesets", "getAsteriskTags")
importFrom("R.filesets", "getColumnNames")
importFrom("R.filesets", "getDefaultColumnNames")
importFrom("R.filesets", "getDefaultFullName")
importFrom("R.filesets", "getExtensionPattern")
importFrom("R.filesets", "getFileClass")
importFrom("R.filesets", "getFilenameExtension")
importFrom("R.filesets", "getFullName")
importFrom("R.filesets", "getFullNames")
importFrom("R.filesets", "getHeader")
importFrom("R.filesets", "getReadArguments")
importFrom("R.filesets", "getTags")
importFrom("R.filesets", "hasColumnHeader")
importFrom("R.filesets", "nbrOfColumns")
importFrom("R.filesets", "nbrOfRows")
importFrom("R.filesets", "readDataFrame")
importFrom("R.filesets", "setTags")
importFrom("R.filesets", "translateColumnNames")
importFrom("R.filesets", "translateFullName")
importFrom("R.filesets", "update2")
importFrom("R.filesets", "verify")
importFrom("R.oo", "clearCache") ## Multi-sources: R.oo, R.cache, R.filesets
importFrom("R.oo", "clone") ## Multi-sources: R.oo, R.filesets, oligoClasses
importFrom("R.oo", "getCalls")
importFrom("R.oo", "getFields")
importFrom("R.oo", "getName") ## Multi-sources: R.oo, R.filesets
importFrom("R.oo", "getPath") ## Multi-sources: R.oo, R.filesets
importFrom("R.oo", "getPosition")
importFrom("R.utils", "getLabel")
importFrom("R.utils", "setLabel")
importFrom("R.utils", "validate") ## Multi-sources: R.utils, R.filesets

## Importing functions
importFrom("aroma.apd", "readApd")
importFrom("aroma.apd", "writeApd")
importFrom("aroma.core", "allocateFromUnitNamesFile")
importFrom("aroma.core", "backtransformGenotypeCone")
importFrom("aroma.core", "backtransformMultiDimensionalCone")
importFrom("aroma.core", "countBases")
importFrom("aroma.core", "display")
importFrom("aroma.core", "downloadPackagePatch")
importFrom("aroma.core", "extractGenotypes")
importFrom("aroma.core", "findAnnotationDataByChipType")
importFrom("aroma.core", "findPngDevice")
importFrom("aroma.core", "fitGenotypeCone")
importFrom("aroma.core", "fitMultiDimensionalCone")
importFrom("aroma.core", "fitSplineBlockPolish")
importFrom("aroma.core", "fitWHLAPLM.matrix")
importFrom("aroma.core", "fixSearchPathInternal")
importFrom("aroma.core", "getArrays")
importFrom("aroma.core", "getCacheKey")
importFrom("aroma.core", "getChipTypes")
importFrom("aroma.core", "getDataFileMatrix")
importFrom("aroma.core", "getParametersAsString")
importFrom("aroma.core", "getParentPath")
importFrom("aroma.core", "getProbeLength")
importFrom("aroma.core", "getProbePositionEffectDesignMatrix")
importFrom("aroma.core", "getRam")
importFrom("aroma.core", "getReferenceSetTuple")
importFrom("aroma.core", "getTableOfArrays")
importFrom("aroma.core", "getUnitsAt")
importFrom("aroma.core", "groupBySnpNucleotides")
importFrom("aroma.core", "isAverageFile")
importFrom("aroma.core", "isHeterozygous")
importFrom("aroma.core", "lapplyInChunks")
importFrom("aroma.core", "locallyUnique")
importFrom("aroma.core", "mergeBoxplotStats")
importFrom("aroma.core", "patchPackage")
importFrom("aroma.core", "processTime")
importFrom("aroma.core", "readFooter")
importFrom("aroma.core", "readSequenceMatrix")
importFrom("aroma.core", "readTargetStrands")
importFrom("aroma.core", "splitInChunks")
importFrom("aroma.core", "stextLabels")
importFrom("aroma.core", "stextSize")
importFrom("aroma.core", "updateGenotypes")
importFrom("aroma.core", "updateSequenceMatrix")
importFrom("aroma.core", "updateSequences")
importFrom("aroma.core", "updateTargetStrands")
importFrom("aroma.core", "writeFooter")
importFrom("matrixStats", "anyMissing") ## Multi-sources: matrixStats, Biobase
importFrom("matrixStats", "colMaxs")
importFrom("matrixStats", "colMedians")
importFrom("matrixStats", "indexByRow")
importFrom("matrixStats", "rowMads")
importFrom("matrixStats", "rowMedians") ## Multi-sources: matrixStats, Biobase
importFrom("matrixStats", "rowSds")
importFrom("methods", "new")
importFrom("R.cache", "getChecksum") ## Multi-sources: R.cache, R.filesets
importFrom("R.cache", "loadCache")
importFrom("R.cache", "saveCache")
importFrom("R.filesets", "copyTo")
importFrom("R.filesets", "dropRootPathTags")
importFrom("R.filesets", "getFile")
importFrom("R.filesets", "getFiles")
importFrom("R.filesets", "getFileSize")
importFrom("R.filesets", "getNames")
importFrom("R.filesets", "getOneFile")
importFrom("R.filesets", "getPathname")
importFrom("R.filesets", "getPathnames")
importFrom("R.filesets", "getSets")
importFrom("R.filesets", "hasTag")
importFrom("R.filesets", "indexOf")
importFrom("R.filesets", "readColumns")
importFrom("R.filesets", "readRawHeader")
importFrom("R.filesets", "renameTo")
importFrom("R.filesets", "setAttributesBy")
importFrom("R.filesets", "setAttributesByTags")
importFrom("R.methodsS3", "appendVarArgs")
importFrom("R.oo", "attachLocally")
importFrom("R.oo", "equals")
importFrom("R.oo", "getDate")
importFrom("R.oo", "getEnvironment")
importFrom("R.oo", "getKnownSubclasses")
importFrom("R.oo", "getVersion")
importFrom("R.oo", "isAbstract")
importFrom("R.oo", "isOlderThan")
importFrom("R.oo", "isVisible")
importFrom("R.oo", "ll")
importFrom("R.oo", "newInstance")
importFrom("R.oo", "objectSize")
importFrom("R.oo", "startupMessage")
importFrom("R.oo", "trim")
importFrom("R.utils", "callHooks")
importFrom("R.utils", "capitalize")
importFrom("R.utils", "capture")
importFrom("R.utils", "cat") ## Multi-sources: R.utils, base
importFrom("R.utils", "dataFrame")
importFrom("R.utils", "dimNA<-")
importFrom("R.utils", "doCall")
importFrom("R.utils", "enter")
importFrom("R.utils", "exit")
importFrom("R.utils", "extract") ## Multi-sources: R.utils, R.filesets
importFrom("R.utils", "filePath")
importFrom("R.utils", "findFiles") ## Multi-sources: R.utils, affxparser
importFrom("R.utils", "getFilename") ## Multi-sources: R.utils, R.filesets
importFrom("R.utils", "getLeaves")
importFrom("R.utils", "getOption") ## Multi-sources: R.utils, base
importFrom("R.utils", "getParent")
importFrom("R.utils", "getThreshold")
importFrom("R.utils", "hasOption")
importFrom("R.utils", "hpaste")
importFrom("R.utils", "increase")
importFrom("R.utils", "insert")
importFrom("R.utils", "isDirectory")
importFrom("R.utils", "isDone")
importFrom("R.utils", "isFile") ## Multi-sources: R.utils, R.filesets
importFrom("R.utils", "isPackageInstalled")
importFrom("R.utils", "isPackageLoaded") ## Multi-sources: R.utils, oligoClasses
importFrom("R.utils", "isZero")
importFrom("R.utils", "less")
importFrom("R.utils", "loadObject")
importFrom("R.utils", "loadToEnv")
importFrom("R.utils", "more")
importFrom("R.utils", "moveInSearchPath")
importFrom("R.utils", "popState")
importFrom("R.utils", "popTemporaryFile")
importFrom("R.utils", "printf")
importFrom("R.utils", "pushState")
importFrom("R.utils", "pushTemporaryFile")
importFrom("R.utils", "readTable")
importFrom("R.utils", "reset")
importFrom("R.utils", "saveObject")
importFrom("R.utils", "seqToHumanReadable")
importFrom("R.utils", "setOption")
importFrom("R.utils", "stext")
importFrom("R.utils", "subplots")
importFrom("R.utils", "toAsciiRegExprPattern")
importFrom("R.utils", "toCamelCase")
importFrom("R.utils", "wrap")
importFrom("R.utils", "writeRaw")

## Manually adjusted
## Cannot import explicitly from 'base';
## importFrom("base", "parse") ## Multi-sources: R.utils, R.rsp, base
## importFrom("base", "readLines") ## Multi-sources: R.filesets, base
## importFrom("base", "gc") ## Multi-sources: R.oo, base
## importFrom("base", "warnings") ## Multi-sources: R.utils, base
## importFrom("inherits", "inherits") ## Multi-sources: R.utils, base

## Manual imports
importFrom("R.utils", "Arguments")
importFrom("R.filesets", "append")
if (packageVersion("R.utils") < "1.27.5") {
  importFrom("R.utils", "cat.default")
  importFrom("R.utils", "getOption.default")
}

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Several packages are only optional or suggested for now, so
# we cannot assume they are available for import.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (FALSE) {
  importFrom("aroma.light", "calibrateMultiscan")
  importFrom("aroma.light", "normalizeFragmentLength")
  importFrom("aroma.light", "normalizeQuantileSpline")
  importFrom("aroma.light", "robustSmoothSpline")

  importFrom("Biobase", "annotation") ## Multi-sources: Biobase, oligo, oligoClasses
  importFrom("Biobase", "annotation<-")
  importFrom("Biobase", "assayData")
  importFrom("Biobase", "featureNames<-")
  importFrom("Biobase", "phenoData<-")
  importFrom("Biobase", "sampleNames<-") ## Multi-sources: Biobase, oligoClasses

  importFrom("affxparser", "applyCdfGroups")
  importFrom("affxparser", "cdfHeaderToCelHeader")
  importFrom("affxparser", "cdfMergeAlleles")
  importFrom("affxparser", "compareCdfs")
  importFrom("affxparser", "convertCdf")
  importFrom("affxparser", "convertCel")
  importFrom("affxparser", "createCel")
  importFrom("affxparser", "findCdf")
  importFrom("affxparser", "invertMap")
  importFrom("affxparser", "readBpmap")
  importFrom("affxparser", "readBpmapHeader")
  importFrom("affxparser", "readCcg")
  importFrom("affxparser", "readCcgHeader")
  importFrom("affxparser", "readCdf")
  importFrom("affxparser", "readCdfCellIndices")
  importFrom("affxparser", "readCdfGroupNames")
  importFrom("affxparser", "readCdfHeader")
  importFrom("affxparser", "readCdfIsPm")
  importFrom("affxparser", "readCdfNbrOfCellsPerUnitGroup")
  importFrom("affxparser", "readCdfQc")
  importFrom("affxparser", "readCdfUnitNames")
  importFrom("affxparser", "readCdfUnits")
  importFrom("affxparser", "readCel")
  importFrom("affxparser", "readCelHeader")
  importFrom("affxparser", "readCelRectangle")
  importFrom("affxparser", "readCelUnits")
  importFrom("affxparser", "readPgfEnv")
  importFrom("affxparser", "readPgfHeader")
  importFrom("affxparser", "updateCel")
  importFrom("affxparser", "updateCelUnits")
  importFrom("affxparser", "writeCdfHeader")
  importFrom("affxparser", "writeCdfQcUnits")
  importFrom("affxparser", "writeCdfUnits")

  importFrom("affy", "bg.adjust")
  importFrom("affy", "cleancdfname")
  importFrom("affy", "close") ## Multi-sources: affy, oligoClasses, base
  importFrom("affy", "featureNames") ## Multi-sources: affy, Biobase
  importFrom("affy", "fit.li.wong")
  importFrom("affy", "image") ## Multi-sources: affy, oligo

  importFrom("affyPLM", "summary") ## Multi-sources: affyPLM, DBI, base

  importFrom("oligo", "cleanPlatformName")
  importFrom("oligo", "coef")
  importFrom("oligo", "db") ## Multi-sources: oligo, oligoClasses
  importFrom("oligo", "geometry") ## Multi-sources: oligo, oligoClasses
  importFrom("oligo", "getPlatformDesign")
  importFrom("oligo", "ncol") ## Multi-sources: oligo, base
  importFrom("oligo", "read.celfiles")
  importFrom("oligo", "residuals")

  importFrom("oligoClasses", "getM")
  importFrom("oligoClasses", "mean") ## Multi-sources: oligoClasses, base

  importFrom("DBI", "dbGetQuery")
  importFrom("DBI", "dbListTables")
} # if (FALSE)


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# EXPORTS
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Export all public methods, that is, those without a preceeding dot
# in their names.
exportPattern("^[^\\.]")


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# DECLARATIONS
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
S3method("doASCRMAv1", "default");
S3method("doASCRMAv2", "default");
S3method("doCRMAv1", "default");
S3method("doCRMAv2", "default");
S3method("doFIRMA", "default");
S3method("doGCRMA", "default");
S3method("doRMA", "default");
