想知道单细胞国自然基金有哪些?
- 2020 年 3 月 30 日
- 筆記
作者 | 单细胞天地小编 天涯清水
一、国家自然科学基金-单细胞项目
基金首页 – 科学网 – 基金 – 构建全球华人科学社区(http://fund.sciencenet.cn/) 以“单细胞”作为关键词查询2009-2019之间的项目,总计449项, 累计金额:39285 万元。
“单细胞”作为关键词2009-2019查询结果(http://fund.sciencenet.cn/search?name=%E5%8D%95%E7%BB%86%E8%83%9E&code=&yearStart=2009&yearEnd=2019&subject=&category=&fundStart=&fundEnd=&submit=list)
二、国家自然科学基金-单细胞项目爬取
我最早接触的R语言爬取,还是生信技能树Jimmy的【生信技能树】生信人应该这样学R语言(https://www.bilibili.com/video/av25643438/?p=28),又发现了两个比较好的博文:
和你息息相关——国自然基金标题爬取(https://www.jianshu.com/p/12159d9fee3c) R语言的爬虫 | RVDSD的个人笔记本 (http://rvdsd.top/2019/10/12/R/R%E8%AF%AD%E8%A8%80%E7%9A%84%E7%88%AC%E8%99%AB/)
按照博文里面的代码,就可以进行爬取数据。整理的过程中发现,某一个关键词,现在科学网只允许显示200条项目(怀疑是由于爬取或查询的太多了,进行了限制),今年8月份基金刚刚公布的时候,本人仔细查询了单细胞相关的项目,当时还能显示全部的项目。由于只能显示20页,200条项目的信息,因此分时间段进行查询;然后,合并文件。
#R包爬取2010-2019单细胞相关的国家自然科学基金项目,主要包括单细胞及微流控相关 rm(list = ls()) ##安装rvest与stringr包 BiocManager::install("rvest") BioBiocManager::install("stringr") # 加载相应的包 library(rvest) library(stringr) #site <- 'http://fund.sciencenet.cn/search?name=%E5%8D%95%E7%BB%86%E8%83%9E&yearStart=2010&yearEnd=2019&submit=list&page=' #由于科学网基金查询限制了结果,只展示200个项目,下面是2018-2019单细胞相关的项目192项 site <- 'http://fund.sciencenet.cn/search?name=%E5%8D%95%E7%BB%86%E8%83%9E&yearStart=2018&yearEnd=2019&submit=list&page=' #2014-2017单细胞相关的项目 site <- 'http://fund.sciencenet.cn/search?name=%E5%8D%95%E7%BB%86%E8%83%9E&yearStart=2014&yearEnd=2017&submit=list&page=' #2009-2013 site <- 'http://fund.sciencenet.cn/search?name=%E5%8D%95%E7%BB%86%E8%83%9E&yearStart=2009&yearEnd=2013&submit=list&page=' table2 <- NULL # 下面写一个循环,为了时间关系,我只循环到第20页 for(page in 1:20){ url0 <- paste(site, page, sep = "") web <- read_html(url0) News <- web %>% html_nodes('p.t') # 标题内容 #---获得基金标题--- Title <- News %>% html_text() # 标题内容解析 Title <- gsub('n','',Title) # 去除换行符 Title <- gsub('\s+',' ',Title) # 去除空格 Title #---获得负责人信息--- Information <- web %>% html_nodes('div.d') %>% html_text() # 负责人等相关消息解析 Information <- gsub('n', ' ', Information) Information <- gsub('\s+', ' ', Information) Information #Author <- web %>% html_nodes('div.d .author') %>% html_text() #---获得申请单位--- # Department <- web %>% html_nodes('.ico , #resultLst a') %>% html_text() # Department <- gsub('n',' ',Department) # 去除换行符 # Department <- gsub('\s+',' ',Department) # 去除空格 #---保存为csv文件--- #组合成数据框 # dat <- data.frame(Title,Time,link1) dat <- cbind(Title, Information) table2 <- as.data.frame(rbind(table2, dat)) write.csv(table2,file = 'scRNA_NSFC2009_2013.csv',row.names = FALSE) } # 对表格进行处理 df <- cbind(table2$Title,data.frame(do.call(rbind, strsplit(as.character(table2$Information), split = " ")))) df$X1 <- NULL # 将空值的那一列删除 # 给每一列附上列名 names(df) <- c("基金名称","负责人","申请单位","研究类型","项目批准号", "批准年度","金额","关键词") write.csv(df,file = 'scRNA_NSFC2009_2013_revised.csv',row.names = F) ###合并数据 #list.files命令将input文件夹下所有文件名 a = list.files() ##a 设定当前工作目录 dir = paste("./",a,sep="") n = length(dir) merge.data = read.csv(file = dir[1],sep=",",header=T) for (i in 2:n){ new.data = read.csv(file = dir[i], header=T, sep=",") merge.data = rbind(merge.data,new.data) } #循环从第二个文件开始读入所有文件,并组合到merge.data变量中 write.csv(merge.data,file = "./merge.csv",row.names=F) #输出组合后的文件merge.csv到input文件夹 ###合并文件,有多种方法 #先读入数据 file1 <- read.csv("scRNA_NSFC2009_2013_revised.csv") file2 <- read.csv("scRNA_NSFC2014_2017_revised.csv") file3 <- read.csv("scRNA_NSFC2018_2019_revised.csv") library(dplyr) file4 <- bind_rows(file1,file2) file5 <- bind_rows(file3,file4) write.csv(file4,file = 'scRNA_NSFC2009_2017_revised.csv',row.names = F) write.csv(file5,file = 'scRNA_NSFC2009_2019_revised.csv',row.names = F) file6 <- read.csv("scRNA_NSFC2009_2019_revised.csv",sep = ".",header = T)
后续可以对历年项目进行分析,发现2013年单细胞项目的爆发年,虽然只有31个项目,但是金额却是目前为止最高的一年,11379 万元。主要是2013有一个国家重大研发计划(6400万)、多个国家重大科研仪器设备研制专项(1150)、一个重点(2000万),重大研究计划(200万)、一个优青(100万),青年项目金额普遍不高。
科学网基金查询今年也推出了分析功能,另外还有一些网站也推出了相应的功能,如LetPub(http://www.letpub.com.cn/?page=grant&name=%E5%8D%95%E7%BB%86%E8%83%9E&person=&no=&company=&addcomment_s1=&addcomment_s2=&addcomment_s3=&addcomment_s4=&money1=&money2=&startTime=2009&endTime=2019&subcategory=&searchsubmit=true&submit.x=53&submit.y=13&submit=advSearch#fundlisttable)