Entering edit mode
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