rm(list=ls())
library(tidyr)
library(openxlsx)
library(dplyr)
library(stringr)
setwd("/Users/tongyuantao/Desktop/weblast/code/code/genecorpus/")
data2=read.table("gene_vocabulary.txt",sep="\t",head=T,quote ="",fill=T,stringsAsFactors = FALSE)
length(unique(data2[,"virus"]))
write.table(unique(data2[,"virus"]),"gene_corpus.txt",sep="\t",quote=F,na="",row.names = F,col.names =T)
mutation=read.xlsx('BioC_rules_regex.xlsx',sheet=1,detectDates = TRUE)
mutation[,"id"]=paste(mutation[,"pmid"],"|pmid|",mutation[,"sentence"],sep="")
write.table(unique(mutation[,"id"]),"gene_example.txt",sep="\t",quote=F,na="",row.names = F,col.names =F)

  