import(Biobase)
import(biomaRt)
import(DT)
import(edgeR)
import(GenomicRanges)
import(graphics)
import(lattice)
import(limma)
import(methods)
import(magrittr)
import(NBPSeq)
import(parallel)
import(Rsamtools)
import(RSQLite)
import(splines)
import(VennDiagram)

import(grDevices,except=windows)
import(locfit,except=dat)

importFrom("ABSSeq",ABSDataSet)
importFrom("ABSSeq",ABSSeq)
importFrom("ABSSeq",ABSSeqlm)
importFrom("ABSSeq",aFoldcomplexDesign)
importFrom("ABSSeq",callDEs)
importFrom("ABSSeq",callParameter)
importFrom("ABSSeq",callParameterwithoutReplicates)
importFrom("ABSSeq",estimateSizeFactorsForMatrix)
importFrom("ABSSeq",excounts)
importFrom("ABSSeq","excounts<-")
importFrom("ABSSeq",maxRates)
importFrom("ABSSeq",minimalDispersion)
importFrom("ABSSeq",minRates)
importFrom("ABSSeq",normalFactors)
importFrom("ABSSeq",normMethod)

importFrom("baySeq",getLibsizes)
importFrom("baySeq",getPriors.NB)
importFrom("baySeq",getLikelihoods.NB)
importFrom("baySeq",groups)
importFrom("baySeq",libsizes)
importFrom("baySeq",replicates)
importFrom("baySeq",topCounts)

importFrom("BiocGenerics",counts)
importFrom("BiocGenerics","counts<-")
importFrom("BiocGenerics",conditions)
importFrom("BiocGenerics","conditions<-")
importFrom("BiocGenerics",dispTable)
importFrom("BiocGenerics","dispTable<-")
importFrom("BiocGenerics",sizeFactors)
importFrom("BiocGenerics","sizeFactors<-")

importFrom("BiocParallel",bpparam)

importFrom("Biostrings",alphabetFrequency)
importFrom("Biostrings",uniqueLetters)
importFrom("Biostrings",readDNAStringSet)

importFrom("corrplot",corrplot)

importFrom("DESeq2",DESeq)
importFrom("DESeq2",DESeqDataSetFromMatrix)
importFrom("DESeq2",estimateBetaPriorVar)
importFrom("DESeq2",estimateDispersions)
importFrom("DESeq2",estimateSizeFactors)
importFrom("DESeq2",nbinomLRT)
importFrom("DESeq2",nbinomWaldTest)
importFrom("DESeq2",normalizationFactors)
importFrom("DESeq2",normalizeGeneLength)
importFrom("DESeq2",normTransform)
importFrom("DESeq2",sizeFactors)

importFrom("DSS",callDML)
importFrom("DSS",callDMR)
importFrom("DSS",dispersion)
importFrom("DSS",DMLfit.multiFactor)
importFrom("DSS",DMLtest)
importFrom("DSS",DMLtest.multiFactor)
importFrom("DSS",DSS.DE)
importFrom("DSS",estDispersion)
importFrom("DSS",estNormFactors)
importFrom("DSS",newSeqCountSet)
importFrom("DSS",normalizationFactor)
importFrom("DSS",waldTest)

importFrom("EDASeq",betweenLaneNormalization)
importFrom("EDASeq",biasPlot)
importFrom("EDASeq",MDPlot)
importFrom("EDASeq",meanVarPlot)
importFrom("EDASeq",newSeqExpressionSet)
importFrom("EDASeq",normCounts)
importFrom("EDASeq",withinLaneNormalization)

importFrom("genefilter",rowVars)

importFrom("GenomeInfoDb",dropSeqlevels)
importFrom("GenomeInfoDb",fetchExtendedChromInfoFromUCSC)
importFrom("GenomeInfoDb",seqinfo)
importFrom("GenomeInfoDb",Seqinfo)
importFrom("GenomeInfoDb",seqlevels)
importFrom("GenomeInfoDb",seqlengths)
importFrom("GenomeInfoDb","seqlengths<-")
importFrom("GenomeInfoDb",seqlevelsStyle)
importFrom("GenomeInfoDb","seqlevelsStyle<-")

importFrom("GenomicAlignments",readGAlignments)
importFrom("GenomicAlignments",summarizeOverlaps)

importFrom("GenomicFeatures",makeTxDbFromGFF)
importFrom("GenomicFeatures",exons)
importFrom("GenomicFeatures",genes)
importFrom("GenomicFeatures","seqlevels<-")
importFrom("GenomicFeatures",transcripts)
importFrom("GenomicFeatures",threeUTRsByTranscript)

importFrom("gplots",bluered)
importFrom("gplots",col2hex)
importFrom("gplots",colorpanel)
importFrom("gplots",heatmap.2)

