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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 8 18:59:22 CET 2011


Author: kdbeuf
Date: 2011-12-08 18:59:22 +0100 (Thu, 08 Dec 2011)
New Revision: 4

Added:
   pkg/man/getSigGenes.Rd
Modified:
   pkg/NAMESPACE
   pkg/R/allGenerics.R
   pkg/R/methods-Wfm.R
   pkg/TODO
Log:
added getSigGenes,Wfm-method


Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2011-12-08 13:12:37 UTC (rev 3)
+++ pkg/NAMESPACE	2011-12-08 17:59:22 UTC (rev 4)
@@ -55,7 +55,7 @@
 exportMethods(getFilteredIndices, getChromosome, getPosition, getStrand,                            selectProbesFromFilterOverlap)
 
 ## Wfm methods
-exportMethods(getProbePosition, getNoProbes, getBetaMAP, getVarBetaMAP, getSmoothPar,               getVarEps, getGenomeInfo, getChromosome, getStrand, getMinPos,                        getMaxPos, getNoLevels, getWfmMethod, getDesign, getPhenoInfo,                        getDataOrigSpace, getDataWaveletSpace, getWaveletFilter, getKj,                       getPrior, getAlpha, getDelta, getTwoSided, getRescale, getSigProbes,                  getRegions, getGenomicRegions, getFDR, getF, getVarF, getEff,                         getVarEff, plotWfm, getNonAnnotatedRegions)
+exportMethods(getProbePosition, getNoProbes, getBetaMAP, getVarBetaMAP, getSmoothPar,               getVarEps, getGenomeInfo, getChromosome, getStrand, getMinPos,                        getMaxPos, getNoLevels, getWfmMethod, getDesign, getPhenoInfo,                        getDataOrigSpace, getDataWaveletSpace, getWaveletFilter, getKj,                       getPrior, getAlpha, getDelta, getTwoSided, getRescale, getSigProbes,                  getRegions, getGenomicRegions, getFDR, getF, getVarF, getEff,                         getVarEff, plotWfm, getNonAnnotatedRegions, getSigGenes)
 
 ## Other
 export(cel2TilingFeatureSet)

Modified: pkg/R/allGenerics.R
===================================================================
--- pkg/R/allGenerics.R	2011-12-08 13:12:37 UTC (rev 3)
+++ pkg/R/allGenerics.R	2011-12-08 17:59:22 UTC (rev 4)
@@ -266,3 +266,8 @@
 	standardGeneric("getNonAnnotatedRegions")
 }
 )
+setGeneric("getSigGenes",function(object, annoFile)
+{
+	standardGeneric("getSigGenes")
+}
+)
\ No newline at end of file

Modified: pkg/R/methods-Wfm.R
===================================================================
--- pkg/R/methods-Wfm.R	2011-12-08 13:12:37 UTC (rev 3)
+++ pkg/R/methods-Wfm.R	2011-12-08 17:59:22 UTC (rev 4)
@@ -225,7 +225,7 @@
 	{
 		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=regions[[1]],location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+		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 (getWfmMethod(object)=="twoGroup" | getWfmMethod(object)=="circadian")
@@ -242,7 +242,7 @@
 				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=regions[[2]],location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+			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)
 			{
@@ -272,13 +272,13 @@
 			{
 				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=regions[[effectId[effectNo]+1]],location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+				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=regions[[effectId[length(effectsToPlot)-2]+2]],location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+			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)
 			{
@@ -311,7 +311,7 @@
 				#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=regions[[i+1]],location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+				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)))
@@ -340,7 +340,7 @@
 			{
 				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=regions[[i]],location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+				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)))
@@ -371,7 +371,7 @@
 				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=regions[[i]],location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+				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)))
@@ -405,7 +405,7 @@
 				#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=regions[[i+1]],location=Gloc,start=sta,end=end,region=c(trackCount,trackCount),dp=DisplayPars(color="darkgrey",alpha=.1))
+				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)))
@@ -484,8 +484,191 @@
 })
 
 
