[Wavetiling-commits] r28 - in pkg: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 9 11:29:48 CET 2012


Author: ppipeler
Date: 2012-03-09 11:29:48 +0100 (Fri, 09 Mar 2012)
New Revision: 28

Modified:
   pkg/NAMESPACE
   pkg/R/allGenerics.R
   pkg/R/methods-WfmInf.R
Log:


Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2012-03-09 09:48:12 UTC (rev 27)
+++ pkg/NAMESPACE	2012-03-09 10:29:48 UTC (rev 28)
@@ -43,23 +43,19 @@
 
 importFrom(methods, "@<-", callNextMethod, new)
 
-importFrom(waveslim, wave.filter, dwt, idwt)
+importFrom(oligo, read.celfiles)
 
 importFrom(stats, contr.helmert, contr.treatment, lm, pnorm, qnorm,
            rnorm)
 
-## importFrom(waveslim, wave.filter)
+importFrom(waveslim, wave.filter)
 
-## Plot
-importFrom(graphics, plot)
-
 ## Export Classes
 exportClasses(WaveTilingFeatureSet, MapFilterProbe, GenomeInfo, WfmFit, WfmInf, WfmFitTime, WfmFitFactor, WfmFitCircadian, WfmFitCustom, WfmInfCompare, WfmInfEffects )
 
 ## Export Methods
 exportMethods(show)
 
-exportMethods(plot)
 
 ## WaveTilingFeatureSet 
 exportMethods(addPheno, getNoGroups, getGroupNames, getReplics, filterOverlap, selectProbesFromTilingFeatureSet,bgCorrQn,wfm.fit)
@@ -68,8 +64,8 @@
 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)
+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, plotWfm)
+export(cel2TilingFeatureSet, makeContrasts, makeDesign)
 

Modified: pkg/R/allGenerics.R
===================================================================
--- pkg/R/allGenerics.R	2012-03-09 09:48:12 UTC (rev 27)
+++ pkg/R/allGenerics.R	2012-03-09 10:29:48 UTC (rev 28)
@@ -291,11 +291,11 @@
 }
 )
 
-# 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("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)
 {
@@ -309,10 +309,10 @@
 }
 )
 
-if (!isGeneric("plot")) {
-  setGeneric("plot",function(fit,inf,...){
-	standardGeneric("plot")
-  }
-)
-}
+#if (!isGeneric("plot")) {
+#  setGeneric("plot",function(fit,inf,...){
+#	standardGeneric("plot")
+#  }
+#)
+#}
 

Modified: pkg/R/methods-WfmInf.R
===================================================================
--- pkg/R/methods-WfmInf.R	2012-03-09 09:48:12 UTC (rev 27)
+++ pkg/R/methods-WfmInf.R	2012-03-09 10:29:48 UTC (rev 28)
@@ -153,6 +153,282 @@
 	return(out)
 })
 
-setMethod("plot",signature=c(fit="WfmFit",inf="WfmInf"),plotWfm)
+setMethod("plotWfm",signature=c(fit="WfmFit",inf="WfmInf"),
+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])
+                }
+
+        }
+#       if (getWfmFitMethod(object)=="meansByGroupTime" | getWfmFitMethod(object)=="meansByGroupFactor")
+        else if (inherits(inf,"WfmInfMeans"))
+        {
+                if (length(tracks)==1 & tracks[1]==0)
+                {
+                        effectNames <- sapply(1:noGroups,function(x) paste("Gr",x,sep=""))
+                        for (i in 1:noGroups)
+                        {
+                                trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[i,sta:end]),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=c(min(-1.3,range(effects[i,sta:end])[1]),max(1.3,range(effects[i,sta:end])[2]))+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]]),end(regions[[i]]))),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])
+                }
+                if (length(tracks)>1 | tracks[1]!=0)
+                {
+                        if (length(tracks)>8)
+                        {
+                                stop("Too many tracks specified")
+                        }
+                        #effectNames <- sapply(1:noGroups,function(x) paste("Gr",x,sep=""))
+                        effectNames <- paste("day",8:13,sep="")
+                        for (i in tracks)
+                        {
+                                trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[i,sta:end]),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=c(min(-1.3,range(effects[i,sta:end])[1]),max(1.3,range(effects[i,sta:end])[2]))+c(-0.2,0.2),pointSize=.3,pch=1,lwd=1,type="line"))
+                                #trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[i,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]]),end(regions[[i]]))),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])
+                }
+        }
+#       if (getWfmFitMethod(object)=="effectsTime")
+        else if (inherits(fit,"WfmFitTime") & inherits(inf,"WfmInfEffects"))
+        {
+                fct <- 0.2390457
+                if (tracks==0 | (length(tracks)==2 & tracks[1]==1 & tracks[2]==2) | tracks==1 | tracks==2)
+                {
+                        if (tracks==0)
+                        {
+                                tracks <- c(1,2)
+                        }
+                        effectNames <- c("Linear","Quadratic")
+                        for (i in tracks)
+                        {
+                                #trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[i+1,sta:end]),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=range(effects[i+1,sta:end])+c(-0.5,0.5),pointSize=.3,pch=1,lwd=1,type="line"))
+                                trackInfo[[trackCount]] <- makeGenericArray(intensity=as.matrix(effects[i+1,sta:end]*fct),probeStart=Gloc[sta:end],dp=DisplayPars(color="black",ylim=range(effects[i+1,sta:end]*fct)+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])
+                } else
+                {
+                                stop("tracks argument has been misspecified")
+                }
+        }
+        else if (inherits(inf,"WfmInfCustom")) {
+                stop("Custom Inference plot not implemented!")
+        }
+        else {
+                stop("Unknown Design")
+        }
+}
+)
+



More information about the Wavetiling-commits mailing list