[Wavetiling-commits] r17 - in pkg: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 21 10:38:39 CET 2011


Author: kdbeuf
Date: 2011-12-21 10:38:39 +0100 (Wed, 21 Dec 2011)
New Revision: 17

Modified:
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/allGenerics.R
   pkg/R/helperFunctions.R
   pkg/R/methods-WaveTilingFeatureSet.R
   pkg/TODO
   pkg/man/wfm.analysis.Rd
Log:


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2011-12-21 09:35:29 UTC (rev 16)
+++ pkg/DESCRIPTION	2011-12-21 09:38:39 UTC (rev 17)
@@ -5,8 +5,8 @@
 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, GenomeGraphs, IRanges, Biostrings, GenomicRanges
-Imports: affy, waveslim, methods
+Depends: oligo, oligoClasses, Biobase, GenomeGraphs, IRanges, Biostrings, GenomicRanges, waveslim
+Imports: affy, methods
 Suggests:
 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

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2011-12-21 09:35:29 UTC (rev 16)
+++ pkg/NAMESPACE	2011-12-21 09:38:39 UTC (rev 17)
@@ -39,7 +39,7 @@
 importMethodsFrom(IRanges, subseq)
 
 ## Methods from waveslim
-## importMethodsFrom(waveslim, ...) 
+## importFrom(waveslim, wave.filter)
 
 ## Methods from oligo
 ## importMethodsFrom(oligo, ...)

Modified: pkg/R/allGenerics.R
===================================================================
--- pkg/R/allGenerics.R	2011-12-21 09:35:29 UTC (rev 16)
+++ pkg/R/allGenerics.R	2011-12-21 09:38:39 UTC (rev 17)
@@ -38,7 +38,7 @@
 }
 )
 
-setGeneric("wfm.analysis",function(object, filter.overlap=NULL, method=c("twoGroup","compareGroupsTime","compareGroupsFactor","circadian","meansByGroupTime","meansByGroupFactor","effectsTime","twoFactors"), n.levels, chromosome, strand, minPos, maxPos, design.matrix=NULL, var.eps=c("margLik","mad"), prior=c("normal","improper"), max.it=20, wave.filt="haar", skiplevels=NULL, trace=FALSE, save.obs=c("plot","regions","all"), alpha=0.05, nsim=1000, delta=NULL, rescale=NULL, two.sided=NULL, minRunPos=90, minRunProbe=1, factor.levels=NULL)
+setGeneric("wfm.analysis",function(object, filter.overlap=NULL, method=c("twoGroup","compareGroupsTime","compareGroupsFactor","circadian","meansByGroupTime","meansByGroupFactor","effectsTime","twoFactors"), n.levels, chromosome, strand, minPos, maxPos, design.matrix=NULL, var.eps=c("margLik","mad"), prior=c("normal","improper"), eqsmooth=TRUE, max.it=20, wave.filt="haar", skiplevels=NULL, trace=FALSE, save.obs=c("plot","regions","all"), alpha=0.05, nsim=1000, delta=NULL, rescale=NULL, two.sided=NULL, minRunPos=90, minRunProbe=1, factor.levels=NULL)
 {
 	standardGeneric("wfm.analysis")
 }

Modified: pkg/R/helperFunctions.R
===================================================================
--- pkg/R/helperFunctions.R	2011-12-21 09:35:29 UTC (rev 16)
+++ pkg/R/helperFunctions.R	2011-12-21 09:38:39 UTC (rev 17)
@@ -109,7 +109,7 @@
 	return(X)
 }
 
-MapMar <- function(D,X,vareps,J=0)
+MapMar <- function(D,X,vareps,J=0,eqsmooth=TRUE)
 {
 	N <- nrow(X)
 	q <- ncol(X)
@@ -124,7 +124,13 @@
 	B <- matrix(0,nrow=q,ncol=K)
 	varB <- B
 	phi <- B
-	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]
+	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]])
@@ -135,7 +141,7 @@
 	return(out)
 }
 
-MapMarImp <- function(D,X,vareps,J=0)
+MapMarImp <- function(D,X,vareps,J=0,eqsmooth=TRUE)
 {
 	N <- nrow(X)
 	q <- ncol(X)
@@ -150,7 +156,13 @@
 	B <- matrix(0,nrow=q,ncol=K)
 	varB <- B
 	phi <- B
-	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]
+	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]])
@@ -162,7 +174,7 @@
 }
 
 
-WaveMarEstVarJ <- function(Y,X,n.levels,wave.filt,prior=c("normal","improper"),saveall=FALSE,D,var.eps,max.it,tol=1e-6,trace=FALSE)
+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)		
@@ -187,11 +199,11 @@
 	{
 		if (prior=="normal")
 		{
-			WaveFit <- MapMar(D,X,varEps,n.levels)
+			WaveFit <- MapMar(D,X,varEps,n.levels,eqsmooth)
 		}
 		if (prior=="improper")
 		{
-			WaveFit <- MapMarImp(D,X,varEps,n.levels)
+			WaveFit <- MapMarImp(D,X,varEps,n.levels,eqsmooth)
 		}
 	} else
 	{
@@ -201,11 +213,11 @@
 			crit0 <- crit1
 			if (prior=="normal")
 			{
-				WaveFit <- MapMar(D,X,varEps,n.levels)
+				WaveFit <- MapMar(D,X,varEps,n.levels,eqsmooth)
 			}
 			if (prior=="improper")
 			{
-				WaveFit <- MapMarImp(D,X,varEps,n.levels)
+				WaveFit <- MapMarImp(D,X,varEps,n.levels,eqsmooth)
 			}
 			for (i in 1:(n.levels+1))
 			{

Modified: pkg/R/methods-WaveTilingFeatureSet.R
===================================================================
--- pkg/R/methods-WaveTilingFeatureSet.R	2011-12-21 09:35:29 UTC (rev 16)
+++ pkg/R/methods-WaveTilingFeatureSet.R	2011-12-21 09:38:39 UTC (rev 17)
@@ -377,7 +377,7 @@
 })
 
 
