useDynLib(ShortRead, .registration=TRUE)

import(zlibbioc)

import(methods)

importClassesFrom(Biobase, AnnotatedDataFrame, AssayData,
                  ScalarCharacter, ScalarInteger, ScalarLogical,
                  ScalarNumeric, Versioned, Versions)

importClassesFrom(BiocGenerics, connection)

importClassesFrom(Biostrings, BStringSet, DNAString, DNAStringSet,
                  PairwiseAlignments, PhredQuality,
                  QualityScaledDNAStringSet, SolexaQuality,
                  XStringQuality, XStringSet)

importClassesFrom(GenomicRanges, GAlignments, GRanges, Seqinfo)

importClassesFrom(IRanges, characterORNULL, DataFrame, DataTableORNULL,
                  FilterRules, IRanges, RangedData, RangesList, Rle,
                  SimpleList)

importClassesFrom(Rsamtools, BamFileList, RsamtoolsFileList)

importMethodsFrom(IRanges, Ops, coerce)

importMethodsFrom(IRanges, append, as.factor, as.list, as.vector, by,
                  coerce, colnames, "colnames<-", coverage, diff,
                  endoapply, eval, gsub, head, ifelse, "%in%", levels,
                  median, metadata, "metadata<-", narrow, ncol, nrow,
                  paste, pmin, quantile, Reduce, rev, Rle, rownames,
                  "rownames<-", runLength, runValue, score, split,
                  start, sub, t, table, tapply, toupper, unlist,
                  update, Views, which, width, with)

importMethodsFrom(Biobase, "dimLabels<-", initialize, pData, phenoData,
                  sampleNames, show, varLabels, varMetadata)

importMethodsFrom(BiocGenerics, cbind, density, Filter, get, lapply,
                  Map, mapply, rbind, sapply, strand)

importMethodsFrom(Biostrings, alphabet, alphabetFrequency, detail,
                  duplicated, end, match, nchar, pairwiseAlignment,
                  pattern, PDict, quality, reverse, reverseComplement,
                  substr, summary, tail, trimLRPatterns, unaligned,
                  union, vcountPDict)

importMethodsFrom(GenomicRanges, as.data.frame, cigar, countOverlaps,
                  left, qnarrow, qwidth, ranges, reduce,
                  right, seqlevels, "seqlevels<-", seqnames,
                  values, "values<-")

importMethodsFrom(IRanges, append, as.factor, as.list, as.vector, by,
                  coerce, colnames, "colnames<-", coverage, diff,
                  endoapply, eval, gsub, head, ifelse, "%in%", levels,
                  median, metadata, "metadata<-", narrow, ncol, nrow,
                  order, paste, pmin, quantile, Reduce, rev, Rle, rownames,
                  "rownames<-", runLength, runValue, score, sort, split,
                  start, sub, t, table, tapply, toupper, unique, unlist,
                  update, Views, which, width, with)

importMethodsFrom(Rsamtools, isOpen, path, readGAlignmentsFromBam,
                  readGappedReadsFromBam, scanBam, ScanBamParam)

importFrom(Biobase, copySubstitute, mkScalar, selectSome,
           subListExtract)

importFrom(Biostrings, BString, BStringSet, DNAString, DNAStringSet,
           get_seqtype_conversion_lookup, mkAllStrings,
           QualityScaledDNAStringSet, readDNAStringSet,
           writeXStringSet)

importFrom(GenomicRanges, cigarToQWidth, GAlignments, GRanges)

importFrom(grDevices, colorRampPalette, dev.off, jpeg, pdf, png)

importFrom(hwriter, hwrite, hwriteImage)

importFrom(IRanges, DataFrame, encoding, FilterRules, IntegerList,
           IRanges, isSingleString, isTRUEorFALSE, RleList,
           SimpleList, solveUserSEW)

importFrom(lattice, dotplot, histogram, levelplot, llines, lsegments,
           ltext, panel.abline, panel.dotplot, panel.grid,
           panel.histogram, panel.levelplot, panel.xyplot,
           strip.custom, xyplot)

importFrom(latticeExtra, xyplot.list)

importFrom(Rsamtools, BamFileList, bamFlagTest, bamReverseComplement,
           "bamReverseComplement<-", bamSimpleCigar,
           "bamSimpleCigar<-", bamWhat, "bamWhat<-")

importFrom(stats, approxfun, setNames)

importFrom(utils, capture.output, packageDescription, read.csv,
           read.table, Sweave)

importFrom(Biostrings, DNA_ALPHABET)

exportClassPattern("^.*$")

exportMethods(show, coerce, dim, length, "[", "[[", alphabetFrequency,
              alphabet, coverage, encoding, narrow, strand,
              trimLRPatterns, width, append, rbind, "%in%", c, lapply,
              sapply)

export(pData, phenoData, varLabels, varMetadata)

exportPattern("^[^\\.]")