import(methods)
import(utils)
import(BiocGenerics)
import(S4Vectors)
import(GGBase)
importFrom(data.table, data.table)

importFrom(reshape2, melt)
importFrom(ggplot2, ggplot, geom_point, aes,
   facet_grid, theme, element_text, labs, ylab)
importFrom(VariantAnnotation, ScanVcfParam, readVcf,
  genotypeToSnpMatrix, ref, alt)
importMethodsFrom(Biostrings, nchar)
importFrom(Biostrings, nchar)
importFrom(Rsamtools, "headerTabix", "isOpen", "close.TabixFile", "open.TabixFile")
importFrom(Biostrings, nchar)
importMethodsFrom(Biostrings, nchar)

importFrom(stats4, plot)

importFrom(snpStats, snp.rhs.tests, p.value, col.summary, snp.rhs.estimates)

importFrom(ff, ff, as.ram, ffrowapply, filename, is.open)

importFrom(bit, chunk)

importFrom(Gviz, DataTrack, plotTracks, GeneRegionTrack, GenomeAxisTrack)

importFrom(AnnotationDbi, get, mget, revmap, mappedkeys)

importFrom(IRanges, RangedData, IRanges)

importMethodsFrom(IRanges, as.matrix, findOverlaps,
	as.data.frame, values, start, ranges, end)

importFrom(Biobase, featureNames, annotation, pData, rowMin,
    selectSome, samples)

import(GenomeInfoDb)

importClassFrom(GenomicRanges, GRanges, GenomicRanges, GenomicRanges_OR_missing)
importFrom(GenomicRanges, GRanges, GRangesList)

importFrom(Rsamtools, TabixFile)
importFrom(BiocGenerics, path)
export(TabixFile)

importMethodsFrom(Rsamtools, scanTabix)

importClassFrom(Rsamtools, TabixFile)

importFrom(VariantAnnotation, scanVcfHeader)
importFrom(rtracklayer, import.gff3)

importFrom("graphics", "abline", "axis", "hist", "mtext", "par",
    "points", "segments", "smoothScatter", "text")
importFrom("stats", "approx", "as.formula", "binomial", "coef",
    "dffits", "formula", "ftable", "lm", "model.matrix",
    "plogis", "predict", "qqplot", "relevel", "runif", "vcov")

importClassFrom(IRanges, RangedData)

exportMethods("gwSnpTests", "show", "topFeats", "plot", transTab)

exportClasses("eqtlTestsManager", "eqtlEstimatesManager", "mcwBestCis",
   "gwSnpScreenResult", transManager, allSigCis, sensiCisInput,
   sensiCisOutput, mcwAllCis, cisRun, CisConfig, TransConfig)

export(gwSnpTests, topSnps, eqtlTests, topFeats, getCisMap, pData, plot,
	best.cis.eQTLs, chromsUsed, fullreport, 
	eqtlEstimates, probesManaged, snpsManaged,
	topScores, topGenes, locusNames, geneNames, geneIndcol, nthScores,
	vcf2sm, fdr, transScores, getBest, getAll, 
	getCall, transTab, meqtlTests, meta.best.cis.eQTLs, meta.All.cis.eQTLs,
	meta.transScores, annotation, sensanal, snplocsDefault, 
	richNull, meta.bindmaf, meta.richNull, pifdr, 
 	All.cis, collectBest, 
        collectFiltered, cis.FDR.filter.SNPcentric, cis.FDR.filter.best,
	eqBox, eqDesc)

export(best.trans.eQTLs, chrFilter, All.cis)


export("chrnames", "chrnames<-", "estimates", "estimates<-", 
"excludeRadius", "excludeRadius<-", "exFilter", "exFilter<-", 
"folderStem", "folderStem<-", "gchrpref", "gchrpref<-", "geneannopk", 
"geneannopk<-", "geneApply", "geneApply<-", "keepMapCache", "keepMapCache<-", 
"nperm", "nperm<-", "radius", 
"radius<-", "rhs", "rhs<-", "schrpref", "schrpref<-", 
"shortfac", "shortfac<-", "smchrpref", "smchrpref<-", 
"smFilter", "smFilter<-", "smpack", "smpack<-", "snpannopk", 
"snpannopk<-", "SSgen", "SSgen<-",
"cis.FDR.filter.SNPcentric.complete", "binqq", "qqhex",
 "gffprocess", "simpleTiling", "cgff2dt", "ciseqByCluster", "scoresCis",
 "binnedQQ", "transeqByCluster", "transeqByChrom", "cisScores")

exportMethods("chrnames", "chrnames<-", "estimates", "estimates<-", 
"excludeRadius", "excludeRadius<-", "exFilter", "exFilter<-", 
"folderStem", "folderStem<-", "gchrpref", "gchrpref<-", "geneannopk", 
"geneannopk<-", "geneApply", "geneApply<-", "keepMapCache", "keepMapCache<-", 
"nperm", "nperm<-", "radius", 
"radius<-", "rhs", "rhs<-", "schrpref", "schrpref<-", 
"shortfac", "shortfac<-", "smchrpref", "smchrpref<-", 
"smFilter", "smFilter<-", "smpack", "smpack<-", "snpannopk", 
"snpannopk<-", "SSgen", "SSgen<-")

export(concatCis, eqtlTests.me, plotsens, inflammFilter)
#   SnpMatrixCisToSummex)

exportMethods("snpchr", "snpchr<-", "gbufsize", "gbufsize<-",
 "batchsize", "batchsize<-", "extraProps", "extraProps<-")

importFrom(hexbin, hexbin)
importClassFrom(hexbin, hexbin)

export(update_fdr_filt, filtgen.maf.dist, eqsens_dt, "genome<-",
  buildConfList, add878, addgwhit, cisAssoc, sampsInVCF, appraise)

importFrom(iterators, nextElem, idiv)

importFrom(ROCR, prediction, performance)
importFrom(biglm, biglm, bigglm, bigglm.function,
  bigglm.data.frame, bigglm.RODBC)

# new appraisal workflow elements

exportClass("EqAppr")
exportMethods("calfig")
#exportMethods("getSens", "getPruned", "getUnpruned",
#   "getNrec", "getModnames", "calfig")
#export("buildEqAppr", "maxAtFDR", "optAUC", "getAUCs")

