[Wavetiling-commits] r45 - in pkg/waveTiling: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jun 10 12:17:12 CEST 2012


Author: kdbeuf
Date: 2012-06-10 12:17:11 +0200 (Sun, 10 Jun 2012)
New Revision: 45

Modified:
   pkg/waveTiling/DESCRIPTION
   pkg/waveTiling/R/helperFunctions.R
   pkg/waveTiling/R/methods-WfmInf.R
Log:


Modified: pkg/waveTiling/DESCRIPTION
===================================================================
--- pkg/waveTiling/DESCRIPTION	2012-06-06 08:00:53 UTC (rev 44)
+++ pkg/waveTiling/DESCRIPTION	2012-06-10 10:17:11 UTC (rev 45)
@@ -1,6 +1,6 @@
 Package: waveTiling
-Version: 0.99.1
-Date: 2012-05-14
+Version: 0.99.2
+Date: 2012-06-06
 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>

Modified: pkg/waveTiling/R/helperFunctions.R
===================================================================
--- pkg/waveTiling/R/helperFunctions.R	2012-06-06 08:00:53 UTC (rev 44)
+++ pkg/waveTiling/R/helperFunctions.R	2012-06-10 10:17:11 UTC (rev 45)
@@ -306,7 +306,7 @@
 		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)
+		Xorig[,2:noGroups] <- apply(as.matrix(desPoly[,2:noGroups]),2,rep,replics)
 		
 	}
 	else if (design=="circadian") # circadian
@@ -324,6 +324,7 @@
 		desHelmert <- contr.helmert(noGroups)
 		Xorig[,1] <- 1
 		Xorig[,2:noGroups] <- apply(desHelmert[,1:(noGroups-1)],2,rep,replics)
+		Xorig[,2:noGroups] <- apply(as.matrix(desHelmert[,1:(noGroups-1)]),2,rep,replics)
 	}
 	else if (design=="factorial")
 	{

Modified: pkg/waveTiling/R/methods-WfmInf.R
===================================================================
--- pkg/waveTiling/R/methods-WfmInf.R	2012-06-06 08:00:53 UTC (rev 44)
+++ pkg/waveTiling/R/methods-WfmInf.R	2012-06-10 10:17:11 UTC (rev 45)
@@ -55,55 +55,6 @@
 })
 
 
-# setMethod("getSigGenes",signature(fit="WfmFit",inf="WfmInf"),function(fit,inf,annoFile)
-# {
-# 	#Gloc <- getProbePosition(object)
-# 	strand <- getStrand(fit)
-# 	chromosome <- getChromosome(fit)
-# 	regions <- getGenomicRegions(inf)
-# 	annoFile$strand[annoFile$strand=="forward"] <- "+"
-# 	annoFile$strand[annoFile$strand=="reverse"] <- "-"
-# 	annoFile$strand[!(annoFile$strand %in% c("+","-"))] <- "*"
-# 	annoFileGR <- GRanges(seqnames=Rle(annoFile$chromosome),ranges=IRanges(start=annoFile$start,end=annoFile$end),strand=Rle(annoFile$strand),feature=annoFile$feature,id=annoFile$ID)
-# 	if (strand=="forward")
-# 	{
-# 		strandAlt <- "+"
-# 		strandOpp <- "-"
-# 	} else
-# 	{
-# 		strandAlt <- "-"
-# 		strandOpp <- "+"
-# 	}
-# 	annoChrGR <- annoFileGR[seqnames(annoFileGR)==chromosome]
-# 	geneId <- which(values(annoChrGR)$feature=="gene" | values(annoChrGR)$feature=="transposable_element_gene")
-# 	annoChrGeneGR <- annoChrGR[geneId]
-# 	#annoChrGeneStrandGR <- annoChrGeneGR[strand(annoChrGeneGR)==strandAlt]
-# 	#annoChrGeneStrandOppGR <- annoChrGeneGR[strand(annoChrGeneGR)==strandOpp]
-# 	message("find overlaps with detected regions...")
-# 	nList <- length(regions)
-# 	annoOver <- GRangesList()
-# 	for (j in 1:nList)
-# 	{
-# 		regGlocIR <- regions[[j]]
-# 		regGlocGR <- GRanges(seqnames=rep(chromosome,length(regGlocIR)),ranges=regGlocIR,strand=rep("*",length(regGlocIR)),effectNo=rep(j,length(regGlocIR)))
-# 		overL <- findOverlaps(regGlocGR,annoChrGeneGR)
-# 		regOver <- regGlocGR[queryHits(overL)]
-# 		annoOverj <- annoChrGeneGR[subjectHits(overL)]
-# 		overInt <- pintersect(regOver,annoOverj)
-# 		values(annoOverj)$regNo <- queryHits(overL)
-# 		values(annoOverj)$percOverGene <- width(overInt)/width(annoOverj)*100
-# 		values(annoOverj)$percOverReg <- width(overInt)/width(regOver)*100
-# 		totPercOverGeneHlp <- rep(0,max(subjectHits(overL)))
-# 		totPercOverGeneHlp2 <- tapply(values(annoOverj)$percOverGene,subjectHits(overL),sum)
-# 		totPercOverGeneHlp[as.numeric(names(totPercOverGeneHlp2))] <- totPercOverGeneHlp2
-# 		values(annoOverj)$totPercOverGene <- totPercOverGeneHlp[subjectHits(overL)]
-# 		annoOverj <- GRangesList(annoOverj)
-# 		annoOver <- c(annoOver,annoOverj)
-# 	}
-# 	return(annoOver)
-# })
-
-
 setMethod("getSigGenes",signature(fit="WfmFit",inf="WfmInf"),function(fit,inf,biomartObj)
 {
 	#Gloc <- getProbePosition(object)
@@ -146,59 +97,6 @@
 })
 
 
