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

rong [guest] guest at bioconductor.org
Thu Aug 9 17:13:32 CEST 2012


setwd("Desktop")

annoT=read.table("annoarray.txt")

 head(annoT)

colnames(annoT)<-c("name","symbol","chr","strand","start","end","name2","affy","expr")

head(annoT)


ordering<-as.matrix(annoT[,"expr"])

head(ordering)

 Top25Expr<-logical(length=nrow(ordering))

 head(Top25Expr)

peak=read.table("top7000peaks.csv")

head(peak)

colnames(peak)=c("name")

 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


#The gene names in "top7000peaks.csv" is a subset of "annoarray.txt", what I want to do is to find the gene names that exist in both "annoarray.txt" and "top7000peaks.csv", and  return Top25Expr as TRUE(in default it is FALSE):

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

But there are 901 genes in "top7000peaks.csv", it is not so convenient to do as above until peak[901,], do you know if there is any easier script to do the same thing?

Thank you in advance for your help.

 -- output of sessionInfo(): 

R version 2.14.1 (2011-12-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Repitools_1.0.11

loaded via a namespace (and not attached):
[1] Biostrings_2.22.0   BSgenome_1.22.0     GenomicRanges_1.6.7 IRanges_1.12.6  

--
Sent via the guest posting facility at bioconductor.org.



More information about the Bioconductor mailing list