+setMethod("getSigGenes",signature("Wfm"),function(object,annoFile)
+{
+	#Gloc <- getProbePosition(object)
+	strand <- getStrand(object)
+	chromosome <- getChromosome(object)
+	regions <- getGenomicRegions(object)
+	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]
+	cat("find overlaps with detected regions...\n")
+	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)
+})
 
+getATGPolynomWavelet <- function(bgCorrData,mapFilter,chromosome,strand,tair9GffFile,FCRegions,FCFit,thresh,aboveLim)
+{
+	thresh <- thresh
+	threshdensity <- 0.005
+	
+	cat("Filter extreme outliers.\n")
+	
+	aboveid <- (1:dim(Y)[2])[apply(Y,2,function(x) max(x)>aboveLim)]
+	above_IR <- IRanges(aboveid,aboveid)
+	
+	cat("Select differentially expressed genes (Compare).\n")
+	
+	FCpair_regions.mix <- FCRegions
+	FCpair_EB_median <- FCFit
+	FCpair_regionsCompare <- vector("list",15)
+	spuriousID <- vector("list",15)
+	filterID <- vector("list",15)
+	ATG <- vector("list",15)
+	for (j in 1:15)
+	{
+		FCpair_regions <- as.data.frame(FCpair_regions.mix[[j]])
+		FCpairreg_probe <- IRanges(start=FCpair_regions[,1],end=FCpair_regions[,2])
+		names(FCpair_regions) <- c("start","end")
+		FCpair_regions$no_probes <- width(FCpairreg_probe)
+		FCpair_regions[,1] <- Gloc[FCpair_regions.mix[[j]][,1]]
+		FCpair_regions[,2] <- Gloc[FCpair_regions.mix[[j]][,2]]
+		FCpair_regions$meanmedianFC <- sapply(1:dim(FCpair_regions)[1],function(x)
+		{
+			xx <- mean(FCpair_EB_median[j,FCpair_regions.mix[[j]][x,1]:FCpair_regions.mix[[j]][x,2]])
+		})
+		nreg <- dim(FCpair_regions)[1]
+		FCpairreg <- IRanges(start=FCpair_regions[,1],end=FCpair_regions[,2])
+		FCpair_regions$length <- width(FCpairreg)
+		FCpair_regions$density <- FCpair_regions$no_probes/FCpair_regions$length
+		exprOverlap_ana <- findOverlaps(t9chr_IR_expr_ana,FCpairreg)
+		exprOverlap_ana150 <- findOverlaps(t9chr_IR_expr_ana,FCpairreg,maxgap=150)
+		exprOverlap_opp <- findOverlaps(t9chr_IR_expr_opp,FCpairreg)
+		exprnames <- t9chr_ana$attributes[exprID_ana[matchMatrix(exprOverlap_ana)[,1]]]
+		exprnames_opp <- t9chr_opp$attributes[exprID_opp[matchMatrix(exprOverlap_opp)[,1]]]
+		exon <- rep("",nreg)
+		exonBis <- rep("",nreg)
+		mRNA <- rep("",nreg)
+		miRNA <- rep("",nreg)
+		ncRNA <- rep("",nreg)
+		pseudogenic_exon <- rep("",nreg)
+		rRNA <- rep("",nreg)
+		snoRNA <- rep("",nreg)
+		snRNA <- rep("",nreg)
+		transposable_element_gene <- rep("",nreg)
+		tRNA <- rep("",nreg)
+		feature <- rep("",nreg)
+		opp_strand <- rep("",nreg)
+		match150 <- rep(NA,nreg)
+		noverlap <- length(exprnames)
+		noverlap_opp <- length(exprnames_opp)
+		for (i in 1:nreg)
+		{
+			match <- (1:noverlap)[matchMatrix(exprOverlap_ana)[,2]==i]
+			matchFeature <- tair9gff_expr_ana$feature[matchMatrix(exprOverlap_ana)[match,1]]
+			match_opp <- (1:noverlap_opp)[matchMatrix(exprOverlap_opp)[,2]==i]
+			matchFeature_opp <- tair9gff_expr_opp$feature[matchMatrix(exprOverlap_opp)[match_opp,1]]
+			exon[i] <- paste(unique(exprnames[match][matchFeature=="exon"]),collapse=", ")
+			exonBis[i] <- paste(unique(exprnames[match][matchFeature=="exon"]),collapse="")
+			opp_strand[i] <- paste(unique(exprnames_opp[match_opp][matchFeature_opp=="exon"]),collapse=", ")
+			mRNA[i] <- paste(unique(exprnames[match][matchFeature=="mRNA"]),collapse=", ")
+			miRNA[i] <- paste(unique(exprnames[match][matchFeature=="miRNA"]),collapse=", ")
+			ncRNA[i] <- paste(unique(exprnames[match][matchFeature=="ncRNA"]),collapse=", ")
+			pseudogenic_exon[i] <- paste(unique(exprnames[match][matchFeature=="pseudogenic_exon"]),collapse=", ")
+			rRNA[i] <- paste(unique(exprnames[match][matchFeature=="rRNA"]),collapse=", ")
+			snoRNA[i] <- paste(unique(exprnames[match][matchFeature=="snoRNA"]),collapse=", ")
+			snRNA[i] <- paste(unique(exprnames[match][matchFeature=="snRNA"]),collapse=", ")
+			transposable_element_gene[i] <- paste(unique(exprnames[match][matchFeature=="transposable_element_gene"]),collapse=", ")
+			tRNA[i] <- paste(unique(exprnames[match][matchFeature=="tRNA"]),collapse=", ")
+			featureID <- (1:9)[c(mRNA[i],miRNA[i],ncRNA[i],pseudogenic_exon[i],rRNA[i],snoRNA[i],snRNA[i],transposable_element_gene[i],tRNA[i])!=""]
+			feature[i] <- ifelse(length(featureID)==0,"no strand annotation",paste(c("mRNA","miRNA","ncRNA","pseudogenic_exon","rRNA","snoRNA","snRNA","transposable_element_gene","tRNA")[featureID],collapse=", "))
+			match150[i] <- i %in% matchMatrix(exprOverlap_ana150)[,2]
+		}
+		FCpair_regions <- data.frame(FCpair_regions,as.character(exon),as.character(feature),as.character(opp_strand),match150)
+		names(FCpair_regions)[7:10] <- c("exon","feature","opp_strand","flankingAnno")
+		spurious <- (1:nreg)[abs(FCpair_regions$meanmedian)<thresh]
+		sparse <- (1:nreg)[FCpair_regions$density<threshdensity]
+		overlapAbove <- findOverlaps(FCpairreg_probe,above_IR)
+		Regoverlap <- FCpairreg_probe[matchMatrix(overlapAbove)[,1]]
+		outid1 <- (1:length(Regoverlap))[width(Regoverlap)<9]
+		outid2 <- matchMatrix(overlapAbove)[outid1,1]
+		spsp <- unique(c(spurious,sparse,outid2))
+		spuriousID[[j]] <- spsp
+		#further prosprocessing
+		FCpair_regionsNew <- FCpair_regions[-spsp,]
+		FCpair_regionsNewIR <- IRanges(start=FCpair_regionsNew[,1],end=FCpair_regionsNew[,2])
+		nReg <- length(FCpair_regionsNewIR)
+		#select short regions
+		lowwidth_id <- (1:nReg)[width(FCpair_regionsNewIR)<300]
+		#select stand-alone regions
+		hlp <- matchMatrix(findOverlaps(FCpair_regionsNewIR,FCpair_regionsNewIR,maxgap=300))
+		nOver <- dim(hlp)[1]
+		hlpid <- (1:nOver)[hlp[,1]!=hlp[,2]]
+		notalone_id <- hlp[hlpid,1]
+		alone_id <- (1:nOver)[!(1:nOver %in% notalone_id)]
+		suspect_id <- (1:nOver)[(1:nOver %in% lowwidth_id)&(1:nOver %in% alone_id)]
+		suspectReg <- FCpair_regionsNewIR[suspect_id]
+		suspectProbe <- GReg2id(suspectReg,Gloc)
+		gap <- rep(0,length(suspectProbe))
+		for (i in 1:length(suspectProbe))
+		{
+			dat <- as.numeric(Y[,(max(1,(start(suspectProbe)[i]-8))):(min(end(suspectProbe)[i]+8,length(Gloc)))])
+			ll <- length(dat)
+			sdata <- sort(dat,decreasing=TRUE)
+			gap[i] <- max(sdata[1:(ll-1)]-sdata[2:ll])
+		}
+		filter_id <- suspect_id[(1:length(suspectProbe))[gap > 1.5]]
+		filterID[[j]] <- filter_id
+		FCpair_regionsClean <- FCpair_regionsNew[-filter_id,]
+		highFC_id <- order(abs(FCpair_regionsClean$meanmedianFC),decreasing=TRUE)
+		FCpair_regionsOrd <- FCpair_regionsClean[highFC_id,]
+		FCpair_regionsCompare[[j]] <- FCpair_regionsOrd
+		exonBis <- exonBis[-spsp]
+		exonBis <- exonBis[-filter_id]
+		tt <- strsplit(exonBis,"Parent=")
+		tt <- unlist(tt)
+		tt <- tt[tt!=""]
+		ATG[[j]] <- unique(tt)
+	}
+	for (i in 1:15)
+	{
+		FCpair_regions.mix[[i]] <- FCpair_regions.mix[[i]][-spuriousID[[i]],]
+		FCpair_regions.mix[[i]] <- FCpair_regions.mix[[i]][-filterID[[i]],]
+	}
+	out$AtgCompareSplice <- ATG
+	out$AdaptedFCPairRegions <- FCpair_regions.mix
+	out$FCPairRegionsInfo <- FCpair_regionsCompare
+	out$Gloc <- Gloc
+	return(out)
+}
 
 
 
 
+
+

