[Wavetiling-commits] r31 - / pkg pkg/R pkg/inst pkg/inst/scripts pkg/man pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 9 14:15:36 CET 2012


Author: kdbeuf
Date: 2012-03-09 14:15:36 +0100 (Fri, 09 Mar 2012)
New Revision: 31

Added:
   pkg/
   pkg/CHANGELOG
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/
   pkg/R/allClasses.R
   pkg/R/allGenerics.R
   pkg/R/helperFunctions.R
   pkg/R/initialize-methods.R
   pkg/R/methods-MapFilterProbe.R
   pkg/R/methods-WaveTilingFeatureSet.R
   pkg/R/methods-WfmFit.R
   pkg/R/methods-WfmInf.R
   pkg/R/show-methods.R
   pkg/TODO
   pkg/inst/
   pkg/inst/NEWS.Rd
   pkg/inst/doc/
   pkg/inst/scripts/
   pkg/inst/scripts/Sweave.sty
   pkg/inst/scripts/waveTiling-vignette.Rnw
   pkg/inst/scripts/waveTiling-vignette.pdf
   pkg/man/
   pkg/man/GenomeInfo-class.Rd
   pkg/man/MapFilterProbe-class.Rd
   pkg/man/WaveTilingFeatureSet-class.Rd
   pkg/man/WfmFit-class.Rd
   pkg/man/WfmFitCircadian-class.Rd
   pkg/man/WfmFitCustom-class.Rd
   pkg/man/WfmFitFactor-class.Rd
   pkg/man/WfmFitTime-class.Rd
   pkg/man/WfmInf-class.Rd
   pkg/man/WfmInfCompare-class.Rd
   pkg/man/WfmInfCustom-class.Rd
   pkg/man/WfmInfEffects-class.Rd
   pkg/man/WfmInfMeans-class.Rd
   pkg/man/WfmInfOverallMean-class.Rd
   pkg/man/addPheno.Rd
   pkg/man/bgCorrQn.Rd
   pkg/man/cel2TilingFeatureSet.Rd
   pkg/man/filterOverlap.Rd
   pkg/man/getAlpha.Rd
   pkg/man/getBetaWav.Rd
   pkg/man/getChromosome.Rd
   pkg/man/getDataOrigSpace.Rd
   pkg/man/getDataWaveletSpace.Rd
   pkg/man/getDelta.Rd
   pkg/man/getDesignMatrix.Rd
   pkg/man/getEff.Rd
   pkg/man/getF.Rd
   pkg/man/getFDR.Rd
   pkg/man/getFilteredIndices.Rd
   pkg/man/getGenomeInfo.Rd
   pkg/man/getGenomicRegions.Rd
   pkg/man/getGroupNames.Rd
   pkg/man/getKj.Rd
   pkg/man/getMaxPos.Rd
   pkg/man/getMinPos.Rd
   pkg/man/getNoGroups.Rd
   pkg/man/getNoLevels.Rd
   pkg/man/getNoProbes.Rd
   pkg/man/getNonAnnotatedRegions.Rd
   pkg/man/getPhenoInfo.Rd
   pkg/man/getPosition.Rd
   pkg/man/getPrior.Rd
   pkg/man/getProbePosition.Rd
   pkg/man/getRegions.Rd
   pkg/man/getReplics.Rd
   pkg/man/getSigGenes.Rd
   pkg/man/getSigProbes.Rd
   pkg/man/getSmoothPar.Rd
   pkg/man/getStrand.Rd
   pkg/man/getTwoSided.Rd
   pkg/man/getVarBetaWav.Rd
   pkg/man/getVarEff.Rd
   pkg/man/getVarEps.Rd
   pkg/man/getVarF.Rd
   pkg/man/getWaveletFilter.Rd
   pkg/man/makeContrasts.Rd
   pkg/man/makeDesign.Rd
   pkg/man/plotWfm.Rd
   pkg/man/selectProbesFromFilterOverlap.Rd
   pkg/man/selectProbesFromTilingFeatureSet.Rd
   pkg/man/wfm.fit.Rd
   pkg/man/wfm.inference.Rd
   pkg/src/
   pkg/src/MAPmarlik.c
   pkg/src/MAPmarlikEqSmooth.c
   pkg/src/MAPmarlikImp.c
   pkg/src/MAPmarlikImpEqSmooth.c
Log:
new copy


Added: pkg/CHANGELOG
===================================================================
--- pkg/CHANGELOG	                        (rev 0)
+++ pkg/CHANGELOG	2012-03-09 13:15:36 UTC (rev 31)
@@ -0,0 +1,3 @@
+2011-12-04  Kristof De Beuf <kristof.debeuf at ugent.be> - committed version 0.1.1
+
+* First version

Added: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	                        (rev 0)
+++ pkg/DESCRIPTION	2012-03-09 13:15:36 UTC (rev 31)
@@ -0,0 +1,19 @@
+Package: waveTiling
+Version: 0.1.1
+Date: 2012-02-16
+License: GPL (>=2)
+Title: Wavelet-Based Models for Tiling Array Transcriptome Analysis
+Author: Kristof De Beuf <kristof.debeuf at UGent.be>, Peter Pipelers <peter.pipelers at ugent.be> and Lieven Clement <lieven.clement at gmail.com>
+Maintainer: Kristof De Beuf <kristof.debeuf at UGent.be>
+Depends: oligo, oligoClasses, Biobase, Biostrings
+Imports: methods, affy, preprocessCore, GenomicRanges, waveslim, GenomeGraphs, IRanges
+Suggests: BSgenome
+Description: This package is designed to conduct transcriptome analysis for tiling arrays based on fast wavelet-based functional models.
+Collate: allClasses.R allGenerics.R helperFunctions.R
+        initialize-methods.R methods-MapFilterProbe.R
+        methods-WaveTilingFeatureSet.R methods-WfmFit.R methods-WfmInf.R show-methods.R
+URL: https://r-forge.r-project.org/projects/wavetiling/
+LazyLoad: yes
+LazyData:
+biocViews:
+Packaged: 2011-12-05 20:18:51 UTC; kdebeuf

