#importClassesFrom(methods, ANY, character, data.frame, list, logical, matrix, missing, numeric)
#importMethodsFrom(methods, initialize, show)
#importFrom(methods, "@<-", as, callNextMethod, new)
import(methods)

import(BiocGenerics)

importClassesFrom(Biobase, AnnotatedDataFrame, AssayData, MIAME, Versions, Versioned, VersionedBiobase, eSet)
importMethodsFrom(Biobase, assayData, "assayData<-", combine, fData, featureData, "featureData<-",
    pData, phenoData, "phenoData<-", sampleNames, varMetadata)
importFrom(Biobase, assayDataElementNames, assayDataNew)
    
importClassesFrom(IRanges, RangesList)
importMethodsFrom(IRanges, "%in%", Views, aggregate, as.data.frame, as.matrix, as.vector, cbind, 
    colnames, "colnames<-", countOverlaps, coverage, duplicated, end, "end<-", findOverlaps, gsub,
    intersect, lapply, levels, mad, match, mean, median, nchar, ncol, nrow, order,
    paste, pmax, pmin, ranges, rbind, restrict, rev, rownames, "rownames<-", sapply, score, sd, 
    setdiff, shift, sort, split, start, subject, subseq, subset, substr, substring, summary, t, 
    table, toString, union, unique, unlist, values, "values<-", which, width)
importFrom(IRanges, IRanges, RangedData, compact)

importFrom(biomaRt, getBM, getSequence, useMart)

importClassesFrom(Biostrings, DNAString, DNAStringSet, XStringSet, QualityScaledDNAStringSet, QualityScaledXStringSet, XStringQuality, BString, PhredQuality, SolexaQuality)
importMethodsFrom(Biostrings, PDict, aligned, complement, countIndex, deletion, endIndex,
    insertion, matchPDict, matchPattern, mismatchTable, pairwiseAlignment, reverseComplement,
    startIndex, translate, vmatchPattern, quality, append)
importFrom(Biostrings, BStringSet, DNAString, DNAStringSet, nucleotideSubstitutionMatrix)

importClassesFrom(BSgenome, BSgenome)

importFrom(graphics, axis, barplot, boxplot, legend, lines, mtext, par, plot, points, polygon, rect,
    strheight, strwidth, text)

importFrom(grDevices, dev.off, pdf, png, rgb)

importFrom(R2HTML, HTML, HTML.title, HTMLEndFile, HTMLInitFile)

importFrom(Rsamtools, scanBam)

#importMethodsFrom(rtracklayer, strand)

importClassesFrom(ShortRead, AlignedRead)
importMethodsFrom(ShortRead, chromosome, id, name, position)
importFrom(ShortRead, AlignedDataFrame, AlignedRead, alignData, sread, alphabetByCycle)

importFrom(stats, as.dist, cutree, filter, hclust)

importFrom(utils, read.csv, read.table, write.csv)

importFrom(VariantAnnotation, VCF, VCFHeader)
importMethodsFrom(VariantAnnotation, writeVcf)

importFrom(xtable, xtable)

importFrom(tools, texi2dvi)

exportClasses(
    AVASet,
    MapperSet,
    AnnotatedVariants,
    Breakpoints,
    SFFRead,
    SFFContainer)


exportMethods(
    alignShortReads,
    readsOnTarget,
    coverageOnTarget,
    calculateTiTv,
    genomeSequencerMIDs,
    sequenceCaptureLinkers,
    demultiplexReads,
    removeLinker,

    filterChimericReads,
    detectBreakpoints,
    mergeBreakpoints,

    annotateVariants,
    annotatedVariants,
    htmlReport,

    ava2vcf,
    
    plotVariationFrequency,
    plotAmpliconCoverage,
    plotVariants,
    plotChimericReads,
            
    seqsC1, "seqsC1<-",
    seqsC2, "seqsC2<-",
    commonBpsC1, "commonBpsC1<-",
    commonBpsC2, "commonBpsC2<-",
    commonAlignC1, "commonAlignC1<-",
    commonAlignC2, "commonAlignC2<-",
    alignedReadsC1, "alignedReadsC1<-",
    alignedReadsC2, "alignedReadsC2<-",
             
    MapperSet,
    AVASet,
    fDataAmp,
    featureDataAmp, "featureDataAmp<-",
    assayDataAmp, "assayDataAmp<-",
    getAlignedReads,
    referenceSequences, "referenceSequences<-",
    getReadStatus,
    getVariantPercentages,
    setVariantFilter,
    
    name, "name<-",
    flowgramFormat, "flowgramFormat<-",
    flowChars, "flowChars<-",
    keySequence, "keySequence<-",
    clipQualityLeft, "clipQualityLeft<-",
    clipQualityRight, "clipQualityRight<-",
    clipAdapterLeft, "clipAdapterLeft<-",
    clipAdapterRight, "clipAdapterRight<-",
    flowgram, "flowgram<-",   
    flowgrams, "flowgrams<-",     
    flowIndexes, "flowIndexes<-",
    read, "read<-",
    quality, "quality<-",
    reads, "reads<-",
    addRead, getRead,
    sff2fastq,
    
    readLengthStats,
    readLengthHist,
    baseQualityStats,
    baseQualityHist,
    sequenceQualityHist,
    positionQualityBoxplot,
    baseFrequency,
    nucleotideCharts,
    gcContent,
    gcPerPosition,
    gcContentHist,
    complexity.dust,
    complexity.entropy,
    dinucleotideOddsRatio,
    flowgramBarplot,
    homopolymerHist
)

export(
    extendedCIGARToList,
    listToExtendedCIGAR,
    readSFF,
    writeSFF,
    qualityReportSFF
)

useDynLib(R453Plus1Toolbox)