-setMethod("wfm.analysis",signature("WaveTilingFeatureSet"),function(object,filter.overlap=NULL,method=c("twoGroup","compareGroupsTime","compareGroupsFactor","circadian","meansByGroupTime","meansByGroupFactor","effectsTime","twoFactors"),n.levels,chromosome,strand,minPos,maxPos,design.matrix=NULL,var.eps=c("margLik","mad"),prior=c("normal","improper"),max.it=20,wave.filt="haar",skiplevels=NULL,trace=FALSE,save.obs=c("plot","regions","all"),alpha=0.05,nsim=1000,delta=NULL,rescale=NULL,two.sided=NULL,minRunPos=90,minRunProbe=1,factor.levels=NULL)
+setMethod("wfm.analysis",signature("WaveTilingFeatureSet"),function(object,filter.overlap=NULL,method=c("twoGroup","compareGroupsTime","compareGroupsFactor","circadian","meansByGroupTime","meansByGroupFactor","effectsTime","twoFactors"),n.levels,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"),alpha=0.05,nsim=1000,delta=NULL,rescale=NULL,two.sided=NULL,minRunPos=90,minRunProbe=1,factor.levels=NULL)
 {
 # construct filtered data set
 	if ((names(pData(object))[1]!="group")|((names(pData(object))[2]!="replicate")))
@@ -443,7 +443,7 @@
 	}
 	N <- nrow(Y)
 	D <- t(apply(Y,1,wave.transform,n.levels,filt=wave.filt))
-	fit <- WaveMarEstVarJ(Y=Y,X=Z,n.levels=n.levels,wave.filt=wave.filt,D=D,var.eps=var.eps,prior=prior,max.it=max.it,tol=1e-6,trace=trace,saveall=TRUE)
+	fit <- WaveMarEstVarJ(Y=Y,X=Z,n.levels=n.levels,wave.filt=wave.filt,D=D,var.eps=var.eps,prior=prior,eqsmooth=eqsmooth,max.it=max.it,tol=1e-6,trace=trace,saveall=TRUE)
 	Xsel <- cumsum(getReplics(object))-getReplics(object)+1
 	Xdes <- X[Xsel,]
 	if (method=="twoGroup" | method=="compareGroupsTime" | method=="compareGroupsFactor")

Modified: pkg/TODO
===================================================================
--- pkg/TODO	2011-12-21 09:35:29 UTC (rev 16)
+++ pkg/TODO	2011-12-21 09:38:39 UTC (rev 17)
@@ -1,8 +1,8 @@
 
-1) filterOverlap,WaveTilingFeatureSet-method: adapting function
-2) mail Benilton Carvalho to make available pmStrand for TilingFeatureSet
-3) wfm.analysis,WaveTilingFeatureSet-method: adapt function to obtain identical smoothing (C-code)
-4) filterOverlap,WaveTilingFeatureSet-method: check if this function makes use of all the TilingFeatureSet functionalities as constructed in the oligo-package (eg. pmChr, pmStrand...) remark: pmStrand does not seem to work properly
+1) mail Benilton Carvalho to make available pmStrand for TilingFeatureSet
+2) split function wfm.analysis in part for fitting with normalized estimated effect functions and part for inference for specific contrasts
+3) wfm.analysis: merge arguments "method" and "design.matrix" to "design". If character then use preprogrammed code, if matrix use custom design matrix
+4) plot function: create argument contrasts to plot specific contrasts
 5) wfm.analysis,WaveTilingFeatureSet-method: check calculation of confidence intervals
 6) wfm.analysis,WaveTilingFeatureSet-method: check implementation of "two.sided" (adapt according to SAGMB paper)
 7) plotWfm,Wfm-method: introduce option to give groupnames to put on Y-axis of plot

Modified: pkg/man/wfm.analysis.Rd
===================================================================
--- pkg/man/wfm.analysis.Rd	2011-12-21 09:35:29 UTC (rev 16)
+++ pkg/man/wfm.analysis.Rd	2011-12-21 09:38:39 UTC (rev 17)
@@ -10,7 +10,7 @@
 }
 
 \usage{
-wfm.analysis(object, filter.overlap=NULL, method=c("twoGroup","compareGroupsTime","compareGroupsFactor","circadian","meansByGroupTime","meansByGroupFactor","effectsTime","twoFactors"), n.levels, chromosome, strand, minPos, maxPos, design.matrix=NULL, var.eps=c("margLik","mad"), prior=c("normal","improper"), max.it=20, wave.filt="haar", skiplevels=NULL, trace=FALSE, save.obs=c("plot","regions","all"), alpha=0.05, nsim=1000, delta=NULL, rescale=NULL, two.sided=NULL, minRunPos=90, minRunProbe=1, factor.levels=NULL)
+wfm.analysis(object, filter.overlap=NULL, method=c("twoGroup","compareGroupsTime","compareGroupsFactor","circadian","meansByGroupTime","meansByGroupFactor","effectsTime","twoFactors"), n.levels, 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"), alpha=0.05, nsim=1000, delta=NULL, rescale=NULL, two.sided=NULL, minRunPos=90, minRunProbe=1, factor.levels=NULL)
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{
@@ -47,6 +47,9 @@
   \item{prior}{
 prior distribution on effect functions
 }
+ \item{eqsmooth}{
+force equal amount of smooth for different effect functions
+}
   \item{max.it}{
 maximum number of iteration for estimation
 }



More information about the Wavetiling-commits mailing list