【发布时间】:2017-08-03 13:29:57
【问题描述】:
我有一个包含 40802 个基因名称的数据框列表,我有一个包含 14000 条文章信息的数据框。文章信息包含文章、摘要、日、月、年。
我已将日期转换为正常格式,并将摘要转换为字符。
我想有一个X的时间图,基因名称出现在摘要中的频率。 EG
| Date | Gene Name | Frequency |
|------------|-----------|-----------|
| 2017-03-20 | GAPDH | 5 |
| 2017-03-21 | AKT | 6 |
基本上,我想知道过去 100 天内最常发表的基因名称,并有一个时间表来了解这些基因名称的演变。有点像趋势。
library(RISmed)
##Research the query - can be anything relevant to protein expression.
##Multiple research not tested yet
search_topic <- 'protein expression'
##Evaluate the query with reldate = days before today, retmax = maximun number of returned results
search_query <- EUtilsSummary(search_topic, retmax=15000, reldate = 100)
##explore the outcome
summary(search_query)
##get the ids for tall the queries to get the articles
QueryId(search_query)
##get all the records associated with the ID - THIS TAKES LOOONG TIME
records<- EUtilsGet(search_query)
##Analyze the structure
str(records)
summary(records)
##Create a data frame with article/abstract/date
pubmed_data <- data.frame('Title'=ArticleTitle(records),'Abstract'=AbstractText(records),
"Day"=DayPubmed(records), "Month" = MonthPubmed(records), "Year"=YearPubmed(records))
##explore the data
head(pubmed_data,1)
##gene names
genename <- read.csv("genename.csv", header = T, stringsAsFactors = F)
##remove any NA tittles
pubmed <-pubmed_data[-which(is.na(pubmed_data$Title)), ]
##Coerce the date to YYYY-MM-DD
pubmed$Date <- as.Date( paste( pubmed$Day , pubmed$Month , sep = "." ) , format = "%d.%m" )
我读了很多书,不知道如何在pubmed$Abstract 中找到genemane[1,1],
并按时间计算它出现的次数。
绘制一个图,其中 X 是最后 100 天,线 prot 将是基因名的频率,
传说将是基因名。因此可以观察到趋势。
我真的很感激任何想法如何做到这一点。
我尝试了tm,并尝试了很多不同的东西,但仍然碰壁。我的概念错了吗?
【问题讨论】:
标签: r text bioinformatics biometrics mining