R/xmlgene_atomizations_new.R

xmlgene_atomizations_new = function (m) 
{
  tempb = unlist(lapply(m@Abstract, function(x) {
    tempa = strsplit(x, ".", fixed = T)
    return(tempa)
  }))
  
  tempc = unlist(strsplit(tempb, ",", fixed = T))
  tempd = unlist(strsplit(tempc, ":", fixed = T))
  tempe = unlist(strsplit(tempd, ";", fixed = T))
  tempe1 = unlist(strsplit(tempe, "'", fixed = T))
  tempf = unlist(strsplit(tempe1, " ", fixed = T))
  
  
  tempi = as.data.frame(table(tempf))
  tempj = unlist(lapply(common_words_new, function(x) {
    tempoo = which(as.character(tempi[, 1]) == x)
    if (length(tempoo) != 0) 
      return(tempoo)
  }))
  tempk = tempi[-tempj, ]
  templ = as.character(HGNCdata$symbol)
  tempm = unlist(lapply(templ, function(x) {
    return(which(x == as.character(tempk$tempf)))
  }))
  tempn = tempk[tempm, ]
  tempn2 = tempn[order(as.numeric(tempn$Freq), decreasing = T), 
  ]
  tempo = unlist(lapply(as.character(tempn2$tempf), function(x) {
    return(which(x == templ))
  }))
  Genes = as.character(HGNCdata$name[tempo])
  data_table = cbind(as.character(tempn2$tempf), Genes, tempn2$Freq)
  colnames(data_table) = c("Gene_symbol", "   Genes", 
                           "Freq")
  write.table(data_table, file = "table.txt", sep = "\t", 
              row.names = F)
  return(data_table)
}

Try the pubmed.mineR package in your browser

Any scripts or data that you put into this service are public.

pubmed.mineR documentation built on Nov. 26, 2021, 5:11 p.m.