
useDynLib(girafe, girafeCoverage=girafe_coverage)

import("methods")

importFrom("graphics", "barplot", "legend", "plot", "hist")

importFrom("grDevices", "rainbow")

importFrom("grid", "arrow", "convertWidth", "dataViewport", "gpar",
          "grid.layout", "grid.lines", "grid.polygon", "grid.rect",
          "grid.segments", "grid.text", "grid.yaxis", "popViewport",
          "pushViewport", "stringWidth", "unit", "viewport")

importFrom("utils", "write.table")

importFrom("stats", "p.adjust", "p.adjust.methods", "pnbinom", "rnbinom")

importFrom("BSgenome", "organism")

importMethodsFrom("Biobase", "annotation")
importFrom("Biobase", "addVigs2WinMenu", "listLen")

importFrom("Biostrings", "consensusString","pairwiseAlignment","pattern","quality", "nucleotideSubstitutionMatrix")
importClassesFrom("Biostrings", "DNAString","DNAStringSet")
importMethodsFrom("Biostrings", "nchar", "detail")

importClassesFrom("IRanges", "IRanges", "Ranges", "RangedData", "CompressedIRangesList", "RangesList", "Rle", "SimpleRleList")
importMethodsFrom("IRanges", "score", "score<-", "width", "rdapply", "[", "endoapply", "Rle", "coverage", "sort", "split")
importFrom("IRanges", "IRanges", "RangedData", "RleList")

importClassesFrom("ShortRead", "AlignedRead")
importMethodsFrom("ShortRead", "chromosome", "position", "id")
importFrom("ShortRead", "sread")

importFrom("intervals", "plot")
importClassesFrom("intervals", "Intervals_virtual",
                     "Intervals_virtual_or_numeric", "Intervals_full")
importMethodsFrom("intervals", "clusters", "interval_included", "interval_overlap", "which_nearest", "reduce")

importClassesFrom("genomeIntervals", "Genome_intervals",
                  "Genome_intervals_stranded")
importMethodsFrom("genomeIntervals", "strand", "strand<-",
                  "seq_name", "seq_name<-")
importFrom("genomeIntervals", "getGffAttribute")

export("AlignedGenomeIntervals", "plotAligned", "trimAdapter",
       "perWindow", "fracOverlap", "intPhred", "coverageOneStrand",
       "addNBSignificance", "plotNegBinomFit", "medianByPosition",
       "agiFromBam", "getFeatureCounts", "countReadsAnnotated",
       "chrlengths", "clusters", "coerce", "organism",
       "plot", "sample", "subset", "summary") # generics

exportClasses("AlignedGenomeIntervals")

exportMethods("plot", "[", "interval_overlap", "interval_included",
              "chrlengths", "chrlengths<-", "chromosome",
              "coerce", "coverage", "clusters", "detail",
              "export", "extend", "hist", "nchar",
              "matches", "matches<-", "id", "id<-",
              "organism", "organism<-", "reads", "reads<-", "reduce", 
              "sample", "score", "score<-", "seq_name", "show",
              "sort", "strand", "strand<-", "subset", "summary",
              "width", "which_nearest")

S3method("c", "AlignedGenomeIntervals")
