I am new to this R programming, I am having problems in getting gene name and symbols for the Affy probe ids using R programming language.
- probe Symbol Name
- 215535_s_at NA NA
- 32836_at NA NA
- 210678_s_at NA NA
- 32837_at NA NA
- 219723_x_at NA NA
- 223182_s_at NA NA But iam not able to pull the details from merging HGNC and David flat file.
Please let me know how best this can be solved.
I used the following code
enter code here
probe <- read.delim("super.txt",stringsAsFactors=F, header = T, sep="\t")
probe$probeid<-tolower(probe$probeid)
names<-read.delim("GSE42568_probeid.txt", as.is=T, stringsAsFactors=F, header=T)
##insted of dataframa we are sending out the vecotr
names<-names$probeid
NoMatchID = NULL
vec<-NULL
system.time({
for (i in 1:11390){
index<-grep(names[i],probe$probeid,fixed=T)
#index<-grep(paste("^",names[i],"$"),probe$probeid,fixed=T)
if (length(index)!=0) {
cat("Index of", names[i],"is", index, "\n")
} else {
cat("Index of", names[i], "Found No Match \n")
NoMatchID = c(NoMatchID,i)
}
NoMatchID<-c(NoMatchID,index)
vec_NA <- data.frame(probe[-NoMatchID,])
}
})
NoMatchID <- data.frame(probe[NoMatchID,])
NoMatchID_probe = setdiff(1:nrow(probe), unique(vec))
write.table(vec_NA, file = "probeids_matched_1.txt", row.names = FALSE, append = FALSE, col.names = TRUE, sep = "\t")
Please let me know if you guys have any other way/s to solve this issue :(..it would be of great help to me!!!