useDynLib("crlmm", .registration=TRUE)


## Biobase
importClassesFrom(Biobase, AnnotatedDataFrame, AssayData, eSet,
		  SnpSet, NChannelSet, MIAME, Versioned, VersionedBiobase, Versions)

importMethodsFrom(Biobase, annotation, "annotation<-", annotatedDataFrameFrom,
                  assayData, "assayData<-", combine, dims,
                  experimentData, "experimentData<-",
                  fData, featureData, "featureData<-", featureNames,
                  fvarMetadata, fvarLabels,
                  pData, phenoData, "phenoData<-", protocolData, "protocolData<-",
                  pubMedIds, rowMedians, sampleNames,
                  storageMode, "storageMode<-", updateObject, varLabels)

importFrom(Biobase, assayDataElement, assayDataElementNames,
           assayDataElementReplace, assayDataNew, classVersion, validMsg)

## oligoClasses
importClassesFrom(oligoClasses, SnpSuperSet, AlleleSet)
importMethodsFrom(oligoClasses, 
				 allele,
                                 calls, "calls<-",  
          			 confs, "confs<-",
				 cnConfidence, "cnConfidence<-", 
				 copyNumber)
importFrom("oligoClasses", "position")
importFrom("oligoClasses", "chromosome")
 
## IRanges
importClassesFrom(IRanges, "RangedData", "IRanges")
importMethodsFrom(IRanges, Rle, start, end, width, runValue)
importFrom(IRanges, IRanges, RleList, RangedData)

##importMethodsFrom(methods, initialize, show)

##importFrom(methods, "@<-", callNextMethod, new, validObject)

importFrom(graphics, abline, axis, layout, legend, mtext, par, plot,
           polygon, rect, segments, text, points, boxplot)

importFrom(SNPchip, chromosome2integer)

importFrom(VanillaICE, viterbi, transitionProbability)

importFrom(stats, update)

importFrom(grDevices, grey)

importFrom(affyio, read.celfile.header, read.celfile)

importFrom(preprocessCore, normalize.quantiles.use.target, normalize.quantiles)

importFrom(utils, data, packageDescription, setTxtProgressBar, txtProgressBar)

importFrom(stats, coef, cov, dnorm, kmeans, lm, mad, median, quantile, sd)

importFrom(genefilter, rowSds)

importFrom(mvtnorm, dmvnorm)

importFrom(ellipse, ellipse)

exportMethods(A, B,
		 CA, "CA<-", CB, "CB<-",
		 isSnp) 


exportMethods(chromosome, position)

export(
       celDates, 
      crlmm, 
       cnOptions, 
       confs,
       "confs<-",
       copyNumber, 
       emissionPr,
       "emissionPr<-",
       list.celfiles, 
      snprma)

exportMethods(computeHmm, 
              rangedData,
             "rangedData<-",
	     segmentData,
	     "segmentData<-")

export(hmmOptions,
       crlmmCopynumber)

export(ellipse) ##, ellipse.CopyNumberSet, getParam.SnpSuperSet)
export(viterbi.CNSet, 
		      combineIntensities,
		      whichPlatform,
		      isValidCdfName,
		      splitByChromosome,
	crlmmWrapper,
       computeHmm.CNSet, addFeatureAnnotation.SnpSuperSet,
       readIdatFiles,
       withinGenotypeMoments,  trioOptions, hmm.SnpSuperSet, trioOptions, computeBpiEmission.SnpSuperSet,
       isBiparental.matrix, isBiparental.SnpSuperSet, hapmapPedFile, isSnp.AlleleSet,
       findFatherMother)
exportMethods(start, end, width)