[BioC] how to get a gene list for profilePlots in Repitools package

Dario Strbenac D.Strbenac at garvan.org.au
Fri Aug 10 06:00:26 CEST 2012


Hello,

This question isn't about profilePlots in particular, but about subsetting a vector by a set of values.

> Top25Expr[which(annoT[,"symbol"]==as.character(peak[1,]) | annoT[,"symbol"]==as.character(peak[2,]) |annoT[,"symbol"]==as.character(peak[3,]) | annoT[,"symbol"]==as.character(peak[4,]) | annoT[,"symbol"]==as.character(peak[5,]) | annoT[,"symbol"]==as.character(peak[6,]) | annoT[,"symbol"]==as.character(peak[7,]) | annoT[,"symbol"]==as.character(peak[8,]) ............ )]<-TRUE

One problem in your code is that you are comparing the symbol column with each row of peaks.

Assuming that your peak table has a column called overlapsGene, which is the symbol of the gene that the peak overlaps, to do what you want in one line is :

annoT[, "symbol"] %in% peak [, "overlapsGene"]

This gives you a logical vector, each element being one of the genes in annoT.

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia



More information about the Bioconductor mailing list