import(methods)
import(BiocGenerics)

importClassesFrom(Biobase, AnnotatedDataFrame, AssayData, eSet, ExpressionSet)
importMethodsFrom(Biobase, annotation, "annotation<-", 
		assayData, "assayData<-", 
		featureData, "featureData<-", 
		featureNames, "featureNames<-",
		pData, "pData<-",
		exprs, "exprs<-",
		sampleNames, "sampleNames<-",
		coerce, combine, dim, initialize, notes, 
                storageMode, show, "[", "[[", "$")

importClassesFrom(methylumi, MethyLumiM)

importFrom(lumi, getChrInfo, getHistory, estimateBeta, m2beta, addAnnotationInfo, estimateM)
# importMethodsFrom(lumi, asBigMatrix)
importMethodsFrom(methylumi, methylated, unmethylated, "detection", "methylated<-", 
	"unmethylated<-", "detection<-", "betas", "betas<-",  combine, "[", "dataType", 
	"dataType<-")

importFrom(annotate, lookUp, getSYMBOL)
importFrom(AnnotationDbi, get, mget, loadDb)
importFrom(genefilter, rowttests)
importFrom(biomaRt, listAttributes, getBM)

# GenoSet related classes and functions
importClassesFrom(genoset, GenoSet)
importClassesFrom(IRanges, IRanges, RangedData)
importClassesFrom(GenomicRanges, GenomicRanges, GRanges)
importClassesFrom(VariantAnnotation, VRanges)
importMethodsFrom(IRanges, space, start, end, width, universe,
	unlist, as.vector, as.list, as.matrix, overlapsAny)
importMethodsFrom(GenomicRanges, distanceToNearest)
importMethodsFrom(genoset, chrNames, "chrNames<-", chrInfo, toGenomeOrder)
# importMethodsFrom(genoset, rowRanges, "rowRanges<-", chrNames, "chrNames<-", chrInfo, toGenomeOrder)
importMethodsFrom(VariantAnnotation, ref, alt, altDepth, totalDepth)

importFrom(rtracklayer, export.bw, import.bed, browserSession, ucscTableQuery, getTable, export)
importFrom(GenomicFeatures, getChromInfoFromUCSC, exons, transcripts)
importFrom(IRanges, IRanges, RangedData)
importFrom(genoset, GenoSet)
import(GenomeInfoDb)
importFrom(GenomicRanges, GRanges)
importFrom(parallel, detectCores, mclapply)
importFrom("grDevices", "col2rgb", "colorRampPalette", "dev.off",
           "gray", "palette", "png", "rgb")
importFrom("stats", "as.dendrogram", "dist", "hclust",
           "order.dendrogram", "p.adjust", "quantile", "reorder",
           "t.test", "wilcox.test")
importFrom("utils", "capture.output", "head", "packageDescription",
           "packageVersion", "write.csv", "write.table")

importClassesFrom(SummarizedExperiment, SummarizedExperiment)
importMethodsFrom(SummarizedExperiment, rowRanges, "rowRanges<-", assays, assayNames, "assays<-", colData, rowData, "colData<-", "rowData<-")

importFrom(Gviz, IdeogramTrack, GenomeAxisTrack, AnnotationTrack, GeneRegionTrack, 
	BiomartGeneRegionTrack, UcscTrack, DataTrack, stacks, plotTracks, coords, tags)
importMethodsFrom(Gviz, gene, ranges, feature, subset, chromosome, "chromosome<-", 
	displayPars, "displayPars<-", getPar, transcript)


exportClasses(MethyGenoSet)
exportMethods(asBigMatrix, exprs, "exprs<-", "methylated", "unmethylated", "detection", "methylated<-",
	"unmethylated<-", "detection<-", getHistory, combine, "[", coerce, chrNames)

export(MethyGenoSet, annotateDMRInfo, annotateGRanges, detectDMR.slideWin, 	
	export.methyGenoSet, getContinuousRegion, identifySigDMR, export.DMRInfo, 
	MethyLumiM2GenoSet, smoothMethyData, createTranscriptTrack, buildAnnotationTracks, 
	heatmapByChromosome, plotHeatmapByGene, plotMethylationHeatmapByGene, 
	plotTracksWithDataTrackInfo, checkChrName, estimateCMR.methylation,
	estimateMethySeq, filterBisulfiteVariant, getCoverage, identifyCpG, updateMethyGenoSet,
	rowRanges, colData, assays)


