relating the number with gene names in a list of genes
1
0
Entering edit mode
8.2 years ago
zizigolu ★ 4.3k

hi,

I have this genes

> head(genes[,1])
[1] AT1G01170 AT1G01260 AT1G01380 AT1G01490 AT1G01500 AT1G01610
2884 Levels: AT1G01170 AT1G01260 AT1G01380 AT1G01490 AT1G01500 AT1G01610 ... AT5G67430
also I have this edge list of the above genes but not by gene name and by number of genes like below

> head(edgelist[1:10,1:3])
 0.179539384784291 18 177
         0.1769863 306  539
          0.1699997 422  539
         0.1540843 270  580
         0.1367052 416  529
          0.1230802  97  383
         0.1227789  73  557

for example gene 18 and gene 177 connect with 0.179539384784291 value

how i can replace these numbers with the name of my genes???? for example genes 1 is AT1G01170 and gene 2 is AT1G01260

thank you

software-error R • 1.0k views
ADD COMMENT
1
Entering edit mode

Hi,

Is your length of gene list names and length of edgelist are equal? If they are equal then you can use either cbind function to a new column of your gene names to the existing edgelist or you can make use of gsub function.

ADD REPLY
0
Entering edit mode

Yes the length is the same. Sorry I could not figure out what to do. May you please write the code here? Thank you

ADD REPLY
1
Entering edit mode
8.2 years ago
zizigolu ★ 4.3k

If edgelist is a data.frame, and the numbers are indices pointing to the gene

edgelist$TFLocus <- genes[,1][edgelist$TFLocus]
edgelist$TargetLocus <- genes[,1][edgelist$TargetLocus]
ADD COMMENT

Login before adding your answer.

Traffic: 2434 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