-# setMethod("getNonAnnotatedRegions",signature(fit="WfmFit",inf="WfmInf"),function(fit,inf,annoFile)
-# {
-# 	#Gloc <- getProbePosition(object)
-# 	strand <- getStrand(fit)
-# 	chromosome <- getChromosome(fit)
-# 	regions <- getGenomicRegions(inf)
-# 	if (strand=="forward")
-# 	{
-# 		strandAlt <- "+"
-# 		strandOpp <- "-"
-# 	} else
-# 	{
-# 		strandAlt <- "-"
-# 		strandOpp <- "+"
-# 	}
-# 	message("get annotated regions...")
-# 	annoExons <- annoFile[(annoFile$strand==strandAlt)&(annoFile$chromosome==chromosome)&((annoFile$feature=="exon")|(annoFile$feature=="pseudogenic_exon")),c("chromosome","strand","feature","ID","start","end")]
-# 	annoExonsOpp <- annoFile[(annoFile$strand==strandOpp)&(annoFile$chromosome==chromosome)&((annoFile$feature=="exon")|(annoFile$feature=="pseudogenic_exon")),c("chromosome","strand","feature","ID","start","end")]
-# 	regGlocNoAnnoSense <- list()
-# 	regGlocNoAnnoBoth <- list()
-# 	nList <- length(regions)
-# 	message("find overlaps with detected regions...")
-# 	for (j in 1:nList)
-# 	{
-# 		regGlocIR <- regions[[j]]
-# 		annoExonsIR <- IRanges(start=annoExons$start,end=annoExons$end)
-# 		annoExonsOppIR <- IRanges(start=annoExonsOpp$start,end=annoExonsOpp$end)
-# 		overSense <- findOverlaps(regGlocIR,annoExonsIR)
-# 		overOpp <- findOverlaps(regGlocIR,annoExonsOppIR)
-# 		noAnnoSenseId <- which(!(1:length(regGlocIR) %in% as.matrix(overSense)[,1]))
-# 		noAnnoOppId <- which(!(1:length(regGlocIR) %in% as.matrix(overOpp)[,1]))
-# 		noAnnoBothId <- which((1:length(regGlocIR) %in% noAnnoSenseId) & (1:length(regGlocIR) %in% noAnnoOppId))
-# 		regGlocNoAnnoSense[[j]] <- regGlocIR[noAnnoSenseId]
-# 		regGlocNoAnnoBoth[[j]] <- regGlocIR[noAnnoBothId]
-# 	}
-# 	noAnnoSenseIR <- regGlocNoAnnoSense[[1]]
-# 	noAnnoBothIR <- regGlocNoAnnoBoth[[1]]
-# 	for (i in 2:nList)
-# 	{
-# 		noAnnoSenseIRi <- regGlocNoAnnoSense[[i]]
-# 		noAnnoSenseIR <- c(noAnnoSenseIR,noAnnoSenseIRi)
-# 		noAnnoBothIRi <- regGlocNoAnnoBoth[[i]]
-# 		noAnnoBothIR <- c(noAnnoBothIR,noAnnoBothIRi)
-# 	}
-# 	noAnnoSenseIRAll <- reduce(noAnnoSenseIR)
-# 	noAnnoBothIRAll <- reduce(noAnnoBothIR)
-# 	## TO DO:  include option to give maximum expression / FC per region
-# 	out <- NULL
-# 	out$noAnnoBoth <- GRanges(seqnames=Rle(rep(chromosome,length(noAnnoBothIRAll))),strand=Rle(rep(strandAlt,length(noAnnoBothIRAll))),ranges=noAnnoBothIRAll)
-# 	out$noAnnoSense <- GRanges(seqnames=Rle(rep(chromosome,length(noAnnoSenseIRAll))),strand=Rle(rep(strandAlt,length(noAnnoSenseIRAll))),ranges=noAnnoSenseIRAll)
-# 	return(out)
-# })
-
 setMethod("getNonAnnotatedRegions",signature(fit="WfmFit",inf="WfmInf"),function(fit,inf,biomartObj)
 {
 	strand <- getStrand(fit)
@@ -410,7 +308,7 @@
                         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"))
+                                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.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



More information about the Wavetiling-commits mailing list