import(S4Vectors)

importClassesFrom(IRanges, IRanges)

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

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

#importMethodsFrom(BiocParallel, bplapply)

importMethodsFrom(GenomicAlignments, readGAlignments)

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

importMethodsFrom(methods, show)

importMethodsFrom(Rsamtools, scanBamHeader, ScanBamParam)

import(chipseq)

importFrom(Biobase, selectSome)

importFrom(BiocGenerics, as.vector, unlist)

import(DiffBind)

import(GenomicRanges)

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, coord_cartesian)

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(GenomicFeatures, fiveUTRsByTranscript, threeUTRsByTranscript, cdsBy, intronsByTranscript,
                            transcripts)

importFrom(Rsamtools, bamFlagAsBitMatrix, BamFile, index, indexBam)

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

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

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

importFrom("grDevices", "boxplot.stats")

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",
    "plotSSD",
    "reads",
    "duplicates",
    "duplicateRate",
    "plotCorHeatmap",
    "plotPrincomp",
    "ChIPQCreport"
)
exportClasses(
    "ChIPQCsample", 
    "ChIPQCexperiment"
)

#importFrom(TxDb.Hsapiens.UCSC.hg20.knownGene,TxDb.Hsapiens.UCSC.hg20.knownGene)
importFrom(TxDb.Hsapiens.UCSC.hg19.knownGene,TxDb.Hsapiens.UCSC.hg19.knownGene)
importFrom(TxDb.Hsapiens.UCSC.hg18.knownGene,TxDb.Hsapiens.UCSC.hg18.knownGene)
importFrom(TxDb.Mmusculus.UCSC.mm10.knownGene, TxDb.Mmusculus.UCSC.mm10.knownGene)
importFrom(TxDb.Mmusculus.UCSC.mm9.knownGene,TxDb.Mmusculus.UCSC.mm9.knownGene)
importFrom(TxDb.Rnorvegicus.UCSC.rn4.ensGene, TxDb.Rnorvegicus.UCSC.rn4.ensGene)
importFrom(TxDb.Celegans.UCSC.ce6.ensGene,TxDb.Celegans.UCSC.ce6.ensGene)
importFrom(TxDb.Dmelanogaster.UCSC.dm3.ensGene,TxDb.Dmelanogaster.UCSC.dm3.ensGene)