setwd(“F:\̽��_Lnc_GPL570”)
duiying <- read.table(“probe-lncRNA-plus 2.0-GPL570.txt”,stringsAsFactors = F)
colnames(duiying) <- duiying[1,]
duiying <- duiying[-1,]
setwd(“F:\������ʦ_���߷ΰ�\ɸѡ�����������.CEL”)
data <- read.table(“imm_tanzhen.txt”,stringsAsFactors = F)
linshi <- matrix(,,115) ## ������������
colnames(linshi) <- colnames(data)
name <- c()
for (i in 1:nrow(duiying)){
weizhi <- which(duiying[i,1] == rownames(data))
if (length(weizhi) != 0){
linshi <- rbind(linshi,data[weizhi,])
name <- c(name,rep(duiying[i,2],length(weizhi)))
}
}
linshi <- linshi[-1,]
linshi <- as.matrix(linshi)
colnames(linshi) <- colnames(data)
rownames(linshi) <- name
�����ظ��� lncRNA
linshi_new <- matrix(,,115) ## ������������
colnames(linshi_new) <- colnames(data)
name_new <- unique(name)
name <- c()
for (i in 1:length(name_new)){
weizhi <- which(name_new[i] == rownames(linshi))
if (length(weizhi) == 1){
linshi_new <- rbind(linshi_new,linshi[weizhi,])
name <- c(name,name_new[i])
}
else if (length(weizhi) > 1){
linshi_new <- rbind(linshi_new,colMeans(linshi[weizhi,]))
name <- c(name,name_new[i])
}
}
linshi_new <- linshi_new[-1,]
linshi_new <- as.matrix(linshi_new)
colnames(linshi_new) <- colnames(data)
rownames(linshi_new) <- name
write.table(linshi_new,”imm_lnc.txt”)