Ranking genes based on other features
1
0
Entering edit mode
7 weeks ago
sadaf ▴ 20

I have a list of genes that I want to rank them based on two other features(P&Z column) using robust rank aggregation, see below:

my_dataTable:

gene_name   P   Z
x                  6.3   0.08
y                  5.6  0.009
z                  3.4  0.04
w                   2.6 0.0085

In aggregate() method we can assign other columns to the genes, e.g. aggregate(gene_name~P+Z, my_dataTable , median), but how can I do the same in robust rank aggregation method?

could anyone help me with this?

aggregate RRA R rank robust • 267 views
ADD COMMENT
0
Entering edit mode
7 weeks ago
ATpoint 57k

How about:

my_dataTable <-
  data.frame(gene_name=c("x", "y", "z", "w"),
             P=c(6.3, 5.6, 3.4, 2.6),
             Z=c(0.08, 0.009, 0.04, 0.0085))

library(RobustRankAggreg)

#/ make the glist with the ordered gene names:
glist <- list(P=my_dataTable[order(my_dataTable$P),"gene_name"],
              Z=my_dataTable[order(my_dataTable$Z),"gene_name"])

#/ aggregate by ranks:
aR <- aggregateRanks(glist=glist)

#/ match order in aR with my_dataTable:
matched <- match(aR$Name, my_dataTable$gene_name)

#/ order my_dataTable accordingly:
my_dataTable[matched,]
ADD COMMENT
0
Entering edit mode

Thanks. I'm gonna give it a try

ADD REPLY

Login before adding your answer.

Traffic: 2249 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6