importClassesFrom(GenomicRanges, GRanges, Seqinfo)

importClassesFrom(IRanges, DataFrame, IRanges, Rle)

importClassesFrom(methods, character, list, numeric, oldClass)

importMethodsFrom(BiocGenerics, as.data.frame, as.vector, cbind,
                  colnames, duplicated, lapply, ncol, nrow, order,
                  paste, rbind, rownames, sapply, strand, table,
                  unique, unlist, xtabs)

importMethodsFrom(BiocParallel, bplapply)

importMethodsFrom(GenomicAlignments, readGAlignmentsFromBam)

importMethodsFrom(GenomicRanges, seqlengths, "seqlengths<-",
                  "seqlevels<-", seqnames)

importMethodsFrom(IRanges, "%in%", as.list, as.matrix, "colnames<-",
                  countOverlaps, coverage, elementMetadata,
                  "elementMetadata<-", end, flank, gsub, mean, median,
                  merge, ranges, reduce, resize, "rownames<-",
                  runLength, runValue, sd, shiftApply, start, t,
                  viewMaxs, viewApply, Views, which, which.max, width)

importMethodsFrom(methods, show)

importMethodsFrom(Rsamtools, scanBamHeader, ScanBamParam)

import(chipseq)

importFrom(Biobase, selectSome)

import(DiffBind)

importFrom(GenomicRanges, GIntervalTree, GRanges, GRangesList,
           makeGRangesFromDataFrame)

importFrom(ggplot2, aes, aes_string, element_blank, element_text,
           facet_grid, facet_wrap, geom_bar, geom_boxplot, geom_line,
           geom_path, geom_rect, geom_tile, ggplot, ggsave, labs,
           scale_fill_gradient2, scale_fill_manual, theme, xlab, xlim,
           ylab)

importFrom(grDevices, dev.off, png)

importFrom(gtools, running)

importFrom(IRanges, "%over%", IRanges)

importFrom(methods, as, new)

importFrom(Nozzle.R1, addTo, asLink, asStrong, newCustomReport,
           newFigure, newList, newParagraph, newSection, newSubSection,
           newTable, writeReport)

importFrom(reshape2, melt)

importFrom(Rsamtools, bamFlagAsBitMatrix)

importFrom(stats, as.formula, formula, weighted.mean)

importFrom(utils, browseURL, read.delim, read.table, sessionInfo)

importFrom(Nozzle.R1, IMAGE.TYPE.RASTER, PROTECTION.PUBLIC)

export('ChIPQCsample','ChIPQC')
exportMethods(
    "averagepeaksignal",
    "coveragehistogram",
    "crosscoverage",
    "flagtagcounts",
    "fragmentlength",
    "FragmentLengthCrossCoverage",
    "Normalisedaveragepeaksignal",
    "peaks",
    "ReadLengthCrossCoverage",
    "RelativeCrossCoverage",
    "show",
    "ssd",
    "readlength",
    "plotCC",
    "plotPeakProfile",
    "plotFrip",
    "plotFribl",
    "plotRap",
    "plotCoverageHist",
    "plotRegi",
    "frip",
    "rip",
    "ribl",
    "regi",
    "mapped",
    "plotFribl",
    "QCmetrics",
    "QCsample",
    "QCcontrol",
    "QCmetadata",
    "QCannotation",
    "QCdba",
    "plotRap",
    "plotRegi",
    "reads",
    "duplicates",
    "duplicateRate",
    "plotCorHeatmap",
    "plotPrincomp",
    "ChIPQCreport",
    "plotSSD"
)
exportClasses(
    "ChIPQCsample", 
    "ChIPQCexperiment"
)
