useDynLib(cydar, .registration=TRUE, .fixes="cxx_")

import(BiocParallel, SummarizedExperiment, S4Vectors, methods)

importFrom("viridis", viridis)

importFrom("stats", coef, kmeans, median, quantile, lm.fit, density, approx, lm,
    mad, splinefun, setNames)

importMethodsFrom("flowCore", markernames, "markernames<-", sampleNames,
    "sampleNames<-", exprs, normalize)

importFrom("flowCore", rectangleGate, polygonGate, flowFrame, flowSet,
    normalization)

importFrom("Biobase", AnnotatedDataFrame)

importFrom("graphics", plot, points, lines, par, polygon, text, segments,
    legend, hist, plot.new)

importFrom("grDevices", rainbow, col2rgb, rgb)

importFrom("Rcpp", sourceCpp)

importFrom("shiny", 
        column, fluidPage, fluidRow, 
        pageWithSidebar, sidebarPanel, mainPanel, headerPanel, h4, hr, br, HTML,
        actionButton, textInput, sliderInput, updateTextInput, selectInput, updateSelectInput,
        observeEvent, observe, nearPoints, reactive, reactiveValues,
        plotOutput, renderPlot, renderTable, tableOutput, htmlOutput, renderUI,
        shinyApp, stopApp, runApp)

exportClasses(CyData)

exportMethods(nmarkers, 
    ncells,
    markernames, "markernames<-",
    sampleNames, "sampleNames<-",
    markerData, "markerData<-",
    intensities, "intensities<-",
    cellAssignments, "cellAssignments<-",
    cellIntensities, "cellIntensities<-",
    cellData, "cellData<-"
)

export(countCells,  
    expandRadius,
    normalizeBatch,
    diffIntDistr,
    multiIntHist,
    plotCellLogFC,
    plotCellIntensity,
    intensityRanges,
    spatialFDR,
    pickBestMarkers,
    prepareCellData,
    neighborDistances,
    findFirstSphere,
    interpretSpheres,
    labelSpheres,
    CyData,
    packIndices,
    unpackIndices,
    recountCells,
    medIntensities,
    poolCells,
    outlierGate,
    dnaGate
)

