gene.csv文件获取方法
rt<-read.csv("~data.csv",header = T,row.names = 1)
ann<-read.csv("~/Desktop/GoogleDrive/Annotation/gencod.v30.annotation.gene.csv",header = T,row.names = 1)
ann_gene<-as.matrix(ann$gene_name)
row.names(ann_gene)<-row.names(ann)
a<-row.names(ann)
rt<-rt[intersect(a,row.names(rt)),]
rt_ann<-cbind(ann_gene[intersect(a,row.names(rt)),],rt)
rt_ann<-rt_ann[!duplicated(rt_ann[,1]),]
row.names(rt_ann)<-as.character(rt_ann[,1])
rt_ann<-rt_ann[,-1]
write.csv(rt_ann,"~yourfilename_geneSymbol_v30.csv")
其他的方法参照这篇文章
网友评论