Find the most frequently appeared genes in a list of pathways and genes
Hello everyone
I have a list of pathways and genes involved in those pathways as follow (the real list is much longer):

I want to see which genes appear most frequently in these pathways. Do you know how to do that in R or recommend any tools?
Thank you very much
• 1,511 views
•
link
2 answers
You can use R packages tidyr and dplyr for this.
# First import into R
table.file <- read.table("your.file.txt", header = T, sep = "\t", stringsAsFactors = F)
library(tidyr)
# Get your genes in separate rows
table.genes.sep <- separate_rows(table.file, Submitted.entities.found, sep = ";")
library(dplyr)
# use dplyr to count genes and sort
table.genes.count <- table.genes.sep %>% count(Submitted.entities.found, sort = TRUE)
• 0 views
•
link
Something like this, which will display most frequent 10 gene names:
head(names(table(unlist(strsplit(table.file$Submitted.entities.found, sep = ";")))), n = 10)
• 0 views
•
link
Log in to answer this question.
Paste your data as text, please.