读取剪切板内容 下载网上内容 r 下载网页内容 网上内容Harmonizome下载某一疾病表型的所有基因比如lung fibrosis相关基因 找交集
第
二种方法: 非常推荐,直接在R里面下载安装R包。小白一开始不知道R里面也能下载软件,都是自己默默地手动下载,蠢哭,委屈 ╮(╯_╰)╭。
感谢这位朋友,文章链接: https://zhuanlan.zhihu.com/p/129331377可以使用以下代码 下载的文件需要位于工作目录比较好
download.file("https://www.bioconductor.org/packages/3.14/bioc/src/contrib/Archive/monocle/monocle_2.21.1.tar.gz","monocle_2.21.1.tar.gz")
install.packages("monocle_2.21.1.tar.gz",repos=NULL)#安装
链接在https://www.bioconductor.org/packages/3.14/bioc/src/contrib/Archive/monocle/
#####genes from harmonizomegetwd()
download.file(url="https://maayanlab.cloud/Harmonizome/api/1.0/gene_set/Pulmonary+Fibrosis/CTD+Gene-Disease+Associations",destfile="G:/silicosis/fibrosis_geness/CTD+Gene-Disease+Associations.txt", quiet = FALSE, mode = "w",cacheOK = TRUE)urlgenes=read.ftable("G:/silicosis/fibrosis_geness/CTD+Gene-Disease+Associations.txt")
head(urlgenes)[1:2,1:2]
str(urlgenes)mygenes=as.vector(str_split(urlgenes[,4],'symbol',simplify =TRUE))head(mygenes)
str_split("ADFaf",'a',simplify = TRUE)
###harmonizome genesharmonizomegenes=read.xlsx("G:/silicosis/fibrosis_geness/harmonizome_genes_fibrosis.xlsx")
head(harmonizomegenes)myharmonizomegenes=harmonizomegenes$Symbol %>% tolower() %>% capitalize()
head(myharmonizomegenes)
harmonizomegenes[,1]=myharmonizomegeneswrite.xlsx(harmonizomegenes,file ="G:/silicosis/fibrosis_geness/harmonizome_gfibrosis.xlsx" )###读入剪切版内容
data = read.table("clipboard",header=T)
head(data)harmonizomegenes[,5]=c(data,rep("na",times=nrow(harmonizomegenes)-length(data)+1))write.xlsx(harmonizomegenes,file ="G:/silicosis/fibrosis_geness/harmonizome_gfibrosis.xlsx" )fibrosis_genes=read.xlsx("G:/silicosis/fibrosis_geness/harmonizome_gfibrosis.xlsx")