## Import
## ============================================================

import(methods)

### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### base packages
###

importFrom(grid, arrow, convertUnit, editGrob, gList, gTree, gpar, grid.draw,
           grid.newpage, grobTree, is.unit, rectGrob, textGrob, unit, unit.c)
importFrom(grDevices, dev.off, png)
importFrom(graphics, par)
importFrom(stats, approx, as.formula, df)
importFrom(utils, capture.output, getFromNamespace)

###
importFrom(GGally, ggpairs)
import(ggplot2)
import(gtable)
### importFrom(gtable, gtable, gtable_add_grob, gtable_add_cols, gtable_add_rows, gtable_filter)
importFrom(reshape2, melt)
importFrom(scales, cbreaks, rescale, expand_range, math_format,
           scientific_format, trans_breaks, trans_format)
importFrom(gridExtra, grid.arrange, arrangeGrob)
importFrom(Hmisc, bezier)

### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### Bioconductor packages
###

import(BiocGenerics)
import(S4Vectors)
import(IRanges)
import(GenomicRanges)
import(GenomeInfoDb)
import(biovizBase)

## Biobase
importClassesFrom(Biobase, ExpressionSet, eSet, AssayData)
importMethodsFrom(Biobase, exprs, pData, phenoData, varLabels)

## Biostrings
importMethodsFrom(Biostrings, getSeq)

## Rsamtools
importFrom(Rsamtools, BamFile)
importMethodsFrom(Rsamtools, ScanBamParam, scanBamHeader, path)
importClassesFrom(Rsamtools, BamFile, BamFileList)

## GenomicAlignments
importMethodsFrom(GenomicAlignments, readGAlignments)
importClassesFrom(GenomicAlignments, GAlignments)

## BSgenome
importClassesFrom(BSgenome, BSgenome)

## rtracklayer
importMethodsFrom(rtracklayer, import)
importClassesFrom(rtracklayer, BigWigFile, UCSCData)

## GenomicFeatures
importClassesFrom(GenomicFeatures, TxDb)
importMethodsFrom(GenomicFeatures, exonsBy)

## VariantAnnotation
importClassesFrom(VariantAnnotation, VCF)
importMethodsFrom(VariantAnnotation, fixed, "fixed<-", ref,
                  alt, info, geno)

## OrganismDb
importClassesFrom(OrganismDbi, OrganismDb)
## ============================================================
## Export
## ============================================================
## utils
exportMethods(autoplot, rescale, fixed, "fixed<-",
              xlim, "xlim<-", reset, backup,
              bgColor, "bgColor<-", labeled, "labeled<-",
              mutable, "mutable<-", height, "height<-",
              hasAxis, "hasAxis<-", ggplot)


export(arrangeGrobByParsingLegend, ggbio, GGbio)

## scale
export(scale_x_sequnit, scale_fill_giemsa, scale_fill_fold_change)

## geom
exportMethods(geom_chevron,
              geom_arch,
              geom_alignment,
              geom_arrow,
              geom_arrowrect,
              geom_rect,
              geom_bar,
              geom_segment)

## stat
exportMethods(stat_aggregate,
              stat_coverage,
              stat_identity,
              stat_mismatch,
              stat_stepping,
              stat_gene,
              stat_table,
              stat_slice,
              stat_bin,
              stat_reduce)

## layout
exportMethods(layout_karyogram,
              layout_circle)

export(circle)
## coord
## exportMethods(coord_genome)
export(tracks,
       align.plots,
       alignPlots,
       plotFragLength,
       plotSpliceSum,
       plotStackedOverview,
       plotKaryogram,
       plotSingleChrom,
       plotIdeogram,
       Ideogram,
       plotGrandLinear,
       plotRangesLinkedToData)

export(theme_null, theme_alignment, theme_clear, theme_tracks_sunset,
       theme_pack_panels, theme_noexpand, theme_genome)

export(ggsave)
exportMethods(cbind, rbind)
exportClasses(GGbio, Ideogram, Plot, Tracked, Tracks, Grob)
## export(btextGrob, geom_text2, zoom, zoom_in, zoom_out, nextView, prevView)
export(zoom, zoom_in, zoom_out, nextView, prevView)
## exportMethods(Grob, Plot, get_gtable, cached, "cached<-",
##               cached_xlim, "cached_xlim<-",
##               cached_ylim, "cached_ylim<-",
##               cached_item, "cached_item<-", addItem, addWhich,
##               cached_which, cbind, rbind)
## export(PlotList, Tracked, Plot, Grob)