Added: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	                        (rev 0)
+++ pkg/NAMESPACE	2012-03-09 13:15:36 UTC (rev 31)
@@ -0,0 +1,71 @@
+useDynLib("waveTiling")
+
+## Import Classes
+importClassesFrom(Biobase, AnnotatedDataFrame, AssayData, MIAxE,
+                  Versions)
+
+importClassesFrom(methods, array, character, data.frame, list, matrix,
+                  numeric, vector)
+
+importClassesFrom(oligoClasses, TilingFeatureSet)
+
+## Import Methods
+importMethodsFrom(affy, pm, pmindex)
+
+importMethodsFrom(Biobase, exprs, "exprs<-", pData, "phenoData<-")
+
+importMethodsFrom(Biostrings, complement, matchPDict, PDict,
+                  reverseComplement, startIndex)
+
+importMethodsFrom(GenomicRanges, seqnames)
+
+importMethodsFrom(IRanges, as.matrix, cbind, findOverlaps, ifelse, intersect, lapply, mad, Map, matchMatrix, mean,
+                  median, ncol, nrow, order, paste, pintersect, pmin,
+                  queryHits, rbind, reduce, Reduce, Rle, rownames,
+                  "rownames<-", sapply, stack, start, subjectHits,
+                  subseq, t, table, tapply, unique, unlist, values,
+                  "values<-", which, width)
+
+importMethodsFrom(methods, initialize, show)
+
+importMethodsFrom(oligo, pmChr, pmPosition, pmSequence, pmStrand)
+
+## Import
+importFrom(affy, bg.adjust, list.celfiles)
+
+importFrom(GenomeGraphs, DisplayPars, gdPlot, makeAnnotationTrack,
+           makeGenericArray, makeGenomeAxis, makeRectangleOverlay,
+           makeTextOverlay)
+
+importFrom(GenomicRanges, GRanges, GRangesList)
+
+importFrom(IRanges, IRanges)
+
+importFrom(methods, "@<-", callNextMethod, new)
+
+importFrom(oligo, read.celfiles)
+
+importFrom(stats, contr.helmert, contr.treatment, lm, pnorm, qnorm,
+           rnorm)
+
+importFrom(waveslim, wave.filter)
+
+## Export Classes
+exportClasses(WaveTilingFeatureSet, MapFilterProbe, GenomeInfo, WfmFit, WfmInf, WfmFitTime, WfmFitFactor, WfmFitCircadian, WfmFitCustom, WfmInfCompare, WfmInfEffects )
+
+## Export Methods
+exportMethods(show)
+
+
+## WaveTilingFeatureSet 
+exportMethods(addPheno, getNoGroups, getGroupNames, getReplics, filterOverlap, selectProbesFromTilingFeatureSet,bgCorrQn,wfm.fit)
+
+## MapFilterProbe
+exportMethods(getFilteredIndices, getPosition, selectProbesFromFilterOverlap)
+
+## WfmFit and WfmInf
+exportMethods(getProbePosition, getNoProbes, getBetaWav, getVarBetaWav, getSmoothPar, getVarEps, getGenomeInfo, getChromosome, getStrand, getMinPos, getMaxPos, getNoLevels, getDesignMatrix, getPhenoInfo, getDataOrigSpace, getDataWaveletSpace, getWaveletFilter, getKj,getPrior, getAlpha, getDelta, getTwoSided, getSigProbes,getRegions, getGenomicRegions, getFDR, getF, getVarF, getEff,getVarEff, wfm.inference, getSigGenes, getNonAnnotatedRegions, plotWfm)
+
+## Other
+export(cel2TilingFeatureSet, makeContrasts, makeDesign)
+

Added: pkg/R/allClasses.R
===================================================================
--- pkg/R/allClasses.R	                        (rev 0)
+++ pkg/R/allClasses.R	2012-03-09 13:15:36 UTC (rev 31)
@@ -0,0 +1,45 @@
+#MapFilterProbe
+setClass("MapFilterProbe",representation(filteredIndices="vector",chromosome="vector",position="vector",strand="vector"))
+
+#GenomeInfo
+setClass("GenomeInfo",representation(chromosome="vector",strand="character",minPos="numeric",maxPos="numeric"))
+
+#WaveTilingFeatureSet
+setClass("WaveTilingFeatureSet",contains="TilingFeatureSet")
+
+#WfmFit
+setClass(Class="WfmFit",
+	representation = representation	(betaWav="matrix",varbetaWav="matrix",smoothPar="matrix",varEps="numeric",dataOrigSpace="matrix",dataWaveletSpace="matrix",design.matrix="matrix",phenoData="data.frame",genome.info="GenomeInfo",n.levels="numeric",probePosition="vector",wave.filt="character",Kj="numeric",prior="character",F="matrix",varF="matrix",P="numeric",Z="matrix",noGroups="numeric",replics="numeric")
+)
+
+### Factor
+setClass(Class="WfmFitFactor", contains="WfmFit")
+
+### Time
+setClass(Class="WfmFitTime", contains="WfmFit")
+
+## Circadian
+setClass(Class="WfmFitCircadian", contains="WfmFit")
+
+## Custom
+setClass(Class="WfmFitCustom", contains="WfmFit")
+
+#WfmInf
+setClass(Class="WfmInf",
+	representation = representation	(alpha="numeric",delta="numeric",two.sided="numeric",sigProbes="list",regions="list",GlocRegions="list",FDR="matrix",CI="array",eff="matrix",varEff="matrix")
+)
+
+## Compare
+setClass(Class="WfmInfCompare", contains="WfmInf")
+
+## Effects
+setClass(Class="WfmInfEffects", contains="WfmInf")
+
+## Means
+setClass(Class="WfmInfMeans", contains="WfmInf")
+
+## Overall Mean
+setClass(Class="WfmInfOverallMean", contains="WfmInf")
+
+## Custom
+setClass(Class="WfmInfCustom", contains="WfmInf")

