Question: Find the most frequently appeared genes in a list of pathways and genes
1
gravatar for Kim
10 months ago by
Kim10
Kim10 wrote:

Hello everyone

I have a list of pathways and genes involved in those pathways as follow (the real list is much longer):

enter image description here

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

ADD COMMENTlink modified 10 months ago by zx87549.3k • written 10 months ago by Kim10

Paste your data as text, please.

ADD REPLYlink written 10 months ago by zx87549.3k
3
gravatar for Benn
10 months ago by
Benn8.0k
Netherlands
Benn8.0k wrote:

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)
ADD COMMENTlink modified 10 months ago • written 10 months ago by Benn8.0k
1
gravatar for zx8754
10 months ago by
zx87549.3k
London
zx87549.3k wrote:

Something like this, which will display most frequent 10 gene names:

head(names(table(unlist(strsplit(table.file$Submitted.entities.found, sep = ";")))), n = 10)
ADD COMMENTlink written 10 months ago by zx87549.3k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1766 users visited in the last hour