Modified: pkg/TODO
===================================================================
--- pkg/TODO	2011-12-08 13:12:37 UTC (rev 3)
+++ pkg/TODO	2011-12-08 17:59:22 UTC (rev 4)
@@ -5,5 +5,7 @@
 4) getNonAnnotatedRegions,Wfm-method: make function more generic wrt how the strands and features in the annotation file are defined
 5) getNonAnnotatedRegions,Wfm-method: include option to give max./mean expression / FC per region
 6) getNonAnnotatedRegions,Wfm-method: add option to set threshold for minimum density of probes within the regions
+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
 
-

Added: pkg/man/getSigGenes.Rd
===================================================================
--- pkg/man/getSigGenes.Rd	                        (rev 0)
+++ pkg/man/getSigGenes.Rd	2011-12-08 17:59:22 UTC (rev 4)
@@ -0,0 +1,55 @@
+\name{getSigGenes}
+\alias{getSigGenes}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{
+Get significant genes
+}
+
+\description{
+## %%  ~~ A concise (1-5 lines) description of what the function does. ~~
+}
+
+\usage{
+getSigGenes(object,annoFile)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+  \item{object}{
+object of class Wfm
+}
+  \item{annoFile}{
+annotation file
+}
+}
+
+\details{
+## %%  ~~ If necessary, more details than the description above ~~
+}
+\value{
+GRangesList object
+}
+
+\references{
+## %% ~put references to the literature/web site here ~
+}
+
+\author{
+Kristof De Beuf <kristof.debeuf at ugent.be>
+}
+
+\note{
+## %%  ~~further notes~~
+}
+
+%% ~Make other sections like Warning with \section{Warning }{....} ~
+
+\seealso{
+## %% ~~objects to See Also as \code{\link{help}}, ~~~
+}
+
+\examples{
+##
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{manip}



More information about the Wavetiling-commits mailing list