Added: pkg/R/allGenerics.R
===================================================================
--- pkg/R/allGenerics.R	                        (rev 0)
+++ pkg/R/allGenerics.R	2012-03-09 13:15:36 UTC (rev 31)
@@ -0,0 +1,318 @@
+# temporary(?) pmStrand
+# 
+# setGeneric("pmStrand",function(object)
+# {
+# 	standardGeneric("pmStrand")
+# }
+# )
+
+# method data extraction
+
+setGeneric("addPheno",function(object, noGroups, groupNames, replics, ...)
+{
+	standardGeneric("addPheno")
+}
+)
+
+
+setGeneric("filterOverlap",function(object, remap=TRUE, BSgenomeObject, chrId,  strand=c("forward","reverse","both"), MM=FALSE, ...)
+{
+	standardGeneric("filterOverlap")
+}
+)
+
+setGeneric("bgCorrQn",function(object, useMapFilter=NULL)
+{
+	standardGeneric("bgCorrQn")
+}
+)
+
+setGeneric("selectProbesFromTilingFeatureSet",function(object, chromosome, strand=c("forward","reverse"), minPos, maxPos)
+{
+	standardGeneric("selectProbesFromTilingFeatureSet")
+}
+)
+
+setGeneric("selectProbesFromFilterOverlap",function(object, chromosome, strand=c("forward","reverse"), minPos=min(getPosition(object)), maxPos=max(getPosition(object)))
+{
+	standardGeneric("selectProbesFromFilterOverlap")
+}
+)
+
+#fit method
+# setGeneric("makeDesign",function(object, method=c("twoGroup","compareGroupsTime","compareGroupsFactor","circadian","twoFactors","meansByGroupTime","meansByGroupFactor","effectsTime"), factor.levels=NULL)
+# {
+# 	standardGeneric("makeDesign")
+# }
+# )
+
+setGeneric("wfm.fit",function(object, filter.overlap=NULL, design=c("time","circadian","group","factorial","custom"), n.levels, factor.levels=NULL, chromosome, strand, minPos, maxPos, design.matrix=NULL, var.eps=c("margLik","mad"), prior=c("normal","improper"), eqsmooth=FALSE, max.it=20, wave.filt="haar", skiplevels=NULL, trace=FALSE, save.obs=c("plot","regions","all"))
+{
+	standardGeneric("wfm.fit")
+}
+)
+
+setGeneric("wfm.inference",function(object,contrast.matrix=NULL, contrasts=c("compare","means","effects","overallMean"), delta=NULL, two.sided=NULL, minRunPos=90, minRunProbe=1, alpha=0.05, nsim=1000, rescale=NULL) {
+	standardGeneric("wfm.inference")
+}
+)
+
+#accessors mapFilterProbe
+setGeneric("getFilteredIndices",function(object)
+{
+	standardGeneric("getFilteredIndices")
+}
+)
+
+setGeneric("getChromosome",function(object)
+{
+	standardGeneric("getChromosome")
+}
+)
+
+setGeneric("getPosition",function(object)
+{
+	standardGeneric("getPosition")
+}
+)
+
+setGeneric("getStrand",function(object)
+{
+	standardGeneric("getStrand")
+}
+)
+
+#accessors TilingFeatureSet
+setGeneric("getNoGroups",function(object)
+{
+	standardGeneric("getNoGroups")
+}
+)
+
+setGeneric("getGroupNames",function(object)
+{
+	standardGeneric("getGroupNames")
+}
+)
+
+setGeneric("getReplics",function(object)
+{
+	standardGeneric("getReplics")
+}
+)
+
+######
+#accessors WfmFit
+setGeneric("getProbePosition",function(object)
+{
+	standardGeneric("getProbePosition")
+}
+)
+
+setGeneric("getNoProbes",function(object)
+{
+	standardGeneric("getNoProbes")
+}
+)
+
+setGeneric("getBetaWav",function(object)
+{
+	standardGeneric("getBetaWav")
+}
+)
+
+setGeneric("getVarBetaWav",function(object)
+{
+	standardGeneric("getVarBetaWav")
+}
+)
+
+setGeneric("getSmoothPar",function(object)
+{
+	standardGeneric("getSmoothPar")
+}
+)
+
+setGeneric("getVarEps",function(object)
+{
+	standardGeneric("getVarEps")
+}
+)
+
+setGeneric("getGenomeInfo",function(object)
+{
+	standardGeneric("getGenomeInfo")
+}
+)
+
+setGeneric("getMinPos",function(object)
+{
+	standardGeneric("getMinPos")
+}
+)
+
+setGeneric("getMaxPos",function(object)
+{
+	standardGeneric("getMaxPos")
+}
+)
+
+setGeneric("getNoLevels",function(object)
+{
+	standardGeneric("getNoLevels")
+}
+)
+
+setGeneric("getWfmMethod",function(object)
+{
+	standardGeneric("getWfmMethod")
+}
+)
+setGeneric("getDesignMatrix",function(object)
+{
+	standardGeneric("getDesignMatrix")
+}
+)
+
+setGeneric("getWfmDesign",function(object)
+{
+	standardGeneric("getWfmDesign")
+}
+)
+setGeneric("getPhenoInfo",function(object)
+{
+	standardGeneric("getPhenoInfo")
+}
+)
+
+setGeneric("getDataOrigSpace",function(object)
+{
+	standardGeneric("getDataOrigSpace")
+}
+)
+setGeneric("getDataWaveletSpace",function(object)
+{
+	standardGeneric("getDataWaveletSpace")
+}
+)
+
+setGeneric("getWaveletFilter",function(object)
+{
+	standardGeneric("getWaveletFilter")
+}
+)
+setGeneric("getKj",function(object)
+{
+	standardGeneric("getKj")
+}
+)
+
+setGeneric("getPrior",function(object)
+{
+	standardGeneric("getPrior")
+}
+)
+
+setGeneric("getAlpha",function(object)
+{
+	standardGeneric("getAlpha")
+}
+)
+
+setGeneric("getDelta",function(object)
+{
+	standardGeneric("getDelta")
+}
+)
+
+setGeneric("getTwoSided",function(object)
+{
+	standardGeneric("getTwoSided")
+}
+)
+
+setGeneric("getSigProbes",function(object)
+{
+	standardGeneric("getSigProbes")
+}
+)
+
+setGeneric("getRegions",function(object)
+{
+	standardGeneric("getRegions")
+}
+)
+
+setGeneric("getGenomicRegions",function(object)
+{
+	standardGeneric("getGenomicRegions")
+}
+)
+
+setGeneric("getFDR",function(object)
+{
+	standardGeneric("getFDR")
+}
+)
+
+setGeneric("getCI",function(object)
+{
+	standardGeneric("getCI")
+}
+)
+
+setGeneric("getF",function(object)
+{
+	standardGeneric("getF")
+}
+)
+
+setGeneric("getVarF",function(object)
+{
+	standardGeneric("getVarF")
+}
+)
+
+setGeneric("getEff",function(object)
+{
+	standardGeneric("getEff")
+}
+)
+
+setGeneric("getVarEff",function(object)
+{
+	standardGeneric("getVarEff")
+}
+)
+
+setGeneric("getDesignMatrix",function(object)
+{
+	standardGeneric("getDesignMatrix")
+}
+)
+
+setGeneric("plotWfm",function(object, annoFile, minPos, maxPos, trackFeature="exon", overlayFeature=c("gene","transposable_element_gene"), two.strand=TRUE, plotData=TRUE, plotMean=TRUE, tracks=0)
+{
+ 	standardGeneric("plotWfm")
+}
+)
+
+setGeneric("getSigGenes",function(fit, inf, annoFile)
+{
+	standardGeneric("getSigGenes")
+}
+)
+
+setGeneric("getNonAnnotatedRegions",function(fit, inf, annoFile)
+{
+	standardGeneric("getNonAnnotatedRegions")
+}
+)
+
+#if (!isGeneric("plot")) {
+#  setGeneric("plot",function(fit,inf,...){
+#	standardGeneric("plot")
+#  }
+#)
+#}
+

