[Wavetiling-commits] r7 - in pkg: . R inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 11 22:03:59 CET 2011


Author: kdbeuf
Date: 2011-12-11 22:03:59 +0100 (Sun, 11 Dec 2011)
New Revision: 7

Modified:
   pkg/R/allGenerics.R
   pkg/R/helperFunctions.R
   pkg/R/initialize-methods.R
   pkg/R/methods-waveTilingFeatureSet.R
   pkg/TODO
   pkg/inst/doc/waveTiling-vignette.Rnw
Log:
preparation vignette


Modified: pkg/R/allGenerics.R
===================================================================
--- pkg/R/allGenerics.R	2011-12-08 21:19:02 UTC (rev 6)
+++ pkg/R/allGenerics.R	2011-12-11 21:03:59 UTC (rev 7)
@@ -270,4 +270,4 @@
 {
 	standardGeneric("getSigGenes")
 }
-)
\ No newline at end of file
+)

Modified: pkg/R/helperFunctions.R
===================================================================
--- pkg/R/helperFunctions.R	2011-12-08 21:19:02 UTC (rev 6)
+++ pkg/R/helperFunctions.R	2011-12-11 21:03:59 UTC (rev 7)
@@ -12,8 +12,7 @@
 {
 	expFiles <- paste(dataPath,list.celfiles(dataPath),sep="/")
 	tfs <- read.celfiles(expFiles,pkgname=annotationPackage)
-	wtfs <- new("waveTilingFeatureSet",tfs)
-	return(wtfs)
+	return(tfs)
 }
 
 

Modified: pkg/R/initialize-methods.R
===================================================================
--- pkg/R/initialize-methods.R	2011-12-08 21:19:02 UTC (rev 6)
+++ pkg/R/initialize-methods.R	2011-12-11 21:03:59 UTC (rev 7)
@@ -53,11 +53,78 @@
 	return(.Object)	
 })
 
+## remark: found this also as constructors for "NChannelSet","FeatureSet" and "TilingFeatureSet" (selectMethod("initialize","TilingFeatureSet"))
 #waveTilingFeatureSet
-setMethod("initialize","waveTilingFeatureSet",function(.Object,tfs)
+setMethod("initialize","waveTilingFeatureSet",function (.Object, ...)
 {
-	.Object <- tfs
-	class(.Object) <- "waveTilingFeatureSet"
-	attr(class(.Object),"package") <- "waveTiling"
-	return(.Object)
-})
+    .local <- function (.Object, assayData, phenoData, ...)
+    {
+        mySlots <- slotNames(.Object)
+        dotArgs <- list(...)
+        isSlot <- names(dotArgs) %in% mySlots
+        if (missing(assayData)) {
+            assayData <- do.call(assayDataNew, dotArgs[!isSlot],
+                envir = parent.frame())
+        }
+        if (missing(phenoData)) {
+            phenoData <- annotatedDataFrameFrom(assayData, byrow = FALSE)
+        }
+        if (is.null(varMetadata(phenoData)[["channel"]])) {
+            varMetadata(phenoData)[["channel"]] <- factor(rep("_ALL_",
+                nrow(varMetadata(phenoData))), levels = c(assayDataElementNames(assayData),
+                "_ALL_"))
+        }
+        appl <- if (storageMode(assayData) == "list")
+            lapply
+        else eapply
+        assaySampleNames <- appl(assayData, function(elt) {
+            cnames <- colnames(elt)
+            if (is.null(cnames))
+                sampleNames(phenoData)
+            else cnames
+        })
+        sampleNames(assayData) <- assaySampleNames
+        sampleNames(phenoData) <- sampleNames(assayData)
+        do.call(callNextMethod, c(.Object, assayData = assayData,
+            phenoData = phenoData, dotArgs[isSlot]))
+    }
+    .local(.Object, ...)
+}
+)
+
+# > structure(function (.Object, ...)
+# > {
+# >     # check if the first argument is an ExpressionSet
+# >     # if so: initialize the object with it and tells .local not to
+# >     # overwrite slots corresponding to missing arguments.
+# >     # otherwise: s
+# >     overwrite.missing<- TRUE
+# >     dotargs<- list(...)   
+# >     if( length(dotargs)>  1&&  is(dotargs[[1]], 'ExpressionSet') ){       
+# >         .Object<- dotargs[[1]]       
+# >         overwrite.missing<- FALSE
+# >         dotargs<- dotargs[-1]
+# >     }       
+# > 
+# >     # .local should initialize (i.e. overwrite) a slot of .Object with
+# > its prototype only if overwrite.missing=TRUE, or in any case with the
+# > corresponding non missing argument for this slot.
+# >      .local<- function (.Object, overwrite.missing=TRUE, assayData,
+# > phenoData, featureData,
+# >          exprs = new("matrix"), ...)
+# >      {                  if (overwrite.missing&&  missing(assayData)) {
+# >     # stuff ...
+# >     }
+# >     # other stuff ...
+# >      }
+# > 
+# >     # call .local with overwrite.missing as its first argument
+# >     do.call(.local, c(list(.Object, overwrite.missing), dotargs))
+# >     
+# > }
+
+# setMethod("initialize","waveTilingFeatureSet",function(.Object, ...)
+# {
+# 	Object <- callNextMethod(.Object, ...)
+# 	return(Object)
+# })

Modified: pkg/R/methods-waveTilingFeatureSet.R
===================================================================
--- pkg/R/methods-waveTilingFeatureSet.R	2011-12-08 21:19:02 UTC (rev 6)
+++ pkg/R/methods-waveTilingFeatureSet.R	2011-12-11 21:03:59 UTC (rev 7)
@@ -66,7 +66,7 @@
 
 setMethod("filterOverlap",signature("waveTilingFeatureSet"),function(object,remap=TRUE,fastaFile,chrId,strand=c("forward","reverse","both"),MM=FALSE)
 {
-	if (class(object)!="TilingFeatureSet")
+	if (class(object)!="TilingFeatureSet" | class(object)!="waveTilingFeatureSet")
 	{
 		stop("class of object is not TilingFeatureSet.")
 	}

Modified: pkg/TODO
===================================================================
--- pkg/TODO	2011-12-08 21:19:02 UTC (rev 6)
+++ pkg/TODO	2011-12-11 21:03:59 UTC (rev 7)
@@ -8,4 +8,6 @@
 7) getSigGenes,Wfm-method: add option to include thresholds (density, outliers,...)
 8) getSigGenes,Wfm-method: add option to also detect regions that don't overlap but are in the neighbourhood of annotated regions
 9) getSigGenes,Wfm-method: add option to include mean / max expression / FC for each gene
+10) 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
 
+PRIORITY: 11) solve trouble with initialize-method waveTilingFeatureSet

Modified: pkg/inst/doc/waveTiling-vignette.Rnw
===================================================================
--- pkg/inst/doc/waveTiling-vignette.Rnw	2011-12-08 21:19:02 UTC (rev 6)
+++ pkg/inst/doc/waveTiling-vignette.Rnw	2011-12-11 21:03:59 UTC (rev 7)
@@ -40,5 +40,6 @@
 
 \section{Introduction}
 
+In this \waveTiling{} package vignette the package's main functionalities to conduct a tiling array trancriptome analysis are illustrated. The implemented method is based on a wavelet-based functional model introduced in [REF] Clement et al. (2012).
 
 \end{document}



More information about the Wavetiling-commits mailing list