useDynLib(stam)

.onLoad <- function(libname, pkgname) {
  # make sure to register S4 classes
  require(methods)

  # check for dot (from graphviz)
  if (.Platform$OS.type == "unix") {
    if (system("which dot > /dev/null", ignore.stderr=TRUE) != 0) {
      warning("stam did not find 'dot'. Graph layout will not work!")
    }
  }

  # initialize the StAM's server feature if possible
  data(server.config, package="stam", 
       envir=as.environment(match("package:stam", search())))
  cat("Welcome to Structured Analysis of Microarrays\n")
}


import(methods)
import(pamr)
importFrom(cluster, diana)
importClassesFrom(Biobase, exprSet)
importMethodsFrom(Biobase, exprs)

exportClasses(stamNode, stamINode, stamLeaf, stamNet, 
              stamFit, stamCV, stamPrediction, stamEval)
exportMethods(getGOterm, getGOchildren, getGOparents, writeHTML, print, initialize)
export(stam.net, stam.cv, stam.fit, stam.predict, stam.evaluate, 
       stam.writeHTML, stam.graph.plot, stam.rgb.colors)

S3method(plot,  stamCV)
S3method(plot,  stamFit)
S3method(plot,  stamPrediction)
S3method(image, stamPrediction)