Added: pkg/R/helperFunctions.R
===================================================================
--- pkg/R/helperFunctions.R	                        (rev 0)
+++ pkg/R/helperFunctions.R	2012-03-09 13:15:36 UTC (rev 31)
@@ -0,0 +1,653 @@
+
+## functions for data input
+
+cel2TilingFeatureSet <- function(dataPath,annotationPackage)
+{
+	expFiles <- paste(dataPath,list.celfiles(dataPath),sep="/")
+	tfs <- read.celfiles(expFiles,pkgname=annotationPackage)
+	return(tfs)
+}
+
+
+extractChrFromFasta <- function(char,fasPath)
+{
+	splt <- unlist(strsplit(char,fasPath))
+	hlp <- splt[seq(2,length(splt),2)]
+	splt2 <- unlist(strsplit(hlp,".fas"))
+	return(splt2)
+}
+
+pm2mm <- function(z)
+{
+	z <- complement(subseq(z,start=13,end=13))
+	return(z)
+}
+
+## functions for model fitting
+
+normVec <- function(vec)
+{
+	return(vec/sqrt(sum(vec^2)))
+}
+
+wave.transform <- function(x,n.levels=log(length(x),2),filt="haar") 
+{
+	N <- length(x)
+	J <- n.levels
+	if (N/2^J != trunc(N/2^J)) stop("Sample size is not divisible by 2^J")
+	dict <- wave.filter(filt)
+	L <- dict$length
+	storage.mode(L) <- "integer"
+	h <- dict$hpf
+	storage.mode(h) <- "double"
+	g <- dict$lpf
+	storage.mode(g) <- "double"
+	start <- 1
+	stop <- N/2
+	Y <- rep(0,N)
+	for (j in 1:J)
+	{
+		W <- V <- numeric(N/2^j)
+		out <- .C("dwt", as.double(x), as.integer(N/2^(j - 1)),L, h, g, W =  as.double(W), V = as.double(V), PACKAGE = "waveslim")[6:7]
+		Y[start:stop] <- out$W
+		x <- out$V
+		start <- start+N/(2^j)
+		stop <- stop+N/2^(j+1)
+	}
+	stop <- N
+	Y[start:stop] <- x
+	return(Y)
+}
+
+wave.backtransform <- function(D,n.levels,filt="haar")
+{
+	p <- length(D)
+	if ((p%%2^n.levels)!=0) stop("Sample size is not divisible by 2^n.levels")
+	dict <- wave.filter(filt)
+	L <- dict$length
+	storage.mode(L) <- "integer"
+	h <- dict$hpf
+	storage.mode(h) <- "double"
+	g <- dict$lpf
+	storage.mode(g) <- "double"
+	stop <- p
+	start <- p-p/2^n.levels+1
+	X <- D[start:stop]
+	for (j in n.levels:1)
+	{
+		stop <- start-1
+		start <- stop-p/2^j+1
+		N <- length(X)
+		XX <- numeric(2*p/2^j)
+		X <- .C("idwt", as.double(D[start:stop]), as.double(X), as.integer(N),L, h, g, out = as.double(XX), PACKAGE = "waveslim")$out
+	}
+	return(X)
+}
+
+wave.backtransformK <- function(Cum,n.levels,order=1,filt="haar")
+{
+	p <- length(Cum)
+	if ((p%%2^n.levels)!=0) stop("Sample size is not divisible by 2^n.levels")
+	dict <- wave.filter(filt)
+	L <- dict$length
+	storage.mode(L) <- "integer"
+	h <- dict$hpf^order
+	storage.mode(h) <- "double"
+	g <- dict$lpf^order
+	storage.mode(g) <- "double"
+	stop <- p
+	start <- p-p/2^n.levels+1
+	X <- Cum[start:stop]
+	for (j in n.levels:1)
+	{
+		stop <- start-1
+		start <- stop-p/2^j+1
+		N <- length(X)
+		XX <- numeric(2*p/2^j)
+		X <- .C("idwt", as.double(Cum[start:stop]), as.double(X), as.integer(N),L, h, g, out = as.double(XX), PACKAGE = "waveslim")$out
+	}
+	return(X)
+}
+
+MapMar <- function(D,X,vareps,J=0,eqsmooth=TRUE)
+{
+	N <- nrow(X)
+	q <- ncol(X)
+	K <- ncol(D)
+	if (J==0)
+	{
+		ends <- K
+	} else
+	{
+	ends <- cumsum(K/2^c(1:J,J))
+	}
+	B <- matrix(0,nrow=q,ncol=K)
+	varB <- B
+	phi <- B
+	if (eqsmooth)
+	{
+		out <- .C("MAPMARGEQSMOOTH",as.double(D),as.integer(K),as.double(vareps),as.double(B),as.double(varB),as.double(phi),as.double(X),as.double(diag(t(X)%*%X)),as.integer(q),as.integer(N),as.integer(ends), PACKAGE = "waveTiling")[4:6]
+	} else
+	{
+		out <- .C("MAPMARG",as.double(D),as.integer(K),as.double(vareps),as.double(B),as.double(varB),as.double(phi),as.double(X),as.double(diag(t(X)%*%X)),as.integer(q),as.integer(N),as.integer(ends), PACKAGE = "waveTiling")[4:6]
+	}
+	names(out) <- c("beta_MAP","varbeta_MAP","phi")
+	dim(out[[1]]) <- c(K,q)
+	out[[1]] <- t(out[[1]])
+	dim(out[[2]]) <- c(K,q)
+	out[[2]] <- t(out[[2]])
+	dim(out[[3]]) <- c(K,q)
+	out[[3]] <- t(out[[3]])
+	return(out)
+}
+
+MapMarImp <- function(D,X,vareps,J=0,eqsmooth=TRUE)
+{
+	N <- nrow(X)
+	q <- ncol(X)
+	K <- ncol(D)
+	if (J==0)
+	{
+		ends <- K
+	} else
+	{
+	ends <- cumsum(K/2^c(1:J,J))
+	}
+	B <- matrix(0,nrow=q,ncol=K)
+	varB <- B
+	phi <- B
+	if (eqsmooth)
+	{
+		out <- .C("MAPMARGIMPEQSMOOTH",as.double(D),as.integer(K),as.double(vareps),as.double(B),as.double(varB),as.double(phi),as.double(X),as.double(diag(t(X)%*%X)),as.integer(q),as.integer(N),as.integer(ends), PACKAGE = "waveTiling")[4:6]
+	} else
+	{
+		out <- .C("MAPMARGIMP",as.double(D),as.integer(K),as.double(vareps),as.double(B),as.double(varB),as.double(phi),as.double(X),as.double(diag(t(X)%*%X)),as.integer(q),as.integer(N),as.integer(ends), PACKAGE = "waveTiling")[4:6]
+	}
+	names(out) <- c("beta_MAP","varbeta_MAP","phi")
+	dim(out[[1]]) <- c(K,q)
+	out[[1]] <- t(out[[1]])
+	dim(out[[2]]) <- c(K,q)
+	out[[2]] <- t(out[[2]])
+	dim(out[[3]]) <- c(K,q)
+	out[[3]] <- t(out[[3]])
+	return(out)
+}
+
+
+WaveMarEstVarJ <- function(Y,X,n.levels,wave.filt,prior=c("normal","improper"),eqsmooth=TRUE,saveall=FALSE,D,var.eps,max.it,tol=1e-6,trace=FALSE)
+{
+	N <- nrow(D)
+	K <- ncol(D)		
+	Kj <- K/2^c(1:n.levels,n.levels)
+	ends <- cumsum(Kj)
+	starts <- c(1,ends[-(n.levels+1)]+1)
+	varEps <- rep(mad(D[,starts[1]:ends[1]])^2,n.levels+1)
+	if (var.eps=="mad")
+	{
+		max.it <- -1
+		saveall <- TRUE
+	}
+	if (max.it<0)
+	{
+		for (i in 2:(n.levels+1))
+		{
+			varEps[i] <- ifelse(i<(n.levels+1),mad(D[,starts[i]:ends[i]])^2,varEps[i-1])
+		}
+	}
+	crit1 <- sum(D^2)
+	if (max.it<1)
+	{
+		if (prior=="normal")
+		{
+			WaveFit <- MapMar(D,X,varEps,n.levels,eqsmooth)
+		}
+		if (prior=="improper")
+		{
+			WaveFit <- MapMarImp(D,X,varEps,n.levels,eqsmooth)
+		}
+	} else
+	{
+		if (trace==TRUE) cat("Gauss Seidel algorithm...")
+		for (j in 1:max.it)
+		{
+			crit0 <- crit1
+			if (prior=="normal")
+			{
+				WaveFit <- MapMar(D,X,varEps,n.levels,eqsmooth)
+			}
+			if (prior=="improper")
+			{
+				WaveFit <- MapMarImp(D,X,varEps,n.levels,eqsmooth)
+			}
+			for (i in 1:(n.levels+1))
+			{
+				VinvD <- D[,starts[i]:ends[i]]-X%*%(t(X)%*%D[,starts[i]:ends[i]]/(diag(t(X)%*%X)+1/WaveFit$phi[,starts[i]:ends[i]]))
+				varEps[i] <- sum(D[,starts[i]:ends[i]]*VinvD)/(ends[i]-starts[i]+1)/N
+			}
+			crit1 <- -1/2*sum(log(t(X)%*%X%*%WaveFit$phi+rep(1,ncol(X))))-1/2*(log(varEps)%*%Kj)-N*K*log(2*pi)/2-N*K/2
+			if (trace==TRUE) cat("\n iteration", j,"of",max.it)
+			if ((abs((crit0-crit1)/crit0))<tol)
+			{
+				if (trace==TRUE) cat("\n Gauss Seidel algorithm converged \n")
+				break
+			}
+		}
+		if ((abs(crit0-crit1)/crit0)>tol) cat("\n Warning: The maximum number of iterations reached without convergence\n")
+	}
+	if (!saveall)
+	{
+		WaveFit$beta_MAP <- matrix()
+		WaveFit$varbeta_MAP <- matrix()
+		WaveFit$phi <- matrix()
+	}
+	WaveFit$varEps <- varEps
+	WaveFit$n.levels <- n.levels
+	WaveFit$K <- K
+	WaveFit$N <- N
+	WaveFit$Kj <- Kj
+	WaveFit$X <- X
+	WaveFit$wave.filt <- wave.filt
+	return(WaveFit)
+}
+
+## plot
+# annoFIle needs the following columns: "chromosome", "strand", "feature", "ID", "start", "end"
+makeNewAnnotationTrack <- function(annoFile,chromosome,strand,minBase,maxBase,feature="exon",dp=NULL)
+{
+	if (is.null(dp))
+	{
+		dp <- DisplayPars(exon="lightblue")
+	}
+	return(makeAnnotationTrack(regions=annoFile[(annoFile$chromosome==chromosome)&(annoFile$strand==strand)&(annoFile$start<maxBase)&(annoFile$end>minBase)&(annoFile$feature==feature),c("start","end","feature","group","ID")],dp=dp))
+}
+
+
+makeNewAnnotationTextOverlay <- function(annoFile,chromosome,strand,minBase,maxBase,region,feature=c("gene","transposable_element_gene"),y=.5,dp=NULL)
+{
+	if (is.null(dp))
+	{
+		dp=DisplayPars(cex=1)
+	}
+	annohlp <- annoFile[(annoFile$chromosome==chromosome)&(annoFile$strand==strand)&(annoFile$start<maxBase)&(annoFile$end>minBase)&(is.element(annoFile$feature,feature)),c("ID","start","end")]
+	return(makeTextOverlay(annohlp$ID,xpos=(annohlp$start+annohlp$end)/2,ypos=y,region=region,dp=dp))
+}
+
+makeNewTranscriptRectangleOverlay <- function(sigRegions,locations,start,end,region=NULL,dp=NULL)
+{
+	if (is.null(dp))
+	{
+		dp=DisplayPars(color="black")
+	}
+	detectedRegionsSelect <- matrix(sigRegions[sigRegions[,1]<end&sigRegions[,2]>start,],ncol=2)
+	detectedRegionsSelect[detectedRegionsSelect[,1]<start,1] <- start
+	detectedRegionsSelect[detectedRegionsSelect[,2]>end,2] <- end
+	return(makeRectangleOverlay(start=locations[detectedRegionsSelect[,1]],end =locations[detectedRegionsSelect[,2]],region=region,dp=dp)) 
+}
+
+#### makeDesign
+makeDesign<-function(design=c("time","circadian","group","factorial"),replics, noGroups, factor.levels=NULL) {
+# 	if (method=="twoGroup")
+# 	{
+# 		Xorig <- matrix(0,nrow=dim(pData(object))[1],ncol=2)
+# 		Xorig[,1] <- 1
+# 		Xorig[,2] <- rep(c(1,-1),replics) ## contr.helmert
+# 	}
+	if (design=="time") #time
+	{
+#		Xorig <- matrix(0,nrow=dim(pData(object))[1],ncol=noGroups)
+		Xorig <- matrix(0,nrow=noGroups*replics,ncol=noGroups)
+		orderedFactor <- factor(1:noGroups,ordered=TRUE)
+		desPoly <- lm(rnorm(noGroups)~orderedFactor,x=TRUE)$x
+		Xorig[,1] <- 1
+		Xorig[,2:noGroups] <- apply(desPoly[,2:noGroups],2,rep,replics)
+		
+	}
+	else if (design=="circadian") # circadian
+	{
+#		Xorig <- matrix(0,nrow=dim(pData(object))[1],ncol=3)
+		Xorig <- matrix(0,nrow=noGroups*replics,ncol=3)
+		Xorig[,1] <- 1
+		Xorig[,2] <- rep(sin(seq(0,2*pi-(pi/noGroups),2*pi/noGroups)),replics)
+		Xorig[,3] <- rep(cos(seq(0,2*pi-(pi/noGroups),2*pi/noGroups)),replics)
+	}
+	else  if (design=="group") # group
+	{
+#		Xorig <- matrix(0,nrow=dim(pData(object))[1],ncol=noGroups)
+		Xorig <- matrix(0,nrow=noGroups*replics,ncol=noGroups)
+		desHelmert <- contr.helmert(noGroups)
+		Xorig[,1] <- 1
+		Xorig[,2:noGroups] <- apply(desHelmert[,1:(noGroups-1)],2,rep,replics)
+	}
+	else if (design=="factorial")
+	{
+		if (is.null(factor.levels))
+		{
+			stop("No proper factor levels given.")
+		}
+		Xorig <- matrix(0,nrow=sum(replics),ncol=prod(factor.levels))
+		Xorig[,1] <- 1
+		desTrt1 <- contr.treatment(factor.levels[1])
+		desTrt2 <- contr.treatment(factor.levels[2])
+		#desHelmert1 <- contr.helmert(factor.levels[1])
+		#desHelmert2 <- contr.helmert(factor.levels[2])
+		replicsMat <- matrix(replics,nrow=factor.levels[1],ncol=factor.levels[2],byrow=TRUE)
+		desFac1 <- apply(desTrt1,2,function(x) unlist(sapply(1:nrow(replicsMat),function(y) rep(x[y],sum(replicsMat[y,])))))
+		Xorig[,2:(factor.levels[1])] <- desFac1
+		desFac2 <- apply(desTrt2,2,function(x) unlist(sapply(1:nrow(replicsMat),function(y) rep(x,replicsMat[y,]))))
+		Xorig[,(factor.levels[1]+1):(factor.levels[1]+factor.levels[2]-1)] <- desFac2
+		# include interactions
+		colno <- sum(factor.levels)
+		for (i in 1:ncol(desFac1))
+		{
+			for (j in 1:ncol(desFac2))
+			{
+				Xorig[,colno] <- desFac1[,i]*desFac2[,j]
+				colno <- colno + 1
+			}
+		}
+	}
+	else {
+		stop("No proper design specified!")
+	}	
+	out <- list()
+	X.qr <- qr(Xorig)
+	out$Xorthnorm <- qr.Q(X.qr)
+	out$Xorig <- Xorig
+	return (out);
+}
+
+#### makeContrasts
+makeContrasts <- function(contrasts, nlevels) {
+	if (contrasts=="compare") {
+		q <- nlevels*(nlevels-1)/2
+		contr <- matrix(0,nrow=q,ncol=nlevels)
+		hlp1 <- rep(2:nlevels,1:(nlevels-1))
+		hlp2 <- unlist(sapply(1:(nlevels-1),function(x) seq(1:x)))
+		for (i in 1:nrow(contr))
+		{
+			contr[i,hlp1[i]] <- 1
+			contr[i,hlp2[i]] <- -1
+		}
+	}
+
+	return (contr);
+}
+
+
+##### plot
+plotWfm <- function(fit,inf,annoFile,minPos,maxPos,trackFeature="exon",overlayFeature=c("gene","transposable_element_gene"),two.strand=TRUE,plotData=TRUE,plotMean=TRUE,tracks=0)
+{
+	if (missing(annoFile)) {stop("Annotation File is missing!!")}
+	Gloc <- getProbePosition(fit)
+	if (missing(minPos)) {minPos<-min(Gloc)}
+	if (missing(maxPos)) {maxPos<-max(Gloc)}
+	chromosome <- getChromosome(fit)
+	strand <- getStrand(fit)
+	selID <- (1:length(Gloc))[Gloc>minPos & Gloc<maxPos]
+	sta <- min(selID)
+	end <- max(selID)
+	minBase <- Gloc[sta]
+	maxBase <- Gloc[end]
+	trackCount <- 1
+	trackInfo <- list()
+	overlayInfo <- list()
+	if (plotData==TRUE)
+	{
+		Y <- getDataOrigSpace(fit)
+		replcs <- as.numeric(table(getPhenoInfo(fit)$group))
+		trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(t(Y[,sta:end])),probeStart=Gloc[sta:end],dp=DisplayPars(color=rep(1:length(replcs),replcs),ylim=range(Y[,sta:end]),pointSize=.3,pch=sequence(replcs)))
+		names(trackInfo)[trackCount] <- "Data"
+		trackCount <- trackCount + 1
+	}
+	if (two.strand==TRUE)
+	{
+		trackInfo[[trackCount]] <- makeNewAnnotationTrack(annoFile=annoFile,chromosome=chromosome,minBase=minBase,maxBase=maxBase,strand="forward",feature=trackFeature,dp=NULL)
+		names(trackInfo)[trackCount] <- "F"
+		overlayInfo[[trackCount]] <- makeNewAnnotationTextOverlay(annoFile=annoFile,chromosome=chromosome,minBase=minBase,maxBase=maxBase,strand="forward",region=c(trackCount,trackCount),feature=overlayFeature,y=0.5)
+		trackCount <- trackCount + 1
+		trackInfo[[trackCount]] <- makeGenomeAxis(add53 = TRUE,add35 = TRUE)
+		trackCount <- trackCount + 1
+		trackInfo[[trackCount]] <- makeNewAnnotationTrack(annoFile=annoFile,chromosome=chromosome,minBase=minBase,maxBase=maxBase,strand="reverse",feature=trackFeature)
+		names(trackInfo)[trackCount] <- "R"
+		overlayInfo[[trackCount]] <- makeNewAnnotationTextOverlay(annoFile=annoFile,chromosome=chromosome,minBase=minBase,maxBase=maxBase,strand="reverse",region=c(trackCount,trackCount),feature=overlayFeature,y=0.5)
+		trackCount <- trackCount + 1
+	} else
+	{
+		trackInfo[[trackCount]] <- makeNewAnnotationTrack(annoFile=annoFile,chromosome=chromosome,minBase=minBase,maxBase=maxBase,strand=strand,feature=trackFeature)
+		if (strand=="forward")
+		{
+			names(trackInfo)[trackCount] <- "F"
+		}
+		if (strand=="reverse")
+		{
+			names(trackInfo)[trackCount] <- "R"
+		}
+		overlayInfo[[trackCount]] <- makeNewAnnotationTextOverlay(annoFile=annoFile,chromosome=chromosome,minBase=minBase,maxBase=maxBase,strand=strand,region=c(trackCount,trackCount),feature=overlayFeature,y=0.5)
+		trackCount <- trackCount + 1
+		gAxis <- makeGenomeAxis(add53 = TRUE,add35 = TRUE)
+		trackCount <- trackCount + 1
+	}
+	effects <- getEff(inf)
+	regions <- getRegions(inf)
+	noGroups <- length(table(getPhenoInfo(fit)$group))
+	if (inherits(inf,"WfmInfMeans")) {
+		plotMean <- FALSE
+	}
+	if (plotMean==TRUE)
+	{
+		trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[1,sta:end]),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=range(effects[1,sta:end])+c(-0.4,0.4),pointSize=.3,pch=1,lwd=1,type="line"))
+		names(trackInfo)[trackCount] <- "Mean"
+		overlayInfo[[trackCount]] <- makeNewTranscriptRectangleOverlay(sigRegions=as.matrix(data.frame(start(regions[[1]]),end(regions[[1]]))),location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+		trackCount <- trackCount + 1
+	}
+#	if (getWfmFitMethod(object)=="twoGroup" | getWfmFitMethod(object)=="circadian")
+	if ((inherits(fit,"WfmFitFactor") & noGroups==2) | inherits(fit,"WfmFitCircadian"))  
+	{
+		if (tracks==0)
+		{
+			trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[2,sta:end]),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=c(min(-1.3,range(effects[2,sta:end])[1]),max(1.3,range(effects[2,sta:end])[2]))+c(-0.2,0.2),pointSize=.3,pch=1,lwd=1,type="line"))
+			#if (getWfmFitMethod(object)=="twoGroup")
+			if (inherits(inf,"WfmInfCompare")) 
+			{
+				trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[2,sta:end]),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=c(min(-1.3,range(effects[2,sta:end])[1]),max(1.3,range(effects[2,sta:end])[2])+c(-0.2,0.2)),pointSize=.3,pch=1,lwd=1,type="line"))
+				names(trackInfo)[trackCount] <- "FC"
+			} else
+			{
+				trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(sqrt(effects[2,sta:end]^2+effects[3,sta:end]^2)),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=c(min(-1.3,range(sqrt(effects[2,sta:end]^2+effects[3,sta:end]^2))[1]),max(1.2,range(sqrt(effects[2,sta:end]^2+effects[3,sta:end]^2))))+c(-0.2,0.2),pointSize=.3,pch=1,lwd=1,type="line"))
+				names(trackInfo)[trackCount] <- "Ampl"
+			}
+			overlayInfo[[trackCount]] <- makeNewTranscriptRectangleOverlay(sigRegions=as.matrix(data.frame(start(regions[[2]]),end(regions[[2]]))),location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+			hlp <- which(!unlist(lapply(overlayInfo,is.null)))
+			if (two.strand==TRUE)
+			{
+				hlpAnno <- hlp[1:2]
+			} else
+			{
+				hlpAnno <- hlp[1]
+			}
+			hlpAnnoIndex <- unlist(lapply(hlpAnno,function(x) length(overlayInfo[[x]]@xpos)>0))
+			hlpEff <- hlp[!(hlp%in%hlpAnno)]
+			hlpEffIndex <- unlist(lapply(hlpEff,function(x) length(overlayInfo[[x]]@start)>0))
+			hlpIndex <- c(hlpAnnoIndex,hlpEffIndex)
+			overlayInfoCorr <- lapply(hlp,function(x) overlayInfo[[x]])
+			gdPlot(trackInfo,minBase=minBase,maxBase=maxBase,overlay=overlayInfoCorr[hlpIndex])
+		}
+	}
+#	if (getWfmFitMethod(object)=="compareGroupsTime" | getWfmFitMethod(object)=="compareGroupsFactor")
+	else if (inherits(inf,"WfmInfCompare"))
+	{
+		if (length(tracks)==1 & tracks[1]==0)
+		{
+			
+			effectsToPlot <- rep(0,noGroups)
+			effectId <- c(1,3,6,10,15)
+			effectNames <- c("2-1","3-2","4-3","5-4","6-5")
+			effectNo <- 1
+			while (effectNo<length(effectsToPlot))
+			{
+				trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[effectId[effectNo]+1,sta:end]),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=c(min(-1.3,range(effects[effectId[effectNo]+1,sta:end])[1]),max(1.3,range(effects[effectId[effectNo]+1,sta:end])[2]))+c(-0.2,0.2),pointSize=.3,pch=1,lwd=1,type="line"))
+				names(trackInfo)[trackCount] <- effectNames[effectNo]
+				overlayInfo[[trackCount]] <- makeNewTranscriptRectangleOverlay(sigRegions=as.matrix(data.frame(start(regions[[effectId[effectNo]+1]]),end(regions[[effectId[effectNo]+1]]))),location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+				effectNo <- effectNo + 1
+				trackCount <- trackCount + 1
+			}
+			trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[effectId[length(effectsToPlot)-2]+2,sta:end]),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=c(min(-1.3,range(effects[effectId[length(effectsToPlot)-2]+2,sta:end])[1]),max(1.3,range(effects[effectId[length(effectsToPlot)-2]+2,sta:end])[2]))+c(-0.2,0.2),pointSize=.3,pch=1,lwd=1,type="line"))
+			names(trackInfo)[trackCount] <- "Last-First"
+			overlayInfo[[trackCount]] <- makeNewTranscriptRectangleOverlay(sigRegions=as.matrix(data.frame(start(regions[[effectId[length(effectsToPlot)-2]+2]]),end(regions[[effectId[length(effectsToPlot)-2]+2]]))),location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+			hlp <- which(!unlist(lapply(overlayInfo,is.null)))
+			if (two.strand==TRUE)
+			{
+				hlpAnno <- hlp[1:2]
+			} else
+			{
+				hlpAnno <- hlp[1]
+			}
+			hlpAnnoIndex <- unlist(lapply(hlpAnno,function(x) length(overlayInfo[[x]]@xpos)>0))
+			hlpEff <- hlp[!(hlp%in%hlpAnno)]
+			hlpEffIndex <- unlist(lapply(hlpEff,function(x) length(overlayInfo[[x]]@start)>0))
+			hlpIndex <- c(hlpAnnoIndex,hlpEffIndex)
+			overlayInfoCorr <- lapply(hlp,function(x) overlayInfo[[x]])
+			gdPlot(trackInfo,minBase=minBase,maxBase=maxBase,overlay=overlayInfoCorr[hlpIndex])
+			
+		}
+		if (length(tracks)>1 | tracks[1]!=0)
+		{
+			if (length(tracks)>8)
+			{
+				stop("Too many tracks specified")
+			}
+			groupNames <- sapply(1:noGroups,function(x) paste("Gr",x,sep=""))
+			#groupNames <- sapply(8:13,function(x) paste("D",x,sep=""))
+			firstId <- rep(2:noGroups,1:(noGroups-1))
+			lastId <- sequence(1:(noGroups-1))
+			effectNames <- sapply(1:(noGroups*(noGroups-1)/2),function(x) paste(groupNames[firstId[x]],"-",groupNames[lastId[x]],sep=""))
+			for (i in tracks)
+			{
+				#trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[i+1,sta:end]),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=c(min(-1.3,range(effects[i+1,sta:end])[1]),max(1.3,range(effects[i+1,sta:end])[2]))+c(-0.2,0.2),pointSize=.3,pch=1,lwd=1,type="line"))
+				trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[i+1,sta:end]),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=range(effects[,sta:end])+c(-0.2,0.2),pointSize=.3,pch=1,lwd=1,type="line"))
+				names(trackInfo)[trackCount] <- effectNames[i]
+				overlayInfo[[trackCount]] <- makeNewTranscriptRectangleOverlay(sigRegions=as.matrix(data.frame(start(regions[[i+1]]),end(regions[[i+1]]))),location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+				trackCount <- trackCount + 1
+			}
+			hlp <- which(!unlist(lapply(overlayInfo,is.null)))
+			if (two.strand==TRUE)
+			{
+				hlpAnno <- hlp[1:2]
+			} else
+			{
+				hlpAnno <- hlp[1]
+			}
+			hlpAnnoIndex <- unlist(lapply(hlpAnno,function(x) length(overlayInfo[[x]]@xpos)>0))
+			hlpEff <- hlp[!(hlp%in%hlpAnno)]
+			hlpEffIndex <- unlist(lapply(hlpEff,function(x) length(overlayInfo[[x]]@start)>0))
+			hlpIndex <- c(hlpAnnoIndex,hlpEffIndex)
+			overlayInfoCorr <- lapply(hlp,function(x) overlayInfo[[x]])
+			gdPlot(trackInfo,minBase=minBase,maxBase=maxBase,overlay=overlayInfoCorr[hlpIndex])
+		}
+		
+	}
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/wavetiling -r 31


More information about the Wavetiling-commits mailing list