importFrom("harmonicmeanp",hmp.stat)
importFrom("harmonicmeanp",p.hmp)

importFrom("heatmaply",heatmaply)

importFrom("htmltools",tags)

importFrom("httr",config)
importFrom("httr",set_config)

importFrom("IRanges",IRanges)
importFrom("IRanges",slice)

importFrom("jsonlite",fromJSON)
importFrom("jsonlite",toJSON)
importFrom("jsonlite",unbox)

importFrom("log4r",create.logger)
importFrom("log4r",debug)
importFrom("log4r",error)
importFrom("log4r",fatal)
importFrom("log4r",info)
importFrom("log4r",level)
importFrom("log4r",logfile)
importFrom("log4r",warn)

importFrom("MASS",negative.binomial)

importFrom("Matrix",rankMatrix)

importFrom("pander",pandoc.header)

importFrom("qvalue",qvalue)

importFrom("rmarkdown",render)

importFrom("rmdformats",material)

importFrom("rtracklayer",export.2bit)
importFrom("rtracklayer",export.bw)
importFrom("rtracklayer",import)
importFrom("rtracklayer",import.bed)

importFrom("S4Vectors",DataFrame)
importFrom("S4Vectors",Rle)
importFrom("S4Vectors",queryHits)
importFrom("S4Vectors",subjectHits)

importFrom("stats",aggregate)
importFrom("stats",approxfun)
importFrom("stats",as.dist)
importFrom("stats",as.formula)
importFrom("stats",cmdscale)
importFrom("stats",coefficients)
importFrom("stats",cor)
importFrom("stats",density)
importFrom("stats",deviance)
importFrom("stats",df)
importFrom("stats",df.residual)
importFrom("stats",dnbinom)
importFrom("stats",Gamma)
importFrom("stats",glm)
importFrom("stats",glm.fit)
importFrom("stats",fitted.values)
importFrom("stats",kmeans)
importFrom("stats",ks.test)
importFrom("stats",lowess)
importFrom("stats",mad)
importFrom("stats",median)
importFrom("stats",model.matrix)
importFrom("stats",na.exclude)
importFrom("stats",na.omit)
importFrom("stats",optimize)
importFrom("stats",p.adjust)
importFrom("stats",p.adjust.methods)
importFrom("stats",pchisq)
importFrom("stats",prop.test)
importFrom("stats",quantile)
importFrom("stats",rexp)
importFrom("stats",rnbinom)
importFrom("stats",rnorm)
importFrom("stats",rmultinom)
importFrom("stats",runif)
importFrom("stats",sd)
importFrom("stats",splinefun)
importFrom("stats",supsmu)
importFrom("stats",var)
importFrom("stats",wilcox.test)

importFrom("stringr",str_match)

importFrom("SummarizedExperiment",assays)

importFrom("survcomp",combine.test)

importFrom("utils",capture.output)
importFrom("utils",combn)
importFrom("utils",download.file)
importFrom("utils",head)
importFrom("utils",packageVersion)
importFrom("utils",read.delim)
importFrom("utils",read.table)
importFrom("utils",write.table)
importFrom("utils",zip)

importFrom("vsn",vsn2)
importFrom("vsn",predict)

importFrom("yaml",read_yaml)
importFrom("yaml",write_yaml)

importFrom("zoo",rollmean)

useDynLib("metaseqR2",calc_pvals)

export(buildAnnotationDatabase)
export(buildCustomAnnotation)
export(createSignalTracks)
export(combineBonferroni)
export(combineHarmonic)
export(combineMaxp)
export(combineMinp)
export(combineSimes)
export(combineWeight)
export(diagplotAvgFtd)
export(diagplotBoxplot)
export(diagplotCor)
export(diagplotDeHeatmap)
export(diagplotEdaseq)
export(diagplotFiltered)
export(diagplotFtd)
export(diagplotMds)
export(diagplotNoiseq)
export(diagplotPairs)
export(diagplotRoc)
export(diagplotVenn)
export(diagplotVolcano)
export(downsampleCounts)
export(estimateAufcWeights)
export(estimateSimParams)
export(getAnnotation)
export(getDefaults)
export(getInstalledAnnotations)
export(getWeights)
export(importCustomAnnotation)
export(loadAnnotation)
export(makeSimDataTcc)
export(makeSimDataSd)
export(metaseqr2)
export(metaseqrPlot)
export(metaTest)
export(normalizeAbsseq)
export(normalizeDeseq)
export(normalizeDeseq2)
export(normalizeDss)
export(normalizeEdaseq)
export(normalizeEdger)
export(normalizeNbpseq)
export(normalizeNoiseq)
export(read2count)
export(readTargets)
export(statAbsseq)
export(statBayseq)
export(statDeseq)
export(statDeseq2)
export(statDss)
export(statEdger)
export(statLimma)
export(statNbpseq)
export(statNoiseq)
